<div class="progress"></div>
<div id="y-control">
<div class="cube-wrap">
<div class="cube">
<div class="side top"></div>
<div class="side bottom"></div>
<div class="side front"></div>
<div class="side back"></div>
<div class="side left"></div>
<div class="side right"></div>
</div>
</div>
</div>
#zoom:after {
content: '\00a0';
}
#zoom-range {
width: 200vw;
}
#zoom-range:after {
content: '\00a0';
}
body {
padding: 0;
margin: 0;
min-height: 500vh;
background-color: rgb(139, 201, 228);
animation: body 1s linear;
animation-timeline: scroll();
}
.progress {
height: 3px;
width: 0%;
background-color: #fff;
position: fixed;
top: 0;
left: 0;
animation: progress 1s linear;
animation-timeline: scroll();
}
@keyframes progress {
to {
background-color: rgb(20, 255, 226);
width: 100%;
}
}
@keyframes body {
to {
background-color: rgb(19, 48, 97);
}
}
.progress {
height: 3px;
width: 0%;
background-color: #fff;
position: fixed;
top: 0;
left: 0;
}
.cube-wrap {
--size: 30vmin;
position: fixed;
top: 50%;
left: 50%;
width: 0;
height: 0;
perspective: 100vmin;
}
.cube {
transform-style: preserve-3d;
transform: rotateX(0deg) rotateZ(45deg) rotateY(-45deg);
animation-name: cubeRotateX;
animation-duration: 1ms;
animation-timeline: scroll();
}
@keyframes cubeRotateX {
to {
transform: rotateX(360deg);
}
}
@keyframes cubeRotateY {
to {
transform: rotateY(360deg);
}
}
.side {
position: absolute;
width: var(--size);
height: var(--size);
background-color: #eee;
backface-visibility: visible;
top: calc(var(--size) * -.5);
left: calc(var(--size) * -.5);
}
.top {
background-color: #fff;
transform: rotateX(90deg) translateZ(calc(var(--size) * .5));
}
.bottom {
background-color: #999;
transform: rotateX(90deg) translateZ(calc(var(--size) * -.5));
}
.left {
background-color: #ccc;
transform: rotateY(90deg) translateZ(calc(var(--size) * .5));
}
.right {
background-color: #ddd;
transform: rotateY(90deg) translateZ(calc(var(--size) * -.5));
}
.front {
background-color: #aaa;
transform: translateZ(calc(var(--size) * .5));
}
.back {
background-color: #bbb;
transform: translateZ(calc(var(--size) * -.5));
}
This Pen doesn't use any external CSS resources.
This Pen doesn't use any external JavaScript resources.