Browse Source

js pour clixmax

master
BARRAUX Arthur 3 years ago
parent
commit
805de6be98
  1. 12
      app.js
  2. BIN
      machine.png
  3. 2
      master.css

12
app.js

@ -43,11 +43,11 @@ function tirette(){
}
function tirage(){
let numbers = [nbAlea()+1, nbAlea()+1, nbAlea()+1]
console.log(numbers)
rotate(document.getElementsByClassName("cube")[0], Math.floor(Math.random() * 15)*360+(numbers[0]-1)*36)
rotate(document.getElementsByClassName("cube")[1], Math.floor(Math.random() * 15)*360+(numbers[1]-1)*36)
rotate(document.getElementsByClassName("cube")[2], Math.floor(Math.random() * 15)*360+(numbers[2]-1)*36)
let numbers = [nbAlea(), nbAlea(), nbAlea()]
console.log(numbers);
rotate(document.getElementsByClassName("cube")[0], (Math.floor(Math.random()*15)*360) - (numbers[0]*36));
rotate(document.getElementsByClassName("cube")[1], (Math.floor(Math.random()*15)*360) - (numbers[1]*36));
rotate(document.getElementsByClassName("cube")[2], (Math.floor(Math.random()*15)*360) - (numbers[2]*36));
return numbers
}
@ -106,4 +106,4 @@ for (let i = 0; i < 10; i++) {
document.getElementsByClassName('cube__face--'+i)[j].style.transform = 'rotateX('+(i*36)+'deg) translateZ(calc(1.6vw /'+Math.tan(18* Math.PI / 180)+')';
}
}
}

BIN
machine.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 135 KiB

After

Width:  |  Height:  |  Size: 133 KiB

2
master.css

@ -1,5 +1,5 @@
body{
background-color: #001f37;
background-color: #03183a;
margin: 0;
}

Loading…
Cancel
Save