From 658f4ab841a17ddb267e85a98a25731dd0bec196 Mon Sep 17 00:00:00 2001 From: syntaxbullet Date: Mon, 9 Feb 2026 20:11:34 +0100 Subject: [PATCH] feat: convert js modules to ts and optimize performance --- src/components/TuiSegment.astro | 2 +- src/pages/api-proxy/[...path].ts | 16 +- src/pages/index.astro | 377 ++++++----- src/scripts/anime-api.js | 132 ---- src/scripts/anime-api.ts | 75 +++ src/scripts/ascii.js | 615 ------------------ src/scripts/ascii.ts | 546 ++++++++++++++++ src/scripts/image-loader.ts | 135 ++++ src/scripts/rate-limiter.ts | 73 +++ .../{webgl-ascii.js => webgl-ascii.ts} | 229 +++++-- tsconfig.json | 21 + 11 files changed, 1269 insertions(+), 952 deletions(-) delete mode 100644 src/scripts/anime-api.js create mode 100644 src/scripts/anime-api.ts delete mode 100644 src/scripts/ascii.js create mode 100644 src/scripts/ascii.ts create mode 100644 src/scripts/image-loader.ts create mode 100644 src/scripts/rate-limiter.ts rename src/scripts/{webgl-ascii.js => webgl-ascii.ts} (61%) create mode 100644 tsconfig.json diff --git a/src/components/TuiSegment.astro b/src/components/TuiSegment.astro index d328ddb..12eac01 100644 --- a/src/components/TuiSegment.astro +++ b/src/components/TuiSegment.astro @@ -14,7 +14,7 @@ const { id, label, options, value = options[0], title = "" } = Astro.props; {label}
{ - options.map((opt, i) => ( + options.map((opt) => (