diff --git a/app.js b/app.js index fad4890..782de28 100644 --- a/app.js +++ b/app.js @@ -71,6 +71,7 @@ function regles(){ //afficher règles } +// Anime les rouleaux function rotate(rouleau, angle){ let i = 0; let id = setInterval(() => { @@ -82,6 +83,25 @@ function rotate(rouleau, angle){ }, 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(){ rotate(document.getElementsByClassName("cube")[0], Math.floor(Math.random() * 15)*360+nbAlea()) rotate(document.getElementsByClassName("cube")[1], Math.floor(Math.random() * 15)*360+nbAlea()) diff --git a/index.html b/index.html index 86bc0a6..8531caa 100644 --- a/index.html +++ b/index.html @@ -3,10 +3,12 @@ + Document - + tirette +
diff --git a/machine.png b/machine.png new file mode 100644 index 0000000..514b800 Binary files /dev/null and b/machine.png differ diff --git a/master.css b/master.css index 0cf9c43..8cc0ff2 100644 --- a/master.css +++ b/master.css @@ -1,12 +1,13 @@ body{ - background-color: #001a35; + background-color: #001f37; + margin: 0; } .rouleau { width: 4.1vw; height: 3.4vw; position: absolute; - top: 16.8vw; + top: 16.6vw; } .cube { @@ -20,10 +21,10 @@ body{ position: absolute; width: 4.1vw; height: 3.4vw; - border: 2px solid black; + border: 2px solid #362730; line-height: 3.4vw; font-size: 1.5vw; - background-color: #e52800; + background-color: #c21121; box-sizing: border-box; font-weight: bold; color: white; @@ -31,18 +32,25 @@ body{ } #rouleau_1{ - left: 42.8%; + left: 42.65%; } #rouleau_2{ - left: 47.1%; + left: 47.05%; } #rouleau_3{ left: 51.5%; } -#tirage { +#tirette{ + position: absolute; + z-index: 10; + margin-left: 30.6%; + transform-origin: 70% 58%; +} + +img { display: flex; justify-content: space-around; margin: auto; diff --git a/tirette.png b/tirette.png new file mode 100644 index 0000000..2ef8fa7 Binary files /dev/null and b/tirette.png differ