Uhhh how about this?
This commit is contained in:
parent
6d0361fede
commit
defe1960cc
|
|
@ -7,15 +7,25 @@
|
|||
|
||||
<title>ASCII — Clove Twilight</title>
|
||||
<link rel="stylesheet" href="/css/main.css">
|
||||
<script>try { var f = localStorage.getItem('ctpFlavor'); document.documentElement.setAttribute('data-flavor', ['mocha', 'macchiato', 'frappe', 'latte'].indexOf(f) >= 0 ? f : 'mocha'); } catch (e) { document.documentElement.setAttribute('data-flavor', 'mocha'); }</script>
|
||||
|
||||
<script>
|
||||
try {
|
||||
var f = localStorage.getItem('ctpFlavor');
|
||||
document.documentElement.setAttribute(
|
||||
'data-flavor',
|
||||
['mocha', 'macchiato', 'frappe', 'latte'].indexOf(f) >= 0 ? f : 'mocha'
|
||||
);
|
||||
} catch (e) {
|
||||
document.documentElement.setAttribute('data-flavor', 'mocha');
|
||||
}
|
||||
</script>
|
||||
|
||||
<link rel="icon" type="image/svg+xml" href="/assets/favicon/favicon.svg">
|
||||
|
||||
<meta name="description" content="ASCII art of Clove Twilight, rendered in full colour.">
|
||||
<meta name="robots" content="index, follow">
|
||||
<link rel="canonical" href="https://c.stupid.cat/ascii">
|
||||
<meta name="theme-color" content="#f5c2e7">
|
||||
|
||||
<script src="https://cdn.jsdelivr.net/npm/ansi_up@6.0.0/ansi_up.min.js"></script>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
|
|
@ -46,29 +56,39 @@
|
|||
<span class="ascii-dot green"></span>
|
||||
<span class="ascii-frame-title">ascii.txt</span>
|
||||
</div>
|
||||
|
||||
<pre class="ascii-art" id="ascii-art" aria-busy="true">loading…</pre>
|
||||
</div>
|
||||
</main>
|
||||
|
||||
<script src="/js/core.js" data-cat="/assets/oneko/classics/classic.png"></script>
|
||||
<script>
|
||||
(async function () {
|
||||
|
||||
<script type="module">
|
||||
import AnsiUp from "https://cdn.jsdelivr.net/npm/ansi_up@6.0.0/+esm";
|
||||
|
||||
const el = document.getElementById('ascii-art');
|
||||
|
||||
try {
|
||||
const res = await fetch('/ascii.txt', { cache: 'no-store' });
|
||||
if (!res.ok) throw new Error(res.status);
|
||||
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 :(";
|
||||
console.error(err);
|
||||
}
|
||||
})();</script>
|
||||
</script>
|
||||
|
||||
</body>
|
||||
|
||||
</html>
|
||||
Loading…
Reference in New Issue