-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
255 lines (233 loc) · 17.8 KB
/
Copy pathindex.html
File metadata and controls
255 lines (233 loc) · 17.8 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
<!DOCTYPE html>
<html lang="zh-Hant">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>諾曼第登陸 · D-Day: The Normandy Landings, 1944</title>
<meta name="description" content="An interactive, to-scale 3D documentary of the D-Day landings (6 June 1944), rendered on real Normandy terrain with a directed cinematic camera." />
<meta property="og:type" content="website" />
<meta property="og:title" content="D-Day: The Normandy Landings, 1944 (interactive 3D documentary)" />
<meta property="og:description" content="A to-scale 3D retelling of the Normandy landings on real Normandy terrain. Three.js, no build, no backend, no API keys." />
<meta property="og:url" content="https://keithligh.github.io/d-day-normandy-1944/" />
<meta property="og:image" content="https://keithligh.github.io/d-day-normandy-1944/docs/og.jpg" />
<meta property="og:image:width" content="1200" />
<meta property="og:image:height" content="630" />
<meta property="og:image:alt" content="The D-Day Normandy landings rendered in 3D on real Normandy terrain" />
<meta name="twitter:card" content="summary_large_image" />
<meta name="twitter:image" content="https://keithligh.github.io/d-day-normandy-1944/docs/og.jpg" />
<link rel="icon" href="data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'><rect width='16' height='16' fill='%2306080c'/></svg>" /><!-- the faction-coloured favicon is rebuilt from FAC by app.js at boot -->
<style>
:root{
/* --<faction>/--<faction>-glow CSS vars are set from FAC by app.js at boot (no faction colour is hard-coded here) */
--ink:#eee6d2; --ink-dim:#b3a98c; --paper:#06080c;
--panel:rgba(12,15,21,.74); --panel-edge:rgba(210,190,140,.26); --accent:#d8c08a;
--mono:"Consolas","SFMono-Regular",ui-monospace,monospace;
--font-display:"Microsoft JhengHei","PingFang TC","Noto Sans TC","Heiti TC",sans-serif; /* pre-boot fallback; app.js sets --font-display + --mono + --text-dir from D.meta */
}
*{box-sizing:border-box;margin:0;padding:0}
@media (prefers-reduced-motion: reduce){ *{ animation-duration:.001ms !important; animation-iteration-count:1 !important; transition-duration:.001ms !important; } }
html,body{width:100%;height:100%;overflow:hidden;background:var(--paper);color:var(--ink);font-family:var(--font-display)}
/* reading direction: the primary-narration-script text follows --text-dir (from D.meta.dir, set by app.js); the
Latin/secondary text + technical labels stay LTR so mixed bilingual captions read correctly (RTL-safe). */
.lbl .zh,.unit .name,#title h1,#caption .ttl,#caption .narr .nz,#caption .str,#boot .bt,#notes-body,#resume{direction:var(--text-dir,ltr)}
.lbl .en,#title .sub,#caption .ttl .en,#caption .narr .ne,#caption .date,#caption .cmd,#scene-label{direction:ltr;unicode-bidi:isolate}
#scene{position:fixed;inset:0;z-index:0}
/* soft lower-third scrim: darkens the bottom band behind the caption so text is always legible,
sits BELOW the on-map labels (z2) so place/unit labels stay bright */
#lower-scrim{position:fixed;left:0;right:0;bottom:0;height:44%;z-index:1;pointer-events:none;
background:linear-gradient(to top, rgba(4,7,12,0.84) 0%, rgba(4,7,12,0.5) 36%, rgba(4,7,12,0) 100%)}
#labels{position:fixed;inset:0;z-index:2;pointer-events:none;overflow:hidden}
/* ---------- place / terrain labels (CSS2D) ---------- */
.lbl{transform:translate(-50%,-50%);text-align:center;text-shadow:0 1px 4px #000,0 0 8px #000;white-space:nowrap;user-select:none;transition:opacity .45s}
.lbl .zh{font-family:var(--font-display);font-weight:700;letter-spacing:1px}
.lbl .en{font-family:var(--mono);letter-spacing:.5px;opacity:.72;font-size:.62em}
.lbl.region .zh{font-size:19px;color:#f2ead2}
.lbl.peak .zh{font-size:13px;color:#e7d6a6}
.lbl.peak::before{content:"▲";display:block;font-size:9px;color:#cdb877;margin-bottom:-2px}
.lbl.bay .zh,.lbl.town .zh{font-size:12px;color:#bfd4e8}
.lbl.fort .zh{font-size:12px;color:#f0b48a}
.lbl.linelbl .zh{font-size:12px;font-weight:700;letter-spacing:1px}
/* ---------- unit flag labels (CSS2D) ---------- */
.unit{transform:translate(-50%,-115%);min-width:90px;pointer-events:none;text-align:center;transition:opacity .45s}
.unit .name{font-family:var(--font-display);font-weight:700;font-size:12px;line-height:1.15;text-shadow:0 1px 3px #000,0 0 6px #000}
.unit .cmd{font-family:var(--mono);font-size:9.5px;opacity:.85;text-shadow:0 1px 2px #000}
/* per-faction .unit.<key> .name colours are injected from FAC by app.js */
/* ---------- title ---------- */
.panel{background:var(--panel);border:1px solid var(--panel-edge);border-radius:10px;backdrop-filter:blur(7px);box-shadow:0 8px 30px rgba(0,0,0,.55)}
#hud-tl{position:fixed;z-index:5;top:16px;left:18px;display:flex;flex-direction:column;align-items:flex-start;gap:9px;max-width:min(330px,82vw);pointer-events:none}
#title{padding:9px 15px 10px;pointer-events:auto}
#title h1{font-family:var(--font-display);font-size:21px;letter-spacing:3px;color:#f4ecd6;line-height:1}
#title .sub{font-family:var(--mono);font-size:9.5px;letter-spacing:2px;color:var(--ink-dim);margin-top:4px}
#notes-btn,#lang-btn,#music-btn{margin-top:7px;font-family:var(--mono);font-size:9.5px;letter-spacing:.5px;color:var(--accent);
background:rgba(216,192,138,.08);border:1px solid var(--panel-edge);border-radius:6px;padding:3px 8px;cursor:pointer;transition:.18s}
#notes-btn:hover,#lang-btn:hover,#music-btn:hover{background:rgba(216,192,138,.2)}
#lang-btn,#music-btn{margin-left:6px}
#music-btn.off{opacity:.5}
/* ---------- credits ---------- */
#title .credit{margin-top:8px;font-family:var(--mono);font-size:9px;letter-spacing:.2px;color:var(--ink-dim);line-height:1.45;max-width:230px}
#title .credit a{color:var(--accent);text-decoration:none;border-bottom:1px solid rgba(216,192,138,.45)}
#title .credit a:hover{color:#fff}
#credit{position:fixed;z-index:6;left:50%;bottom:5px;transform:translateX(-50%);max-width:94vw;text-align:center;
font-family:var(--mono);font-size:10px;letter-spacing:.3px;color:rgba(216,222,232,.66);text-shadow:0 1px 2px #000,0 0 5px #000;pointer-events:none}
#credit a{color:var(--accent);text-decoration:none;border-bottom:1px solid rgba(216,192,138,.55);pointer-events:auto}
#credit a:hover{color:#fff}
/* ---------- tiny faction key ---------- */
#key{position:fixed;z-index:5;top:16px;right:18px;padding:8px 12px;font-size:11px}
#key .row{display:flex;align-items:center;gap:7px;margin:2px 0}
#key .sw{width:11px;height:11px;border-radius:3px;box-shadow:0 0 6px currentColor}
#key .ln{width:16px;height:0;border-top:3px solid currentColor;border-radius:2px;box-shadow:0 0 6px currentColor}
#key .front{color:#ffb24a} /* the generic front-line legend colour; per-battle line colours come inline from D.geography.lines[].color; faction swatches from FAC */
#key .sep{height:1px;background:var(--panel-edge);margin:6px 0}
/* collapsible symbol key (native <details>, no JS) */
#key .syms{margin-top:5px}
#key .syms>summary{cursor:pointer;color:var(--accent);font-size:10px;letter-spacing:.5px;list-style:none;outline:none;opacity:.92}
#key .syms>summary::-webkit-details-marker{display:none}
#key .syms>summary::before{content:"▸ ";font-size:9px}
#key .syms[open]>summary::before{content:"▾ "}
#key .syms .row{margin:3px 0}
#key .syms:not([open]) > :not(summary){display:none} /* closed details hide their rows so the legend panel never overflows (the .row display:flex above otherwise overrides the UA closed-details hiding) */
#key .gl{display:inline-flex;align-items:center;justify-content:center;width:14px;font-size:12px;color:var(--ink)}
#key .gl.mini{width:16px;height:6px;border-radius:2px;background:rgba(255,255,255,.14);overflow:hidden}
#key .gl.mini>i{display:block;height:100%;width:62%} /* the strength-glyph gradient is injected from FAC (defender) */
#key .flagsw{width:24px;height:16px;border-radius:2px;flex:0 0 auto;box-shadow:0 0 4px rgba(0,0,0,.55)}
#key .syms .row .en{opacity:.55}
/* always-visible honesty tag: present-day-imagery disclosure (survives the ≤600px breakpoint) */
#disclaimer{max-width:100%;font-size:9.5px;line-height:1.32;
color:rgba(228,234,242,0.92);text-shadow:0 1px 2px #000,0 0 4px #000,0 0 9px rgba(0,0,0,.85);pointer-events:none;letter-spacing:.2px}
/* ---------- cinematic lower-third caption ---------- */
#caption{position:fixed;z-index:5;left:50%;bottom:78px;transform:translateX(-50%) translateY(14px);
width:min(760px,92vw);text-align:center;opacity:0;transition:opacity .7s,transform .7s;pointer-events:none}
#caption.show{opacity:1;transform:translateX(-50%) translateY(0)}
#caption .date{font-family:var(--mono);font-size:12px;letter-spacing:3px;color:var(--accent)}
#caption .ttl{font-family:var(--font-display);font-weight:700;font-size:30px;letter-spacing:2px;color:#f6efda;
margin:3px 0 2px;text-shadow:0 2px 16px #000,0 0 30px rgba(0,0,0,.8)}
#caption .ttl .en{display:block;font-family:var(--mono);font-weight:400;font-size:12px;letter-spacing:2px;color:var(--ink-dim);margin-top:3px}
#caption .narr{font-family:var(--font-display);font-size:14.5px;line-height:1.6;color:#f0e7d2;max-width:680px;margin:6px auto 0;
text-shadow:0 1px 3px #000,0 0 6px #000,0 0 14px rgba(0,0,0,.9)}
#caption .narr .nz{display:block}
#caption .narr .ne{display:block;font-family:var(--mono);font-size:11.5px;font-style:italic;color:#ded4b8;opacity:.92;margin-top:3px;letter-spacing:.3px}
#caption .meta{display:flex;justify-content:center;align-items:center;gap:14px;margin-top:9px;flex-wrap:wrap}
#caption .cmd{font-family:var(--mono);font-size:11px;color:#f0e4c4;border:1px solid var(--panel-edge);
background:rgba(12,15,21,.5);border-radius:20px;padding:3px 11px}
#caption .str{display:flex;align-items:center;gap:6px;font-family:var(--mono);font-size:10px;color:var(--ink-dim)}
#caption .str .bar{width:90px;height:5px;border-radius:3px;background:rgba(255,255,255,.12);overflow:hidden}
#caption .str .bar > i{display:block;height:100%}
/* per-faction .str.<key> strength-bar gradients + text colours are injected from FAC by app.js */
/* ---------- minimal transport controls (auto-hide) ---------- */
#controls{position:fixed;z-index:6;left:50%;bottom:32px;transform:translateX(-50%);
display:flex;align-items:center;gap:14px;width:min(760px,92vw);transition:opacity .5s}
#controls.hide{opacity:0}
#play{flex:0 0 auto;width:42px;height:42px;border-radius:50%;border:1px solid var(--panel-edge);
background:var(--panel);color:var(--accent);font-size:16px;cursor:pointer;backdrop-filter:blur(6px);transition:.18s}
#play:hover{background:rgba(216,192,138,.22)}
#prog{flex:1;height:5px;border-radius:3px;background:rgba(255,255,255,.12);position:relative;cursor:pointer}
#prog > i{display:block;height:100%;width:0;border-radius:3px;transition:width .4s linear} /* the faction progress gradient is injected from FAC */
#prog .beats{position:absolute;inset:0;pointer-events:none}
#prog .beats b{position:absolute;top:-3px;width:2px;height:11px;background:rgba(255,255,255,.34);transform:translateX(-50%);border-radius:1px;pointer-events:auto;cursor:pointer}
#prog .beats b:hover{background:var(--accent);width:3px}
#scene-label{flex:0 0 auto;font-family:var(--mono);font-size:10px;color:var(--ink-dim);min-width:42px;text-align:right}
/* ---------- resume overlay (only while free-look) ---------- */
#resume{position:fixed;z-index:7;left:50%;top:24px;transform:translateX(-50%);display:none;
font-family:var(--font-display);font-size:13px;color:var(--ink);background:var(--panel);border:1px solid var(--accent);
border-radius:22px;padding:8px 18px;cursor:pointer;backdrop-filter:blur(6px);box-shadow:0 6px 22px rgba(0,0,0,.5)}
#resume.show{display:block}
#resume:hover{background:rgba(216,192,138,.2)}
/* ---------- notes / sources ---------- */
#notes{position:fixed;top:50%;left:50%;transform:translate(-50%,-50%);z-index:9;width:min(620px,92vw);max-height:78vh;
display:none;flex-direction:column;overflow:hidden}
#notes.open{display:flex}
#notes .nhd{display:flex;justify-content:space-between;align-items:center;padding:11px 15px;
border-bottom:1px solid var(--panel-edge);font-family:var(--mono);font-size:11px;letter-spacing:1.5px;color:var(--accent)}
#notes .nhd button{background:none;border:none;color:var(--ink-dim);font-size:15px;cursor:pointer}
#notes .nbody{padding:14px 17px;overflow:auto;font-size:12.5px;line-height:1.65;color:var(--ink-dim)}
#notes .nbody p{margin-bottom:9px}
#notes .nbody h5{font-family:var(--font-display);font-size:13px;color:var(--accent);margin:13px 0 6px}
#notes .nbody ul{margin:0 0 6px 2px;list-style:none}
#notes .nbody li{position:relative;padding-inline-start:15px;margin-bottom:7px} /* logical: bullet sits on the reading-start side (left LTR, right RTL) */
#notes .nbody li::before{content:"▸";position:absolute;inset-inline-start:0;color:var(--accent)}
[data-text-dir="rtl"] #notes .nbody li::before{content:"◂"} /* RTL: the marker points the reading direction (left) */
[data-text-dir="rtl"] #caption .cmd{direction:rtl;unicode-bidi:isolate} /* RTL: commander chips flow with the text (a Latin rank still isolates) */
#hint{font-family:var(--mono);font-size:10px;color:var(--ink-dim);pointer-events:none;
background:var(--panel);border:1px solid var(--panel-edge);border-radius:8px;padding:6px 10px;max-width:200px;line-height:1.5;transition:opacity .5s}
#hint.hide{opacity:0}
#hint b{color:var(--accent)}
#boot{position:fixed;inset:0;z-index:50;background:radial-gradient(ellipse at center,#131922,#04060a);display:flex;flex-direction:column;align-items:center;justify-content:center;gap:16px;transition:opacity .8s}
#boot.gone{opacity:0;pointer-events:none}
#boot .bt{font-family:var(--font-display);font-size:30px;letter-spacing:7px;color:#f4ecd6}
#boot .bs{font-family:var(--mono);font-size:11px;letter-spacing:3px;color:var(--accent)}
#boot .bar{width:240px;height:3px;background:rgba(255,255,255,.1);border-radius:2px;overflow:hidden}
#boot .bar>i{display:block;height:100%;width:30%;background:var(--accent);animation:load 1.1s ease-in-out infinite}
@keyframes load{0%{margin-left:-30%}100%{margin-left:100%}}
#boot .msg{font-family:var(--mono);font-size:10px;color:var(--ink-dim)}
#err{position:fixed;inset:0;z-index:60;background:#1a0d0d;color:#ffd9d2;font-family:var(--mono);font-size:13px;padding:40px;display:none;white-space:pre-wrap;overflow:auto}
@media (max-width:600px){
#title h1{font-size:17px} #caption .ttl{font-size:22px} #caption .narr{font-size:13px}
#hud-tl{max-width:54vw} #key{max-width:46vw;font-size:10px;top:10px;right:10px;padding:6px 9px}
#caption .narr .ne{font-size:10.5px}
#credit{font-size:8px;bottom:3px} #title .credit{font-size:8px}
}
/* iPhone-class phones (SE 375 → Pro Max 430): shrink the top row so #title & #key never collide */
@media (max-width:440px){
#title{padding:6px 9px 7px}
#title h1{font-size:15px;letter-spacing:1.5px}
#title .sub{font-size:7px;letter-spacing:1px;margin-top:2px}
#notes-btn,#lang-btn{font-size:8px;margin-top:5px}
#title .credit{font-size:7px;margin-top:5px;max-width:165px;line-height:1.35}
#hud-tl{max-width:48vw} #key{max-width:42vw;font-size:8px;top:10px;right:8px;padding:5px 6px}
#resume{top:112px} /* free-look prompt drops below the title/legend row so it never overlaps them */
}
</style>
</head>
<body>
<div id="scene"></div>
<div id="lower-scrim"></div>
<div id="labels"></div>
<div id="hud-tl">
<div id="title" class="panel">
<h1></h1>
<div class="sub" lang="en"></div>
<button id="notes-btn"></button>
<button id="lang-btn" aria-label="Toggle narration language"></button>
<button id="music-btn" class="off" title="Music" aria-label="Background music">🔇</button>
<div class="credit">Built with ❤️ by Keith Li · <a href="https://www.linkedin.com/in/keithlihk/" target="_blank" rel="noopener">Follow on LinkedIn</a></div>
</div>
<div id="disclaimer"></div>
<div id="hint" class="panel"></div>
</div>
<div id="key" class="panel"></div><!-- the legend is painted from data by buildChrome(): faction rows from FAC, line rows from D.geography.lines, symbol/flag labels from D.ui -->
<!-- cinematic lower-third caption (driven by the Director) -->
<div id="caption">
<div class="date" id="cap-date"></div>
<div class="ttl" id="cap-title"></div>
<div class="narr" id="cap-narr"></div>
<div class="meta" id="cap-meta"></div>
</div>
<div id="credit" lang="en">Built by Keith Li · <a href="https://www.linkedin.com/in/keithlihk/" target="_blank" rel="noopener">LinkedIn</a></div>
<!-- minimal transport (auto-hides) -->
<div id="controls">
<button id="play" title="Play / pause" aria-label="Play / pause">⏸</button>
<div id="prog" role="progressbar" aria-label="Tour progress"><i></i><div class="beats" id="prog-beats"></div></div>
<div id="scene-label"></div>
</div>
<div id="resume"></div>
<div id="notes" class="panel">
<div class="nhd"><span></span><button id="notes-close" aria-label="Close">✕</button></div>
<div id="notes-body" class="nbody"></div>
</div>
<audio id="bgm" loop muted preload="auto" src="lib/gray-tide-at-normandy.mp3"></audio>
<div id="boot">
<div class="bt"></div>
<div class="bs"></div>
<div class="bar"><i></i></div>
<div class="msg" id="boot-msg"></div>
</div>
<pre id="err"></pre>
<!-- vendored Three.js r128 (classic globals) + scenario data load first, synchronously -->
<script src="lib/three.min.js"></script>
<script src="lib/OrbitControls.js"></script>
<script src="lib/CSS2DRenderer.js"></script>
<script src="data.js"></script>
<!-- the engine is ES modules; this entry runs after the classic scripts above, so global THREE / BATTLE_DATA exist when it evaluates -->
<script type="module" src="app.js"></script>
</body>
</html>