extratonal.org website
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

33 lines
1.1 KiB

1 year ago
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 += "<span class='change'>"+septerating.charAt(i)+"</span>";
}
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);