3D cube rotation
How do I make an 3d cube rotation?
What is a 3d cube rotation? How do you make a 3d cube rotation? This script and codes were developed by Ivan Sakoman on 12 June 2022, Sunday.
3D cube rotation - Script Codes HTML Codes
<!DOCTYPE html>
<html >
<head> <meta charset="UTF-8"> <title>3D cube rotation</title> <link rel="stylesheet" href="css/style.css">
</head>
<body> <div class="wrapper"> <div class="cube"> <div class="face front">1</div> <div class="face back">2</div> <div class="face right">3</div> <div class="face left">4</div> <div class="face top">5</div> <div class="face bottom">6</div> </div>
</div>
<button id="prvi">stisni me</button>
<button id="drugi">stisni me</button> <script src='http://cdnjs.cloudflare.com/ajax/libs/jquery/2.1.3/jquery.min.js'></script> <script src="js/index.js"></script>
</body>
</html>
3D cube rotation - Script Codes CSS Codes
body { margin: 100px;
}
* { transition: all 0.8s linear;
}
.wrapper { width: 200px; height: 200px; position: relative; perspective: 1000px;
}
.wrapper .cube { width: 100%; height: 100%; position: absolute; transform-style: preserve-3d; transform: translateZ(-100px);
}
.wrapper .cube.show-back { transform: rotate3d(1, 0, 0, 180deg);
}
.wrapper .cube.show-right { transform: rotate3d(0, 1, 1, 90deg);
}
.wrapper .cube .face { position: absolute; width: 196px; height: 196px; border: 2px solid black;
}
.wrapper .cube .face.front { transform: rotateX(0) translateZ(100px); background-color: rgba(0, 0, 0, 0.3); background-blend-mode: multiply;
}
.wrapper .cube .face.back { transform: rotateX(180deg) translateZ(100px); background-color: rgba(0, 0, 163, 0.3); background-blend-mode: multiply;
}
.wrapper .cube .face.right { transform: rotateY(90deg) translateZ(100px); background-color: rgba(135, 0, 0, 0.3); background-blend-mode: multiply;
}
.wrapper .cube .face.left { transform: rotateY(-90deg) translateZ(100px); background-color: rgba(0, 231, 0, 0.3); background-blend-mode: multiply;
}
.wrapper .cube .face.top { transform: rotateX(90deg) translateZ(100px); background-color: rgba(0, 0, 234, 0.3); background-blend-mode: multiply;
}
.wrapper .cube .face.bottom { transform: rotateX(-90deg) translateZ(100px); background-color: rgba(157, 56, 0, 0.3); background-blend-mode: multiply;
}
button { margin-top: 150px;
}
3D cube rotation - Script Codes JS Codes
$('#prvi').click(function(){ $('.cube').toggleClass('show-back');
});
$('#drugi').click(function(){ $('.cube').toggleClass('show-right');
});
Developer | Ivan Sakoman |
Username | ssaakkaa |
Uploaded | June 12, 2022 |
Rating | 3 |
Size | 2,653 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 |
Dropdown | 2,457 Kb |
CSS work desk | 6,139 Kb |
Dubble header idea | 1,543 Kb |
Spinner CSS | 2,411 Kb |
OnClick transition | 2,263 Kb |
Form elements | 4,578 Kb |
CSS tutorial | 6,187 Kb |
Ribon label | 2,254 Kb |
R2-D2 | 5,171 Kb |
Bootstrap header | 1,872 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 |
Gradients | Karpovsystems | 2,394 Kb |
Google Chrome Icon using Pure CSS in one DIV | Grssam | 3,627 Kb |
TestTube CSS | EZPK | 2,710 Kb |
GrcJS | Vino6 | 2,047 Kb |
Christ the Redeemer | Prashantsani | 2,208 Kb |
Next Word Predictor | Rfalor | 2,776 Kb |
Simple, flat contact form | Zeaklous | 2,719 Kb |
Three js | Paulq | 2,353 Kb |
Box Shadow Effects | Retrofuturistic | 2,143 Kb |
Nav Test -- cats 1 | Payls | 4,735 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!