my-portfolio/dist/js/text.js
rodude123 048dc0b58b changed how a few code snippets work and added in all projects section to view all the current projects includig <div class="grid__item"></div>
<div class="grid__item"></div>
                                                                                                                   <div class="grid__item"></div>
                                                                                                                   <div class="grid__item"></div>the one as the main

Signed-off-by: rodude123 <rodude123@gmail.com>
2023-02-23 18:53:28 +00:00

1 line
599 B
JavaScript

let dataText=["full stack developer","web designer","student","gamer","drummer"];function typeWriter(t,e,n){e<t.length?(document.querySelector("header div h1").innerHTML=t.substring(0,e+1)+'<span aria-hidden="true">_</span>',setTimeout((function(){typeWriter(t,e+1,n)}),100)):"function"==typeof n&&setTimeout(n,700)}function StartTextAnimation(t){void 0===dataText[t]?setTimeout((function(){StartTextAnimation(0)}),1500):t<dataText[t].length&&typeWriter(dataText[t],0,(function(){setTimeout(StartTextAnimation,1500,t+1)}))}document.addEventListener("DOMContentLoaded",(()=>{StartTextAnimation(0)}));