Slider bullet clock animation
How do I make an slider bullet clock animation?
Testing a clock animation on a slider bullet that shows the time until next slide.. What is a slider bullet clock animation? How do you make a slider bullet clock animation? This script and codes were developed by Tbleckert on 16 October 2022, Sunday.
Slider bullet clock animation - Script Codes HTML Codes
<!DOCTYPE html>
<html >
<head> <meta charset="UTF-8"> <title>Slider bullet clock animation</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> <button id="start">Press me</button>
<ol class="clock-indicators" id="indicators"> <li></li> <li></li> <li></li> <li></li>
</ol> <script src='http://ajax.googleapis.com/ajax/libs/mootools/1.4.5/mootools-yui-compressed.js'></script> <script src="js/index.js"></script>
</body>
</html>
Slider bullet clock animation - Script Codes CSS Codes
body { background: #f8f8f8;
}
button { background: #a8d729; color: #fff; border: none; border-radius: 5px; position: absolute; top: 10px; left: 10px; padding: 10px 20px;
}
.clock-indicators { list-style: none; width: 400px; text-align: center; overflow: hidden; font-size: 0; letter-spacing: -1px; margin: 10% auto;
}
.clock-indicators > li { width: 50px; height: 50px; border-radius: 25px; background: #5f5f5f; position: relative; display: inline-block; margin: 0 20px; -moz-backface-visibility: hidden; -webkit-backface-visibility: hidden; backface-visibility: hidden; -moz-perspective: 1000; -webkit-perspective: 1000; perspective: 1000; -moz-transform: 0; -webkit-transform: 0; transform: 0; /* Transition transform overflow bug fix */
}
.clock-indicators > li.active > span { display: block;
}
.clock-indicators > li::after { content: ""; width: 100%; height: 100%; position: absolute; top: -20px; left: -20px; border: 20px solid #f8f8f8; border-radius: 50%; z-index: 4;
}
.clock-indicators > li > span { display: none;
}
.clock-indicators > li > span:first-child { position: absolute; top: 0; left: 0; width: 50%; height: 100%; background: #a8d729; z-index: 1; -moz-transform: rotate(0deg); -ms-transform: rotate(0deg); -webkit-transform: rotate(0deg); transform: rotate(0deg); -moz-transform-origin: 25px 50%; -ms-transform-origin: 25px 50%; -webkit-transform-origin: 25px 50%; transform-origin: 25px 50%;
}
.clock-indicators > li > span:first-child + span { position: absolute; top: 0; right: 0; width: 50%; height: 100%; background: #5f5f5f; z-index: 2;
}
.clock-indicators > li > span:last-child { width: 50%; height: 110%; float: right; background: #a8d729; -moz-transform: rotate(0deg); -ms-transform: rotate(0deg); -webkit-transform: rotate(0deg); transform: rotate(0deg); -moz-transform-origin: 0 50%; -ms-transform-origin: 0 50%; -webkit-transform-origin: 0 50%; transform-origin: 0 50%; position: relative; z-index: 3; opacity: 1;
}
.clock-indicators > li.start span:first-child { -moz-transition: -moz-transform 3s linear 3s; -o-transition: -o-transform 3s linear 3s; -webkit-transition: -webkit-transform 3s linear; -webkit-transition-delay: 3s; transition: transform 3s linear 3s; -moz-transform: rotate(180deg); -ms-transform: rotate(180deg); -webkit-transform: rotate(180deg); transform: rotate(180deg);
}
.clock-indicators > li.start span:last-child { opacity: 0; -moz-transition: -moz-transform 3s linear, opacity 0s 3s; -o-transition: -o-transform 3s linear, opacity 0s 3s; -webkit-transition: -webkit-transform 3s linear, opacity 0s; -webkit-transition-delay: 0s, 3s; transition: transform 3s linear, opacity 0s 3s; -moz-transform: rotate(180deg); -ms-transform: rotate(180deg); -webkit-transform: rotate(180deg); transform: rotate(180deg);
}
Slider bullet clock animation - Script Codes JS Codes
var indicators = document.id('indicators'), active = indicators.getChildren('li:first-child'), button = document.id('start'), init, startIndicators, timer;
button.addEvent('click', function () { // Start the loop startIndicators();
});
// Add html to bullets
init = function () { // Make first bullet active active.addClass('active'); // Loop through bullets and add some html indicators.getChildren('li').each(function (item) { item.set('html', '<span></span><span></span><span></span>'); });
};
// Run init
init();
// Indicator loop
startIndicators = function () { // I'm too lazy to create a transition end event clearTimeout(timer); // Start active bullet active.addClass('start'); timer = setTimeout(function () { // Make current active inactive active.removeClass('active start'); // Find next bullet active = active.getNext('li'); // If no next, start over if (!active[0]) { active = indicators.getChildren('li:first-child'); } // Make current active active.addClass('active'); // Re-run setTimeout(startIndicators, 50); }, 6000);
};
Developer | Tbleckert |
Username | tbleckert |
Uploaded | October 16, 2022 |
Rating | 3 |
Size | 3,579 Kb |
Views | 22,264 |
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 |
Profile image concepts | 4,152 Kb |
Pacman loader | 2,598 Kb |
CSS3 Cases | 3,330 Kb |
Swimming dude loader | 3,656 Kb |
Google font effects | 1,951 Kb |
Canvas circle hover test | 2,576 Kb |
Named media queris | 1,810 Kb |
Colorful header navigation concept | 4,499 Kb |
Scoreboard.js messages | 2,031 Kb |
A Pen by tbleckert | 1,901 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 |
Animate a paper plane along an SVG path, looking ahead | PotatoDie | 3,734 Kb |
Pure CSS Torch Light | Juliendargelos | 2,727 Kb |
AngularJS Skills | Supro | 3,312 Kb |
Animating characters with jQuery | 042 | 2,776 Kb |
This in constructor context | _shree33 | 1,718 Kb |
Banner Ad | Raquellorenzana | 4,172 Kb |
Elon Musk - Tribute Page - FreeCodeCamp | Yunnimun | 8,615 Kb |
A Pen by Moeid Saleem | Moeidsaleem | 1,862 Kb |
Sinclair Research Computers | MattCowley | 3,068 Kb |
A Pen by Rob Levin | Roblevin | 2,787 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!