This commit is contained in:
Barrett Ruth 2025-10-07 19:22:54 -04:00
parent ead7032f21
commit 17d52f5b07

View file

@ -9,20 +9,24 @@ import BaseLayout from "../layouts/BaseLayout.astro";
</BaseLayout>
<script>
document.addEventListener("DOMContentLoaded", function () {
const terminalText = " /not-found";
const terminalPrompt = document.querySelector(".terminal-prompt");
const delay = 250;
if (!location.pathname.endsWith("/404.html")) {
document.addEventListener("DOMContentLoaded", function () {
const terminalText = " /not-found";
const terminalPrompt = document.querySelector(".terminal-prompt");
const delay = 250;
let i = 0;
function typechar() {
if (i < terminalText.length) {
terminalPrompt.innerHTML += terminalText.charAt(i++);
setTimeout(typechar, delay / terminalText.length);
if (!terminalPrompt) return;
let i = 0;
function typechar() {
if (i < terminalText.length) {
terminalPrompt.innerHTML += terminalText.charAt(i++);
setTimeout(typechar, delay / terminalText.length);
}
}
}
typechar();
});
typechar();
});
}
</script>
<style>
@ -40,4 +44,4 @@ import BaseLayout from "../layouts/BaseLayout.astro";
margin: 0;
}
</style>
</BaseLayout>
</BaseLayout>