I've looked online and only found a version for swift. Online, the only keyword that returns a search result is ScrollCounter. Is this type of animation even possible is CSS HTML?
If anyone can point me to a resource that works, or an example, I will post back my research after creating a working example.
Take a look
And Obfuscated CSS and HTML...
Update 1
I've found the following counter animation but still trying to figure it out how to implement it as a currency counter including optional comma for numbers greater than 999.99.
Although... In real life, I would be updating this value through WebSockets.
const genNumber = () => {
document.querySelector("div").style.setProperty("--percent", Math.random());
};
setInterval(genNumber, 3000);
setTimeout(genNumber);
@property --percent {
syntax: "<number>";
initial-value: 0;
inherits: false;
}
@property --temp {
syntax: "<number>";
initial-value: 0;
inherits: false;
}
@property --v1 {
syntax: "<integer>";
initial-value: 0;
inherits: false;
}
@property --v2 {
syntax: "<integer>";
initial-value: 0;
inherits: false;
}
div {
font: 800 40px monospace;
padding: 2rem;
transition: --percent 1s;
--temp: calc(var(--percent) * 100);
--v1: max(var(--temp) - 0.5, 0);
--v2: max((var(--temp) - var(--v1)) * 100 - 0.5, 0);
counter-reset: v1 var(--v1) v2 var(--v2);
}
div::before {
content: counter(v1) "." counter(v2, decimal-leading-zero) "%";
}
<div></div>


