-
Notifications
You must be signed in to change notification settings - Fork 1
/
demo.html
48 lines (40 loc) · 959 Bytes
/
demo.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
<head>
<link rel="stylesheet" href="scrollbar.css">
<script src="scrollbar.js"></script>
<script>
function toggleDesign() {
["dark", "light"].forEach(s => document.body.classList.toggle(s));
}
</script>
<style>
body.dark {
background: #333;
}
body.light {
background: #d8d8d8;
}
.dark #content {
background: #aaa;
}
.light #content {
background: #efefef;
}
.dark button {
background: #555;
color: #eee;
}
#content {
height: 200vh;
width: 70vw;
margin: 1.6em auto;
padding: 5em;
}
</style>
</head>
<body class="light">
<div id="content">
sample content
<br>
<button onclick="toggleDesign()">Change design (dark/light)</button>
</div>
</body>