-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
709 lines (625 loc) · 18 KB
/
index.html
File metadata and controls
709 lines (625 loc) · 18 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
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="description" content="A dungeon pixel art game starter project">
<meta name="author" content="vomitorius">
<title>Endless Dungeon</title>
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-QWTKZyjpPEjISv5WaRU9OFeRpok6YctnYmDr5pNlyT2bRjXh0JMhjY6hW+ALEwIH" crossorigin="anonymous">
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Cinzel:wght@400;600;700&family=MedievalSharp&display=swap" rel="stylesheet">
<link rel="shortcut icon" href="/img/favicon.ico" type="image/x-icon">
<style>
:root {
--dungeon-bg: #09070f;
--dungeon-highlight: #6f4122;
--dungeon-accent: #cfa767;
--dungeon-shadow: rgba(0, 0, 0, 0.85);
--parchment-top: #4b2d1a;
--parchment-bottom: #2b1a10;
--text-body: #f4e9c7;
--text-muted: #c0a47c;
}
body {
padding-top: 56px; /* Account for fixed navbar */
background: radial-gradient(circle at 20% 20%, rgba(65, 38, 17, 0.45), transparent 55%),
radial-gradient(circle at 80% 25%, rgba(92, 53, 24, 0.35), transparent 60%),
linear-gradient(145deg, #060608 0%, #110c18 40%, #050307 100%);
color: var(--text-body);
font-family: 'Cinzel', serif;
letter-spacing: 0.02em;
user-select: none; /* Prevent text selection on mobile */
-webkit-user-select: none;
touch-action: manipulation;
overflow-x: hidden;
position: relative;
min-height: 100vh;
}
body::before,
body::after {
content: "";
position: fixed;
top: 120px;
width: 360px;
height: 360px;
background: radial-gradient(circle, rgba(255, 180, 92, 0.25) 0%, rgba(255, 160, 54, 0.08) 35%, transparent 70%);
filter: blur(1px);
opacity: 0.9;
pointer-events: none;
z-index: 0;
animation: torch-flicker 4s ease-in-out infinite;
}
body::before {
left: -120px;
}
body::after {
right: -120px;
animation-delay: 1.6s;
}
@keyframes torch-flicker {
0%,
100% {
transform: scale(1) translateY(0);
opacity: 0.8;
}
45% {
transform: scale(1.05) translateY(-3px);
opacity: 1;
}
70% {
transform: scale(0.96) translateY(2px);
opacity: 0.75;
}
}
.navbar {
background: linear-gradient(120deg, rgba(34, 21, 14, 0.95), rgba(15, 12, 18, 0.92));
border-bottom: 2px solid rgba(126, 80, 37, 0.9);
box-shadow: 0 8px 24px rgba(0, 0, 0, 0.7);
font-family: 'MedievalSharp', cursive;
text-shadow: 0 0 8px rgba(255, 176, 84, 0.25);
}
.navbar .container-fluid {
max-width: 1140px;
margin: 0 auto;
padding: 0 24px;
}
.navbar-brand {
color: var(--text-body) !important;
letter-spacing: 0.08em;
font-size: 1.25rem;
}
.navbar small,
.nav-subtitle {
color: var(--text-muted);
font-family: 'Cinzel', serif;
text-shadow: 0 0 4px rgba(0, 0, 0, 0.6);
}
.nav-subtitle {
letter-spacing: 0.08em;
font-size: 0.78rem;
text-transform: uppercase;
opacity: 0.85;
}
.dungeon-wrapper {
position: relative;
z-index: 1;
max-width: 1140px;
margin: 0 auto;
padding: 40px 28px 80px;
color: var(--text-body);
}
.dungeon-wrapper::before {
content: "";
position: absolute;
inset: 10px;
border: 1px solid rgba(203, 156, 102, 0.25);
border-radius: 24px;
background: linear-gradient(160deg, rgba(27, 20, 33, 0.96), rgba(17, 12, 21, 0.92));
box-shadow:
0 0 30px rgba(0, 0, 0, 0.85),
0 0 80px rgba(126, 80, 37, 0.35);
z-index: -2;
}
.dungeon-wrapper::after {
content: "";
position: absolute;
inset: 0;
background: radial-gradient(circle at top left, rgba(255, 193, 110, 0.18), transparent 60%),
radial-gradient(circle at bottom right, rgba(102, 217, 252, 0.08), transparent 55%);
pointer-events: none;
border-radius: 32px;
z-index: -3;
}
.floating-runes {
position: absolute;
inset: 20px;
pointer-events: none;
z-index: -1;
opacity: 0.55;
filter: drop-shadow(0 0 12px rgba(255, 203, 139, 0.25));
}
.floating-runes span {
position: absolute;
font-family: 'MedievalSharp', cursive;
font-size: 1.6rem;
color: rgba(255, 214, 153, 0.45);
text-shadow:
0 0 12px rgba(255, 196, 128, 0.4),
0 0 24px rgba(255, 196, 128, 0.2);
animation: rune-float 14s ease-in-out infinite;
}
.floating-runes .rune-1 {
top: 12%;
left: 10%;
animation-delay: 0s;
}
.floating-runes .rune-2 {
top: 22%;
right: 8%;
animation-delay: 3s;
}
.floating-runes .rune-3 {
bottom: 18%;
left: 18%;
animation-delay: 6s;
}
.floating-runes .rune-4 {
bottom: 8%;
right: 16%;
animation-delay: 9s;
}
.floating-runes .rune-5 {
top: 45%;
left: 46%;
animation-delay: 12s;
}
@keyframes rune-float {
0%,
100% {
transform: translate3d(0, 0, 0) scale(0.9);
opacity: 0.35;
}
50% {
transform: translate3d(14px, -18px, 0) scale(1.25);
opacity: 0.8;
}
}
.dungeon-wrapper > .row {
position: relative;
z-index: 1;
}
.controls {
margin-bottom: 25px;
text-align: center;
position: relative;
}
.controls::before {
content: "";
position: absolute;
left: 50%;
bottom: -12px;
width: 160px;
height: 2px;
background: linear-gradient(90deg, transparent, rgba(207, 167, 103, 0.85), transparent);
transform: translateX(-50%);
box-shadow: 0 0 10px rgba(207, 167, 103, 0.6);
}
.btn-generate {
background: linear-gradient(160deg, #8b4513, #5c2f0d);
border: 1px solid rgba(207, 167, 103, 0.7);
color: var(--text-body);
font-size: 0.95rem;
padding: 10px 28px;
border-radius: 999px;
text-transform: uppercase;
letter-spacing: 0.1em;
box-shadow:
0 0 12px rgba(207, 167, 103, 0.45),
inset 0 0 12px rgba(255, 200, 132, 0.25);
position: relative;
overflow: hidden;
}
.btn-generate::after {
content: "✦";
position: absolute;
right: 14px;
top: 50%;
transform: translateY(-50%);
font-size: 1.15rem;
color: rgba(255, 231, 186, 0.9);
text-shadow: 0 0 12px rgba(255, 198, 135, 0.7);
animation: twinkle 2.8s ease-in-out infinite;
}
@keyframes twinkle {
0%,
100% {
opacity: 0.3;
transform: translateY(-50%) scale(0.85) rotate(0deg);
}
50% {
opacity: 1;
transform: translateY(-50%) scale(1.2) rotate(18deg);
}
}
@media (prefers-reduced-motion: reduce) {
*,
*::before,
*::after {
animation-duration: 0.01ms !important;
animation-iteration-count: 1 !important;
transition-duration: 0.01ms !important;
}
body::before,
body::after,
.floating-runes span,
.btn-generate::after {
animation: none !important;
}
.floating-runes {
opacity: 0.35;
}
}
.btn-generate:hover {
background: linear-gradient(160deg, #a0522d, #6a3814);
border-color: rgba(255, 206, 143, 0.9);
color: #fff8e5;
box-shadow:
0 0 18px rgba(255, 198, 135, 0.6),
inset 0 0 16px rgba(255, 216, 165, 0.4);
}
.game-container {
background: linear-gradient(135deg, rgba(20, 17, 24, 0.92), rgba(14, 11, 18, 0.88));
border-radius: 16px;
padding: 18px;
margin: 20px auto 24px;
border: 1px solid rgba(207, 167, 103, 0.35);
box-shadow:
inset 0 0 24px rgba(0, 0, 0, 0.85),
0 0 32px rgba(0, 0, 0, 0.65),
0 0 48px rgba(139, 69, 19, 0.3);
position: relative;
}
.game-container::before,
.game-container::after {
content: "";
position: absolute;
width: 32px;
height: 32px;
border: 2px solid rgba(207, 167, 103, 0.6);
border-radius: 50%;
box-shadow: 0 0 12px rgba(207, 167, 103, 0.6);
opacity: 0.65;
}
.game-container::before {
top: -12px;
left: -12px;
}
.game-container::after {
bottom: -12px;
right: -12px;
}
#c {
border: 3px solid rgba(207, 167, 103, 0.35);
border-radius: 12px;
max-width: 100%;
height: auto;
display: block;
margin: 0 auto;
touch-action: none; /* Prevent scrolling on touch */
box-shadow:
inset 0 0 18px rgba(0, 0, 0, 0.85),
0 0 22px rgba(207, 167, 103, 0.2);
background: repeating-linear-gradient(45deg, rgba(255, 255, 255, 0.02) 0 4px, transparent 4px 8px);
}
.instructions {
color: var(--text-body);
margin-top: 25px;
font-size: 0.9rem;
background: linear-gradient(180deg, rgba(95, 61, 33, 0.65), rgba(31, 20, 14, 0.9));
border: 1px solid rgba(207, 167, 103, 0.45);
border-radius: 18px;
padding: 20px 24px;
box-shadow:
inset 0 0 16px rgba(0, 0, 0, 0.7),
0 0 36px rgba(0, 0, 0, 0.6);
position: relative;
overflow: hidden;
}
.instructions::before {
content: "";
position: absolute;
inset: 0;
background: linear-gradient(0deg, rgba(255, 214, 151, 0.08), transparent 40%),
linear-gradient(90deg, rgba(255, 199, 135, 0.12), transparent 30%, transparent 70%, rgba(255, 199, 135, 0.12));
pointer-events: none;
mix-blend-mode: screen;
}
.instructions h5 {
font-family: 'MedievalSharp', cursive;
letter-spacing: 0.12em;
font-size: 1.15rem;
color: #ffe8ba;
text-transform: uppercase;
text-shadow:
0 0 14px rgba(255, 198, 135, 0.7),
0 0 8px rgba(0, 0, 0, 0.8);
}
.instructions ul {
list-style: none;
margin: 0;
padding-left: 0;
}
.instructions li {
position: relative;
padding-left: 28px;
margin-bottom: 10px;
color: rgba(255, 238, 201, 0.95);
}
.instructions li::before {
content: "✷";
position: absolute;
left: 0;
top: 0;
color: rgba(255, 212, 153, 0.85);
text-shadow: 0 0 6px rgba(255, 212, 153, 0.65);
}
.instructions .keyword {
color: #ffe8ba;
font-weight: 600;
letter-spacing: 0.05em;
}
/* Virtual Gamepad Styles */
.virtual-gamepad {
display: none;
position: fixed;
bottom: 20px;
left: 50%;
transform: translateX(-50%);
background: linear-gradient(160deg, rgba(28, 24, 34, 0.95), rgba(18, 15, 22, 0.92));
border: 1px solid rgba(207, 167, 103, 0.35);
border-radius: 22px;
padding: 18px;
z-index: 1000;
box-shadow:
0 12px 24px rgba(0, 0, 0, 0.7),
0 0 28px rgba(207, 167, 103, 0.25);
align-items: center;
gap: 20px;
}
.dpad {
display: grid;
grid-template-columns: repeat(3, 60px);
grid-template-rows: repeat(3, 60px);
gap: 5px;
position: relative;
}
.sword-btn {
background: linear-gradient(145deg, #8b4513, #654321);
border: none;
border-radius: 50%;
width: 60px;
height: 60px;
color: white;
font-size: 24px;
font-weight: bold;
display: flex;
align-items: center;
justify-content: center;
cursor: pointer;
transition: all 0.1s;
user-select: none;
-webkit-tap-highlight-color: transparent;
box-shadow:
inset 0 0 10px rgba(0, 0, 0, 0.6),
0 6px 12px rgba(0, 0, 0, 0.6);
}
.sword-btn:active,
.sword-btn.active {
background: linear-gradient(145deg, #654321, #4a2c17);
transform: scale(0.95);
}
.dpad-btn {
background: linear-gradient(145deg, #56442f, #271b15);
border: 1px solid rgba(207, 167, 103, 0.4);
border-radius: 12px;
color: #ffe7c2;
font-size: 18px;
font-weight: bold;
display: flex;
align-items: center;
justify-content: center;
cursor: pointer;
transition: all 0.1s;
user-select: none;
-webkit-tap-highlight-color: transparent;
box-shadow:
inset 0 0 8px rgba(0, 0, 0, 0.8),
0 4px 12px rgba(0, 0, 0, 0.6);
}
.dpad-btn:active {
background: linear-gradient(145deg, #302216, #4a3525);
transform: scale(0.95);
}
.dpad-btn:disabled {
opacity: 0.3;
cursor: not-allowed;
}
.dpad-up {
grid-column: 2;
grid-row: 1;
}
.dpad-left {
grid-column: 1;
grid-row: 2;
}
.dpad-center {
grid-column: 2;
grid-row: 2;
background: rgba(139, 69, 19, 0.3);
cursor: default;
}
.dpad-right {
grid-column: 3;
grid-row: 2;
}
.dpad-down {
grid-column: 2;
grid-row: 3;
}
/* Show gamepad on touch devices */
@media (hover: none) and (pointer: coarse), (max-width: 768px) {
.virtual-gamepad {
display: flex !important;
}
.instructions {
padding-bottom: 140px; /* Make room for gamepad */
}
}
/* Force show on very small screens */
@media (max-width: 480px) {
.virtual-gamepad {
display: flex !important;
}
}
/* Mobile responsive adjustments */
@media (max-width: 768px) {
body {
padding-top: 50px;
}
.dungeon-wrapper {
padding: 36px 16px 120px;
}
.floating-runes {
inset: 12px;
opacity: 0.35;
}
.navbar-brand {
font-size: 1.1rem;
}
.navbar small,
.nav-subtitle {
font-size: 0.7rem;
}
.game-container {
padding: 12px;
margin: 20px 5px;
}
.btn-generate {
font-size: 0.8rem;
padding: 8px 18px;
}
.instructions h5 {
font-size: 1rem;
}
.instructions {
font-size: 0.75rem;
padding-bottom: 150px; /* Extra space for gamepad */
}
/* Optimize canvas for mobile */
#c {
max-width: 95vw;
max-height: 60vh;
width: auto !important;
height: auto !important;
}
}
/* Portrait mobile specific optimizations */
@media (max-width: 480px) and (orientation: portrait) {
.game-container {
padding: 8px;
margin: 10px 2px 24px;
}
#c {
max-width: 98vw;
max-height: 55vh;
}
.dpad {
grid-template-columns: repeat(3, 50px);
grid-template-rows: repeat(3, 50px);
gap: 8px;
}
.dpad-btn {
font-size: 16px;
border-radius: 10px;
}
.virtual-gamepad {
bottom: 10px;
padding: 12px;
}
.instructions {
padding-bottom: 160px;
}
}
@media (max-width: 480px) {
.dpad {
grid-template-columns: repeat(3, 50px);
grid-template-rows: repeat(3, 50px);
}
.dpad-btn {
font-size: 16px;
}
.virtual-gamepad {
bottom: 15px;
padding: 12px;
}
.floating-runes {
display: none;
}
}
</style>
</head>
<body>
<nav class="navbar navbar-dark fixed-top">
<div class="container-fluid">
<a class="navbar-brand" href="#">🏰 Endless Dungeon</a>
<small class="nav-subtitle">Move, fight, and survive the shifting halls to reach the exit</small>
</div>
</nav>
<div class="container-fluid dungeon-wrapper">
<div class="floating-runes" aria-hidden="true">
<span class="rune-1">⚷</span>
<span class="rune-2">✶</span>
<span class="rune-3">⚔</span>
<span class="rune-4">✹</span>
<span class="rune-5">☽</span>
</div>
<div class="row">
<div class="col-12">
<div class="controls">
<button id="generate" class="btn btn-generate" type="button">
🎲 Generate New Dungeon
</button>
</div>
<div id="content" class="game-container">
<canvas id="c" width="1050" height="700"></canvas>
</div>
<div class="instructions">
<h5>Dungeon Directives</h5>
<ul>
<li><span class="keyword">Movement:</span> Use arrow keys for smooth strides, click tiles to pathfind, swipe to dash, or wield the virtual gamepad to guide your knight (🛡️).</li>
<li><span class="keyword">Combat:</span> Strike with SPACE or tap the sword sigil (⚔️) to clash with foes lurking in adjacent tiles.</li>
<li><span class="keyword">Exploration:</span> Scout the torch-lit floors and doorways to uncover treasure, potions, and lurking enemies.</li>
<li><span class="keyword">Obstacles:</span> Stone walls and void chasms are impassable—chart alternate paths through the maze.</li>
<li><span class="keyword">Objective:</span> Defeat the guardians to reveal the shimmering exit glyph (✨) and claim victory.</li>
<li><span class="keyword">Replay:</span> Summon a fresh challenge anytime with the <em>Generate New Dungeon</em> relic.</li>
</ul>
</div>
</div>
</div>
</div>
<!-- Virtual Gamepad for Mobile -->
<div class="virtual-gamepad" id="virtual-gamepad">
<div class="dpad">
<button class="dpad-btn dpad-up" data-direction="up">▲</button>
<button class="dpad-btn dpad-left" data-direction="left">◀</button>
<div class="dpad-center"></div>
<button class="dpad-btn dpad-right" data-direction="right">▶</button>
<button class="dpad-btn dpad-down" data-direction="down">▼</button>
</div>
<button class="sword-btn" id="sword-btn">⚔️</button>
</div>
<script type="module" src="/src/main.js"></script>
</body>
</html>