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

Line 101: Line 101:
 
  <link href="https://fonts.googleapis.com/css?family=Open+Sans:400,600" rel="stylesheet">  
 
  <link href="https://fonts.googleapis.com/css?family=Open+Sans:400,600" rel="stylesheet">  
 
<script>
 
<script>
$("[data-typer]").attr("data-typer", function(i, txt) {
+
   var pauseMax = 80,
 
+
   var $typer = $(this),
+
    tot = txt.length,
+
    pauseMax = 80,
+
 
     pauseMin = 40,
 
     pauseMin = 40,
     ch = 0;
+
     ch = 0, cht = 0;
function typeIt(typer) {
+
(function typeIt() {
     if (ch > tot) return;
+
     if (ch > tot)return;
     if(txt[ch]!="<")
+
     if(qsa("[data-typer]")[0].dataset.typer[ch]!="<")
     typer.html(txt.substring(0, ch++));
+
     qsa("[data-typer]")[0].innerHTML = qsa("[data-typer]")[0].dataset.typer.substring(0, ch++);
     else typer.html(txt.substring(0, ch+=3));
+
     else qsa("[data-typer]")[0].innerHTML=qsa("[data-typer]")[0].dataset.typer.substring(0, ch+=3);
     setTimeout(typeIt(typer), ~~(Math.random() * (pauseMax - pauseMin + 1) + pauseMin));
+
     setTimeout(typeIt(), ~~(Math.random() * (pauseMax - pauseMin + 1) + pauseMin));
 
   }
 
   }
   setTimeout(typeIt($typer),$typer.data("delay"));
+
   setTimeout(typeIt(),qsa("[data-typer]")[0].dataset.delay);
 
+
}());
});
+
 
</script>
 
</script>
  

Revision as of 18:44, 30 October 2017

Contents

Designed by Aleksandur Murfitt