Files
breeze/src/web_shell.html
T
2026-06-18 01:11:15 -03:00

177 lines
5.9 KiB
HTML

<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, viewport-fit=cover">
<title>Inner Breeze</title>
<meta property="og:type" content="website">
<meta property="og:url" content="https://inbe.waozi.xyz/">
<meta property="og:title" content="Inner Breeze">
<meta property="og:description" content="guided breathing, meditation, and habit tracking">
<meta property="og:image" content="https://inbe.waozi.xyz/og.jpg">
<meta name="twitter:card" content="summary_large_image">
<meta name="twitter:url" content="https://inbe.waozi.xyz/">
<meta name="twitter:title" content="Inner Breeze">
<meta name="twitter:description" content="guided breathing, meditation, and habit tracking">
<meta name="twitter:image" content="https://inbe.waozi.xyz/og.jpg">
<meta name="twitter:site" content="@waozixyz">
<meta name="twitter:creator" content="@waozixyz">
<link rel="icon" type="image/png" sizes="32x32" href="/web-assets/icons/favicon-32x32.png">
<link rel="apple-touch-icon" href="/web-assets/icons/apple-touch-icon.png">
<link rel="manifest" href="/manifest.json">
<meta name="theme-color" content="#779999">
<style>
html, body {
height: 100%;
margin: 0;
overflow: hidden;
}
#status,
#progress {
display: none;
}
.canvas-stage {
width: 100%;
height: 100vh;
height: 100dvh;
display: flex;
align-items: center;
justify-content: center;
}
body {
background: #1a1a2e;
}
.canvas-frame {
width: 100vw;
height: 100vh;
height: 100dvh;
position: relative;
}
canvas.emscripten {
position: absolute;
inset: 0;
width: 100% !important;
height: 100% !important;
max-width: none !important;
max-height: none !important;
border: 0;
image-rendering: auto;
}
.canvas-frame:fullscreen,
.canvas-frame:-webkit-full-screen {
width: 100vw;
height: 100vh;
}
</style>
</head>
<body>
<div id="status">Downloading...</div>
<progress value="0" max="100" id="progress" hidden></progress>
<div class="canvas-stage">
<div class="canvas-frame" id="canvas-frame">
<canvas class="emscripten" id="canvas" width="320" height="560" oncontextmenu="event.preventDefault()" tabindex="-1"></canvas>
</div>
</div>
<script>
var statusElement = document.querySelector('#status');
var progressElement = document.querySelector('#progress');
var Module = {
preRun: [function() {
if (typeof FS === 'undefined' || typeof IDBFS === 'undefined') {
console.error('IDBFS unavailable');
return;
}
try {
FS.mkdir('/home');
} catch (e) {}
try {
FS.mount(IDBFS, { root: '/' }, '/home');
} catch (e) {
if (e.errno !== 10 && String(e).indexOf('already mounted') === -1) {
console.error('IDBFS mount failed:', e);
return;
}
}
addRunDependency('inbe-idbfs');
FS.syncfs(true, function(err) {
if (err) console.error('IDBFS init sync failed:', err);
else console.log('IDBFS initialized');
removeRunDependency('inbe-idbfs');
});
}],
postRun: [],
locateFile: function(path, prefix) {
if (path === 'index.wasm' || path === 'index.data') {
return prefix + path + '?v=WEB_CACHE_BUSTER';
}
return prefix + path;
},
print: function(text) {
if (arguments.length > 1) text = Array.prototype.slice.call(arguments).join(' ');
console.log(text);
},
printErr: function(text) {
if (arguments.length > 1) text = Array.prototype.slice.call(arguments).join(' ');
console.error(text);
},
canvas: (function() {
var canvas = document.querySelector('#canvas');
canvas.addEventListener('webglcontextlost', function(e) {
alert('WebGL context lost. Reload the page to continue.');
e.preventDefault();
}, false);
return canvas;
})(),
setStatus: function(text) {
if (!Module.setStatus.last) Module.setStatus.last = { time: Date.now(), text: '' };
if (text === Module.setStatus.last.text) return;
var match = text.match(/([^(]+)\((\d+(\.\d+)?)\/(\d+)\)/);
var now = Date.now();
if (match && now - Module.setStatus.last.time < 30) return;
Module.setStatus.last.time = now;
Module.setStatus.last.text = text;
if (match) {
statusElement.textContent = match[1];
progressElement.value = parseInt(match[2], 10) * 100;
progressElement.max = parseInt(match[4], 10) * 100;
progressElement.hidden = false;
} else {
statusElement.textContent = text;
progressElement.hidden = true;
if (!text) statusElement.style.display = 'none';
}
},
totalDependencies: 0,
monitorRunDependencies: function(left) {
this.totalDependencies = Math.max(this.totalDependencies, left);
Module.setStatus(left ? 'Preparing... (' + (this.totalDependencies - left) + '/' + this.totalDependencies + ')' : 'All downloads complete.');
}
};
Module.setStatus('Downloading...');
window.onerror = function() {
Module.setStatus('Exception thrown, see JavaScript console');
Module.setStatus = function(text) {
if (text) Module.printErr('[post-exception status] ' + text);
};
};
</script>
{{{ SCRIPT }}}
</body>
</html>