-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathstyle.css
More file actions
363 lines (321 loc) · 5.97 KB
/
Copy pathstyle.css
File metadata and controls
363 lines (321 loc) · 5.97 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
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
body, html {
width: 100%;
height: 100%;
overflow: hidden;
font-family: sans-serif;
}
#game-container {
position: relative;
width: 100vw;
height: 100vh;
display: none;
}
#background {
position: absolute;
width: 100%;
height: 100%;
object-fit: cover;
z-index: -1;
}
#farmer {
position: absolute;
left: 20px;
bottom: 50px;
width: 150px;
}
#farmer img {
width: 100%;
}
.pest {
position: absolute;
bottom: 50px;
width: 60px;
display: flex;
flex-direction: column;
align-items: center;
}
.pest img {
width: 100%;
}
.word {
background: rgba(255,255,255,0.8);
padding: 2px 5px;
border-radius: 4px;
margin-top: 5px;
font-weight: bold;
}
#ui {
position: absolute;
top: 10px;
left: 10px;
color: white;
z-index: 2;
}
#hp-bar {
width: 200px;
height: 20px;
background: #ccc;
border: 2px solid #444;
margin-bottom: 10px;
}
#hp-fill {
display: block;
height: 100%;
background: green;
width: 100%;
}
#score {
font-size: 18px;
background: rgba(0,0,0,0.5);
padding: 5px;
border-radius: 4px;
}
.typed {
color: green;
}
.untyped {
color: black;
}
.popup-text {
position: fixed;
font-size: 18px;
font-weight: bold;
animation: popup-fade 1s ease-out forwards;
z-index: 1000;
pointer-events: none;
}
.popup-text.score {
color: yellow;
text-shadow: 0 0 5px black;
}
.popup-text.damage {
color: red;
text-shadow: 0 0 5px black;
}
@keyframes popup-fade {
0% {
opacity: 1;
transform: translateY(0);
}
100% {
opacity: 0;
transform: translateY(-30px);
}
}
.popup-text.score {
color: yellow;
text-shadow: 0 0 5px black;
}
.popup-text.damage {
color: red;
text-shadow: 0 0 5px black;
}
.menu-screen h1, .menu-screen h2 {
color: white;
margin-bottom: 20px;
}
.menu-screen button {
margin: 10px;
padding: 12px 24px;
font-size: 18px;
border-radius: 12px;
border: none;
cursor: pointer;
background-color: limegreen;
color: white;
transition: 0.2s;
}
.menu-screen button:hover {
background-color: darkgreen;
}
@import url('https://fonts.googleapis.com/css2?family=Chewy&display=swap');
.menu-screen {
position: fixed;
top: 0;
left: 0;
width: 100vw;
height: 100vh;
background: linear-gradient(to top, #e0f8d8, #f5ffe8), url('assets/bg-menu.gif') center/cover no-repeat;
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
font-family: 'Chewy', cursive;
z-index: 999;
animation: fadeIn 0.6s ease-out;
background-blend-mode: overlay;
}
.menu-screen h1, .menu-screen h2 {
color: #4e7523;
font-size: 48px;
margin-bottom: 20px;
text-shadow: 1px 1px 4px #fff;
}
.menu-screen p {
color: #6d4c41;
font-size: 18px;
margin: 20px;
text-align: center;
}
.menu-screen button {
margin: 12px;
padding: 12px 30px;
font-size: 22px;
border-radius: 32px;
border: 2px solid #4e7523;
cursor: pointer;
background: #a5d6a7;
color: #2e7d32;
font-weight: bold;
transition: transform 0.2s, background 0.2s;
box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}
.menu-screen button:hover {
background: #81c784;
transform: scale(1.05);
}
@keyframes fadeIn {
from { opacity: 0; transform: translateY(30px); }
to { opacity: 1; transform: translateY(0); }
}
.stage-banner {
position: fixed;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
font-size: 60px;
color: yellow;
text-shadow: 2px 2px 8px black;
z-index: 9999;
animation: fadeinout 4s ease;
}
@keyframes fadeinout {
0% { opacity: 0; transform: translate(-50%, -60%); }
20% { opacity: 1; transform: translate(-50%, -50%); }
80% { opacity: 1; }
100% { opacity: 0; transform: translate(-50%, -40%); }
}
#stage-transition-overlay {
position: fixed;
top: 0;
left: 0;
width: 100vw;
height: 100vh;
background: black;
opacity: 0;
pointer-events: none;
z-index: 9998;
transition: opacity 1s ease;
}
.boss img {
width: 120px;
filter: hue-rotate(180deg); /* supaya beda warna dari hama biasa */
}
.boss .word {
font-size: 24px;
background: rgba(255, 0, 0, 0.8);
color: white;
}
.boss {
animation: floatBoss 2s ease-in-out infinite;
position: relative;
width: 500px !important;
/* sesuaikan ukuran */
}
@keyframes floatBoss {
0%, 100% { transform: translateY(0); }
50% { transform: translateY(-10px); }
}
.boss-hp-bar {
width: 120px;
height: 10px;
background-color: #444;
border: 1px solid #222;
margin-top: 5px;
border-radius: 5px;
overflow: hidden;
}
.boss-hp-fill {
height: 100%;
background-color: red;
width: 100%;
transition: width 0.3s ease;
}
#boss-hp-container {
font-family: 'Arial Black', Arial, sans-serif;
user-select: none;
}
#boss-hp-bar {
box-shadow: 0 0 10px red;
}
.boss img {
width: 120px;
}
.pest.die {
animation: pestDie 0.4s forwards;
}
@keyframes pestDie {
0% {
transform: scale(1);
opacity: 1;
}
100% {
transform: scale(0.5) rotate(90deg);
opacity: 0;
}
}
.boss-hit {
animation: bossBlink 0.3s;
}
@keyframes bossBlink {
0% { filter: brightness(1) hue-rotate(0deg); }
50% { filter: brightness(1.5) hue-rotate(-20deg); }
100% { filter: brightness(1) hue-rotate(0deg); }
}
.pest.dead {
animation: fadeOut 0.3s forwards;
}
@keyframes fadeOut {
to {
opacity: 0;
transform: scale(0.5);
}
}
.pest.hit {
animation: blinkRed 0.1s;
}
@keyframes blinkRed {
0% { filter: brightness(1) hue-rotate(0deg); }
50% { filter: brightness(1.2) hue-rotate(-30deg); }
100% { filter: none; }
}
#end-screen {
position: fixed;
top: 0;
left: 0;
width: 100vw;
height: 100vh;
background-color: rgba(0, 0, 0, 0.8); /* semi transparan */
color: white;
font-family: 'Press Start 2P', cursive; /* sesuaikan dengan font utama */
z-index: 999;
}
#end-screen h1 {
font-size: 32px;
margin-bottom: 20px;
}
#end-screen .score-text {
font-size: 20px;
margin-bottom: 20px;
}
#end-screen button {
font-size: 16px;
padding: 10px 20px;
font-family: 'Press Start 2P', cursive;
cursor: pointer;
}