-
Notifications
You must be signed in to change notification settings - Fork 15
/
index.html
92 lines (81 loc) · 1.91 KB
/
index.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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
<!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>bisectercise</title>
<style>
* {
box-sizing: border-box;
}
html,
body {
height: 100vh;
overflow: hidden;
}
body {
display: flex;
flex-flow: column;
align-items: center;
justify-content: center;
font-size: 180px;
font-family: Arial, Helvetica, sans-serif;
color: #222;
margin: 0;
}
main {
display: flex;
flex: 1;
flex-flow: column;
align-items: center;
justify-content: center;
}
.actions {
display: flex;
margin-top: 10px;
}
button {
font-size: 20px;
border: none;
background: #336633;
color: #eaeaea;
border-radius: 4px;
width: 40px;
height: 40px;
}
button:first-child {
margin-right: 10px;
}
footer {
padding: 10px;
font-size: 13px;
background: #eaeaea;
width: 100%;
text-align: center;
}
</style>
</head>
<body>
<main>
<div id="number">0</div>
<div class="actions">
<button data-action="dc">-</button>
<button data-action="ic">+</button>
</div>
</main>
<footer>Version: 100</footer>
<script>
(() => {
const t = document.getElementById("number");
document.querySelectorAll("button").forEach(el =>
el.addEventListener("click", e => {
const val = parseInt(t.innerText, 10);
const action = e.target.getAttribute("data-action");
t.innerText = action === "inc" ? val + 1 : val - 1;
})
);
})();
</script>
</body>
</html>