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> | ||
− | + | var pauseMax = 80, | |
− | + | ||
− | var | + | |
− | + | ||
− | + | ||
pauseMin = 40, | pauseMin = 40, | ||
− | ch = 0; | + | ch = 0, cht = 0; |
− | function typeIt( | + | (function typeIt() { |
− | if (ch > tot) return; | + | if (ch > tot)return; |
− | if( | + | if(qsa("[data-typer]")[0].dataset.typer[ch]!="<") |
− | typer. | + | qsa("[data-typer]")[0].innerHTML = qsa("[data-typer]")[0].dataset.typer.substring(0, ch++); |
− | else typer. | + | else qsa("[data-typer]")[0].innerHTML=qsa("[data-typer]")[0].dataset.typer.substring(0, ch+=3); |
− | setTimeout(typeIt( | + | setTimeout(typeIt(), ~~(Math.random() * (pauseMax - pauseMin + 1) + pauseMin)); |
} | } | ||
− | setTimeout(typeIt( | + | setTimeout(typeIt(),qsa("[data-typer]")[0].dataset.delay); |
− | + | }()); | |
− | }); | + | |
</script> | </script> | ||
Revision as of 18:44, 30 October 2017