forked from tari-project/universe
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
209 lines (186 loc) · 7.28 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
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<link rel="icon" type="image/svg+xml" href="/tari.svg" />
<!-- Preload Poppins fonts -->
<link rel="preload" href="/assets/fonts/Poppins/Poppins-Regular.woff2" as="font" type="font/woff2" crossorigin />
<link rel="preload" href="/assets/fonts/Poppins/Poppins-Medium.woff2" as="font" type="font/woff2" crossorigin />
<link rel="preload" href="/assets/fonts/Poppins/Poppins-SemiBold.woff2" as="font" type="font/woff2" crossorigin />
<link rel="preload" href="/assets/fonts/Poppins/Poppins-Bold.woff2" as="font" type="font/woff2" crossorigin />
<!-- Preload Druk fonts -->
<link rel="preload" href="/assets/fonts/Druk/DrukLCG-Bold.woff2" as="font" type="font/woff2" crossorigin />
<link rel="preload" href="/assets/fonts/Druk/DrukWideLCG-Bold.woff2" as="font" type="font/woff2" crossorigin />
<!-- Preload IBM Plex Mono fonts -->
<link rel="preload" href="/assets/fonts/IBMPlexMono/IBMPlexMono-Regular.woff2" as="font" type="font/woff2" crossorigin />
<link rel="preload" href="/assets/fonts/IBMPlexMono/IBMPlexMono-Medium.woff2" as="font" type="font/woff2" crossorigin />
<link rel="preload" href="/assets/fonts/IBMPlexMono/IBMPlexMono-SemiBold.woff2" as="font" type="font/woff2" crossorigin />
<link rel="preload" href="/assets/fonts/IBMPlexMono/IBMPlexMono-Bold.woff2" as="font" type="font/woff2" crossorigin />
<script type="module" crossorigin src="/assets/glApp.js"></script>
<title>Tari Universe | Testnet</title>
<style>
/* Poppins Font Faces */
@font-face {
font-family: "Poppins";
font-weight: 400;
font-style: normal;
src:
url("/assets/fonts/Poppins/Poppins-Regular.woff2") format("woff2"),
url("/assets/fonts/Poppins/Poppins-Regular.woff") format("woff"),
url("/assets/fonts/Poppins/Poppins-Regular.ttf") format("truetype");
font-display: swap;
}
@font-face {
font-family: "Poppins";
font-weight: 500;
font-style: normal;
src:
url("/assets/fonts/Poppins/Poppins-Medium.woff2") format("woff2"),
url("/assets/fonts/Poppins/Poppins-Medium.woff") format("woff"),
url("/assets/fonts/Poppins/Poppins-Medium.ttf") format("truetype");
font-display: swap;
}
@font-face {
font-family: "Poppins";
font-weight: 600;
font-style: normal;
src:
url("/assets/fonts/Poppins/Poppins-SemiBold.woff2") format("woff2"),
url("/assets/fonts/Poppins/Poppins-SemiBold.woff") format("woff"),
url("/assets/fonts/Poppins/Poppins-SemiBold.ttf") format("truetype");
font-display: swap;
}
@font-face {
font-family: "Poppins";
font-weight: 700;
font-style: normal;
src:
url("/assets/fonts/Poppins/Poppins-Bold.woff2") format("woff2"),
url("/assets/fonts/Poppins/Poppins-Bold.woff") format("woff"),
url("/assets/fonts/Poppins/Poppins-Bold.ttf") format("truetype");
font-display: swap;
}
/* Druk Font Faces */
@font-face {
font-family: "Druk";
src:
url("/assets/fonts/Druk/DrukLCG-Bold.woff2") format("woff2"),
url("/assets/fonts/Druk/DrukLCG-Bold.woff") format("woff"),
url("/assets/fonts/Druk/DrukLCG-Bold.ttf") format("truetype");
font-weight: 700;
font-style: normal;
font-display: swap;
}
@font-face {
font-family: "DrukWide";
src:
url("/assets/fonts/Druk/DrukWideLCG-Bold.woff2") format("woff2"),
url("/assets/fonts/Druk/DrukWideLCG-Bold.woff") format("woff"),
url("/assets/fonts/Druk/DrukWideLCG-Bold.ttf") format("truetype");
font-weight: 800;
font-style: normal;
font-display: swap;
}
/* IBM Plex Mono Fonts */
@font-face {
font-family: "IBM Plex Mono";
src: url("/assets/fonts/IBMPlexMono/IBMPlexMono-Regular.woff2") format("woff2"),
url("/assets/fonts/IBMPlexMono/IBMPlexMono-Regular.woff") format("woff"),
url("/assets/fonts/IBMPlexMono/IBMPlexMono-Regular.ttf") format("truetype");
font-weight: 400;
font-style: normal;
font-display: swap;
}
@font-face {
font-family: "IBM Plex Mono";
src: url("/assets/fonts/IBMPlexMono/IBMPlexMono-Medium.woff2") format("woff2"),
url("/assets/fonts/IBMPlexMono/IBMPlexMono-Medium.woff") format("woff"),
url("/assets/fonts/IBMPlexMono/IBMPlexMono-Medium.ttf") format("truetype");
font-weight: 500;
font-style: normal;
font-display: swap;
}
@font-face {
font-family: "IBM Plex Mono";
src: url("/assets/fonts/IBMPlexMono/IBMPlexMono-SemiBold.woff2") format("woff2"),
url("/assets/fonts/IBMPlexMono/IBMPlexMono-SemiBold.woff") format("woff"),
url("/assets/fonts/IBMPlexMono/IBMPlexMono-SemiBold.ttf") format("truetype");
font-weight: 600;
font-style: normal;
font-display: swap;
}
@font-face {
font-family: "IBM Plex Mono";
src: url("/assets/fonts/IBMPlexMono/IBMPlexMono-Bold.woff2") format("woff2"),
url("/assets/fonts/IBMPlexMono/IBMPlexMono-Bold.woff") format("woff"),
url("/assets/fonts/IBMPlexMono/IBMPlexMono-Bold.ttf") format("truetype");
font-weight: 700;
font-style: normal;
font-display: swap;
}
/* Existing styles */
body,
main,
#root {
padding: 0;
margin: 0;
}
#canvas {
position: absolute;
pointer-events: auto;
}
</style>
</head>
<body>
<main>
<canvas id="canvas"></canvas>
<div id="root"></div>
<script type="module" src="src/main.tsx"></script>
<script>
let time;
function preload() {
glApp.preload(
{
canvas: document.getElementById('canvas'),
orbitTarget: document.getElementById('canvas'),
ASSETS_PATH: '/assets/',
},
() => {
init();
},
);
}
function init() {
glApp.init();
time = performance.now() / 1000;
window.addEventListener('resize', onResize);
onResize();
animate();
}
function animate() {
requestAnimationFrame(animate);
let newTime = performance.now() / 1000;
let dt = newTime - time;
time = newTime;
update(dt);
}
function update(dt) {
glApp.render(dt);
}
function onResize() {
const sidebarOffset = 348 + 20; // sidebar + padding
glApp.properties.cameraOffsetX = sidebarOffset / window.innerWidth;
glApp.setSize(window.innerWidth, window.innerHeight);
}
document.addEventListener('DOMContentLoaded', () => {
if (!window.WebGL2RenderingContext && !window.WebGLRenderingContext) {
console.error('WebGL not supported!');
return;
}
preload();
});
</script>
</main>
</body>
</html>