Pure CSS Spinning Cube
How do I make an pure css spinning cube?
Just having fun with pure css animations and cubes, thought this turned out quite cool. What is a pure css spinning cube? How do you make a pure css spinning cube? This script and codes were developed by Izzy Skye on 27 October 2022, Thursday.
Pure CSS Spinning Cube - Script Codes HTML Codes
<!DOCTYPE html>
<html >
<head> <meta charset="UTF-8"> <title>Pure CSS Spinning Cube</title> <link rel="stylesheet" href="css/style.css">
</head>
<body> <h2 class="text">Click on the cube! </br><small>(NOTE: Not functioning fully on ie)</small></h2>
<div class="cube-overlord"> <input type="checkbox" id="cube-overlord-check" class="display" /> <label for="cube-overlord-check" class="cube-master"> <div class="cube"> <div class="side"></div> <div class="side"></div> <div class="side"></div> <div class="side"></div> <div class="side"></div> <div class="side"></div> </div> <div class="text-2"></br>Click me again!</div> </label>
</div> <script src='http://cdnjs.cloudflare.com/ajax/libs/jquery/2.1.3/jquery.min.js'></script> <script src="js/index.js"></script>
</body>
</html>
Pure CSS Spinning Cube - Script Codes CSS Codes
* { box-sizing: border-box; transition: all 2.2s; -webkit-transition: all 2.2s; color: #EEE; font-family: Monaco, MonoSpace;
}
body { margin: 0; background-color: #1d1f20;
}
/* GENERAL STYLES */
.text { text-align: center; font-size: 40px;
}
small { font-size: 16px;
}
.text-2 { text-align: center; opacity: 0;
}
.cube-overlord { position: relative; margin: 200px auto; width: 100px;
}
.cube-overlord .display { display: none;
}
.cube-overlord .cube-master { position: relative; width: 120px; height: 120px; overflow: hidden;
}
/* CUBESSSSSSSSS */
.cube-overlord .cube { cursor: pointer; position: absolute; width: 100px; height: 100px; transform: rotateY(60deg) rotateX(15deg) rotateZ(30deg); -webkit-transform: rotateY(60deg) rotateX(15deg) rotateZ(30deg); transform-style: preserve-3d; -webkit-transform-style: preserve-3d;
}
.cube-overlord .cube .side { position: absolute; width: 100px; height: 100px; border: 2px solid #E0346A; box-shadow: 0 0 15px rgba(255, 255, 255, 0.6) inset, 0 0 15px #000;
}
.cube-overlord .cube .side:nth-child(1) { transform: translateZ(50px); -webkit-transform: translateZ(50px);
}
.cube-overlord .cube .side:nth-child(2) { transform: rotateY(90deg) translateZ(50px); -webkit-transform: rotateY(90deg) translateZ(50px);
}
.cube-overlord .cube .side:nth-child(3) { transform: rotateY(180deg) translateZ(50px); -webkit-transform: rotateY(180deg) translateZ(50px);
}
.cube-overlord .cube .side:nth-child(4) { transform: rotateY(270deg) translateZ(50px); -webkit-transform: rotateY(270deg) translateZ(50px);
}
.cube-overlord .cube .side:nth-child(5) { transform: rotateX(90deg) translateZ(50px); -webkit-transform: rotateX(90deg) translateZ(50px);
}
.cube-overlord .cube .side:nth-child(6) { transform: rotateX(270deg) translateZ(50px); -webkit-transform: rotateX(270deg) translateZ(50px);
}
/* ANIMATIONS */
.cube-overlord #cube-overlord-check:checked ~ .cube-master > .text-2 { opacity: 1;
}
.cube-overlord #cube-overlord-check:not(:checked) ~ .cube-master > .text-2 { transition: all 0.45s; -webkit-transition: all 0.45s;
}
.cube-overlord #cube-overlord-check:checked ~ .cube-master > .cube { transform: rotateY(232deg) rotateX(332deg) rotateZ(250deg);
}
.cube-overlord #cube-overlord-check:checked ~ .cube-master > .cube > .side { width: 140px; height: 140px; border-width: 5px; box-shadow: 0 0 25px rgba(255, 255, 255, 0.9) inset, 0 0 100px #000;
}
.cube-overlord #cube-overlord-check:checked ~ .cube-master > .cube > .side:nth-child(1) { transform: translateZ(100px); -webkit-transform: translateZ(100px);
}
.cube-overlord #cube-overlord-check:checked ~ .cube-master > .cube > .side:nth-child(2) { transform: rotateY(90deg) translateZ(100px); -webkit-transform: rotateY(90deg) translateZ(100px);
}
.cube-overlord #cube-overlord-check:checked ~ .cube-master > .cube > .side:nth-child(3) { transform: rotateY(180deg) translateZ(100px); -webkit-transform: rotateY(180deg) translateZ(100px);
}
.cube-overlord #cube-overlord-check:checked ~ .cube-master > .cube > .side:nth-child(4) { transform: rotateY(270deg) translateZ(100px); -webkit-transform: rotateY(270deg) translateZ(100px);
}
.cube-overlord #cube-overlord-check:checked ~ .cube-master > .cube > .side:nth-child(5) { transform: rotateX(90deg) translateZ(100px); -webkit-transform: rotateX(90deg) translateZ(100px);
}
.cube-overlord #cube-overlord-check:checked ~ .cube-master > .cube > .side:nth-child(6) { transform: rotateX(270deg) translateZ(100px); -webkit-transform: rotateX(270deg) translateZ(100px);
}
Pure CSS Spinning Cube - Script Codes JS Codes
/**
* Inspired by elneco's cube and put into pure css and html
*
* https://codepen.io/elneco/pen/fnqrv
*
*/
Developer | Izzy Skye |
Username | zephyr |
Uploaded | October 27, 2022 |
Rating | 3 |
Size | 2,539 Kb |
Views | 44,528 |
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 |
Pure CSS Menu Navigation | 2,485 Kb |
Pure CSS Down Arrow | 1,724 Kb |
Unisolated Pure CSS Mobile Nav Spinner | 1,852 Kb |
Pure CSS Dropdown Button | 2,192 Kb |
Material CSS Contact Popup | 6,039 Kb |
Material Button Click Example Usage | 2,185 Kb |
Dynamic Spinning Cubes | 3,293 Kb |
Mobile Material Menu Style | 5,189 Kb |
JQuery Slider | 3,529 Kb |
Small CSS Loading Animation | 2,229 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 |
Touch Carousel - last, no gaps. | Berkin | 4,332 Kb |
NeeilTimer | Neeilan | 2,836 Kb |
CSS Hover Effects | Alen | 3,613 Kb |
React TODO | Enieste | 3,320 Kb |
Google Chrome Icon using Pure CSS in one DIV | Grssam | 3,627 Kb |
NT Tribute | Skybutterfly | 2,850 Kb |
Tiling Subdivision | Francext | 3,937 Kb |
Flexbox slider | Rendro | 3,459 Kb |
Video mute | Leon9208 | 2,131 Kb |
Header | Er40 | 1,542 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!