fix 404s
This commit is contained in:
parent
ead7032f21
commit
17d52f5b07
1 changed files with 17 additions and 13 deletions
|
|
@ -9,20 +9,24 @@ import BaseLayout from "../layouts/BaseLayout.astro";
|
||||||
</BaseLayout>
|
</BaseLayout>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
document.addEventListener("DOMContentLoaded", function () {
|
if (!location.pathname.endsWith("/404.html")) {
|
||||||
const terminalText = " /not-found";
|
document.addEventListener("DOMContentLoaded", function () {
|
||||||
const terminalPrompt = document.querySelector(".terminal-prompt");
|
const terminalText = " /not-found";
|
||||||
const delay = 250;
|
const terminalPrompt = document.querySelector(".terminal-prompt");
|
||||||
|
const delay = 250;
|
||||||
|
|
||||||
let i = 0;
|
if (!terminalPrompt) return;
|
||||||
function typechar() {
|
|
||||||
if (i < terminalText.length) {
|
let i = 0;
|
||||||
terminalPrompt.innerHTML += terminalText.charAt(i++);
|
function typechar() {
|
||||||
setTimeout(typechar, delay / terminalText.length);
|
if (i < terminalText.length) {
|
||||||
|
terminalPrompt.innerHTML += terminalText.charAt(i++);
|
||||||
|
setTimeout(typechar, delay / terminalText.length);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
typechar();
|
||||||
typechar();
|
});
|
||||||
});
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style>
|
<style>
|
||||||
|
|
@ -40,4 +44,4 @@ import BaseLayout from "../layouts/BaseLayout.astro";
|
||||||
margin: 0;
|
margin: 0;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
</BaseLayout>
|
</BaseLayout>
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue