question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

CSS pie countdown timer

See original GitHub issue

Describe the feature you want: I have no idea what you’re doing behind the scenes to generate PNGs for the countdown timer, but there is an efficient way to do it with SVG and CSS animations.

To change the time it takes simply change the animation duration. To continue it from a specific point simply change the last 100 in stroke-dasharray:100 0 100; to whatever % you want (remember to change animation time to reflect).

<svg class="otpPie" viewBox="0 0 64 64"><circle class="pieBG" cx="32" cy="32" r="31.75"/><circle class="pie1" cx="-32" cy="32" r="15.9"/></svg>
.otpPie {width:32px;height:32px; margin-right:1em; vertical-align:middle; }
.pieBG {fill:#555; animation:60s linear 0s infinite both eatPieBG;}
.pie1 { transform:rotate(-90deg);fill:none; stroke:rgb(50,200,50); stroke-width:31.8; stroke-dashoffset:100; stroke-dasharray:100 0 100; /*ignore, offset, % */
animation:60s linear 0s infinite eatPie; }
@keyframes eatPie { to {stroke-dasharray:100 0 0;} }
@keyframes eatPieBG { 50% {fill:#555;} to {fill:#a00;} }

Why do you want this feature in Authenticator? To be smooooooth 😎

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:6 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
Sneezrycommented, Jul 10, 2018

@alystair That’s okay. Then we will commit your code into the project. Thanks for your contribution!

0reactions
Sneezrycommented, Jul 11, 2018

Done

Read more comments on GitHub >

github_iconTop Results From Across the Web

CSS Pie Timer Re-Revisited - CSS-Tricks
Kitty reflected on an ancient blog post here on CSS-Tricks on how to make an animated pie timer. The old technique is still...
Read more >
CSS pie timer revisited - Kitty Giraudel
In my original approach, I needed a container and 3 child elements. In this version, I managed to sort it out with a...
Read more >
CSS Jquery Pie Countdown Timer - CodePen
Pie timer with CSS Jquery using linear-gradient....
Read more >
CSS-Pie-Chart-Timer/README.md at master - GitHub
Create a pie chart timer/countdown using CSS and Javascript. CSS Pie Chart Timer works fine on these browsers: IE 9; Opera; Firefox; Chrome....
Read more >
Free jQuery countdown Plugins - jQueryScript.Net
pietimer is a simple jQuery plugin that allows you to create a circular pie graph-like timer using CSS3 and jQuery. Good for countdown...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found