Tagged: animated numbers
Hello,
Currently the limit fo animation duration for animated numbers is 600, is it possible to increase this limit ?
I would like to have an animated number which increase very slowly.
Regards,
Hey neobiz2,
Thank you for your question, but unfortunately, it’s not possible to control the speed of the requestAnimationFrame function which is responsible for the animation without creating a custom script.
You could try a plugin, or based on this article: Animating Number Counters you could try adding this code to a code block element:
<style>
@property --num {
syntax: "<integer>";
initial-value: 0;
inherits: false;
}
div.slow-numbers {
animation: counter 20s alternate ease-in-out;
animation-fill-mode: forwards;
counter-reset: num var(--num);
font: 800 40px system-ui;
padding: 2rem;
}
div.slow-numbers::after {
content: counter(num);
}
@keyframes counter {
from {
--num: 0;
}
to {
--num: 100;
}
}
</style>
<div class="slow-numbers"></div>
Best regards,
Mike