feat: chaffle header every 10sec

This commit is contained in:
Laureηt 2020-11-19 18:11:07 +01:00
parent c9309ec03b
commit 710336d881

View file

@ -28,21 +28,24 @@ username: Laureηt
</footer> </footer>
<script> <script>
var elements = document.querySelectorAll('[data-chaffle]'); var elm_mouseover = document.querySelectorAll('[data-chaffle]');
var elm = document.querySelectorAll('[data-chaffle-onLoad]'); var elm_onload = document.querySelectorAll('[data-chaffle-onLoad]');
Array.prototype.forEach.call(elements, function (el) { Array.prototype.forEach.call(elm_mouseover, function (el) {
var chaffle = new Chaffle(el) var chaffle = new Chaffle(el)
el.addEventListener('mouseover', function () { el.addEventListener('mouseover', function () {
chaffle.init(); chaffle.init();
}); });
}); });
Array.prototype.forEach.call(elm, function (el) { Array.prototype.forEach.call(elm_onload, function (el) {
var chaffle = new Chaffle(el, { var chaffle = new Chaffle(el, {
delay: 200 delay: 200
}) })
chaffle.init(); chaffle.init();
setInterval(function(){
chaffle.init();
}, 10000)
}); });
</script> </script>
</body> </body>