Rotating timer

Size
2,640 Kb
Views
64,768

How do I make an rotating timer?

Based on Hugo Giraduel's Pure CSS Pie Timer, http://codepen.io/HugoGiraudel/pen/BHEwoI built mine slightly different, using 2 halfs of a circle that do not move, and a mask that rotates to hide/reveal parts of the circles (who in turn change opacity half way through the animation).. What is a rotating timer? How do you make a rotating timer? This script and codes were developed by Ludvig Lindblom on 25 July 2022, Monday.

Rotating timer Previews

Rotating timer - Script Codes HTML Codes

<!DOCTYPE html>
<html >
<head> <meta charset="UTF-8"> <title>Rotating timer</title> <style> /* NOTE: The styles were added inline because Prefixfree needs access to your styles and they must be inlined if they are on local disk! */ * { box-sizing: border-box;
}
body { background: white;
}
.wrapper { width: 200px; height: 200px; margin: 20px auto; position: relative;
}
.left { width: 100px; height: 200px; position: absolute; top: 0; left: 0; background: -webkit-linear-gradient(top, #eaeaea 0%,#7cbc0a 100%); border-radius: 100px 0 0 100px; z-index: 10; opacity: 0; animation: fill 5s steps(1, end) 1; animation-fill-mode: forwards;
}
.right { width: 100px; height: 200px; position: absolute; top: 0; right: 0; background: -webkit-linear-gradient(top, #eaeaea 0%,#7cbc0a 100%); border-radius: 0 100px 100px 0; z-index: 10; opacity: 1; animation: mask 5s steps(1, end) 1; animation-fill-mode: forwards;
}
.rotate { /* The mask is slightly larger than the two halfs to prevent a trailing outline */ width: 101px; height: 202px; position: absolute; top: -1px; right: -1px; background: white; z-index: 20; transform-origin: 0 50%; animation: rota 5s linear 1; animation-fill-mode: forwards;
}
@keyframes rota { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); }
}
@keyframes fill { 0% { opacity: 0; } 50%, 100% { opacity: 1; }
}
@keyframes mask { 0% { z-index: 10; } 50%, 100% { z-index: 30; }
}
.wrapper:hover .left,
.wrapper:hover .right,
.wrapper:hover .rotate { animation-play-state: paused;
} </style> <script src="https://cdnjs.cloudflare.com/ajax/libs/prefixfree/1.0.7/prefixfree.min.js"></script>
</head>
<body> <div class="wrapper">	<div class="left"></div>	<div class="right"></div>	<div class="rotate"></div>
</div>
</body>
</html>

Rotating timer - Script Codes CSS Codes

* { box-sizing: border-box;
}
body { background: white;
}
.wrapper { width: 200px; height: 200px; margin: 20px auto; position: relative;
}
.left { width: 100px; height: 200px; position: absolute; top: 0; left: 0; background: -webkit-linear-gradient(top, #eaeaea 0%,#7cbc0a 100%); border-radius: 100px 0 0 100px; z-index: 10; opacity: 0; animation: fill 5s steps(1, end) 1; animation-fill-mode: forwards;
}
.right { width: 100px; height: 200px; position: absolute; top: 0; right: 0; background: -webkit-linear-gradient(top, #eaeaea 0%,#7cbc0a 100%); border-radius: 0 100px 100px 0; z-index: 10; opacity: 1; animation: mask 5s steps(1, end) 1; animation-fill-mode: forwards;
}
.rotate { /* The mask is slightly larger than the two halfs to prevent a trailing outline */ width: 101px; height: 202px; position: absolute; top: -1px; right: -1px; background: white; z-index: 20; transform-origin: 0 50%; animation: rota 5s linear 1; animation-fill-mode: forwards;
}
@keyframes rota { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); }
}
@keyframes fill { 0% { opacity: 0; } 50%, 100% { opacity: 1; }
}
@keyframes mask { 0% { z-index: 10; } 50%, 100% { z-index: 30; }
}
.wrapper:hover .left,
.wrapper:hover .right,
.wrapper:hover .rotate { animation-play-state: paused;
}
Rotating timer - Script Codes
Rotating timer - Script Codes
Home Page Home
Developer Ludvig Lindblom
Username ludviglindblom
Uploaded July 25, 2022
Rating 3
Size 2,640 Kb
Views 64,768
Do you need developer help for Rotating timer?

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!

Ludvig Lindblom (ludviglindblom) 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!