-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
261 lines (221 loc) · 7.85 KB
/
index.html
File metadata and controls
261 lines (221 loc) · 7.85 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
<!DOCTYPE html>
<html lang="en-us">
<head>
<meta charset="utf-8" />
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Kite 2</title>
<link rel="icon" href="StreamingAssets/kite_II__Bildmarke_RGB_favicon.svg" type="image/svg+xml" />
<meta name="viewport"
content="width=device-width,height=device-height,initial-scale=1.0,viewport-fit=cover,user-scalable=no,shrink-to-fit=yes" />
<style>
:root{
/* Default-Werte – werden per JS überschrieben */
--circle-size-px: 176px;
--circle-top-px: 40px;
--gap-under-circle: 18px;
--wordmark-min: 200px;
--wordmark-max: 420px;
--progress-height: 14px;
--accent-orange: #F36E21;
}
html, body {
background: linear-gradient(180deg, #14305D 0%, #0C1A2D 100%);
width: 100%; height: 100%;
margin: 0; padding: 0; overflow: visible;
}
/* Unity-Container wird per onResize positioniert (1:2 auf Desktop) */
#container {
position: absolute;
box-sizing: border-box;
background: transparent !important;
display: block;
}
#container canvas { position: absolute; }
/* Standardkonforme image-rendering-Werte */
#container canvas[data-pixel-art="true"] { image-rendering: pixelated; }
@media (hover: hover) and (pointer: fine) { #container { outline: 5px solid white; } }
@media (hover: none) and (pointer: coarse){ #container { outline: none; } }
/* Loading-Overlay (mit Logo, Wortmarke, Progress) */
#loading{
position: absolute; inset: 0;
z-index:10; pointer-events:none; transition:opacity .35s ease;
}
#loading.hidden{ opacity:0; }
/* NEU: initial komplett aus dem Viewport schieben, damit nichts kurz oben links flackert */
#loading.preinit{
visibility: hidden; /* sicherheitshalber unsichtbar */
transform: translate(-300vw,-300vh);/* sehr weit off-screen */
}
/* Schwarzer Vorhang für die Überblende */
#blackout{
position:absolute; inset:0; background:#000;
opacity:0; pointer-events:none; z-index:20; /* über dem Loader */
transition: opacity .18s ease; /* erster Sprung: schnell zu Schwarz */
}
/* Kreis-Box */
.brand-mark{
position: absolute;
left: 50%;
top: var(--circle-top-px, 40px); /* Fallbacks für Linter/DevTools */
transform: translateX(-50%);
width: var(--circle-size-px, 176px);
height: var(--circle-size-px, 176px);
border-radius: 50%;
background: #fff;
display: grid; place-items: center;
overflow: hidden;
box-shadow: 0 10px 30px rgba(0,0,0,.18);
}
/* Innen-Logo: 5% kleiner, zentriert */
.brand-mark img{
width: 95%;
height: 95%;
object-fit: contain;
display: block;
}
/* Bereich unterhalb des Kreises */
.below{
position: absolute;
left: 0; width: 100%;
top: calc(
var(--circle-top-px, 40px)
+ var(--circle-size-px, 176px)
+ var(--gap-under-circle, 18px)
);
display: flex; flex-direction: column; align-items: center;
}
.wordmark{
width: clamp(var(--wordmark-min, 200px), 60%, var(--wordmark-max, 420px));
height:auto; display:block;
filter: drop-shadow(0 6px 18px rgba(0,0,0,.25));
}
.progress{
width: clamp(220px, 70%, 380px);
height: var(--progress-height, 14px);
background:#fff; border-radius:8px; overflow:hidden;
box-shadow: 0 6px 18px rgba(0,0,0,.25);
margin-top: 20px;
}
.progress__fill{
width:0%; height:100%; background:var(--accent-orange, #F36E21);
border-radius:8px 0 0 8px; transition: width .2s ease;
}
/* Bewegungen reduzieren, wenn Systempräferenz aktiv ist */
@media (prefers-reduced-motion: reduce){
#loading{ transition:none; }
#blackout{ transition:none; }
.progress__fill{ transition:none; }
}
</style>
</head>
<body>
<div id="container">
<!-- Ladebild -->
<div id="loading" class="preinit" role="status" aria-live="polite" aria-label="Ladevorgang">
<!-- Kreis + Innenlogo -->
<div class="brand-mark">
<img src="StreamingAssets/Kite_Logo_im_Kreis.png" alt="Kite-Logo" />
</div>
<!-- Unterhalb des Kreises: Wortmarke + Progress -->
<div class="below">
<img class="wordmark" src="StreamingAssets/kite_logo_ohne_II.png" alt="kite Wortmarke" />
<div class="progress" aria-hidden="true">
<div id="progress-fill" class="progress__fill"></div>
</div>
</div>
</div>
<!-- Schwarzer Vorhang für die Überblende -->
<div id="blackout" aria-hidden="true"></div>
<canvas id="game-canvas" data-pixel-art="false"></canvas>
<!-- Unity ersetzt die Platzhalter beim Build -->
<script>
window.KITE_CONFIG = {
passphrase: "KITE_PASSPHRASE_PLACEHOLDER"
};
</script>
<!-- Unity ersetzt die Platzhalter beim Build -->
<script src="Build/KiteWeb.loader.js"></script>
<script>
var canvas = document.querySelector("#game-canvas");
var config = {
dataUrl: "Build/KiteWeb.data",
frameworkUrl: "Build/KiteWeb.framework.js",
codeUrl: "Build/KiteWeb.wasm",
streamingAssetsUrl: "StreamingAssets",
companyName: "Hochschule Heilbronn",
productName: "Kite 2",
productVersion: "1.6.1",
autoSyncPersistentDataPath: true
};
const root = document.documentElement;
const fillEl = document.getElementById("progress-fill");
const loadingEl = document.getElementById("loading");
const blackout = document.getElementById("blackout");
let revealed = false;
function revealLoader(){
if (revealed) return;
// Klasse entfernen NACHDEM Maße gesetzt wurden
loadingEl.classList.remove('preinit');
loadingEl.style.visibility = 'visible';
revealed = true;
}
function progressHandler(progress){
const pct = Math.max(0, Math.min(100, Math.round(progress*100)));
fillEl.style.width = pct + "%";
if (pct >= 100 || progress >= 0.999){
// 1) Schnell zu Schwarz blenden (über dem Loader)
blackout.style.opacity = 1; // nutzt .18s ease (CSS)
// 2) Sobald schwarz: Loader unter dem Vorhang ausblenden
setTimeout(()=>{ loadingEl.classList.add("hidden"); }, 180);
// 3) Kurz schwarz stehen lassen, dann den Vorhang langsam aufziehen
setTimeout(()=>{
blackout.style.transition = "opacity .40s ease";
blackout.style.opacity = 0;
}, 180 + 120); // 120ms Standzeit in Schwarz
// 4) Aufräumen
setTimeout(()=>{
loadingEl.remove();
blackout.remove();
}, 180 + 120 + 450);
}
}
/* Container berechnen & CSS-Variablen setzen (26,7% Höhe, Topkante 20,6%) */
function onResize(){
var container = canvas.parentElement;
var isDesktop = matchMedia("(hover: hover) and (pointer: fine)").matches;
var w,h,left,top;
if(isDesktop){
var vw = innerWidth, vh = innerHeight;
h = vh; w = Math.floor(h/2);
if (w > vw){ w = vw; h = Math.floor(w*2); }
left = Math.floor((vw - w)/2); top = 0;
}else{
var vv = visualViewport || { width: innerWidth, height: innerHeight, offsetLeft:0, offsetTop:0 };
w = vv.width; h = vv.height; left = vv.offsetLeft; top = vv.offsetTop;
}
container.style.width = w+"px"; container.style.height = h+"px";
container.style.left = left+"px"; container.style.top = top+"px";
canvas.style.width = w+"px"; canvas.style.height = h+"px";
// 26,7% und 20,6% der Containerhöhe
root.style.setProperty("--circle-size-px", (h * 0.267) + "px");
root.style.setProperty("--circle-top-px", (h * 0.206) + "px");
// Jetzt, wo alles positioniert ist, das Overlay ins Bild holen
// per rAF sicherstellen, dass Layout angewandt wurde
requestAnimationFrame(revealLoader);
}
createUnityInstance(canvas, config, progressHandler).then(function(instance){
canvas = instance.Module.canvas;
onResize();
});
addEventListener("resize", onResize);
onResize();
// Zusatz-Viewport-Meta
const meta = document.createElement("meta");
meta.name = "viewport";
meta.content = "width=device-width, height=device-height, initial-scale=1.0, user-scalable=no, shrink-to-fit=yes";
document.head.appendChild(meta);
function logMessage(m){ console.log(m); }
</script>
</div>
</body>
</html>