var septerating = document.getElementById("headertitle").innerText; var fill = document.getElementById("headertitle"); document.getElementById("headertitle").innerText = ""; for (let i = 0; i < septerating.length; i++) { fill.innerHTML += ""+septerating.charAt(i)+""; } var fonts = ["sans-serif", "serif", "monospace"] function theChange(okey){ okey.style.fontFamily = fonts[Math.floor(Math.random()*fonts.length)]; okey.style.transform = "rotate("+String(Math.floor(Math.random()*60-30))+"deg) translateY("+String(Math.floor(Math.random()*10-5))+"px)"; okey.style.fontSize = String(Math.floor(Math.random()*100+50))+"%"; okey.style.fontWeight = Math.random() < 0.5 ? "bold" : "normal"; okey.style.textTransform = Math.random() < 0.5 ? "uppercase" : "lowercase"; } var changing = document.getElementsByClassName("change"); for (let i = 0; i < changing.length; i++) { theChange(changing[i]); } function randomChange(){ var changing = document.getElementsByClassName("change"); var changeme = changing[Math.floor(Math.random()*changing.length)]; theChange(changeme); } setInterval(randomChange, 500);