CSS timer with radial progress bar
How do I make an css timer with radial progress bar?
What is a css timer with radial progress bar? How do you make a css timer with radial progress bar? This script and codes were developed by Juan Cabrera on 12 August 2022, Friday.
CSS timer with radial progress bar - Script Codes HTML Codes
<!DOCTYPE html>
<html >
<head> <meta charset="UTF-8"> <title>CSS timer with radial progress bar</title> <link rel="stylesheet" href="css/style.css">
</head>
<body> <!-- View on Github -->
<!-- http://juancabrera.github.io/radial-timer/ -->
<div class='radialtimer' id='timer'></div> <script src='http://cdnjs.cloudflare.com/ajax/libs/jquery/2.1.3/jquery.min.js'></script> <script src="js/index.js"></script>
</body>
</html>
CSS timer with radial progress bar - Script Codes CSS Codes
body { background-color: #2f3439;
}
.radialtimer { width: 200px; height: 200px; position: absolute; top: 50%; left: 50%; margin: -100px 0 0 -100px;
}
.radialtimer .n { position: absolute; width: 200px; height: 200px; background: white; border-radius: 50%; text-align: center; line-height: 200px; font-family: "Georgia"; font-size: 70px; color: #888;
}
.radialtimer .slice { position: absolute; width: 200px; height: 200px; clip: rect(0px, 200px, 200px, 100px);
}
.radialtimer .slice.nc { clip: rect(auto, auto, auto, auto);
}
.radialtimer .slice .q { position: absolute; width: 170px; height: 170px; border: 16px white solid; border-radius: 50%; clip: rect(0px, 100px, 100px, 0px); z-index: 2;
}
.radialtimer .slice .pie { border: 15px #6BC967 solid; position: absolute; width: 170px; height: 170px; clip: rect(0px, 100px, 200px, 0px); border-radius: 50%; transition: all 1s linear; z-index: 1;
}
CSS timer with radial progress bar - Script Codes JS Codes
function radialTimer() { var self = this; this.seconds = 0; this.count = 0; this.degrees = 0; this.interval = null; this.timerHTML = "<div class='n'></div><div class='slice'><div class='q'></div><div class='pie r'></div><div class='pie l'></div></div>"; this.timerContainer = null; this.number = null; this.slice = null; this.pie = null; this.pieRight = null; this.pieLeft = null; this.quarter = null; this.init = function(e, s) { self.timerContainer = $("#" + e); self.timerContainer.html(self.timerHTML); self.number = self.timerContainer.find(".n"); self.slice = self.timerContainer.find(".slice"); self.pie = self.timerContainer.find(".pie"); self.pieRight = self.timerContainer.find(".pie.r"); self.pieLeft = self.timerContainer.find(".pie.l"); self.quarter = self.timerContainer.find(".q"); // start timer self.start(s); } this.start = function(s) { self.seconds = s; self.interval = window.setInterval(function () { self.number.html(self.seconds - self.count); self.count++; if (self.count > (self.seconds - 1)) clearInterval(self.interval); self.degrees = self.degrees + (360 / self.seconds); if (self.count >= (self.seconds / 2)) { self.slice.addClass("nc"); if (!self.slice.hasClass("mth")) self.pieRight.css({"transform":"rotate(180deg)"}); self.pieLeft.css({"transform":"rotate(" + self.degrees + "deg)"}); self.slice.addClass("mth"); if (self.count >= (self.seconds * 0.75)) self.quarter.remove(); } else { self.pie.css({"transform":"rotate(" + self.degrees + "deg)"}); } }, 1000); }
}
var Timer;
$(document).ready(function() { Timer = new radialTimer(); Timer.init("timer", 20);
});
Developer | Juan Cabrera |
Username | cabrera |
Uploaded | August 12, 2022 |
Rating | 4 |
Size | 3,210 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 |
Dev-social buttons with fancy hover | 3,280 Kb |
Gallery prototype | 6,514 Kb |
A Pen by Juan Cabrera | 2,429 Kb |
Simple styled checkbox | 2,455 Kb |
Simple CSS loader. | 2,574 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 |
Background Images | Jooonebug | 2,100 Kb |
JavaScript constructors | Simboonlong | 2,415 Kb |
Basic template | Tomcat | 1,675 Kb |
Side Sliding Menu CSS | EduardL | 4,388 Kb |
Speech bubbles | Something | 1,547 Kb |
Fading text with CSS blend modes | Giana | 3,305 Kb |
Improve | Gavra | 1,652 Kb |
Fluid Responsive Typography | Jonmilner | 4,205 Kb |
A Pen by John Malc | F789gh | 1,420 Kb |
React Vote Component | Souporserious | 5,465 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!