-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
75 lines (59 loc) · 1.36 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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Bye Bye Nya!</title>
</head>
<body>
<div class="container">
<img id="byebye-nya" src="./assets/byebye-nya.gif" data-show="false" />
<img id="good-nya" src="./assets/good-nya.gif" data-show="false" />
<p id="githublink"> <a href="https://github.com/ryoppippi/bye-bye-nya">Source Code</a> </p>
</div>
<script type="module">
const $ = document.querySelector.bind(document);
const byeByeNya = $("#byebye-nya");
const goodNya = $("#good-nya");
function isWindows() {
return window.navigator.userAgent.includes("Windows");
}
if (isWindows()) {
byeByeNya.dataset.show = "true";
} else {
goodNya.dataset.show = "true";
}
</script>
</body>
<style>
:root {
--light-bg: #fff;
--dark-bg: #000;
}
.container {
display: grid;
place-content: center;
place-items: center;
}
img[data-show="true"] {
display: block;
}
img[data-show="false"] {
display: none;
}
body {
background-color: var(--light-bg);
}
#githublink>a {
color: var(--light-bg);
}
@media (prefers-color-scheme: dark) {
body {
background-color: var(--dark-bg);
}
#githublink>a {
color: var(--dark-bg);
}
}
</style>
</html>