-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcounter.html
45 lines (37 loc) · 1.09 KB
/
counter.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
<style>
.rolling-number-animate {
transition: bottom var(--numberSrcollLength) linear, width var(--numberSrcollLength) linear;
position: relative;
}
.rolling-numbers-number {
transition: color calc(var(--numberSrcollLength) / 5) linear;
font-family: sans-serif;
font-size: 40px;
}
.column-container {
overflow: hidden;
width: fit-content;
}
.row-container {
height: fit-content;
width: fit-content;
display: flex;
flex-direction: row;
}
body {
height: 100%;
}
</style>
<body>
<div id="container" class="">
</div>
<input type="number" id="start">
<button id="button">scroll to this</button>
</body>
<script type="text/javascript" src="counter.js"></script>
<script>
var row = new RollingNumbers(document.getElementById("container"), 1234.56);
document.getElementById("button").addEventListener("click", () => {
row.changeNumber(document.getElementById("start").value, 1000);
})
</script>