Uhhh how about this?
This commit is contained in:
parent
6d0361fede
commit
defe1960cc
|
|
@ -7,15 +7,25 @@
|
||||||
|
|
||||||
<title>ASCII — Clove Twilight</title>
|
<title>ASCII — Clove Twilight</title>
|
||||||
<link rel="stylesheet" href="/css/main.css">
|
<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">
|
<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="description" content="ASCII art of Clove Twilight, rendered in full colour.">
|
||||||
<meta name="robots" content="index, follow">
|
<meta name="robots" content="index, follow">
|
||||||
<link rel="canonical" href="https://c.stupid.cat/ascii">
|
<link rel="canonical" href="https://c.stupid.cat/ascii">
|
||||||
<meta name="theme-color" content="#f5c2e7">
|
<meta name="theme-color" content="#f5c2e7">
|
||||||
|
|
||||||
<script src="https://cdn.jsdelivr.net/npm/ansi_up@6.0.0/ansi_up.min.js"></script>
|
|
||||||
</head>
|
</head>
|
||||||
|
|
||||||
<body>
|
<body>
|
||||||
|
|
@ -46,29 +56,39 @@
|
||||||
<span class="ascii-dot green"></span>
|
<span class="ascii-dot green"></span>
|
||||||
<span class="ascii-frame-title">ascii.txt</span>
|
<span class="ascii-frame-title">ascii.txt</span>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<pre class="ascii-art" id="ascii-art" aria-busy="true">loading…</pre>
|
<pre class="ascii-art" id="ascii-art" aria-busy="true">loading…</pre>
|
||||||
</div>
|
</div>
|
||||||
</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>
|
|
||||||
(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');
|
const el = document.getElementById('ascii-art');
|
||||||
|
|
||||||
try {
|
try {
|
||||||
const res = await fetch('/ascii.txt', { cache: 'no-store' });
|
const res = await fetch('./ascii.txt', { cache: 'no-store' });
|
||||||
if (!res.ok) throw new Error(res.status);
|
|
||||||
|
if (!res.ok) {
|
||||||
|
throw new Error('fetch failed: ' + res.status);
|
||||||
|
}
|
||||||
|
|
||||||
const raw = await res.text();
|
const raw = await res.text();
|
||||||
|
|
||||||
const ansi_up = new AnsiUp();
|
const ansi_up = new AnsiUp();
|
||||||
|
ansi_up.use_classes = false;
|
||||||
|
|
||||||
el.innerHTML = ansi_up.ansi_to_html(raw);
|
el.innerHTML = ansi_up.ansi_to_html(raw);
|
||||||
|
el.removeAttribute('aria-busy');
|
||||||
|
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
el.textContent = "couldn't load ascii.txt :(";
|
el.textContent = "couldn't load ascii.txt :(";
|
||||||
console.error(err);
|
console.error(err);
|
||||||
}
|
}
|
||||||
})();</script>
|
</script>
|
||||||
|
|
||||||
</body>
|
</body>
|
||||||
|
|
||||||
</html>
|
</html>
|
||||||
Loading…
Reference in New Issue