|
1 | 1 | <!DOCTYPE html>
|
2 |
| -<!-- The version of index.html that will be served by app.rerun.io --> |
| 2 | +<!-- Rerun SDK-bundled web viewer. --> |
3 | 3 | <html>
|
4 | 4 | <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
5 | 5 |
|
|
146 | 146 | <!-- The Wasm code will resize the canvas dynamically -->
|
147 | 147 | <canvas id="the_canvas_id" class="hidden"></canvas>
|
148 | 148 |
|
149 |
| - <script |
150 |
| - src="https://fifteen-thirtyeight.rerun.io/script.js" |
151 |
| - data-site="QKMCQFTQ" |
152 |
| - defer |
153 |
| - ></script> |
154 |
| - |
155 | 149 | <script>
|
156 | 150 | // The `--no-modules`-generated JS from `wasm-bindgen` attempts to use
|
157 | 151 | // `WebAssembly.instantiateStreaming` to instantiate the wasm module,
|
|
169 | 163 | <script src="re_viewer.js"></script>
|
170 | 164 |
|
171 | 165 | <script>
|
| 166 | + if (window.location.hostname == "app.rerun.io") { |
| 167 | + const script = document.createElement("script"); |
| 168 | + script.src = "https://fifteen-thirtyeight.rerun.io/script.js"; |
| 169 | + script.dataset.site = "QKMCQFTQ"; |
| 170 | + script.defer = true; |
| 171 | + document.body.appendChild(script); |
| 172 | + } |
| 173 | + |
172 | 174 | function show_center_html(html) {
|
173 | 175 | center_text_elem = document.getElementById("center_text");
|
174 | 176 | center_text_elem.innerHTML = html;
|
|
199 | 201 | )
|
200 | 202 | ) {
|
201 | 203 | show_center_html(`
|
202 |
| - <p> |
203 |
| - Rerun is not yet supported on mobile browsers. |
204 |
| - </p> |
205 |
| - <p> |
206 |
| - <a class="button" href="#" id="try_anyways">Try anyways</a> |
207 |
| - </p>`); |
| 204 | + <p> |
| 205 | + Rerun is not yet supported on mobile browsers. |
| 206 | + </p> |
| 207 | + <p> |
| 208 | + <a class="button" href="#" id="try_anyways">Try anyways</a> |
| 209 | + </p> |
| 210 | + `); |
208 | 211 | document
|
209 | 212 | .querySelector("#try_anyways")
|
210 | 213 | .addEventListener("click", function (event) {
|
|
312 | 315 | "`navigator.gpu` is undefined. This indicates lack of WebGPU support.",
|
313 | 316 | );
|
314 | 317 | show_center_html(`
|
315 |
| - <p class="strong"> |
316 |
| - Missing WebGPU support. |
317 |
| - </p> |
318 |
| - <p class="subdued"> |
319 |
| - This version of Rerun requires WebGPU support which is not available in your browser. |
320 |
| - Either try a different browser or use the WebGL version of Rerun. |
321 |
| - </p>`); |
| 318 | + <p class="strong"> |
| 319 | + Missing WebGPU support. |
| 320 | + </p> |
| 321 | + <p class="subdued"> |
| 322 | + This version of Rerun requires WebGPU support which is not available in your browser. |
| 323 | + Either try a different browser or use the WebGL version of Rerun. |
| 324 | + </p> |
| 325 | + `); |
322 | 326 | return;
|
323 | 327 | }
|
324 | 328 |
|
|
333 | 337 | document.getElementById("the_canvas_id").remove();
|
334 | 338 |
|
335 | 339 | show_center_html(`
|
336 |
| - <p class="strong"> |
337 |
| - Rerun has crashed. |
338 |
| - </p> |
339 |
| - <pre align="left">${handle.panic_message()}</pre> |
340 |
| - <p> |
341 |
| - See the console for details. |
342 |
| - </p> |
343 |
| - <p> |
344 |
| - Reload the page to try again. |
345 |
| - </p>`); |
| 340 | + <p class="strong"> |
| 341 | + Rerun has crashed. |
| 342 | + </p> |
| 343 | + <pre align="left">${handle.panic_message()}</pre> |
| 344 | + <p> |
| 345 | + See the console for details. |
| 346 | + </p> |
| 347 | + <p> |
| 348 | + Reload the page to try again. |
| 349 | + </p> |
| 350 | + `); |
346 | 351 | } else {
|
347 | 352 | let delay_ms = 1000;
|
348 | 353 | setTimeout(check_for_panic, delay_ms);
|
|
381 | 386 |
|
382 | 387 | hide_canvas();
|
383 | 388 | show_center_html(`
|
384 |
| - <p> |
385 |
| - An error occurred during loading: |
386 |
| - </p> |
387 |
| - <p style="font-family:Courier New"> |
388 |
| - ${error} |
389 |
| - </p> |
390 |
| - <p style="font-size:14px"> |
391 |
| - Make sure you use a modern browser with ${render_backend_name} and Wasm enabled. |
392 |
| - </p>`); |
| 389 | + <p> |
| 390 | + An error occurred during loading: |
| 391 | + </p> |
| 392 | + <p style="font-family:Courier New"> |
| 393 | + ${error} |
| 394 | + </p> |
| 395 | + <p style="font-size:14px"> |
| 396 | + Make sure you use a modern browser with ${render_backend_name} and Wasm enabled. |
| 397 | + </p> |
| 398 | + `); |
393 | 399 | }
|
394 | 400 | </script>
|
395 | 401 | </body>
|
|
0 commit comments