CSS Voxel Animation

Developer
Size
3,005 Kb
Views
40,480

How do I make an css voxel animation?

What is a css voxel animation? How do you make a css voxel animation? This script and codes were developed by Chad Scira on 27 August 2022, Saturday.

CSS Voxel Animation Previews

CSS Voxel Animation - Script Codes HTML Codes

<!DOCTYPE html>
<html >
<head> <meta charset="UTF-8"> <title>CSS Voxel Animation</title> <style> /* NOTE: The styles were added inline because Prefixfree needs access to your styles and they must be inlined if they are on local disk! */ .wrap {	margin-top: 10px;	perspective: 2800px;	perspective-origin: 50% 50%; width: 100%; height: 100%; position: relative; transform-origin: 50% 0; transform: scale(.5) translateX(-140px);
}
@media screen and ( min-height: 200px ) {	.wrap {	transform: scale(.6) translateX(-140px); }
}
@media screen and ( min-height: 300px ) {	.wrap {	transform: scale(.8) translateX(-140px); }
}
@media screen and ( min-height: 400px ) {	.wrap {	transform: scale(1) translateX(-140px); }
}
.cube {	position: absolute; height: 200px;	width: 200px; left: 0; top: 300px; bottom: 0; right: 0; margin: auto;	transform-style: preserve-3d; transform: scale(.5) rotateX(-35deg) rotateY(45deg); transition: transform .2s linear 0s;
}
.cube:hover {
}
.cube div {	position: absolute;	width: 200px;	height: 200px;
}
.cube:nth-child(4) { animation: Test 4s infinite;
}
.cube:nth-child(4) .front {
background-color: #deb631;
}
.cube:nth-child(4) .top {
background-color: #deb631;
}
.cube:nth-child(4) .left {
background-color: #deb631;
}
.cube:nth-child(1) { left: 282px;
}
.cube:nth-child(2) { transform: scale(.5) translateX(140px) translateY(245px) rotateX(-35deg) rotateY(45deg);
}
.cube:nth-child(3) { transform: scale(.5) translateX(422px) translateY(245px) rotateX(-35deg) rotateY(45deg);
}
.cube div:after { content: ""; position: absolute; left: 0; right: 0; top: 0; bottom: 0; border: 2px solid black;
}
.left {
background-color: #f76d3f; background-image: repeating-linear-gradient(-135deg, transparent, transparent 20px, rgba(0, 0, 0, 1) 20px, rgba(0, 0, 0, 1) 25px);	transform: rotateY(270deg) translateX(-100px);	transform-origin: center left;
}
.top {	background-color: #f76d3f;	transform: rotateX(-90deg) translateY(-100px);	transform-origin: top center;
}
.front {	background-color: #f76d3f;
background-image: repeating-linear-gradient(-45deg, transparent, transparent 20px, rgba(0, 0, 0, 1) 20px, rgba(0, 0, 0, 1) 25px), repeating-linear-gradient(-135deg, transparent, transparent 20px, rgba(0, 0, 0, 1) 20px, rgba(0, 0, 0, 1) 25px);	transform: translateZ(100px);
}
@keyframes Test { 0% {	transform: scale(.5) rotateX(-35deg) rotateY(45deg) translateZ(0px); } 10% {	transform: scale(.5) rotateX(-35deg) rotateY(45deg) translateZ(200px); } 20% {	transform: scale(.5) rotateX(-35deg) rotateY(45deg) translateZ(400px); } 30% {	transform: scale(.5) rotateX(-35deg) rotateY(45deg) translateZ(400px) translateY(200px); } 40% {	transform: scale(.5) rotateX(-35deg) rotateY(45deg) translateZ(400px); } 50% {	transform: scale(.5) rotateX(-35deg) rotateY(45deg) translateZ(400px) translateX(200px); } 60% {	transform: scale(.5) rotateX(-35deg) rotateY(45deg) translateZ(400px) translateX(400px); } 60.01% { z-index: 1; } 60.02% { z-index: -1; } 70% {	transform: scale(.5) rotateX(-35deg) rotateY(45deg) translateY(0px) translateZ(200px) translateX(400px); } 70.01% { z-index: -1; } 80% {	transform: scale(.5) rotateX(-35deg) rotateY(45deg) translateY(0px) translateZ(0px) translateX(400px); } 90% {	transform: scale(.5) rotateX(-35deg) rotateY(45deg) translateY(0px) translateZ(0px) translateX(200px); }	99.99% { z-index: -1; } 100% { z-index: 1;	transform: scale(.5) rotateX(-35deg) rotateY(45deg) translateZ(0px); }
} </style> <script src="https://cdnjs.cloudflare.com/ajax/libs/prefixfree/1.0.7/prefixfree.min.js"></script>
</head>
<body> <div class="wrap">	<div class="cube">	<div class="front"></div>	<div class="top"></div>	<div class="left"></div>	</div>	<div class="cube">	<div class="front"></div>	<div class="top"></div>	<div class="left"></div>	</div>	<div class="cube">	<div class="front"></div>	<div class="top"></div>	<div class="left"></div>	</div>	<div class="cube">	<div class="front"></div>	<div class="top"></div>	<div class="left"></div>	</div>
</div>
</body>
</html>

CSS Voxel Animation - Script Codes CSS Codes

.wrap {	margin-top: 10px;	perspective: 2800px;	perspective-origin: 50% 50%; width: 100%; height: 100%; position: relative; transform-origin: 50% 0; transform: scale(.5) translateX(-140px);
}
@media screen and ( min-height: 200px ) {	.wrap {	transform: scale(.6) translateX(-140px); }
}
@media screen and ( min-height: 300px ) {	.wrap {	transform: scale(.8) translateX(-140px); }
}
@media screen and ( min-height: 400px ) {	.wrap {	transform: scale(1) translateX(-140px); }
}
.cube {	position: absolute; height: 200px;	width: 200px; left: 0; top: 300px; bottom: 0; right: 0; margin: auto;	transform-style: preserve-3d; transform: scale(.5) rotateX(-35deg) rotateY(45deg); transition: transform .2s linear 0s;
}
.cube:hover {
}
.cube div {	position: absolute;	width: 200px;	height: 200px;
}
.cube:nth-child(4) { animation: Test 4s infinite;
}
.cube:nth-child(4) .front {
background-color: #deb631;
}
.cube:nth-child(4) .top {
background-color: #deb631;
}
.cube:nth-child(4) .left {
background-color: #deb631;
}
.cube:nth-child(1) { left: 282px;
}
.cube:nth-child(2) { transform: scale(.5) translateX(140px) translateY(245px) rotateX(-35deg) rotateY(45deg);
}
.cube:nth-child(3) { transform: scale(.5) translateX(422px) translateY(245px) rotateX(-35deg) rotateY(45deg);
}
.cube div:after { content: ""; position: absolute; left: 0; right: 0; top: 0; bottom: 0; border: 2px solid black;
}
.left {
background-color: #f76d3f; background-image: repeating-linear-gradient(-135deg, transparent, transparent 20px, rgba(0, 0, 0, 1) 20px, rgba(0, 0, 0, 1) 25px);	transform: rotateY(270deg) translateX(-100px);	transform-origin: center left;
}
.top {	background-color: #f76d3f;	transform: rotateX(-90deg) translateY(-100px);	transform-origin: top center;
}
.front {	background-color: #f76d3f;
background-image: repeating-linear-gradient(-45deg, transparent, transparent 20px, rgba(0, 0, 0, 1) 20px, rgba(0, 0, 0, 1) 25px), repeating-linear-gradient(-135deg, transparent, transparent 20px, rgba(0, 0, 0, 1) 20px, rgba(0, 0, 0, 1) 25px);	transform: translateZ(100px);
}
@keyframes Test { 0% {	transform: scale(.5) rotateX(-35deg) rotateY(45deg) translateZ(0px); } 10% {	transform: scale(.5) rotateX(-35deg) rotateY(45deg) translateZ(200px); } 20% {	transform: scale(.5) rotateX(-35deg) rotateY(45deg) translateZ(400px); } 30% {	transform: scale(.5) rotateX(-35deg) rotateY(45deg) translateZ(400px) translateY(200px); } 40% {	transform: scale(.5) rotateX(-35deg) rotateY(45deg) translateZ(400px); } 50% {	transform: scale(.5) rotateX(-35deg) rotateY(45deg) translateZ(400px) translateX(200px); } 60% {	transform: scale(.5) rotateX(-35deg) rotateY(45deg) translateZ(400px) translateX(400px); } 60.01% { z-index: 1; } 60.02% { z-index: -1; } 70% {	transform: scale(.5) rotateX(-35deg) rotateY(45deg) translateY(0px) translateZ(200px) translateX(400px); } 70.01% { z-index: -1; } 80% {	transform: scale(.5) rotateX(-35deg) rotateY(45deg) translateY(0px) translateZ(0px) translateX(400px); } 90% {	transform: scale(.5) rotateX(-35deg) rotateY(45deg) translateY(0px) translateZ(0px) translateX(200px); }	99.99% { z-index: -1; } 100% { z-index: 1;	transform: scale(.5) rotateX(-35deg) rotateY(45deg) translateZ(0px); }
}
CSS Voxel Animation - Script Codes
CSS Voxel Animation - Script Codes
Home Page Home
Developer Chad Scira
Username icodeforlove
Uploaded August 27, 2022
Rating 3.5
Size 3,005 Kb
Views 40,480
Do you need developer help for CSS Voxel Animation?

Find the perfect freelance services for your business! Fiverr's mission is to change how the world works together. Fiverr connects businesses with freelancers offering digital services in 500+ categories. Find Developer!

Chad Scira (icodeforlove) Script Codes
Create amazing blog posts with AI!

Jasper is the AI Content Generator that helps you and your team break through creative blocks to create amazing, original content 10X faster. Discover all the ways the Jasper AI Content Platform can help streamline your creative workflows. Start For Free!