fix: inline script
This commit is contained in:
parent
4339ebe265
commit
653c4869ac
2 changed files with 23 additions and 22 deletions
24
index.html
24
index.html
|
|
@ -48,6 +48,28 @@
|
|||
<a target="_blank" href="mailto:br.barrettruth@gmail.com">Email</a>
|
||||
</div>
|
||||
</footer>
|
||||
<script src="scripts/index.js"></script>
|
||||
<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>
|
||||
</body>
|
||||
</html>
|
||||
|
|
|
|||
|
|
@ -1,21 +0,0 @@
|
|||
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();
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue