<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>KiteDB Mini Graph Demo</title>
<link rel="preconnect" href="https://fonts.googleapis.com" />
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
<link
href="https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@400;600;700&display=swap"
rel="stylesheet"
/>
<style>
:root {
--ink: #0b0f14;
--muted: #64748b;
--paper: rgba(255, 255, 255, 0.86);
--accent: #0ea5e9;
--accent-2: #22c55e;
--shadow: 0 24px 50px -36px rgba(15, 23, 42, 0.55);
}
* { box-sizing: border-box; }
body {
margin: 0;
font-family: "Space Grotesk", "Segoe UI", sans-serif;
color: var(--ink);
min-height: 100vh;
background:
radial-gradient(1100px 600px at 15% -20%, #c6e6ff 0%, transparent 60%),
radial-gradient(1000px 520px at 120% 0%, #ffe3c0 0%, transparent 55%),
linear-gradient(140deg, #f6f7fb 0%, #eef6ff 50%, #f9f4ea 100%);
}
.page {
padding: 28px clamp(16px, 3vw, 40px) 36px;
display: flex;
flex-direction: column;
gap: 20px;
}
header {
display: flex;
align-items: center;
justify-content: space-between;
flex-wrap: wrap;
gap: 16px;
}
h1 {
margin: 0;
font-size: clamp(26px, 4vw, 40px);
}
.subtitle {
margin: 8px 0 0;
color: var(--muted);
}
.pill {
padding: 6px 12px;
border-radius: 999px;
background: var(--paper);
font-size: 12px;
border: 1px solid rgba(15, 23, 42, 0.08);
box-shadow: var(--shadow);
}
.grid {
display: grid;
grid-template-columns: minmax(260px, 320px) 1fr;
gap: 20px;
}
.panel {
background: var(--paper);
border-radius: 18px;
padding: 18px;
border: 1px solid rgba(15, 23, 42, 0.08);
box-shadow: var(--shadow);
}
.controls {
display: grid;
gap: 14px;
}
button {
border: none;
padding: 10px 14px;
border-radius: 10px;
font-weight: 600;
cursor: pointer;
color: white;
background: var(--ink);
}
button.accent { background: var(--accent); }
button.green { background: var(--accent-2); }
.graph-wrap {
background: rgba(15, 23, 42, 0.04);
border-radius: 16px;
padding: 10px;
min-height: 420px;
}
svg { width: 100%; height: 100%; min-height: 380px; }
.node-circle { fill: #ffffff; stroke: #0f172a; stroke-width: 1.2; }
.node-circle.selected { fill: #bae6fd; }
.node-circle.neighbor { fill: #dcfce7; }
.node-label { font-size: 12px; fill: #0f172a; }
.edge-line { stroke: rgba(15, 23, 42, 0.45); stroke-width: 1.2; }
.edge-line.active { stroke: #0ea5e9; stroke-width: 2.2; }
#log {
background: #0b0f14;
color: #e2e8f0;
padding: 12px;
border-radius: 12px;
min-height: 120px;
max-height: 160px;
overflow: auto;
font-size: 12px;
line-height: 1.5;
}
ul { margin: 6px 0 0; padding-left: 18px; color: var(--muted); }
li { margin-bottom: 4px; }
@media (max-width: 980px) {
.grid { grid-template-columns: 1fr; }
}
</style>
</head>
<body>
<div class="page">
<header>
<div>
<h1>KiteDB Mini Graph</h1>
<p class="subtitle">Add nodes, connect them, click a node to see its neighbors.</p>
</div>
<span class="pill" id="status">WASM: loading</span>
</header>
<main class="grid">
<section class="panel">
<div class="controls">
<button id="add-node" class="accent">Add random node</button>
<button id="add-edge" class="green">Add edge</button>
<div>
<strong>Selected node</strong>
<div id="selected-node" class="subtitle">None</div>
</div>
<div>
<strong>Connected out</strong>
<ul id="connections-out"></ul>
</div>
<div>
<strong>Connected in</strong>
<ul id="connections-in"></ul>
</div>
<pre id="log"></pre>
</div>
</section>
<section class="panel">
<div class="graph-wrap">
<svg id="graph" viewBox="0 0 800 520" aria-label="Graph visualization" role="img"></svg>
</div>
</section>
</main>
</div>
<script type="module" src="/src/main.ts"></script>
</body>
</html>