fix minor ui/ux

This commit is contained in:
Thomas Camlong
2025-04-22 10:26:13 +02:00
parent 6f51ba60ab
commit ab684250cf
3 changed files with 9 additions and 12 deletions

View File

@@ -26,7 +26,7 @@ export function NumberTicker({
const motionValue = useMotionValue(direction === "down" ? value : startValue);
const springValue = useSpring(motionValue, {
damping: 30,
stiffness: 100,
stiffness: 200,
});
const isInView = useInView(ref, { once: true, margin: "0px" });
@@ -43,10 +43,7 @@ export function NumberTicker({
() =>
springValue.on("change", (latest) => {
if (ref.current) {
ref.current.textContent = Intl.NumberFormat("en-US", {
minimumFractionDigits: decimalPlaces,
maximumFractionDigits: decimalPlaces,
}).format(Number(latest.toFixed(decimalPlaces)));
ref.current.textContent = Number(latest.toFixed(decimalPlaces)).toString();
}
}),
[springValue, decimalPlaces],