From 2f06d96becd70ad693a51b3d2f1a0bdaba937730 Mon Sep 17 00:00:00 2001 From: Clove Twilight Date: Sat, 27 Jun 2026 05:49:05 +0100 Subject: [PATCH] AAAAAAAAAA --- ascii/index.html | 19 +------------------ js/ascii.js | 20 ++++++++++++++++++++ 2 files changed, 21 insertions(+), 18 deletions(-) create mode 100644 js/ascii.js diff --git a/ascii/index.html b/ascii/index.html index 826c683..22b4660 100644 --- a/ascii/index.html +++ b/ascii/index.html @@ -51,24 +51,7 @@ - + \ No newline at end of file diff --git a/js/ascii.js b/js/ascii.js new file mode 100644 index 0000000..5bdc302 --- /dev/null +++ b/js/ascii.js @@ -0,0 +1,20 @@ +(async function () { + const el = document.getElementById('ascii-art'); + + try { + const res = await fetch('./ascii.txt', { cache: 'no-store' }); + if (!res.ok) throw new Error('fetch failed: ' + res.status); + + const raw = await res.text(); + + const ansi_up = new AnsiUp(); + const html = ansi_up.ansi_to_html(raw); + + el.innerHTML = html; + el.removeAttribute('aria-busy'); + + } catch (err) { + el.textContent = "couldn't load ascii.txt :("; + console.error(err); + } +})(); \ No newline at end of file