fix: reset terminal prompt on back arrow

This commit is contained in:
Barrett Ruth 2024-06-08 13:56:32 -05:00
parent 23e10d1d54
commit 6297fbfb91
4 changed files with 30 additions and 26 deletions

View file

@ -46,28 +46,6 @@
<a target="_blank" href="mailto:br.barrettruth@gmail.com">Email</a>
</div>
</footer>
<script>
function typechars(e, url = "wip.html") {
e.preventDefault();
const text = ` ${e.target.textContent.toLowerCase()}/`;
const terminalPrompt = document.querySelector(".prompt");
let i = 0;
function typechar() {
if (i < text.length) {
terminalPrompt.innerHTML += text.charAt(i);
i++;
setTimeout(typechar, 1000 / text.length);
} else {
setTimeout(() => {
window.location.href = url;
}, 500);
}
}
typechar();
}
</script>
<script src="index.js"></script>
</body>
</html>