html - Animated 3D cube only works in Firefox -


i've created 3d animated cube rotates infinitely in 2 different angles. cube located on home page of our company's new test website (next title software when scroll down). in firefox works fine, in google chrome , opera cube not displayed. there, if inspect element , tick 1 of attributes in styles menu cube appear gaps between faces. in microsoft edge cube displayed doesn't rotate. haven't checked safari because i'm using windows.

also, images on cube faces displayed correctly in firefox, whereas in other browsers images zoomed in , see fraction of seismic layers in image.

i've tried recreate problem in jsfiddle, using google chrome. setting class col 100vh won't me because leave large empty space on our home page.

how can make 3d rotating cube work in browsers? appreciated, in advance!

* {      margin: 0;  }  html, body {      height: 100%;  }  body {      perspective: 25em;  }  .row {      display: flex;  }  .row::after {      display: block;      content: '';      clear: both;  }  .col {      position: relative;      flex: 1;  }  [class*='cube'] {      position: absolute;  }  .cube {      top: 50%;      left: 50%;      font-size: 8vmin;      transform-style: preserve-3d;      animation: cube 8s linear infinite;  }  .cube-face {      margin: -2em;      width: 4em;      height: 4em;      backface-visibility: hidden;  }  .cube-face:nth-child(1) {      transform: translatez(2em);      background: url(http://test.dgbes.com/images/cube-face-1.jpg) center/contain no-repeat fixed;  }  .cube-face:nth-child(2) {      transform: rotatey(90deg) translatez(2em);      background: url(http://test.dgbes.com/images/cube-face-2.jpg) center/contain no-repeat fixed;  }  .cube-face:nth-child(3) {      transform: rotatey(180deg) translatez(2em);      background: url(http://test.dgbes.com/images/cube-face-3.jpg) center/contain no-repeat fixed;  }  .cube-face:nth-child(4) {      transform: rotatey(270deg) translatez(2em);      background: url(http://test.dgbes.com/images/cube-face-4.jpg) center/contain no-repeat fixed;  }  .cube-face:nth-child(5) {      transform: rotatex(90deg) translatez(2em);      background: url(http://test.dgbes.com/images/cube-face-5.jpg) center/contain no-repeat fixed;  }  .cube-face:nth-child(6) {      transform: rotatex(-90deg) translatez(2em);      background: url(http://test.dgbes.com/images/cube-face-6.jpg) center/contain no-repeat fixed;  }  @keyframes cube {  	to {  	    transform: rotate3d(1, 1, 1, 1turn) rotate3d(1, -1, 1, 1turn);      }  }
<div class="row">      <div class="col">          <div class="cube">              <div class="cube-face"></div>              <div class="cube-face"></div>              <div class="cube-face"></div>              <div class="cube-face"></div>              <div class="cube-face"></div>              <div class="cube-face"></div>          </div>      </div>  </div>

apparently fixed problem google chrome , opera removing fixed position in cube faces. problem still isn't solved in microsoft edge.

* {      margin: 0;  }  body {      height: 100vh;  }  [class*=cube] {      position: absolute;  }  .cube {      top: 50%;      left: 50%;      font-size: 8vmin;      transform-style: preserve-3d;      animation: cube 8s linear infinite;  }  .cube-face {      margin: -2em;      width: 4em;      height: 4em;      backface-visibility: hidden;  }  .cube-face:nth-child(1) {      transform: translatez(2em);      background: url(http://test.dgbes.com/images/cube-face-1.jpg) center/contain no-repeat;  }  .cube-face:nth-child(2) {      transform: rotatey(90deg) translatez(2em);      background: url(http://test.dgbes.com/images/cube-face-2.jpg) center/contain no-repeat;  }  .cube-face:nth-child(3) {      transform: rotatey(180deg) translatez(2em);      background: url(http://test.dgbes.com/images/cube-face-3.jpg) center/contain no-repeat;  }  .cube-face:nth-child(4) {      transform: rotatey(270deg) translatez(2em);      background: url(http://test.dgbes.com/images/cube-face-4.jpg) center/contain no-repeat;  }  .cube-face:nth-child(5) {      transform: rotatex(90deg) translatez(2em);      background: url(http://test.dgbes.com/images/cube-face-5.jpg) center/contain no-repeat;  }  .cube-face:nth-child(6) {      transform: rotatex(-90deg) translatez(2em);      background: url(http://test.dgbes.com/images/cube-face-6.jpg) center/contain no-repeat;  }  @keyframes cube {  	to {  	    transform: rotate3d(1, 1, 1, 1turn) rotate3d(1, -1, 1, 1turn);      }  }
<div class="cube">      <div class="cube-face"></div>      <div class="cube-face"></div>      <div class="cube-face"></div>      <div class="cube-face"></div>      <div class="cube-face"></div>      <div class="cube-face"></div>  </div>


Comments

Popular posts from this blog

Sort a complex associative array in PHP -

vb.net - How to ignore if a cell is empty nothing -

recursion - Can every recursive algorithm be improved with dynamic programming? -