Rust (axum) backend with git clone / zip upload / SQLite cache. Three.js frontend with D3 treemap layout and semantic zoom. Docker deployment with musl static binary.
289 lines
6.2 KiB
HTML
289 lines
6.2 KiB
HTML
<!DOCTYPE html>
|
|
<html lang="en">
|
|
<head>
|
|
<meta charset="UTF-8">
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
<title>repo-vis</title>
|
|
<!-- Terminus (code) + LXGW WenKai Mono (CJK) -->
|
|
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@xz/fonts@1/serve/terminus.min.css">
|
|
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/lxgw-wenkai-mono-webfont@1.7.0/style.css">
|
|
<style>
|
|
* { margin: 0; padding: 0; box-sizing: border-box; }
|
|
|
|
body {
|
|
font-family: -apple-system, "Segoe UI", Roboto, sans-serif;
|
|
background: #11111b;
|
|
color: #cdd6f4;
|
|
overflow: hidden;
|
|
}
|
|
|
|
/* Landing page */
|
|
#landing {
|
|
display: flex;
|
|
flex-direction: column;
|
|
align-items: center;
|
|
justify-content: center;
|
|
height: 100vh;
|
|
gap: 32px;
|
|
}
|
|
|
|
#landing h1 {
|
|
font-size: 48px;
|
|
font-weight: 300;
|
|
letter-spacing: -1px;
|
|
color: #cba6f7;
|
|
}
|
|
|
|
#landing .subtitle {
|
|
font-size: 16px;
|
|
color: #6c7086;
|
|
margin-top: -20px;
|
|
}
|
|
|
|
.input-group {
|
|
display: flex;
|
|
flex-direction: column;
|
|
gap: 16px;
|
|
width: 500px;
|
|
max-width: 90vw;
|
|
}
|
|
|
|
.input-row {
|
|
display: flex;
|
|
gap: 8px;
|
|
}
|
|
|
|
.input-row input[type="text"] {
|
|
flex: 1;
|
|
padding: 12px 16px;
|
|
border: 1px solid #313244;
|
|
border-radius: 8px;
|
|
background: #1e1e2e;
|
|
color: #cdd6f4;
|
|
font-size: 15px;
|
|
outline: none;
|
|
transition: border-color 0.2s;
|
|
}
|
|
|
|
.input-row input[type="text"]:focus {
|
|
border-color: #cba6f7;
|
|
}
|
|
|
|
.input-row input[type="text"]::placeholder {
|
|
color: #585b70;
|
|
}
|
|
|
|
button {
|
|
padding: 12px 24px;
|
|
border: none;
|
|
border-radius: 8px;
|
|
background: #cba6f7;
|
|
color: #1e1e2e;
|
|
font-size: 15px;
|
|
font-weight: 600;
|
|
cursor: pointer;
|
|
transition: background 0.2s;
|
|
}
|
|
|
|
button:hover { background: #b4befe; }
|
|
button:disabled { opacity: 0.5; cursor: not-allowed; }
|
|
|
|
.divider {
|
|
display: flex;
|
|
align-items: center;
|
|
gap: 16px;
|
|
color: #585b70;
|
|
font-size: 13px;
|
|
}
|
|
|
|
.divider::before, .divider::after {
|
|
content: "";
|
|
flex: 1;
|
|
height: 1px;
|
|
background: #313244;
|
|
}
|
|
|
|
.drop-zone {
|
|
border: 2px dashed #313244;
|
|
border-radius: 12px;
|
|
padding: 32px;
|
|
text-align: center;
|
|
color: #6c7086;
|
|
cursor: pointer;
|
|
transition: border-color 0.2s, background 0.2s;
|
|
}
|
|
|
|
.drop-zone:hover, .drop-zone.dragover {
|
|
border-color: #cba6f7;
|
|
background: rgba(203, 166, 247, 0.05);
|
|
}
|
|
|
|
.drop-zone input { display: none; }
|
|
|
|
/* Loading state */
|
|
#loading {
|
|
display: none;
|
|
position: fixed;
|
|
inset: 0;
|
|
background: #11111b;
|
|
z-index: 100;
|
|
flex-direction: column;
|
|
align-items: center;
|
|
justify-content: center;
|
|
gap: 16px;
|
|
}
|
|
|
|
#loading.active { display: flex; }
|
|
|
|
.spinner {
|
|
width: 40px;
|
|
height: 40px;
|
|
border: 3px solid #313244;
|
|
border-top-color: #cba6f7;
|
|
border-radius: 50%;
|
|
animation: spin 0.8s linear infinite;
|
|
}
|
|
|
|
@keyframes spin { to { transform: rotate(360deg); } }
|
|
|
|
#loading-text { color: #6c7086; font-size: 14px; }
|
|
|
|
/* Visualization */
|
|
#viewport {
|
|
display: none;
|
|
width: 100vw;
|
|
height: 100vh;
|
|
}
|
|
|
|
#viewport.active { display: block; }
|
|
|
|
/* Tooltip */
|
|
#tooltip {
|
|
display: none;
|
|
position: fixed;
|
|
bottom: 16px;
|
|
left: 50%;
|
|
transform: translateX(-50%);
|
|
padding: 8px 16px;
|
|
background: rgba(30, 30, 46, 0.9);
|
|
backdrop-filter: blur(8px);
|
|
border: 1px solid #313244;
|
|
border-radius: 8px;
|
|
font-size: 13px;
|
|
font-family: Terminus, "LXGW WenKai Mono", monospace;
|
|
color: #cdd6f4;
|
|
pointer-events: none;
|
|
z-index: 50;
|
|
white-space: nowrap;
|
|
}
|
|
|
|
/* Controls hint */
|
|
#controls-hint {
|
|
position: fixed;
|
|
top: 16px;
|
|
right: 16px;
|
|
padding: 8px 12px;
|
|
background: rgba(30, 30, 46, 0.8);
|
|
border: 1px solid #313244;
|
|
border-radius: 8px;
|
|
font-size: 12px;
|
|
color: #585b70;
|
|
line-height: 1.6;
|
|
z-index: 50;
|
|
display: none;
|
|
}
|
|
|
|
#controls-hint.active { display: block; }
|
|
|
|
/* History */
|
|
#history {
|
|
display: none;
|
|
width: 500px;
|
|
max-width: 90vw;
|
|
margin-top: 8px;
|
|
}
|
|
|
|
#history.has-items { display: block; }
|
|
|
|
#history h3 {
|
|
font-size: 13px;
|
|
font-weight: 500;
|
|
color: #585b70;
|
|
margin-bottom: 8px;
|
|
text-transform: uppercase;
|
|
letter-spacing: 1px;
|
|
}
|
|
|
|
.history-list {
|
|
display: flex;
|
|
flex-direction: column;
|
|
gap: 4px;
|
|
}
|
|
|
|
.history-item {
|
|
display: flex;
|
|
align-items: center;
|
|
justify-content: space-between;
|
|
padding: 10px 14px;
|
|
background: #1e1e2e;
|
|
border: 1px solid #313244;
|
|
border-radius: 8px;
|
|
cursor: pointer;
|
|
transition: border-color 0.2s;
|
|
}
|
|
|
|
.history-item:hover { border-color: #cba6f7; }
|
|
|
|
.history-item .name {
|
|
font-size: 14px;
|
|
font-weight: 500;
|
|
color: #cdd6f4;
|
|
}
|
|
|
|
.history-item .meta {
|
|
font-size: 12px;
|
|
color: #585b70;
|
|
}
|
|
</style>
|
|
</head>
|
|
<body>
|
|
|
|
<div id="landing">
|
|
<h1>repo-vis</h1>
|
|
<p class="subtitle">Visualize any codebase in 3D</p>
|
|
|
|
<div class="input-group">
|
|
<div class="input-row">
|
|
<input type="text" id="git-url" placeholder="https://github.com/user/repo">
|
|
<button id="btn-clone">Clone & Visualize</button>
|
|
</div>
|
|
|
|
<div class="divider">or</div>
|
|
|
|
<div class="drop-zone" id="drop-zone">
|
|
<p>Drop a .zip file here, or click to browse</p>
|
|
<input type="file" id="file-input" accept=".zip">
|
|
</div>
|
|
</div>
|
|
|
|
<div id="history">
|
|
<h3>Recent</h3>
|
|
<div class="history-list" id="history-list"></div>
|
|
</div>
|
|
</div>
|
|
|
|
<div id="loading">
|
|
<div class="spinner"></div>
|
|
<div id="loading-text">Cloning repository...</div>
|
|
</div>
|
|
|
|
<div id="viewport"></div>
|
|
<div id="tooltip"></div>
|
|
<div id="controls-hint">
|
|
LMB drag — rotate | RMB drag — pan | scroll — zoom | double-click — focus file
|
|
</div>
|
|
|
|
<script type="module" src="/src/app.js"></script>
|
|
</body>
|
|
</html>
|