-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
executable file
·236 lines (211 loc) · 6.22 KB
/
index.html
File metadata and controls
executable file
·236 lines (211 loc) · 6.22 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
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
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Kelompok 1 - Games</title>
<link rel="stylesheet" href="assets/css/style.css" />
<link
rel="stylesheet"
href="assets/css/minecraft-css-framework-v-1.0.0.css"
/>
<style>
html {
scrollbar-width: none;
}
/* Hide scrollbar for Chrome, Safari and Opera */
::-webkit-scrollbar {
display: none;
}
.element::-webkit-scrollbar {
width: 0 !important;
}
@keyframes move-cloud-left {
from {
transform: translate(100%, -100%);
/* Mulai di luar layar sebelah kanan */
}
to {
transform: translate(-100%, 100%);
/* Berakhir di luar layar sebelah kiri */
}
}
@keyframes earth-move-right {
from {
transform: translateX(100%);
}
to {
transform: translateX(-100%);
}
}
@keyframes object-move-up {
from {
transform: translateY(100%);
/* Mulai di luar layar sebelah kanan */
}
to {
transform: translateY(-100%);
/* Berakhir di luar layar sebelah kiri */
}
}
.cloud-left {
position: absolute;
top: 0%;
left: 0;
width: 100%;
/* 50% dari lebar layar */
/* max-width: 2000px; */
/* Maksimal lebar */
height: auto;
/* opacity: 0.8; */
z-index: 100;
animation: move-cloud-left 25s linear infinite;
/* Durasi 20 detik, berulang */
}
.austronot {
position: absolute;
top: 0%;
left: 0;
width: 100%;
/* 50% dari lebar layar */
/* max-width: 2000px; */
/* Maksimal lebar */
height: auto;
/* opacity: 0.8; */
z-index: 115;
animation: object-move-up 45s linear infinite;
}
.earth {
position: absolute;
top: 0%;
left: 0;
width: 100%;
/* 50% dari lebar layar */
/* max-width: 2000px; */
/* Maksimal lebar */
height: auto;
/* opacity: 0.8; */
z-index: 110;
animation: earth-move-right 85s linear infinite;
}
body.modal-open-prevent-interaction {
pointer-events: none;
/* Prevents interaction with elements below */
}
.modal {
pointer-events: auto;
}
.tooltip {
position: relative;
display: inline-block;
border-bottom: 1px dotted black;
}
.tooltip .tooltiptext {
visibility: hidden;
width: 120px;
background-color: #555;
color: #fff;
text-align: center;
border-radius: 6px;
padding: 5px 0;
position: absolute;
z-index: 1;
bottom: 125%;
left: 50%;
margin-left: -60px;
opacity: 0;
transition: opacity 0.3s;
}
.tooltip .tooltiptext::after {
content: "";
position: absolute;
top: 100%;
left: 50%;
margin-left: -5px;
border-width: 5px;
border-style: solid;
border-color: #555 transparent transparent transparent;
}
.tooltip:hover .tooltiptext {
visibility: visible;
opacity: 1;
}
</style>
</head>
<body class="modal-open-prevent-interaction">
<img src="./assets/meteor2.png" alt="Cloud Left" class="cloud-left" />
<img
src="./assets/ufo.png"
alt="Cloud Left"
width="50px"
class="austronot"
/>
<img src="./assets/naga.png" alt="Cloud Left" width="50px" class="earth" />
<div class="background-container">
<div class="title">
<img src="assets/welcome-text.png" alt="" />
<h1 id="player" class="tooltip">
Player! <span class="tooltiptext">Click to change</span>
</h1>
</div>
<div class="games">
<a href="spacegame/index.html">
<img src="assets/example-1.png" alt="" />
</a>
<a href="flappy-bird/index.html">
<img src="assets/example-2.png" alt="" />
</a>
</div>
<div class="games">
<a href="snake-game/index.html">
<img src="assets/example-4.png" alt="" />
</a>
<a href="TicTacToe/index.html">
<img src="assets/example-3.png" alt="" />
</a>
</div>
<!-- <img src="./assets/cloud.png" alt=""> -->
<img src="assets/cloud1.png" alt="Cloud" class="cloud" />
</div>
<!-- Modal -->
<div id="example-modal" class="modal">
<div class="modal-header">Your Nickname</div>
<div class="modal-body">
<div class="form-group">
<label for="form-label">Your Name</label>
<input type="text" name="" class="form-input" id="nick" />
</div>
</div>
<div class="modal-footer">
<button
class="button button-primary"
onclick="setUsername(document.getElementById('nick').value); document.getElementById('example-modal').classList.remove('modal-open'); document.body.classList.remove('modal-open-prevent-interaction');"
>
Confirm
</button>
</div>
</div>
<script>
window.onload = function () {
if (localStorage.getItem("username") == null) {
document.getElementById("example-modal").classList.add("modal-open");
document.body.classList.add("modal-open-prevent-interaction");
} else {
document.body.classList.remove("modal-open-prevent-interaction");
document.getElementById("player").textContent = getUsername();
}
};
document.getElementById("player").addEventListener("click", (e) => {
document.getElementById("example-modal").classList.add("modal-open");
document.body.classList.add("modal-open-prevent-interaction");
});
function setUsername(username) {
localStorage.setItem("username", username);
document.getElementById("player").textContent = getUsername();
}
function getUsername() {
return localStorage.getItem("username") + "!" || "Player!";
}
</script>
</body>
</html>