AAAAAAAAAA

This commit is contained in:
Clove 2026-06-27 05:49:05 +01:00
parent ff8dcf633b
commit 2f06d96bec
2 changed files with 21 additions and 18 deletions

View File

@ -51,24 +51,7 @@
</main>
<script src="/js/core.js" data-cat="/assets/oneko/classics/classic.png"></script>
<script>
(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();
ansi_up.use_classes = false;
el.innerHTML = ansi_up.ansi_to_html(raw);
el.removeAttribute('aria-busy');
} catch (err) {
el.textContent = 'couldn\'t load ascii.txt :(';
el.classList.add('ascii-error');
console.error(err);
}
})();
</script>
<script src="/js/ascii.js"></script>
</body>
</html>

20
js/ascii.js Normal file
View File

@ -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);
}
})();