react-animated-counter
Version:
React Animated Counter Component
46 lines (37 loc) • 753 B
CSS
.ticker-view {
height: auto;
margin: auto;
display: flex;
flex-direction: row-reverse;
overflow: hidden;
position: relative;
}
.number-placeholder {
visibility: hidden;
}
.ticker-column-container {
position: relative;
}
.ticker-column {
position: absolute;
height: 1000%;
bottom: 0;
}
.ticker-digit {
width: auto;
height: 10%;
}
.ticker-column.increase {
animation: pulseIncrement 500ms cubic-bezier(0.4, 0, 0.6, 1) 1;
}
.ticker-column.decrease {
animation: pulseDecrement 500ms cubic-bezier(0.4, 0, 0.6, 1) 1;
}
@keyframes pulseIncrement {
0%, 100% { color: inherit; }
50% { color: var(--increment-color) }
}
@keyframes pulseDecrement {
0%, 100% { color: inherit; }
50% { color: var(--decrement-color) }
}