-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathindex.html
More file actions
41 lines (41 loc) · 1.04 KB
/
index.html
File metadata and controls
41 lines (41 loc) · 1.04 KB
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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Canvas Odometer</title>
</head>
<body>
<h1>Canvas Odometer</h1>
<script src="odometer.old.js"></script>
<script>
const odo = new FloatOdometer(4.0, {
textColour: "#003c65",
borderColour: "#a19589"
});
odo.appendTo(document.body);
var cpt = 0;
function setRandomValue() {
var v = (cpt++ + Math.random()).toFixed(5);
console.log(v);
odo.set(v);
}
setRandomValue();
setInterval(setRandomValue, 4000);
//odo.set(Math.round(Math.random()*1000000)/1000);
//odo.set(Math.round(Math.random()*1000000));
</script>
<style>
h1 {
font-family: sans-serif;
color: #003c65;
text-align: center;
font-size: 3.63em;
}
.canvas-float-odometer {
justify-content: center;
}
</style>
</body>
</html>