From 4f041249384f564f82a676a994c43254a84b3f25 Mon Sep 17 00:00:00 2001 From: cjtheham Date: Mon, 30 Jan 2023 13:30:46 -0600 Subject: [PATCH] remove unused file --- static/js/typewriter.js | 42 ----------------------------------------- 1 file changed, 42 deletions(-) delete mode 100644 static/js/typewriter.js diff --git a/static/js/typewriter.js b/static/js/typewriter.js deleted file mode 100644 index 3291a69..0000000 --- a/static/js/typewriter.js +++ /dev/null @@ -1,42 +0,0 @@ -// Code from Benjamin Hollon (benjaminhollon@fosstodon.org) - -const addCharDelay = 75; -const removeCharDelay = 45; -const wordDelay = 1500; - -const typewriterElement = document.getElementById('typewriter'); -const typewriterPrompts = [ - 'Amateur Radio Operator', - 'Electrical Engineering Student', - 'Film Enjoyer' -]; -let currentTypewriterIndex = 0; - -function typeNextPrompt() { - function typeChar(char) { - if (char !== '~') typewriterElement.innerText += char; - } - function removeChar() { - typewriterElement.innerText = typewriterElement.innerText.slice(0, -1); - } - - const word = typewriterPrompts[currentTypewriterIndex]; - let delaySoFar = 0; - // Type it - for (const char of word) { - setTimeout(typeChar.bind(this, char), delaySoFar); - delaySoFar += addCharDelay; - } - - delaySoFar += wordDelay; - - for (const char of word.split('').reverse()) { - setTimeout(removeChar, delaySoFar); - delaySoFar += removeCharDelay; - } - - currentTypewriterIndex = (currentTypewriterIndex + 1) % typewriterPrompts.length; - setTimeout(typeNextPrompt, delaySoFar); -} - -setTimeout(typeNextPrompt, wordDelay / 2);