File size: 9,754 Bytes
1390db3
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
fe3647a
 
 
 
 
 
 
 
 
1390db3
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
9b606b6
 
 
 
 
 
 
 
 
 
 
1390db3
 
9b606b6
 
 
 
 
 
1390db3
9b606b6
 
 
1390db3
 
9b606b6
 
 
 
 
 
 
1390db3
 
9b606b6
 
 
 
 
 
 
 
 
 
1390db3
 
9b606b6
 
 
 
 
1390db3
 
 
 
 
9b606b6
1390db3
 
 
 
 
 
 
9b606b6
 
 
 
 
 
 
 
 
1390db3
9b606b6
 
 
 
1390db3
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
a646668
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1390db3
 
 
 
 
 
 
 
9b606b6
1390db3
 
 
 
 
 
 
 
 
874a51f
 
 
 
9b606b6
 
 
 
1390db3
 
 
 
a646668
1390db3
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
fe3647a
 
 
 
1390db3
 
 
 
 
 
 
 
 
bf6239d
1390db3
 
 
 
 
 
 
 
 
 
 
 
 
 
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
<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8" />
  <meta name="viewport" content="width=device-width, initial-scale=1.0" />
  <title>Orcs In The Forest</title>
  <style>
    body {
      margin: 0;
      overflow: hidden;
      font-family: monospace;
      background: #000;
    }
    canvas { display: block; }
    :root {
      --hud-bg: rgba(14, 20, 28, 0.55);
      --hud-border: rgba(120, 200, 255, 0.55);
      --hud-glow: 0 0 18px rgba(80, 180, 255, 0.35);
      --accent: #34d399; /* green */
      --accent2: #60a5fa; /* blue */
      --text: #e8f0ff;
      --muted: rgba(200, 230, 255, 0.65);
    }
    #hud {
      position: absolute;
      top: 0; left: 0; right: 0; bottom: 0;
      pointer-events: none;
      color: white;
      text-shadow: 2px 2px 4px rgba(0,0,0,0.8);
    }
    #crosshair {
      position: absolute;
      top: 50%; left: 50%;
      transform: translate(-50%, -50%);
      width: 0; height: 0;
    }
    .crosshair-arm {
      position: absolute;
      background: rgba(255,255,255,0.85);
      box-shadow: 0 0 6px rgba(255,255,255,0.5);
    }
    .arm-h { height: 2px; }
    .arm-v { width: 2px; }
    /* Hitmarker (X) */
    .hit-arm {
      position: absolute;
      height: 2px;
      background: rgba(255,255,255,0.95);
      box-shadow: 0 0 6px rgba(255,255,255,0.6);
      opacity: 0; /* driven by JS */
      transform-origin: 50% 50%;
    }
    /* HUD Cards */
    .hud-card {
      position: absolute;
      padding: 12px 14px;
      background: var(--hud-bg);
      border: 1px solid var(--hud-border);
      border-radius: 10px;
      box-shadow: var(--hud-glow);
      backdrop-filter: blur(6px);
      color: var(--text);
      pointer-events: none;
    }
    .hud-title { font-size: 12px; letter-spacing: 1.5px; color: var(--muted); margin-bottom: 6px; }
    .hud-value { font-size: 26px; font-weight: 700; color: #fff; }
    .tl { top: 18px; left: 20px; }
    .tr { top: 18px; right: 20px; }
    .bl { bottom: 20px; left: 20px; }
    .br { bottom: 20px; right: 20px; }

    /* Health gauge (modern white-on-white) */
    #ui-health {
      width: 360px;
      padding: 14px 16px;
      /* remove container visuals for a cleaner look */
      background: transparent !important;
      border: none !important;
      box-shadow: none !important;
      backdrop-filter: none !important;
      -webkit-backdrop-filter: none !important;
    }
    #health-bar {
      position: relative;
      width: 100%;
      height: 18px;
      /* subtle track in white tones */
      background: linear-gradient(180deg, rgba(255,255,255,0.22), rgba(255,255,255,0.10));
      border: none;
      border-radius: 10px;
      overflow: hidden;
      box-shadow:
        inset 0 1px 0 rgba(255,255,255,0.35),
        inset 0 -1px 0 rgba(0,0,0,0.06);
    }
    #health-fill {
      position: absolute;
      left: 0; top: 0; bottom: 0;
      width: 60%;
      /* white fill with soft sheen */
      background: linear-gradient(90deg, #ffffff, #f3f6fb);
      box-shadow: 0 0 16px rgba(255,255,255,0.35);
      transition: width 140ms ease-out;
    }
    #health-stripes {
      position: absolute;
      inset: 0;
      background: repeating-linear-gradient(
        45deg,
        rgba(255,255,255,0.18) 0,
        rgba(255,255,255,0.18) 6px,
        transparent 6px,
        transparent 12px
      );
      mix-blend-mode: screen;
      pointer-events: none;
    }
    #health-text {
      font-size: 16px;
      color: #ffffff;
      text-shadow: 0 0 6px rgba(255,255,255,0.4);
    }
    #health-label { margin-bottom: 8px; display: flex; justify-content: space-between; align-items: baseline; }
    #health-label .hud-title { margin: 0; }

    /* Ammo */
    #ui-ammo { min-width: 220px; text-align: right; }
    #ammo { font-size: 32px; font-weight: 800; color: #fff; text-shadow: none; }
    #ammo:before { content: 'AMMO'; display: block; font-size: 12px; color: var(--muted); letter-spacing: 1.5px; margin-bottom: 6px; text-align: right; }

    /* Score */
    #ui-score { min-width: 160px; }
    #score:before { content: 'SCORE'; display: block; font-size: 12px; color: var(--muted); letter-spacing: 1.5px; margin-bottom: 6px; }
    #score { font-size: 28px; font-weight: 800; color: #fff; }

    /* Make score, ammo, and top-right containers match health (no chrome) */
    #ui-score, #ui-ammo, #ui-topright {
      background: transparent !important;
      border: none !important;
      box-shadow: none !important;
      backdrop-filter: none !important;
      -webkit-backdrop-filter: none !important;
    }

    /* Top-right stats */
    #ui-topright { display: flex; gap: 16px; align-items: flex-start; }
    .mini-card { padding: 0; background: transparent; border: none; border-radius: 0; box-shadow: none; text-align: right; }
    .mini-card .label { font-size: 12px; color: var(--muted); letter-spacing: 1.5px; margin-bottom: 2px; }
    .mini-card .value { font-size: 18px; font-weight: 700; color: #fff; }
    #overlay {
      position: absolute;
      top: 0; left: 0; right: 0; bottom: 0;
      display: flex; align-items: center; justify-content: center;
      background: rgba(0,0,0,0.7);
      pointer-events: auto; cursor: pointer;
    }
    #overlay-content { text-align: center; color: white; font-size: 24px; }
    #overlay-content h1 { margin: 20px 0; }
    #overlay-content p { margin: 10px 0; font-size: 18px; }
    .hidden { display: none !important; }
    #wave-banner {
      position: absolute;
      top: 40%; left: 50%; transform: translate(-50%, -50%);
      font-size: 48px; color: #ff0;
      text-shadow: 3px 3px 6px rgba(0,0,0,0.9);
      opacity: 0; transition: opacity 0.5s;
    }
    #wave-banner.show { opacity: 1; }
    #damage-overlay {
      position: absolute;
      top: 0; left: 0; right: 0; bottom: 0;
      pointer-events: none;
      background: radial-gradient(ellipse at center, rgba(255,0,0,0.0) 40%, rgba(255,0,0,0.35) 80%, rgba(255,0,0,0.7) 100%);
      opacity: 0;
    }
    #heal-overlay {
      position: absolute;
      top: 0; left: 0; right: 0; bottom: 0;
      pointer-events: none;
      background: radial-gradient(ellipse at center, rgba(0,255,128,0.0) 40%, rgba(0,255,128,0.28) 80%, rgba(0,255,128,0.55) 100%);
      opacity: 0;
    }
  </style>
  <style>
    /* Powerup chips next to health */
    .powerup-chips { display: flex; gap: 8px; margin-bottom: 8px; flex-wrap: wrap; }
    .pu-chip {
      display: inline-block;
      padding: 2px 8px;
      font-size: 12px;
      letter-spacing: 1px;
      border-radius: 999px;
      border: 1px solid rgba(255,255,255,0.3);
      color: #fff;
      text-shadow: 0 1px 2px rgba(0,0,0,0.5);
      box-shadow: 0 0 10px rgba(255,255,255,0.05);
      pointer-events: none;
      user-select: none;
      position: relative;
      overflow: hidden;
    }
    .pu-chip .pu-fill { position: absolute; left: 0; top: 0; bottom: 0; width: 0%; border-radius: 999px; filter: saturate(1.1); }
    .pu-chip .pu-text { position: relative; z-index: 1; }
    .pu-chip.blink { animation: puBlink 0.6s linear infinite; }
    @keyframes puBlink {
      0% { opacity: 1; filter: brightness(1); }
      50% { opacity: 0.35; filter: brightness(1.4); }
      100% { opacity: 1; filter: brightness(1); }
    }
  </style>
</head>
<body>
  <div id="hud">
    <!-- Score Top-Left -->
    <div id="ui-score" class="hud-card tl">
      <div class="hud-value" id="score">0</div>
    </div>

    <!-- Wave + Enemies + Grenades + FPS Top-Right (single row) -->
    <div id="ui-topright" class="hud-card tr">
      <div class="mini-card">
        <div class="label">WAVE</div>
        <div class="value" id="wave">1</div>
      </div>
      <div class="mini-card">
        <div class="label">ENEMIES</div>
        <div class="value" id="enemies">0</div>
      </div>
      <div class="mini-card">
        <div class="label">GRENADES</div>
        <div class="value" id="grenades">0</div>
      </div>
      <div class="mini-card">
        <div class="label">FPS</div>
        <div class="value" id="fps">-</div>
      </div>
    </div>

    <!-- Health Bottom-Left -->
    <div id="ui-health" class="hud-card bl">
      <div id="powerup-chips" class="powerup-chips"></div>
      <div id="health-label"><span class="hud-title">HEALTH</span><span id="health-text">100</span></div>
      <div id="health-bar">
        <div id="health-fill" style="width: 100%"></div>
        <div id="health-stripes"></div>
      </div>
    </div>

    <!-- Ammo Bottom-Right -->
    <div id="ui-ammo" class="hud-card br">
      <div class="hud-value" id="ammo">0/∞</div>
    </div>
    <div id="crosshair">
      <div id="ch-left" class="crosshair-arm arm-h"></div>
      <div id="ch-right" class="crosshair-arm arm-h"></div>
      <div id="ch-top" class="crosshair-arm arm-v"></div>
      <div id="ch-bottom" class="crosshair-arm arm-v"></div>
      <div id="ch-hit-a1" class="hit-arm"></div>
      <div id="ch-hit-a2" class="hit-arm"></div>
      <div id="ch-hit-b1" class="hit-arm"></div>
      <div id="ch-hit-b2" class="hit-arm"></div>
    </div>
    <div id="wave-banner"></div>
    <div id="heal-overlay"></div>
    <div id="damage-overlay"></div>
  </div>
  <div id="overlay">
    <div id="overlay-content">
      <h1>Orcs In The Forest</h1>
      <p>Click to Start</p>
      <p style="font-size: 14px;">Move: WASD | Look: Mouse | Fire: Click | Reload: R | Grenade: Hold G then release | Crouch: C | Light: F | Pause: ESC</p>
    </div>
  </div>

  <script type="importmap">
  {
    "imports": {
      "three": "https://unpkg.com/three@0.160.0/build/three.module.js",
      "three/addons/": "https://unpkg.com/three@0.160.0/examples/jsm/"
    }
  }
  </script>
  <script type="module" src="src/main.js"></script>
</body>
</html>