-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathtrainingscan_math.html
56 lines (42 loc) · 1.51 KB
/
trainingscan_math.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
46
47
48
49
50
51
52
53
54
55
56
<!DOCTYPE html>
<html>
<style>
.container{
display: flex;
align-items: center;
justify-content: center;
height: 100%;
color:Green;
font-size:70vh;
}
body, html{
height:100%;
}
</style>
<body>
<div id="number" class="container" onclick=randomNumberAndColor()> 😎 </div>
<script>
var ticker;
var emojis = [127942, 128517, 128525, 128536, 128548, 128561, 128583, 128640, 127464, 127541, 9917, 9889, 9981, 127942, 128170, 128175]
var colors = ["yellow", "LightCoral", "LightBlue"]
function randomNumberAndColor() {
document.getElementById("number").innerHTML = "🏃";
if (ticker == null) {
ticker = setInterval(function() {
document.getElementById("number").innerHTML = Math.floor(Math.random() * 10) + " + " + Math.floor(Math.random() * 10);
var body = document.body;
var colorIdx = Math.floor(Math.random() * colors.length)
//body.style.backgroundColor = body.style.backgroundColor == "yellow" ? "red" : "yellow";
body.style.backgroundColor = colors[colorIdx];
}, 3000);
}
else {
clearInterval(ticker);
ticker = null
emoji = Math.floor(Math.random() * emojis.length);
document.getElementById("number").innerHTML = "&#" + emojis[emoji];
}
}
</script>
</body>
</html>