diff --git a/assets/js/site.js b/assets/js/site.js index 5a077a6..a5c2d35 100644 --- a/assets/js/site.js +++ b/assets/js/site.js @@ -285,27 +285,24 @@ jQuery(function($) { document.documentElement.scrollTop = 0; // webkit } - function imagewow() { - var imlocation = "assets/img/maymay/"; +function imagewow() { + const images = [ + "dimanche.png", + "lundi.png", + "mardi.png", + "mercredi.png", + "jeudi.jpg", + "vendredi.jpg", + "samedi.jpg" + ]; - function ImageArray(n) { - this.length = n; - for (var i = 1; i <= n; i++) { - this[i] = ' ' - } - } - image = new ImageArray(7); - image[0] = 'dimanche.png'; - image[1] = 'lundi.png'; - image[2] = 'mardi.png'; - image[3] = 'mercredi.png'; - image[4] = 'jeudi.jpg'; - image[5] = 'vendredi.jpg'; - image[6] = 'samedi.jpg'; - var currentdate = new Date(); - var imagenumber = currentdate.getDay(); - document.getElementById("meme").src = imlocation + image[imagenumber]; - } + const day = new Date().getDay(); + + document.getElementById("meme").src = + "assets/img/maymay/" + images[day]; +} + +imagewow();