Browse Source

yahou

master
alexandre.aboulin 3 years ago
parent
commit
a6349dddc8
  1. 9
      app.js
  2. 2
      master.css

9
app.js

@ -4,11 +4,14 @@ function vw(v) {
return (v * w) / 100;
}
window.onresize = () => {
let cubes = document.getElementsByClassName('cube__face')
for (var i = 0; i < 10; i++) {
document.getElementsByClassName('cube__face')[i].style.transform = 'rotateX('+i*36+'deg) translateZ(calc(3.4vw *'Math.tan(18* Math.PI / 180)')';
/*window.getComputedStyle(cubes[i])*/cubes[i].style.transform =
'rotateX('+i*36+'deg) translateZ('+vw(3.4)*Math.tan(18 * Math.PI / 180)+')';
console.log(window.getComputedStyle(cubes[i]).transform)
}
}
let bac = 1000

2
master.css

@ -19,7 +19,7 @@
position: relative;
transform-style: preserve-3d;
/* transform: translateZ(-100px); */
transition: transform 1s;
/*transition: transform 1s;*/
}
.cube__face {

Loading…
Cancel
Save