3D Message Flipper
How do I make an 3d message flipper?
Using GSAP TimelineMax to flip some messages. What is a 3d message flipper? How do you make a 3d message flipper? This script and codes were developed by Peter Hrynkow on 14 September 2022, Wednesday.
3D Message Flipper - Script Codes HTML Codes
<!DOCTYPE html>
<html >
<head> <meta charset="UTF-8"> <title>3D Message Flipper</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"> <link rel="stylesheet" href="css/style.css">
</head>
<body> <div class="container"> <div class="card" id="card"> <div class="face" id="msg1"> Message 1 </div> <div class="face" id="msg2"> Message 2 </div> <div class="face" id="msg3"> Message 3 </div> <div class="face" id="msg4"> Message 4 </div> </div>
</div> <script src='http://cdnjs.cloudflare.com/ajax/libs/jquery/2.1.3/jquery.min.js'></script>
<script src='https://cdnjs.cloudflare.com/ajax/libs/gsap/1.11.1/TweenMax.min.js'></script> <script src="js/index.js"></script>
</body>
</html>
3D Message Flipper - Script Codes CSS Codes
.container { -moz-transform-style: preserve-3d; -webkit-transform-style: preserve-3d; transform-style: preserve-3d; -moz-perspective: 750px; -webkit-perspective: 750px; perspective: 750px; width: 400px; height: 200px; position: relative; margin: 3em auto;
}
.card { -moz-transform-style: preserve-3d; -webkit-transform-style: preserve-3d; transform-style: preserve-3d; width: 100%; height: 100%;
}
.face { background: #ccc; position: absolute; display: none; text-align: center; width: 100%; height: 200px; line-height: 200px; -moz-backface-visibility: hidden; -webkit-backface-visibility: hidden; backface-visibility: hidden;
}
.face:nth-child(2n) { -moz-transform: rotateX(180deg); -ms-transform: rotateX(180deg); -webkit-transform: rotateX(180deg); transform: rotateX(180deg);
}
.face:nth-child(1) { background: teal;
}
.face:nth-child(2) { background: orange;
}
.face:nth-child(3) { background: crimson;
}
.face:nth-child(4) { background: cornflowerblue;
}
3D Message Flipper - Script Codes JS Codes
(function () { var card = $('#card'), faces = $('.face'), msg1 = $('#msg1'), msg2 = $('#msg2'), msg3 = $('#msg3'), msg4 = $('#msg4'); msg1.show(); var tl = new TimelineMax({repeat:2}) .add( TweenLite.to(card, .25, {rotationX:'+=90', delay: 2}) ) .add(function () {faces.hide(); msg2.show(); }) .add( TweenLite.to(card, .25, {rotationX:'+=90'}) ) .add( TweenLite.to(card, .25, {rotationX:'+=90', delay: 2}) ) .add(function () {faces.hide(); msg3.show(); }) .add( TweenLite.to(card, .25, {rotationX:'+=90'}) ) .add( TweenLite.to(card, .25, {rotationX:'+=90', delay: 2}) ) .add(function () {faces.hide(); msg4.show(); }) .add( TweenLite.to(card, .25, {rotationX:'+=90'}) ) .add( TweenLite.to(card, .25, {rotationX:'+=90', delay: 2}) ) .add(function () {faces.hide(); msg1.show(); }) .add( TweenLite.to(card, .25, {rotationX:'+=90'}) )
}());
Developer | Peter Hrynkow |
Username | peterhry |
Uploaded | September 14, 2022 |
Rating | 3.5 |
Size | 2,651 Kb |
Views | 26,312 |
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 |
Dot Ripple CSS | 9,856 Kb |
Ripple Effect | 242,119 Kb |
Rolldown List | 3,158 Kb |
A Pen by Peter Hrynkow | 2,125 Kb |
Cross-browser vertical centering without Javascript and almost no CSS. | 1,800 Kb |
Simple scroll prompt | 2,480 Kb |
CircleType | 3,535 Kb |
Kris Kross Hamburger | 2,517 Kb |
T-Shape Visualization | 3,883 Kb |
Juicy Red Button | 2,173 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 |
Ball Physics | Getsetbro | 3,149 Kb |
Sinclair Research Computers | MattCowley | 3,068 Kb |
Blackberry Mock | Zacharyolson | 1,865 Kb |
Donut Chart example - MorrisJS | Capelo | 2,385 Kb |
CSS3 Form Page Design | Rssatnam | 3,613 Kb |
Heartbeat | Apetrov | 2,079 Kb |
Angular-HAML | Cwacht | 2,022 Kb |
React Vote Component | Souporserious | 5,465 Kb |
Large canvas mousemove experiment | Jibbon | 2,885 Kb |
Horizontal slider on scroll | Alojzije | 2,672 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!