mirror of
https://git.librezo.fr/Librezo/website.git
synced 2025-09-04 03:58:27 +02:00
boîtes accueil qui bougent
This commit is contained in:
17
static/js/square_box.js
Normal file
17
static/js/square_box.js
Normal file
@ -0,0 +1,17 @@
|
||||
var square_box_classes = ["square_box-inner-left", "square_box-inner-right", "square_box-inner-top", "square_box-inner-bottom"];
|
||||
|
||||
var randomize_square_box = function (elem) {
|
||||
var r = Math.floor(Math.random()*4);
|
||||
for(i in square_box_classes) {
|
||||
if(i != r)
|
||||
elem.classList.remove(square_box_classes[i]);
|
||||
}
|
||||
elem.classList.add(square_box_classes[r]);
|
||||
}
|
||||
|
||||
window.onload = function() {
|
||||
for(elem of document.getElementsByClassName("square_box-inner")) {
|
||||
var elem = elem;
|
||||
randomize_square_box(elem);
|
||||
}
|
||||
};
|
Reference in New Issue
Block a user