/
index.html
259 lines (228 loc) · 9.95 KB
/
index.html
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
<!DOCTYPE html>
<html lang="en" dir="ltr">
<head itemscope itemtype="https://schema.org/WebPage">
<title>abandoned.ai - Never say goodbye</title>
<!-- Link Card Preview metadata -->
<meta name="description" content="A 3D Digital archive of abandoned spaces made using machine learning." />
<meta itemprop="name" content="abandoned.ai | Never say goodbye" />
<meta itemprop="description"
content="A 3D Digital archive of abandoned spaces made using machine learning. Explorable in the browser or Virtual Reality clients." />
<meta itemprop="image" content="/images/previews/square.png" />
<link rel="alternate" type="application/json+oembed" href="https://abandoned.ai/oembed_link.json"
title="abandoned.ai" />
<meta property="og:type" content="website">
<meta property="og:url" content="https://abandoned.ai/">
<meta property="og:title" content="abandoned.ai | Never say goodbye">
<meta property="og:description"
content="A 3D Digital archive of abandoned spaces made using machine learning. Explorable in the browser or Virtual Reality clients.">
<meta property="og:image" content="https://abandoned.ai/images/previews/square.png">
<!-- Performance and compatability metadata -->
<meta charset="utf-8" />
<!-- TODO: convert to actual application-->
<!-- <link rel="manifest" href="/manifest.json"> -->
<!-- Actual application CDN code -->
<script src="https://aframe.io/releases/1.5.0/aframe.min.js"></script>
<script src="https://quadjr.github.io/aframe-gaussian-splatting/index.js"></script>
<script src="https://unpkg.com/aframe-orbit-controls@1.3.2/dist/aframe-orbit-controls.min.js"></script>
<!-- explicitly set favicon last to prevent it from being overwritten by Aframe -->
<link rel="icon" href="favicon.ico" type="image/x-icon" />
<style>
@import url('https://fonts.googleapis.com/css2?family=Nova+Square&family=Texturina:ital,opsz@0,12..72;1,12..72&display=swap');
body {
overflow: hidden;
margin: 0;
height: 100vh;
width: 100vw;
font-family: 'Texturina', serif;
background: black;
text-shadow: 0 0 3px black;
}
a,
body {
color: white;
}
#info {
z-index: 100;
position: absolute;
top: 10px;
left: 15px;
}
h3 {
margin: 5px 0;
}
h1 {
font-family: 'Nova Square', sans-serif;
}
p {
margin: 5px 0;
font-size: small;
}
details {
font-size: small;
}
#progress {
position: absolute;
top: 0;
height: 5px;
background: blue;
z-index: 99;
transition: width 0.1s ease-in-out;
}
#logo {
display: none;
filter: drop-shadow(0 0 6.75rem black) saturate(200%);
pointer-events: none;
width: 100vw;
height: 100vh;
position: fixed;
}
input {
width: 250px;
height: 40px;
line-height: 40px;
position: absolute;
bottom: 35px;
left: calc(50% - 125px);
background: none;
color: white;
font-size: 30px;
font-family: arial;
text-align: center;
border: 1px solid white;
background: rgba(255, 255, 255, 0.2);
}
#instructions {
background: rgba(0, 0, 0, 0.6);
white-space: pre-wrap;
padding: 10px;
border-radius: 10px;
font-size: x-small;
}
body.nohf .nohf {
display: none;
}
body.nohf #progress,
body.nohf .cube-face {
background: #ff9d0d;
}
</style>
</head>
<body>
<script>
if (location.host.includes('hf.space')) document.body.classList.add('nohf');
</script>
<div id="info">
<canvas id="logo"></canvas>
<h1 class="nohf" id="copy">abandoned.ai</h1>
<h2 class="nohf">Never say goodbye</h2>
<p>For more information, visit <a href="https://abandoned.zone/">abandoned.zone</a></p>
<hr>
<p><strong>Current space:</strong> <em>(reload to change)</em></p>
</div>
<!-- We use orbit controls so there is no need for device orientation permissions on mobile -->
<a-scene device-orientation-permission-ui="enabled: false" renderer="antialias: false">
<a-entity id="gs" gaussian_splatting="" rotation="" position="" xrPixelRatio=""></a-entity>
<a-entity id="os" camera look-controls="enabled: false" orbit-controls=""></a-entity>
</a-scene>
<script>
let dev = false;
// Embed a JSON of multiple splats
let directory = [
{
"name": "Examination Room 2",
"building": "7",
"floor": "3",
"site": "Kings Park Psychiatric Center",
"files": {
"high_res": {
"local_dev_uri": "./local_symlinks/building7_floor3_examroom_kppc-full.splat",
"cdn_url": "https://aband.in/building7_floor3_examroom_kppc-full.splat"
},
"low_res": {
"local_dev_uri": "./local_symlinks/building7_floor3_examroom_kppc-compressed.splat",
"cdn_url": "https://aband.in/building7_floor3_examroom_kppc-compressed.splat"
}
},
"a_frame_gaussian_splatting": {
"rotation": "95 15 0",
"position": "0 1.4 -0.4",
"xrPixelRatio": "0.5"
},
"a_frame_orbit_controls": "target: 0.15 1.48 -0.4; minDistance: 0.3; maxDistance: 0.9; initialPosition: 0.15 1.48 -0.38; rotateSpeed: 0.5; autoRotate: true; autoRotateSpeed: -0.5"
},
{
"name": "Radiology Waiting Room",
"building": "7",
"floor": "4",
"site": "Kings Park Psychiatric Center",
"files": {
"high_res": {
"local_dev_uri": "./local_symlinks/building7_floor4_radiologyWaiting_kppc-full.splat",
"cdn_url": "https://aband.in/building7_floor4_radiologyWaiting_kppc-full.splat"
},
"low_res": {
"local_dev_uri": "./local_symlinks/building7_floor4_radiologyWaiting_kppc-compressed.splat",
"cdn_url": "https://aband.in/building7_floor4_radiologyWaiting_kppc-compressed.splat"
}
},
"a_frame_gaussian_splatting": {
"rotation": "0 0 0",
"position": "1 0.6 -1.1",
"xrPixelRatio": "0.5"
},
"a_frame_orbit_controls": "target: -0.5 1.5 -0.1; minDistance: 0.3; maxDistance: 1.4; initialPosition: 0.15 1.48 -0.38; rotateSpeed: 0.5; autoRotate: true; autoRotateSpeed: -0.5"
}
]
// Change the splat file each time on reload
let currentIndex = localStorage.getItem("currentIndex") || 0;
currentIndex = (parseInt(currentIndex) + 1) % directory.length;
localStorage.setItem("currentIndex", currentIndex);
let splat = directory[currentIndex];
// Give the user information about the splat being loaded:
var information_panel = document.getElementById("info");
info.appendChild(document.createElement("p")).innerText = splat.name;
info.appendChild(document.createElement("p")).innerText = "Building " + splat.building + " | Floor " + splat.floor;
info.appendChild(document.createElement("p")).innerText = splat.site;
// Setup universal properties
var g_splat = document.getElementById("gs");
var o_controls = document.getElementById("os");
g_splat.setAttribute("rotation", splat.a_frame_gaussian_splatting.rotation);
g_splat.setAttribute("position", splat.a_frame_gaussian_splatting.position);
g_splat.setAttribute("xrPixelRatio", splat.a_frame_gaussian_splatting.xrPixelRatio);
o_controls.setAttribute("orbit-controls", splat.a_frame_orbit_controls);
if (navigator.maxTouchPoints === 0) {
// Load higher rez splat on desktop
g_splat.setAttribute("gaussian_splatting", "src: " + (dev ? splat.files.high_res.local_dev_uri : splat.files.high_res.cdn_url) + ";");
// Only load the fancy title animation on desktop please
var logoCanvas = document.getElementById("logo");
logoCanvas.style.display = "block";
document.write('<script src="./title_animation.js"><\/script>');
}
else {
// Locate and load decimated splat on mobile
g_splat.setAttribute("gaussian_splatting", "src: " + (dev ? splat.files.low_res.local_dev_uri : splat.files.low_res.cdn_url) + ";");
}
</script>
<!-- Script to monitor if the performance drops to remove superfluous elements (Title Animation) -->
<script>
var logoCanvas = document.getElementById("logo");
var startTime = null;
var frameCount = 0;
function monitorPerformance(timestamp) {
if (!startTime) startTime = timestamp;
var elapsedTime = timestamp - startTime;
frameCount++;
if (elapsedTime >= 5000) {
var averageFramerate = frameCount / (elapsedTime / 1000);
if (averageFramerate < 10) {
logoCanvas.parentNode.removeChild(logoCanvas);
}
startTime = null;
frameCount = 0;
}
window.requestAnimationFrame(monitorPerformance);
}
window.requestAnimationFrame(monitorPerformance);
</script>
</body>
</html>