Altaire commited on
Commit
f72df2f
Β·
verified Β·
1 Parent(s): 768125a

Add 2 files

Browse files
Files changed (2) hide show
  1. README.md +7 -5
  2. index.html +424 -19
README.md CHANGED
@@ -1,10 +1,12 @@
1
  ---
2
- title: Marcia
3
- emoji: 🏒
4
- colorFrom: yellow
5
- colorTo: purple
6
  sdk: static
7
  pinned: false
 
 
8
  ---
9
 
10
- Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
 
1
  ---
2
+ title: marcia
3
+ emoji: 🐳
4
+ colorFrom: blue
5
+ colorTo: blue
6
  sdk: static
7
  pinned: false
8
+ tags:
9
+ - deepsite
10
  ---
11
 
12
+ Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
index.html CHANGED
@@ -1,19 +1,424 @@
1
- <!doctype html>
2
- <html>
3
- <head>
4
- <meta charset="utf-8" />
5
- <meta name="viewport" content="width=device-width" />
6
- <title>My static Space</title>
7
- <link rel="stylesheet" href="style.css" />
8
- </head>
9
- <body>
10
- <div class="card">
11
- <h1>Welcome to your static Space!</h1>
12
- <p>You can modify this app directly by editing <i>index.html</i> in the Files and versions tab.</p>
13
- <p>
14
- Also don't forget to check the
15
- <a href="https://huggingface.co/docs/hub/spaces" target="_blank">Spaces documentation</a>.
16
- </p>
17
- </div>
18
- </body>
19
- </html>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <!DOCTYPE html>
2
+ <html lang="en">
3
+ <head>
4
+ <meta charset="UTF-8">
5
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
6
+ <title>Marcia's Shopping Adventure</title>
7
+ <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
8
+ <style>
9
+ @import url('https://fonts.googleapis.com/css2?family=Press+Start+2P&family=VT323&display=swap');
10
+
11
+ * {
12
+ margin: 0;
13
+ padding: 0;
14
+ box-sizing: border-box;
15
+ image-rendering: pixelated;
16
+ }
17
+
18
+ body {
19
+ background-color: #2b2b4b;
20
+ color: #f0f0f0;
21
+ font-family: 'VT323', monospace;
22
+ overflow: hidden;
23
+ height: 100vh;
24
+ display: flex;
25
+ justify-content: center;
26
+ align-items: center;
27
+ }
28
+
29
+ #game-container {
30
+ position: relative;
31
+ width: 800px;
32
+ height: 600px;
33
+ border: 8px solid #7c45a3;
34
+ border-radius: 5px;
35
+ background-color: #151522;
36
+ box-shadow: 0 0 30px rgba(124, 69, 163, 0.7);
37
+ overflow: hidden;
38
+ }
39
+
40
+ #game-canvas {
41
+ width: 100%;
42
+ height: 100%;
43
+ }
44
+
45
+ #start-screen, #game-over-screen {
46
+ position: absolute;
47
+ top: 0;
48
+ left: 0;
49
+ width: 100%;
50
+ height: 100%;
51
+ display: flex;
52
+ flex-direction: column;
53
+ justify-content: center;
54
+ align-items: center;
55
+ background-color: rgba(21, 21, 34, 0.9);
56
+ z-index: 10;
57
+ }
58
+
59
+ #game-over-screen {
60
+ display: none;
61
+ }
62
+
63
+ h1 {
64
+ font-family: 'Press Start 2P', cursive;
65
+ font-size: 3rem;
66
+ color: #ff7cbc;
67
+ text-shadow: 5px 5px 0 #7c45a3;
68
+ margin-bottom: 2rem;
69
+ text-align: center;
70
+ }
71
+
72
+ h2 {
73
+ font-family: 'Press Start 2P', cursive;
74
+ font-size: 1.5rem;
75
+ color: #8dffcd;
76
+ margin-bottom: 1.5rem;
77
+ text-align: center;
78
+ }
79
+
80
+ p {
81
+ font-size: 1.8rem;
82
+ margin-bottom: 2rem;
83
+ text-align: center;
84
+ max-width: 80%;
85
+ line-height: 1.4;
86
+ }
87
+
88
+ button {
89
+ background-color: #7c45a3;
90
+ color: white;
91
+ border: none;
92
+ padding: 15px 30px;
93
+ font-family: 'VT323', monospace;
94
+ font-size: 1.8rem;
95
+ cursor: pointer;
96
+ border-radius: 5px;
97
+ transition: all 0.3s;
98
+ box-shadow: 0 5px 0 #512d6d;
99
+ margin-top: 1rem;
100
+ }
101
+
102
+ button:hover {
103
+ background-color: #9b5dc6;
104
+ transform: translateY(-3px);
105
+ box-shadow: 0 8px 0 #512d6d;
106
+ }
107
+
108
+ button:active {
109
+ transform: translateY(2px);
110
+ box-shadow: 0 3px 0 #512d6d;
111
+ }
112
+
113
+ #hud {
114
+ position: absolute;
115
+ top: 10px;
116
+ left: 10px;
117
+ display: flex;
118
+ flex-direction: column;
119
+ gap: 10px;
120
+ z-index: 5;
121
+ }
122
+
123
+ .hud-item {
124
+ background-color: rgba(21, 21, 34, 0.8);
125
+ border: 3px solid #7c45a3;
126
+ border-radius: 5px;
127
+ padding: 10px;
128
+ font-size: 1.5rem;
129
+ display: flex;
130
+ align-items: center;
131
+ gap: 10px;
132
+ }
133
+
134
+ #items-collected {
135
+ position: absolute;
136
+ top: 10px;
137
+ right: 10px;
138
+ background-color: rgba(21, 21, 34, 0.8);
139
+ border: 3px solid #7c45a3;
140
+ border-radius: 5px;
141
+ padding: 10px;
142
+ font-size: 1.5rem;
143
+ display: flex;
144
+ flex-direction: column;
145
+ gap: 10px;
146
+ z-index: 5;
147
+ }
148
+
149
+ .item-slot {
150
+ width: 40px;
151
+ height: 40px;
152
+ background-color: #2b2b4b;
153
+ border: 2px solid #7c45a3;
154
+ display: flex;
155
+ justify-content: center;
156
+ align-items: center;
157
+ font-size: 1.2rem;
158
+ }
159
+
160
+ .item-slot.filled {
161
+ background-color: #ff7cbc;
162
+ color: #151522;
163
+ }
164
+
165
+ #shopping-list {
166
+ position: absolute;
167
+ bottom: 10px;
168
+ left: 10px;
169
+ background-color: rgba(21, 21, 34, 0.8);
170
+ border: 3px solid #7c45a3;
171
+ border-radius: 5px;
172
+ padding: 10px;
173
+ font-size: 1.5rem;
174
+ display: flex;
175
+ flex-direction: column;
176
+ gap: 5px;
177
+ z-index: 5;
178
+ max-width: 300px;
179
+ }
180
+
181
+ .list-item {
182
+ display: flex;
183
+ align-items: center;
184
+ gap: 10px;
185
+ }
186
+
187
+ .list-item.completed {
188
+ color: #8dffcd;
189
+ text-decoration: line-through;
190
+ }
191
+
192
+ #timer-bar {
193
+ position: absolute;
194
+ top: 0;
195
+ left: 0;
196
+ width: 100%;
197
+ height: 10px;
198
+ background-color: #2b2b4b;
199
+ z-index: 5;
200
+ }
201
+
202
+ #timer-progress {
203
+ height: 100%;
204
+ width: 100%;
205
+ background-color: #ff7cbc;
206
+ transition: width 0.1s linear;
207
+ }
208
+
209
+ #store {
210
+ position: absolute;
211
+ bottom: 0;
212
+ right: 0;
213
+ width: 300px;
214
+ height: 150px;
215
+ background-color: rgba(124, 69, 163, 0.7);
216
+ border-top-left-radius: 10px;
217
+ display: flex;
218
+ flex-direction: column;
219
+ padding: 10px;
220
+ z-index: 5;
221
+ }
222
+
223
+ .shelf {
224
+ display: flex;
225
+ gap: 10px;
226
+ margin-bottom: 10px;
227
+ }
228
+
229
+ .store-item {
230
+ width: 50px;
231
+ height: 50px;
232
+ background-color: #2b2b4b;
233
+ border: 2px solid #ff7cbc;
234
+ display: flex;
235
+ justify-content: center;
236
+ align-items: center;
237
+ font-size: 1.5rem;
238
+ cursor: pointer;
239
+ transition: transform 0.2s;
240
+ }
241
+
242
+ .store-item:hover {
243
+ transform: scale(1.1);
244
+ background-color: #ff7cbc;
245
+ color: #151522;
246
+ }
247
+
248
+ #character {
249
+ position: absolute;
250
+ width: 60px;
251
+ height: 80px;
252
+ background-color: #ff7cbc;
253
+ border-radius: 50% 50% 0 0;
254
+ z-index: 2;
255
+ transition: transform 0.2s;
256
+ }
257
+
258
+ #character::before {
259
+ content: '';
260
+ position: absolute;
261
+ top: 15px;
262
+ left: 20px;
263
+ width: 20px;
264
+ height: 20px;
265
+ background-color: #151522;
266
+ border-radius: 50%;
267
+ box-shadow: 25px 0 #151522;
268
+ }
269
+
270
+ #character::after {
271
+ content: '';
272
+ position: absolute;
273
+ bottom: 10px;
274
+ left: 15px;
275
+ width: 30px;
276
+ height: 40px;
277
+ background-color: #9b5dc6;
278
+ border-radius: 10px;
279
+ }
280
+
281
+ .collectible {
282
+ position: absolute;
283
+ width: 30px;
284
+ height: 30px;
285
+ background-color: #8dffcd;
286
+ border-radius: 50%;
287
+ display: flex;
288
+ justify-content: center;
289
+ align-items: center;
290
+ font-size: 1.2rem;
291
+ z-index: 1;
292
+ }
293
+
294
+ .obstacle {
295
+ position: absolute;
296
+ background-color: #512d6d;
297
+ z-index: 1;
298
+ }
299
+
300
+ #confetti {
301
+ position: absolute;
302
+ width: 100%;
303
+ height: 100%;
304
+ pointer-events: none;
305
+ z-index: 20;
306
+ }
307
+
308
+ .confetti-piece {
309
+ position: absolute;
310
+ width: 10px;
311
+ height: 10px;
312
+ background-color: #ff7cbc;
313
+ opacity: 0;
314
+ }
315
+
316
+ #pause-btn {
317
+ position: absolute;
318
+ top: 10px;
319
+ right: 10px;
320
+ background: none;
321
+ border: none;
322
+ color: white;
323
+ font-size: 2rem;
324
+ cursor: pointer;
325
+ z-index: 5;
326
+ }
327
+
328
+ @keyframes marcia-walk {
329
+ 0% { transform: rotate(-5deg); }
330
+ 50% { transform: rotate(5deg); }
331
+ 100% { transform: rotate(-5deg); }
332
+ }
333
+
334
+ @keyframes item-bounce {
335
+ 0% { transform: translateY(0); }
336
+ 50% { transform: translateY(-10px); }
337
+ 100% { transform: translateY(0); }
338
+ }
339
+
340
+ .walking {
341
+ animation: marcia-walk 0.5s infinite;
342
+ }
343
+ </style>
344
+ </head>
345
+ <body>
346
+ <div id="game-container">
347
+ <div id="timer-bar"><div id="timer-progress"></div></div>
348
+
349
+ <button id="pause-btn"><i class="fas fa-pause"></i></button>
350
+
351
+ <div id="hud">
352
+ <div class="hud-item">
353
+ <i class="fas fa-heart" style="color: #ff7cbc;"></i>
354
+ <span id="health">3</span>
355
+ </div>
356
+ <div class="hud-item">
357
+ <i class="fas fa-coins" style="color: #ffd700;"></i>
358
+ <span id="money">100</span>
359
+ </div>
360
+ </div>
361
+
362
+ <div id="items-collected">
363
+ <div class="item-slot" id="slot1"></div>
364
+ <div class="item-slot" id="slot2"></div>
365
+ <div class="item-slot" id="slot3"></div>
366
+ <div class="item-slot" id="slot4"></div>
367
+ </div>
368
+
369
+ <div id="shopping-list">
370
+ <h3>Shopping List:</h3>
371
+ <div class="list-item" id="item1"><i class="fas fa-square"></i> <span>Bread</span></div>
372
+ <div class="list-item" id="item2"><i class="fas fa-square"></i> <span>Milk</span></div>
373
+ <div class="list-item" id="item3"><i class="fas fa-square"></i> <span>Eggs</span></div>
374
+ <div class="list-item" id="item4"><i class="fas fa-square"></i> <span>Fruits</span></div>
375
+ </div>
376
+
377
+ <div id="store">
378
+ <h3>Marcia's Shop</h3>
379
+ <div class="shelf">
380
+ <div class="store-item" data-item="🍞" data-price="10">🍞</div>
381
+ <div class="store-item" data-item="πŸ₯›" data-price="15">πŸ₯›</div>
382
+ <div class="store-item" data-item="πŸ₯š" data-price="20">πŸ₯š</div>
383
+ <div class="store-item" data-item="🍎" data-price="25">🍎</div>
384
+ </div>
385
+ <div class="shelf">
386
+ <div class="store-item" data-item="πŸͺ" data-price="30">πŸͺ</div>
387
+ <div class="store-item" data-item="🍫" data-price="35">🍫</div>
388
+ <div class="store-item" data-item="🍡" data-price="40">🍡</div>
389
+ <div class="store-item" data-item="πŸ›’" data-price="50">πŸ›’</div>
390
+ </div>
391
+ </div>
392
+
393
+ <div id="character"></div>
394
+
395
+ <div id="confetti"></div>
396
+
397
+ <div id="start-screen">
398
+ <h1>Marcia's Shopping Adventure</h1>
399
+ <p>Help Marcia collect all the items on her shopping list before time runs out!</p>
400
+ <p>Avoid obstacles and spend your money wisely at the store.</p>
401
+ <button id="start-btn">START GAME</button>
402
+ <div style="margin-top: 2rem; font-size: 1.2rem;">
403
+ <p>Use <i class="fas fa-arrow-up"></i> <i class="fas fa-arrow-down"></i>
404
+ <i class="fas fa-arrow-left"></i> <i class="fas fa-arrow-right"></i> to move</p>
405
+ <p>Press <i class="fas fa-space-shuttle"></i> to buy items at the store</p>
406
+ </div>
407
+ </div>
408
+
409
+ <div id="game-over-screen">
410
+ <h1>GAME OVER</h1>
411
+ <h2 id="result-message"></h2>
412
+ <p id="score-display"></p>
413
+ <button id="restart-btn">PLAY AGAIN</button>
414
+ </div>
415
+ </div>
416
+
417
+ <script>
418
+ // Game elements
419
+ const gameContainer = document.getElementById('game-container');
420
+ const character = document.getElementById('character');
421
+ const startScreen = document.getElementById('start-screen');
422
+ const gameOverScreen = document.getElementById('game-over-screen');
423
+ const startBtn
424
+ </html>