From 4339ebe26582e61934183912d353474c46d22ea3 Mon Sep 17 00:00:00 2001 From: Barrett Ruth Date: Fri, 7 Jun 2024 22:27:27 -0500 Subject: [PATCH] feat: terminal text --- _index.html | 139 ----------------------------------------------- index.html | 15 +++-- readme.md | 4 ++ scripts/index.js | 21 +++++++ 4 files changed, 32 insertions(+), 147 deletions(-) delete mode 100644 _index.html create mode 100644 scripts/index.js diff --git a/_index.html b/_index.html deleted file mode 100644 index c43d4da..0000000 --- a/_index.html +++ /dev/null @@ -1,139 +0,0 @@ - - - - - - - - - - - - Barrett Ruth - - - - - -
-
- -
-
- Header Text Here -
-
-
-

Here is an equation: \(x = {-b \pm \sqrt{b^2-4ac} \over 2a}\)

- -

Projects

- -

Resume

-

Transcript

-
- - - - - - - - - - - - - - - - - - - - - diff --git a/index.html b/index.html index 7473481..cfee339 100644 --- a/index.html +++ b/index.html @@ -24,20 +24,18 @@
@@ -50,5 +48,6 @@ Email + diff --git a/readme.md b/readme.md index cc737d9..d46f2a0 100644 --- a/readme.md +++ b/readme.md @@ -1,3 +1,7 @@ # barrettruth.com My portfolio website + +## todo + +- mobile support diff --git a/scripts/index.js b/scripts/index.js new file mode 100644 index 0000000..48583e4 --- /dev/null +++ b/scripts/index.js @@ -0,0 +1,21 @@ +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(); +}