2025-10-12 19:31:14 -04:00
|
|
|
<!DOCTYPE html>
|
|
|
|
|
<html lang="en">
|
|
|
|
|
|
|
|
|
|
<head>
|
|
|
|
|
<meta charset="UTF-8">
|
|
|
|
|
<title>Kiri:Moto (loading)</title>
|
|
|
|
|
<style>
|
|
|
|
|
body {
|
|
|
|
|
top: 0;
|
|
|
|
|
left: 0;
|
|
|
|
|
right: 0;
|
|
|
|
|
bottom: 0;
|
|
|
|
|
display: flex;
|
|
|
|
|
position: fixed;
|
|
|
|
|
align-items: center;
|
|
|
|
|
flex-direction: column;
|
|
|
|
|
justify-content: center;
|
|
|
|
|
font-family: sans-serif;
|
|
|
|
|
font-weight: bold;
|
|
|
|
|
}
|
2026-02-01 11:09:34 -05:00
|
|
|
#progress {
|
|
|
|
|
margin-top: 20px;
|
|
|
|
|
width: 300px;
|
|
|
|
|
height: 20px;
|
|
|
|
|
border: 1px solid black;
|
|
|
|
|
border-radius: 10px;
|
|
|
|
|
background-color: white;
|
|
|
|
|
overflow: hidden;
|
|
|
|
|
}
|
|
|
|
|
#bar {
|
|
|
|
|
background-color: #555;
|
|
|
|
|
height: 20px;
|
|
|
|
|
width: 0%;
|
|
|
|
|
}
|
2025-10-12 19:31:14 -04:00
|
|
|
</style>
|
2025-10-12 20:22:53 -04:00
|
|
|
<script type="module">
|
|
|
|
|
import { version } from '/lib/moto/license.js';
|
2025-10-12 19:31:14 -04:00
|
|
|
(async () => {
|
|
|
|
|
const reg = await navigator.serviceWorker.register('/boot/service.js', { scope: '/' });
|
|
|
|
|
await reg.update();
|
|
|
|
|
await navigator.serviceWorker.ready;
|
|
|
|
|
|
|
|
|
|
if (!navigator.serviceWorker.controller) {
|
|
|
|
|
console.log('No controller → reloading under SW control');
|
|
|
|
|
location.reload();
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
2025-10-13 11:45:14 -04:00
|
|
|
// turn url params into key/value map
|
|
|
|
|
const map = Object.fromEntries(
|
|
|
|
|
(location.search || location.hash).slice(1).split('&')
|
|
|
|
|
.map(v => v.split('='))
|
|
|
|
|
.map(([k, v = true]) => [k, v])
|
|
|
|
|
);
|
|
|
|
|
if (map.debug) {
|
|
|
|
|
console.log({ map });
|
|
|
|
|
}
|
|
|
|
|
|
2025-10-12 19:31:14 -04:00
|
|
|
navigator.serviceWorker.controller.postMessage({
|
2025-12-06 00:09:17 -05:00
|
|
|
mode: map.mode,
|
2025-10-13 11:45:14 -04:00
|
|
|
clear: map.clear,
|
|
|
|
|
disable: map.disable,
|
|
|
|
|
version: map.version || version
|
2025-10-12 19:31:14 -04:00
|
|
|
});
|
|
|
|
|
|
2026-02-01 11:09:34 -05:00
|
|
|
const bar = document.getElementById('bar');
|
|
|
|
|
|
2025-10-12 19:31:14 -04:00
|
|
|
navigator.serviceWorker.addEventListener('message', e => {
|
2026-02-01 11:09:34 -05:00
|
|
|
let { data } = e;
|
|
|
|
|
if (data.progress) {
|
|
|
|
|
bar.style.width = `${(data.progress * 100)|0}%`;
|
|
|
|
|
return;
|
|
|
|
|
} else {
|
|
|
|
|
console.log('[SM]', data);
|
|
|
|
|
}
|
|
|
|
|
setTimeout(() => {
|
|
|
|
|
bar.style.width = `100%`;
|
|
|
|
|
if (map.mesh) {
|
2025-10-13 11:45:14 -04:00
|
|
|
location.replace('/mesh/index.html');
|
|
|
|
|
} else {
|
|
|
|
|
location.replace('/kiri/index.html');
|
|
|
|
|
}
|
|
|
|
|
}, map.delay || 10);
|
2025-10-12 19:31:14 -04:00
|
|
|
});
|
|
|
|
|
})();
|
|
|
|
|
</script>
|
|
|
|
|
</head>
|
|
|
|
|
|
2026-02-01 11:09:34 -05:00
|
|
|
<body>
|
|
|
|
|
<div>Installing Grid.Space</div>
|
|
|
|
|
<div id="progress">
|
|
|
|
|
<div id="bar"></div>
|
|
|
|
|
</div>
|
|
|
|
|
</body>
|
2025-10-12 19:31:14 -04:00
|
|
|
|
|
|
|
|
</html>
|