{"version":3,"file":"index.js","sources":["../../client/src/typewriter.ts"],"sourcesContent":["document.addEventListener('DOMContentLoaded', async () => {\n\n // all elements with the data-typewriter attribute\n const elements = document.querySelectorAll('[data-typewriter]') as NodeListOf\n\n\n elements.forEach((element) => {\n\n const content = element.innerText\n element.innerText = ''\n\n const intervalMin = parseInt(element.getAttribute('data-interval') || \"30\") // defau\n const intervalMax = intervalMin + 100\n\n let i = 0\n let textToAdd = ''\n\n const iterateChar = () => {\n if (i < content.length) {\n const char = content.charAt(i)\n if (char === ' ') {\n textToAdd += char\n } else {\n textToAdd += char\n element.innerText = textToAdd\n }\n i++\n\n setTimeout(iterateChar, Math.floor(Math.random() * (intervalMax - intervalMin + 1) + intervalMin))\n }\n }\n\n iterateChar()\n })\n})"],"names":["element","content","intervalMin","intervalMax","i","textToAdd","iterateChar","char"],"mappings":"ssBAAA,SAAS,iBAAiB,mBAAoB,SAAY,CAGrC,SAAS,iBAAiB,mBAAmB,EAGrD,QAASA,GAAY,CAE1B,MAAMC,EAAUD,EAAQ,UACxBA,EAAQ,UAAY,GAEpB,MAAME,EAAc,SAASF,EAAQ,aAAa,eAAe,GAAK,IAAI,EACpEG,EAAcD,EAAc,IAElC,IAAIE,EAAI,EACJC,EAAY,GAEhB,MAAMC,EAAc,IAAM,CAClB,GAAAF,EAAIH,EAAQ,OAAQ,CACd,MAAAM,EAAON,EAAQ,OAAOG,CAAC,EACzBG,IAAS,IACIF,GAAAE,GAEAF,GAAAE,EACbP,EAAQ,UAAYK,GAExBD,IAEW,WAAAE,EAAa,KAAK,MAAM,KAAK,UAAYH,EAAcD,EAAc,GAAKA,CAAW,CAAC,CACrG,CAAA,EAGQI,GAAA,CACf,CACL,CAAC"}