-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathviewer.html
More file actions
111 lines (96 loc) · 2.87 KB
/
Copy pathviewer.html
File metadata and controls
111 lines (96 loc) · 2.87 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
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>SmartSplat Image Viewer</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="icon" type="image/x-icon" href="image_gaussians/icon.png">
<link rel="stylesheet" href="https://unpkg.com/normalize.css@8/normalize.css">
<style>
body {
margin: 0;
padding: 0;
width: 100vw;
height: 100vh;
overflow: hidden;
background-color: #0e0e0e;
color: #f0f0f0;
font-family: "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}
canvas {
width: 100%;
height: 100%;
display: block;
}
#loading, #error {
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
text-align: center;
z-index: 10;
}
#loading .spinner {
width: 60px;
height: 60px;
border: 6px solid rgba(255, 255, 255, 0.1);
border-top: 6px solid #00bfff;
border-radius: 50%;
animation: spin 1s linear infinite;
margin: 0 auto 20px auto;
}
#loading p {
font-size: 1.2rem;
color: #aaa;
}
@keyframes spin {
0% { transform: rotate(0deg); }
100% { transform: rotate(360deg); }
}
#error h1 {
font-size: 2rem;
color: #ff4c4c;
margin-bottom: 10px;
}
#error p {
font-size: 1rem;
color: #ccc;
max-width: 400px;
margin: 0 auto;
}
#error {
display: none;
padding: 20px;
border: 1px solid #ff4c4c;
border-radius: 10px;
background: rgba(255, 0, 0, 0.05);
}
</style>
</head>
<body>
<canvas id="canvas"></canvas>
<div id="loading">
<div class="spinner"></div>
<p>Loading SmartSplat Viewer...</p>
</div>
<div id="error">
<h1>⚠ Network Error</h1>
<p id="error_msg">An unexpected error occurred while loading the viewer.</p>
</div>
<script type="module">
import init, { WebHandle } from "./gauss_img.js";
try {
await init();
const canvas = document.getElementById("canvas");
const handle = new WebHandle();
await handle.start(canvas);
document.getElementById("loading").style.display = "none";
} catch (e) {
console.error(e);
document.getElementById("loading").style.display = "none";
document.getElementById("error_msg").innerText = e;
document.getElementById("error").style.display = "block";
}
</script>
</body>
</html>