Slider bullet clock animation

Developer
Size
3,579 Kb
Views
22,264

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 Previews

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);
};
Slider bullet clock animation - Script Codes
Slider bullet clock animation - Script Codes
Home Page Home
Developer Tbleckert
Username tbleckert
Uploaded October 16, 2022
Rating 3
Size 3,579 Kb
Views 22,264
Do you need developer help for Slider bullet clock animation?

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!

Tbleckert (tbleckert) Script Codes
Create amazing blog posts with AI!

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!