<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>PMAT Dashboard</title>
<link rel="icon" href="/demo/favicon.ico" type="image/x-icon">
<style>
* { margin: 0; padding: 0; box-sizing: border-box; }
html, body {
width: 100%;
height: 100%;
overflow: hidden;
background: #1a1a2e;
color: #ffffff;
font-family: system-ui, -apple-system, sans-serif;
}
#app { width: 100%; height: 100%; }
.loading {
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
height: 100vh;
gap: 1rem;
}
.loading-spinner {
width: 48px;
height: 48px;
border: 4px solid #333;
border-top-color: #6366f1;
border-radius: 50%;
animation: spin 1s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.error { color: #ef4444; text-align: center; padding: 2rem; }
</style>
</head>
<body>
<div id="app">
<div class="loading">
<div class="loading-spinner"></div>
<p>Loading PMAT Dashboard...</p>
<p style="font-size: 0.75rem; color: #666;">Pure WASM - No JavaScript dependencies</p>
</div>
</div>
<script type="module">
async function init() {
try {
const { default: init, PmatDashboard } = await import('/pkg/pmat_dashboard.js');
await init('/pkg/pmat_dashboard_bg.wasm');
const dashboard = PmatDashboard.new({
ws_url: `ws://${window.location.host}/api/ws`,
accessibility_enabled: true,
grid_columns: 12
});
dashboard.mount(document.getElementById('app'));
} catch (e) {
console.error('Dashboard initialization failed:', e);
document.getElementById('app').innerHTML = `
<div class="error">
<h2>Dashboard Loading Error</h2>
<p>${e.message}</p>
<p style="margin-top: 1rem; font-size: 0.875rem;">
The pure WASM dashboard requires the pmat-dashboard.wasm module.
<br>Build with: <code>cargo build -p pmat-dashboard --target wasm32-unknown-unknown</code>
</p>
</div>
`;
}
}
if (typeof WebAssembly === 'object') {
init();
} else {
document.getElementById('app').innerHTML = `
<div class="error">
<h2>WebAssembly Not Supported</h2>
<p>Your browser does not support WebAssembly.</p>
<p>Please use a modern browser (Chrome, Firefox, Safari, Edge).</p>
</div>
`;
}
</script>
</body>
</html>