-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
60 lines (59 loc) · 2.61 KB
/
Copy pathindex.html
File metadata and controls
60 lines (59 loc) · 2.61 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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no, viewport-fit=cover" />
<title>Rat Runner</title>
<style>
html, body { margin: 0; height: 100%; overflow: hidden; background: #111; overscroll-behavior: none; }
canvas { display: block; touch-action: none; }
#hud {
position: fixed; top: 12px; left: 12px; color: #ddd;
font: 13px/1.5 system-ui, sans-serif;
background: rgba(0,0,0,.45); padding: 10px 14px; border-radius: 8px;
pointer-events: none; user-select: none;
}
#hud b { color: #fff; }
#overlay {
position: fixed; inset: 0; display: flex; align-items: center; justify-content: center;
color: #fff; font: 16px system-ui, sans-serif; background: rgba(0,0,0,.55);
cursor: pointer;
}
#overlay.hidden { display: none; }
#gyroBtn {
position: fixed; top: 12px; right: 12px; z-index: 10; display: none;
color: #fff; font: 13px system-ui, sans-serif;
background: rgba(0,0,0,.45); border: 1px solid rgba(255,255,255,.25);
padding: 10px 14px; border-radius: 8px;
-webkit-tap-highlight-color: transparent;
}
#gyroBtn.on { background: rgba(70,130,60,.65); border-color: rgba(140,220,120,.5); }
#stick, #nub { position: fixed; border-radius: 50%; display: none; pointer-events: none; z-index: 5; }
#stick { width: 120px; height: 120px; border: 2px solid rgba(255,255,255,.35); background: rgba(255,255,255,.08); }
#nub { width: 52px; height: 52px; background: rgba(255,255,255,.45); z-index: 6; }
</style>
</head>
<body>
<div id="hud">
<b>WASD / Arrows</b> move · <b>Shift</b> run · <b>Mouse</b> look · <b>Scroll</b> zoom · <b>V</b> wireframe
<div id="fps" style="opacity:.85"></div>
<div id="status" style="opacity:.7"></div>
</div>
<div id="overlay">Click to play (locks mouse for camera control)</div>
<button id="gyroBtn">Gyro off</button>
<div id="stick"></div>
<div id="nub"></div>
<script type="importmap">
{
"imports": {
"three": "https://cdn.jsdelivr.net/npm/three@0.166.1/build/three.module.js",
"three/addons/": "https://cdn.jsdelivr.net/npm/three@0.166.1/examples/jsm/",
"three/examples/jsm/": "https://cdn.jsdelivr.net/npm/three@0.166.1/examples/jsm/",
"postprocessing": "https://cdn.jsdelivr.net/npm/postprocessing@6.36.4/build/index.js",
"n8ao": "https://cdn.jsdelivr.net/npm/n8ao@1.9.4/dist/N8AO.js"
}
}
</script>
<script type="module" src="main.js"></script>
</body>
</html>