Difference between revisions of "Team:Judd UK/berhfudf"

Line 104: Line 104:
 
   var pauseMax = 80,
 
   var pauseMax = 80,
 
     pauseMin = 40,
 
     pauseMin = 40,
     ch = 0, cht = 0;
+
     cht = 0;
(function typeIt() {
+
qsa("[data-typer]").forEach(
    if (ch > qsa("[data-typer]")[0].dataset.typer.length)return;
+
function(e,i){setTimeout(function typeItt() {
    if(qsa("[data-typer]")[0].dataset.typer[ch]!="<"){
+
     if (ch > e.dataset.typer.length)return;
    qsa("[data-typer]")[0].innerHTML = qsa("[data-typer]")[0].dataset.typer.substring(0, ch++);
+
     if(e.dataset.typer[cht]!="<")
    console.log(qsa("[data-typer]")[0].innerHTML);}
+
     e.innerHTML = e.dataset.typer.substring(0, cht++);
    else {qsa("[data-typer]")[0].innerHTML=qsa("[data-typer]")[0].dataset.typer.substring(0, ch+=3);qsa("[data-typer]")[0].innerHTML};
+
     else e.innerHTML=e.dataset.typer.substring(0, cht+=3);
    setTimeout(typeIt, ~~(Math.random() * (pauseMax - pauseMin + 1) + pauseMin));
+
}());
+
setTimeout(function typeItt() {
+
    qsa("[data-typer]")[0].removeAttribute("data-typer");
+
     if (ch > qsa("[data-typer]")[1].dataset.typer.length)return;
+
     if(qsa("[data-typer]")[1].dataset.typer[cht]!="<")
+
     qsa("[data-typer]")[1].innerHTML = qsa("[data-typer]")[1].dataset.typer.substring(0, cht++);
+
     else qsa("[data-typer]")[1].innerHTML=qsa("[data-typer]")[1].dataset.typer.substring(0, cht+=3);
+
 
     setTimeout(typeItt, ~~(Math.random() * (pauseMax - pauseMin + 1) + pauseMin));
 
     setTimeout(typeItt, ~~(Math.random() * (pauseMax - pauseMin + 1) + pauseMin));
},qsa("[data-delay]")[1].dataset.delay);
+
},e.dataset.delay);setTimeout(function(){e.removeAttribute("data-typer")},qs("[data-typer]").dataset.delay);
 
</script>
 
</script>
 
</div>
 
</div>

Revision as of 19:37, 30 October 2017

Contents

Designed by Aleksandur Murfitt