Rotating timer
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 - 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;
}
Developer | Ludvig Lindblom |
Username | ludviglindblom |
Uploaded | July 25, 2022 |
Rating | 3 |
Size | 2,640 Kb |
Views | 64,768 |
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 |
Css arrows and pies | 2,584 Kb |
Starburst | 3,581 Kb |
Circle star | 2,690 Kb |
Canvas animation | 2,386 Kb |
Just another responsive layout | 3,660 Kb |
The Ultimate Flexbox Cheat Sheet | 7,954 Kb |
Canvas pie chart with CSS bar chart fallback | 4,014 Kb |
SaSS pattern | 7,900 Kb |
Christmas Tree | 2,301 Kb |
CSS loading spinners | 2,163 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 |
Foundation 5 Menu - Accessibility | Xporter | 1,999 Kb |
A Pen by MurabitoB | MurabitoB | 4,421 Kb |
A Pen by Theun | Tjoen | 6,152 Kb |
A Pen by lizz | Lizz | 10,068 Kb |
Heatmap Color Scales | Stevepepple | 2,331 Kb |
Sitemap generator for Sharepoint | Gyusza | 2,518 Kb |
Lazy Load for Background Images | The_ruther4d | 2,977 Kb |
The Monty Hall Problem | Melatonind | 4,360 Kb |
Wikipedia Viewer | Thalpha | 4,426 Kb |
700 Synapses Per Second | Silentkrange | 2,138 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!