Percentage Animation

Developer
Size
2,648 Kb
Views
36,432

How do I make an percentage animation?

This pen provides a quick, CSS-only animation to show percentages.. What is a percentage animation? How do you make a percentage animation? This script and codes were developed by Tcmulder on 05 August 2022, Friday.

Percentage Animation Previews

Percentage Animation - Script Codes HTML Codes

<!DOCTYPE html>
<html >
<head> <meta charset="UTF-8"> <title>Percentage Animation</title> <script src="http://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> <div class="pie"> <div class="slice-right"></div> <div class="slice-left"></div> <div class="percent"> <div class="number">75%</div> </div>
</div> <script src='http://cdnjs.cloudflare.com/ajax/libs/jquery/2.1.3/jquery.min.js'></script>
</body>
</html>

Percentage Animation - Script Codes CSS Codes

body { background-color: #1d2225; text-align: center; padding-top: 5em;
}
.pie { display: inline-block; position: relative; width: 1em; height: 1em; background-color: #2f3e46; font-size: 7em; text-align: center; -moz-border-radius: 50%; -webkit-border-radius: 50%; border-radius: 50%;
}
.slice-right { position: absolute; z-index: 11; background-color: #ff913b; width: 100%; height: 100%; clip: rect(0, 0.5em, 0.5em, 0.5em); -moz-border-radius: 50%; -webkit-border-radius: 50%; border-radius: 50%;
}
.slice-left { position: absolute; z-index: 11; background-color: #ff913b; width: 100%; height: 100%; clip: rect(0.5em, 0.5em, 1em, 0.5em); -moz-border-radius: 50%; -webkit-border-radius: 50%; border-radius: 50%;
}
.percent { position: absolute; z-index: 20; top: 3px; right: 3px; bottom: 3px; left: 3px; background: #1d2225; -moz-border-radius: 50%; -webkit-border-radius: 50%; border-radius: 50%;
}
.number { position: absolute; z-index: 30; width: 100%; height: 100%; padding-top: 50%; line-height: 0; font-size: .3em; color: #485c65;
}
.slice-right { -webkit-animation-delay: 1.2s; -webkit-animation-duration: 0.3s; -webkit-animation-name: right-slice; -webkit-animation-iteration-count: 1; -webkit-animation-fill-mode: forwards;
}
.slice-left { -webkit-animation-delay: 1.5s; -webkit-animation-duration: 0.3s; -webkit-animation-name: left-slice; -webkit-animation-iteration-count: 1; -webkit-animation-timing-function: ease-out; -webkit-animation-fill-mode: forwards;
}
@-webkit-keyframes right-slice { from { clip: rect(0, 50%, 0.5em, 0.5em); } 50% { clip: rect(0, 1em, 0.5em, 0.5em); } to { clip: rect(0, 1em, 1em, 0.5em); }
}
@-webkit-keyframes left-slice { from { clip: rect(0.5em, 0.5em, 1em, 0.5em); } 50% { clip: rect(0.5em, 0.5em, 1em, 0); } to { clip: rect(0.3em, 0.5em, 1em, 0); }
}
Percentage Animation - Script Codes
Percentage Animation - Script Codes
Home Page Home
Developer Tcmulder
Username tcmulder
Uploaded August 05, 2022
Rating 4
Size 2,648 Kb
Views 36,432
Do you need developer help for Percentage 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!

Tcmulder (tcmulder) Script Codes
Create amazing captions 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!