From 39967a9ba1203e68f6e151db5213f40c3fb43d51 Mon Sep 17 00:00:00 2001 From: Brosef Date: Wed, 18 Feb 2026 19:35:12 +0000 Subject: [PATCH] Added elipsis support to I'm a text --- main.js | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/main.js b/main.js index 6f9ee6c..9efc35d 100644 --- a/main.js +++ b/main.js @@ -3,13 +3,14 @@ const hellos = ['Hewwo!', 'Hello!', 'Awoo!']; const imaTypingSpeed = 75; const imaDeletingSpeed = 50; +const imaElipsisDelay = 750; const imaGapTime = 1500; const imaTexts = shuffle([ 'I\'m a $dumbass$.dog', 'I\'m a $network engineer', 'I\'m an $Arch Linux user', 'I\'m a $programmer', - 'I\'m a $furry', + 'I\'m a $furry...$ duh', 'I\'m a $massive nerd', 'I\'m a $Home Assistant addict', 'I\'m a $House M.D. enjoyer', @@ -113,10 +114,18 @@ window.addEventListener('load', (e) => { } imaCharIdx++; + let nextTime = imaTypingSpeed; + + if (imaTexts[imaSelection].slice(imaCharIdx, imaCharIdx+3) == '...') { + nextTime = imaElipsisDelay; + } + + nextTime *= !controlChar; + if (imaCharIdx >= imaTexts[imaSelection].length) { setTimeout(deleteFunc, imaGapTime); } else { - setTimeout(typeFunc, imaTypingSpeed*!controlChar); + setTimeout(typeFunc, nextTime); } };