|
@ -71,6 +71,7 @@ function regles(){ |
|
|
//afficher règles
|
|
|
//afficher règles
|
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// Anime les rouleaux
|
|
|
function rotate(rouleau, angle){ |
|
|
function rotate(rouleau, angle){ |
|
|
let i = 0; |
|
|
let i = 0; |
|
|
let id = setInterval(() => { |
|
|
let id = setInterval(() => { |
|
@ -82,6 +83,25 @@ function rotate(rouleau, angle){ |
|
|
}, 5); |
|
|
}, 5); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Anime la tirette
|
|
|
|
|
|
function tirette(){ |
|
|
|
|
|
let i = 0; |
|
|
|
|
|
let id = setInterval(() => { |
|
|
|
|
|
if (i > 360) clearInterval(id); |
|
|
|
|
|
else { |
|
|
|
|
|
if (i > 180){ |
|
|
|
|
|
document.getElementById('tirette').style.transform = 'rotate3d(1,0,0,'+(360-i)+'deg)'; |
|
|
|
|
|
} |
|
|
|
|
|
else { |
|
|
|
|
|
document.getElementById('tirette').style.transform = 'rotate3d(1,0,0,'+i+'deg)'; |
|
|
|
|
|
} |
|
|
|
|
|
i += 9; |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
}, 20); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
function tirage(){ |
|
|
function tirage(){ |
|
|
rotate(document.getElementsByClassName("cube")[0], Math.floor(Math.random() * 15)*360+nbAlea()) |
|
|
rotate(document.getElementsByClassName("cube")[0], Math.floor(Math.random() * 15)*360+nbAlea()) |
|
|
rotate(document.getElementsByClassName("cube")[1], Math.floor(Math.random() * 15)*360+nbAlea()) |
|
|
rotate(document.getElementsByClassName("cube")[1], Math.floor(Math.random() * 15)*360+nbAlea()) |
|
|