*, *:before, *:after { box-sizing: border-box; margin: 0; padding: 0; } @font-face { src: url(https://s3-us-west-2.amazonaws.com/s.cdpn.io/142996/Metropolis_1920.otf); font-family: metropolis; } @font-face { src: url(https://s3-us-west-2.amazonaws.com/s.cdpn.io/142996/PFSquareSansPro-Medium.otf); font-family: pfs-medium; } html, body { height: 100%; overflow: hidden; } .scene { position: absolute; top: 0; left: 0; width: 100%; height: 100%; transform-style: preserve-3d; perspective: 2000; } .platform { position: absolute; top: 5%; left: 5%; z-index: 5; width: 90%; height: 90%; padding: 5vh 4.5vw; transition: transform 0.08s linear; will-change: transform; transform-style: preserve-3d; perspective: 2000; &.inactive { transition: transform 0.5s; transform: rotateX(60deg) translateZ(-10rem); } } .element { position: relative; z-index: 10; width: 19vw; height: 39vh; display: inline-block; vertical-align: top; margin: 0 1vw 2vh 0; background: rgba(0,0,0, 0.2); transform: translateZ(1rem); transition: transform 0.3s, opacity 0.1s; will-change: transform; transform-style: preserve-3d; perspective: 2000; &.clicked { opacity: 0; } &:not(.duplicate) { cursor: pointer; } &.duplicate { position: fixed; z-index: 5000; transition: width 0.5s, height 0.5s, top 0.5s, left 0.5s, background-color 0.5s; &.active { width: 100vw; height: 100vh; top: 0 !important; left: 0 !important; background: #A04949; } } &:nth-child(4n) { margin-right: 0; } & > div { border: 1px solid #afafaf; } .content { display: none; border: none; padding: 2rem; width: 100%; height: 100%; overflow-y: auto; color: #f9bdbb; &.visible { .heading { transform: translateX(0); } .content-text { transform: scale(1); opacity: 1; } .close { transform: rotate(45deg); } } .heading { font-size: 4rem; text-transform: uppercase; font-family: pfs-medium; transition: transform 0.5s 0.1s; transform: translateX(-115%); } .content-text { font-family: pfs-medium; font-size: 2rem; transition: transform 0.5s 0.2s, opacity 0.3s 0.2s; transform-origin: 50% 80%; transform: scale(0.3); opacity: 0; } .close { position: absolute; top: -0.5rem; right: 1rem; font-family: metropolis, sans-serif; font-size: 4rem; color: #fff; transform: rotate(45deg) translateY(-5rem); cursor: pointer; transition: transform 0.5s 0.3s cubic-bezier(0.45, 0.25, 0.7, 1.8), color 0.3s; &:hover { color: #673ab7; } } } .back { position: absolute; top: 0.5vh; left: 0; width: 100%; height: 100%; height: calc(100% - 1vh); overflow: hidden; } .hover-text { position: absolute; top: 0; left: 0.5vw; max-width: 18vw; font-family: pfs-medium, sans-serif; color: #771E1E; font-size: 1.5vw; //transition: transform 3s; will-change: transform; } .side { position: absolute; background: rgba(0,0,0, 0.2); &.top, &.bottom { left: 0; width: 100%; height: 1.5rem; } &.top { top: 0; transform-origin: 50% 0%; transform: rotateX(90deg); } &.bottom { bottom: 0; transform-origin: 50% 100%; transform: rotateX(-90deg); } &.left, &.right { top: 0; width: 1.5rem; height: 100%; } &.left { left: 0; transform-origin: 0 50%; transform: rotateY(-90deg); } &.right { right: 0; transform-origin: 100% 50%; transform: rotateY(90deg); } } .face { position: absolute; top: 0; left: 0; width: 100%; height: 100%; transform: translateZ(1.5rem); background: rgba(255,255,255, 0.8); transition: background-color 0.3s; will-change: background-color; font-family: metropolis, sans-sarif; font-size: 4vw; text-align: center; .front-text { color: #BB4141; margin: 0.5rem; text-transform: uppercase; transition: font-size 0s 0s, opacity 0.3s; } } &:not(.clicked):hover { transform: translateZ(3rem); .face { background-color: rgba(255,255,255, 0); height: 0; transition: background-color 0.3s, height 0 0.3s; .front-text { opacity: 0; font-size: 0; transition: opacity 0.3s, font-size 0 0.3s; } } } } label { font-family: pfs-medium; } .label-deg { position: absolute; top: 0; right: 0; } .label-text-hover { position: absolute; bottom: 0; right: 0; } input { z-index: 1000; width: 4rem; height: 1.5rem; }