Full-page loader that hides itself
Paste after <body>. It fades out on window load, but never before 400 ms, so fast pages do not flash.
<div id="ascii-loader" role="status" style="position:fixed;inset:0;z-index:9999;display:grid;place-content:center;justify-items:center;gap:16px;background:#09090b;color:#e4e4e7;transition:opacity .3s">
<ascii-art piece="progress-loader" size="8"></ascii-art>
<p style="margin:0;font:14px system-ui">Loading…</p>
</div>
<script>
var t0 = Date.now();
addEventListener("load", function () {
setTimeout(function () {
var el = document.getElementById("ascii-loader");
el.style.opacity = 0; setTimeout(function () { el.remove(); }, 300);
}, Math.max(0, 400 - (Date.now() - t0)));
});
</script>
<script type="module" src="https://www.ascii-magic.com/ascii/ascii.js"></script>