Animated Counter: Adjust speed
This commit is contained in:
parent
cf01bea655
commit
f668805611
@ -1,7 +1,7 @@
|
|||||||
$perspective: 10px;
|
$perspective: 10px;
|
||||||
$translate: 10px;
|
$translate: 10px;
|
||||||
$rotate: 30deg;
|
$rotate: 30deg;
|
||||||
$animation-time: 0.15s;
|
$animation-time: 200ms;
|
||||||
|
|
||||||
.root {
|
.root {
|
||||||
display: inline-flex;
|
display: inline-flex;
|
||||||
|
|||||||
@ -14,7 +14,7 @@ type OwnProps = {
|
|||||||
text: string;
|
text: string;
|
||||||
};
|
};
|
||||||
|
|
||||||
const ANIMATION_TIME = 150;
|
const ANIMATION_TIME = 200;
|
||||||
|
|
||||||
const AnimatedCounter: FC<OwnProps> = ({
|
const AnimatedCounter: FC<OwnProps> = ({
|
||||||
text,
|
text,
|
||||||
@ -54,7 +54,7 @@ const AnimatedCounter: FC<OwnProps> = ({
|
|||||||
useTimeout(() => {
|
useTimeout(() => {
|
||||||
isAnimatingRef.current = false;
|
isAnimatingRef.current = false;
|
||||||
forceUpdate();
|
forceUpdate();
|
||||||
}, shouldAnimate && isAnimatingRef.current ? ANIMATION_TIME : undefined);
|
}, isAnimatingRef.current ? ANIMATION_TIME : undefined);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<span className={styles.root} dir={lang.isRtl ? 'rtl' : undefined}>
|
<span className={styles.root} dir={lang.isRtl ? 'rtl' : undefined}>
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user