Page Transition with Loader
How do I make an page transition with loader?
What is a page transition with loader? How do you make a page transition with loader? This script and codes were developed by John Heiner on 14 November 2022, Monday.
Page Transition with Loader - Script Codes HTML Codes
<!DOCTYPE html>
<html >
<head> <meta charset="UTF-8"> <title>Page Transition with Loader</title> <meta name="viewport" content="width=device-width, initial-scale=1"> <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="loader"> <div class="bar1"></div> <div class="bar2"></div> <div class="bar3"></div> <div class="bar4"></div> <div class="bar5"></div> <div class="bar6"></div>
</div>
<main> <div class="-content -index"> <div> <h1>Loader Transition</h1> <a href="#" class="btn js-trigger-transition">Begin Transition</a> </div> </div>
</main> <script src='http://cdnjs.cloudflare.com/ajax/libs/jquery/2.1.3/jquery.min.js'></script>
<script src='http://cdnjs.cloudflare.com/ajax/libs/gsap/1.16.1/TweenMax.min.js'></script>
<script src='http://cdnjs.cloudflare.com/ajax/libs/gsap/1.12.1/plugins/CSSRulePlugin.min.js'></script> <script src="js/index.js"></script>
</body>
</html>
Page Transition with Loader - Script Codes CSS Codes
@-webkit-keyframes delay { 0%, 40%, 100% { transform: scaleY(0.05); -webkit-transform: scaleY(0.05); } 20% { transform: scaleY(1); -webkit-transform: scaleY(1); }
}
@keyframes delay { 0%, 40%, 100% { transform: scaleY(0.05); -webkit-transform: scaleY(0.05); } 20% { transform: scaleY(1); -webkit-transform: scaleY(1); }
}
body { font-size: 1.6rem; font-family: "Open Sans", sans-serif; color: #4089a6; background-color: #ffffff; -webkit-font-smoothing: antialiased; /*&.is-changing{ &:before, &:after{ transform: translateY(0); } }*/
}
body:before, body:after { content: ''; height: 50vh; width: 100%; position: fixed; left: 0; background: #1c2020; z-index: 1;
}
body:before { top: 0; -webkit-transform: translateY(-100%); transform: translateY(-100%);
}
body:after { bottom: 0; -webkit-transform: translateY(100%); transform: translateY(100%);
}
h1 { color: #1c2020; margin-bottom: 1em; font-size: 2.2rem; font-weight: 100;
}
.btn { display: inline-block; padding: 1.4em 1.6em; margin-bottom: 2em; border-radius: 50em; background-color: #343b3b; color: #ffffff; font-weight: bold; font-size: 0.8rem; letter-spacing: 1px; text-transform: uppercase; text-decoration: none;
}
.btn:hover { background-color: #404949;
}
.loader { margin: 0 auto; width: 60px; height: 50px; text-align: center; font-size: 10px; position: absolute; top: 50%; left: 50%; -webkit-transform: translateY(-50%) translateX(-50%); transform: translateY(-50%) translateX(-50%); z-index: 500; opacity: 0;
}
.loader > div { height: 100%; width: 8px; display: inline-block; float: left; margin-left: 2px; -webkit-animation: delay 0.8s infinite ease-in-out; animation: delay 0.8s infinite ease-in-out;
}
.loader .bar1 { background-color: #754fa0;
}
.loader .bar2 { background-color: #09b7bf; -webkit-animation-delay: -0.7s; animation-delay: -0.7s;
}
.loader .bar3 { background-color: #90d36b; -webkit-animation-delay: -0.6s; animation-delay: -0.6s;
}
.loader .bar4 { background-color: #f2d40d; -webkit-animation-delay: -0.5s; animation-delay: -0.5s;
}
.loader .bar5 { background-color: #fcb12b; -webkit-animation-delay: -0.4s; animation-delay: -0.4s;
}
.loader .bar6 { background-color: #ed1b72; -webkit-animation-delay: -0.3s; animation-delay: -0.3s;
}
main { height: 100vh; /* padding: 10px; */ text-align: center;
}
main .-content { position: relative; height: 100vh;
}
main .-content > div { height: 100%; overflow: hidden; overflow-y: auto;
}
main .-content.-index { background-color: #f6f6f6; display: table; width: 100%;
}
main .-content.-index > div { display: table-cell; vertical-align: middle;
}
Page Transition with Loader - Script Codes JS Codes
// play on load for gallery view
setTimeout(transition, 1000);
$('.js-trigger-transition').on('click', function(e) { e.preventDefault(); transition();
});
function transition() { var tl = new TimelineMax(); tl.to(CSSRulePlugin.getRule('body:before'), 0.2, {cssRule: {top: '50%' }, ease: Power2.easeOut}, 'close') .to(CSSRulePlugin.getRule('body:after'), 0.2, {cssRule: {bottom: '50%' }, ease: Power2.easeOut}, 'close') .to($('.loader'), 0.2, {opacity: 1}) .to(CSSRulePlugin.getRule('body:before'), 0.2, {cssRule: {top: '0%' }, ease: Power2.easeOut}, '+=1.5', 'open') .to(CSSRulePlugin.getRule('body:after'), 0.2, {cssRule: {bottom: '0%' }, ease: Power2.easeOut}, '-=0.2', 'open') .to($('.loader'), 0.2, {opacity: 0}, '-=0.2');
}
Developer | John Heiner |
Username | johnheiner |
Uploaded | November 14, 2022 |
Rating | 4.5 |
Size | 3,824 Kb |
Views | 70,840 |
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 |
Image Hover | 3,409 Kb |
Passport Flip Open with GSAP | 3,400 Kb |
Breaking Lists at specific points without floats. | 1,962 Kb |
Animated River Depth measurement | 5,247 Kb |
Floating Labels | 3,880 Kb |
Multi-line CSS text-shadow | 2,104 Kb |
Loading Animation | 2,364 Kb |
Social Icon System | 8,772 Kb |
Easy Hamburger to X Icon animation | 2,736 Kb |
Logo Animation | 4,438 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 |
Loading animation with css | Icebob | 2,947 Kb |
Popup Modal | Aldlevine | 3,696 Kb |
Super Discount | Orrinward | 3,225 Kb |
Search Box in Content Moves to Fixed Header | Chriscoyier | 2,768 Kb |
Experiment - SCSS SVG Background Image with Variables | See8ch | 3,270 Kb |
Cartoon Bomb | Tcmulder | 4,929 Kb |
Magnus 3 | ARocketfish | 7,944 Kb |
Myprofile | SoufianeAbid | 2,451 Kb |
Contact | GanNichiHa | 2,514 Kb |
A Pen by panstable | Panstable | 2,940 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!