Rotating 3d cube
How do I make an rotating 3d cube?
Practicing with css 3d effects. What is a rotating 3d cube? How do you make a rotating 3d cube? This script and codes were developed by Chris Hanson on 01 October 2022, Saturday.
Rotating 3d cube - Script Codes HTML Codes
<!DOCTYPE html>
<html >
<head> <meta charset="UTF-8"> <title>Rotating 3d cube</title> <script src="https://s.codepen.io/assets/libs/modernizr.js" type="text/javascript"></script> <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/normalize/5.0.0/normalize.min.css"> <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! */ * { box-sizing: border-box;
}
body { background: #a7afb9;
}
.container { width: 210px; height: 210px; margin: 100px auto;
}
.cube { width: 100%; height: 100%; color: rgba(255, 255, 255, 0.66); text-align: center; line-height: 180px; font-size: 10em; transform-style: preserve-3d; animation: anim 3s linear infinite;
}
.cube .face { width: 100%; height: 100%; position: absolute; border: 15px solid rgba(255, 255, 255, 0.33); background: rgba(0, 0, 0, 0.5);
}
.cube .face:nth-child(1) { transform: translateZ(105px);
}
.cube .face:nth-child(2) { transform: rotateY(-180deg) translateZ(105px);
}
.cube .face:nth-child(3) { transform: rotateY(90deg) translateZ(105px);
}
.cube .face:nth-child(4) { transform: rotateY(-90deg) translateZ(105px);
}
.cube .face:nth-child(5) { transform: rotateX(90deg) translateZ(105px);
}
.cube .face:nth-child(6) { transform: rotateX(-90deg) translateZ(105px);
}
@keyframes anim { to { transform: rotateX(360deg) rotateY(360deg); }
} </style> <script src="https://cdnjs.cloudflare.com/ajax/libs/prefixfree/1.0.7/prefixfree.min.js"></script>
</head>
<body> <div class='container'> <div class='cube'> <div class='face'> 1 </div> <div class='face'> 2 </div> <div class='face'> 3 </div> <div class='face'> 4 </div> <div class='face'> 5 </div> <div class='face'> 6 </div> </div>
</div>
</body>
</html>
Rotating 3d cube - Script Codes CSS Codes
* { box-sizing: border-box;
}
body { background: #a7afb9;
}
.container { width: 210px; height: 210px; margin: 100px auto;
}
.cube { width: 100%; height: 100%; color: rgba(255, 255, 255, 0.66); text-align: center; line-height: 180px; font-size: 10em; transform-style: preserve-3d; animation: anim 3s linear infinite;
}
.cube .face { width: 100%; height: 100%; position: absolute; border: 15px solid rgba(255, 255, 255, 0.33); background: rgba(0, 0, 0, 0.5);
}
.cube .face:nth-child(1) { transform: translateZ(105px);
}
.cube .face:nth-child(2) { transform: rotateY(-180deg) translateZ(105px);
}
.cube .face:nth-child(3) { transform: rotateY(90deg) translateZ(105px);
}
.cube .face:nth-child(4) { transform: rotateY(-90deg) translateZ(105px);
}
.cube .face:nth-child(5) { transform: rotateX(90deg) translateZ(105px);
}
.cube .face:nth-child(6) { transform: rotateX(-90deg) translateZ(105px);
}
@keyframes anim { to { transform: rotateX(360deg) rotateY(360deg); }
}
Developer | Chris Hanson |
Username | chrishanson |
Uploaded | October 01, 2022 |
Rating | 3 |
Size | 2,957 Kb |
Views | 10,120 |
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!
Name | Size |
Css spinner | 2,953 Kb |
Particle Emitter | 3,105 Kb |
Uiselect ie8 issues | 15,255 Kb |
Hello World | 3,501 Kb |
Photo crop prototype | 19,337 Kb |
Alternating rotating shaps | 4,980 Kb |
UI Select Multiselect | 3,372 Kb |
Fireworks | 3,514 Kb |
A Pen by Chris Hanson | 9,469 Kb |
Lf layout | 6,820 Kb |
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!
Name | Username | Size |
UI Challenge - Budget Selector | AgentRR007 | 3,547 Kb |
Cofee and sugar | Tripack | 2,094 Kb |
Portfolio Landing Page | FDfranklin | 3,585 Kb |
Pattern lab logo | TimPietrusky | 3,666 Kb |
Project MMetro beta | Atomicsong | 5,157 Kb |
Animated SVG stroke-dasharray | Netsi1964 | 3,179 Kb |
IPhone5S SVG Space Grey | Onlinechris | 75,035 Kb |
Toolbar | Onsen | 5,414 Kb |
Css3 loader | Clknap | 2,391 Kb |
RRC wrapSwitch | Pshrmn | 2,922 Kb |
Surf anonymously, prevent hackers from acquiring your IP address, send anonymous email, and encrypt your Internet connection. High speed, ultra secure, and easy to use. Instant setup. Hide Your IP Now!