AAAAAAAAAA
This commit is contained in:
parent
ff8dcf633b
commit
2f06d96bec
|
|
@ -51,24 +51,7 @@
|
||||||
</main>
|
</main>
|
||||||
|
|
||||||
<script src="/js/core.js" data-cat="/assets/oneko/classics/classic.png"></script>
|
<script src="/js/core.js" data-cat="/assets/oneko/classics/classic.png"></script>
|
||||||
<script>
|
<script src="/js/ascii.js"></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>
|
|
||||||
</body>
|
</body>
|
||||||
|
|
||||||
</html>
|
</html>
|
||||||
|
|
@ -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);
|
||||||
|
}
|
||||||
|
})();
|
||||||
Loading…
Reference in New Issue