feat: migrate index.html to wd-* design system
This commit is contained in:
parent
33d2a4004d
commit
daa203a43e
1 changed files with 83 additions and 76 deletions
|
|
@ -5,7 +5,7 @@
|
|||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<link rel="icon" type="image/x-icon" href="favicon.ico">
|
||||
<title>Library — Dragonflight</title>
|
||||
<link rel="stylesheet" href="css/common.css">
|
||||
<link rel="stylesheet" href="/dist/app.css">
|
||||
<style>
|
||||
/* ── Library layout ── */
|
||||
.library-shell {
|
||||
|
|
@ -362,76 +362,76 @@
|
|||
<div class="first-splash-stamp"><span class="first-splash-dot"></span><span>Dragonflight</span></div>
|
||||
<div class="first-splash-title">Dragonflight — Media Asset Management</div>
|
||||
</div>
|
||||
<div class="shell">
|
||||
<div class="wd-shell" style="display:flex;min-height:100vh;">
|
||||
<!-- Sidebar -->
|
||||
<nav class="sidebar" aria-label="Main navigation">
|
||||
<div class="sidebar-brand">
|
||||
<img src="img/dragon-logo.png?v=1" alt="Dragonflight" class="sidebar-logo">
|
||||
<span class="sidebar-brand-name">Dragonflight</span>
|
||||
<nav class="wd-sidebar" aria-label="Main navigation">
|
||||
<div class="wd-sidebar-header">
|
||||
<img src="img/dragon-logo.png?v=1" alt="Dragonflight" style="width:18px;height:18px;">
|
||||
<span class="wd-sidebar-brand">Dragonflight</span>
|
||||
</div>
|
||||
<nav class="sidebar-nav">
|
||||
<a href="home.html" class="nav-item">
|
||||
<div class="wd-sidebar-nav">
|
||||
<a href="home.html" class="wd-nav-item">
|
||||
<svg viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.5"><path d="M2 7l6-5 6 5v7a1 1 0 0 1-1 1h-3v-5H6v5H3a1 1 0 0 1-1-1z"/></svg>
|
||||
Home
|
||||
</a>
|
||||
<a href="index.html" class="nav-item active">
|
||||
<a href="index.html" class="wd-nav-item is-active">
|
||||
<svg viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.5"><rect x="1" y="1" width="6" height="6" rx="1"/><rect x="9" y="1" width="6" height="6" rx="1"/><rect x="1" y="9" width="6" height="6" rx="1"/><rect x="9" y="9" width="6" height="6" rx="1"/></svg>
|
||||
Library
|
||||
</a>
|
||||
<a href="projects.html" class="nav-item">
|
||||
<a href="projects.html" class="wd-nav-item">
|
||||
<svg viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.5"><path d="M1 4a1 1 0 0 1 1-1h4l2 2h5a1 1 0 0 1 1 1v6a1 1 0 0 1-1 1H2a1 1 0 0 1-1-1z"/></svg>
|
||||
Projects
|
||||
</a>
|
||||
<a href="upload.html" class="nav-item">
|
||||
<a href="upload.html" class="wd-nav-item">
|
||||
<svg viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.5"><path d="M8 11V3M5 6l3-3 3 3"/><path d="M2 13h12"/></svg>
|
||||
Ingest
|
||||
</a>
|
||||
<a href="recorders.html" class="nav-item">
|
||||
<a href="recorders.html" class="wd-nav-item">
|
||||
<svg viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.5"><rect x="1" y="4" width="10" height="8" rx="1"/><path d="M11 7l4-2v6l-4-2"/></svg>
|
||||
Recorders
|
||||
</a>
|
||||
<a href="capture.html" class="nav-item">
|
||||
<a href="capture.html" class="wd-nav-item">
|
||||
<svg viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.5"><circle cx="8" cy="8" r="3"/><circle cx="8" cy="8" r="6.5"/></svg>
|
||||
Capture
|
||||
</a>
|
||||
<a href="jobs.html" class="nav-item">
|
||||
<a href="jobs.html" class="wd-nav-item">
|
||||
<svg viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.5"><path d="M2 4h12M2 8h8M2 12h5"/></svg>
|
||||
Jobs
|
||||
</a>
|
||||
<a href="editor.html" class="nav-item">
|
||||
<a href="editor.html" class="wd-nav-item">
|
||||
<svg viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.5"><path d="M2 13l1.5-3.5L11 2l3 3-7.5 7.5L3 14zM10 3l3 3"/></svg>
|
||||
Editor
|
||||
</a>
|
||||
<div class="sidebar-section-label">Admin</div>
|
||||
<a href="users.html" class="nav-item">
|
||||
<div class="wd-sidebar-section">Admin</div>
|
||||
<a href="users.html" class="wd-nav-item">
|
||||
<svg viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.5"><circle cx="6" cy="5" r="2.5"/><path d="M1 13c0-2.8 2.2-5 5-5s5 2.2 5 5"/><circle cx="12" cy="5" r="2"/><path d="M15 12c0-1.9-1.3-3.5-3-4"/></svg>
|
||||
Users
|
||||
</a>
|
||||
<a href="tokens.html" class="nav-item">
|
||||
<a href="tokens.html" class="wd-nav-item">
|
||||
<svg viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.5"><circle cx="6" cy="10" r="3.5"/><path d="M8.7 7.3L13 3M11.5 3.5l1.5 1.5M13.5 2.5l1 1"/></svg>
|
||||
Tokens
|
||||
</a>
|
||||
<a href="containers.html" class="nav-item">
|
||||
<a href="containers.html" class="wd-nav-item">
|
||||
<svg viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.5"><rect x="1" y="5" width="14" height="4" rx="1"/><rect x="1" y="10" width="14" height="4" rx="1"/><path d="M4 7h1M4 12h1"/></svg>
|
||||
Containers
|
||||
</a>
|
||||
<a href="cluster.html" class="nav-item">
|
||||
<a href="cluster.html" class="wd-nav-item">
|
||||
<svg viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.5"><circle cx="8" cy="8" r="2"/><circle cx="2" cy="3" r="1.5"/><circle cx="14" cy="3" r="1.5"/><circle cx="2" cy="13" r="1.5"/><circle cx="14" cy="13" r="1.5"/><path d="M3.1 4.1L6.5 6.5M12.9 4.1L9.5 6.5M3.1 11.9L6.5 9.5M12.9 11.9L9.5 9.5"/></svg>
|
||||
Cluster
|
||||
</a>
|
||||
<a href="settings.html" class="nav-item">
|
||||
<a href="settings.html" class="wd-nav-item">
|
||||
<svg viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.5"><circle cx="8" cy="8" r="2.5"/><path d="M8 1v1.5M8 13.5V15M1 8h1.5M13.5 8H15M2.9 2.9l1.1 1.1M12 12l1.1 1.1M2.9 13.1L4 12M12 4l1.1-1.1"/></svg>
|
||||
Settings
|
||||
</a>
|
||||
</nav>
|
||||
<div class="sidebar-footer">
|
||||
<div class="sidebar-user">
|
||||
<div class="sidebar-user-avatar" id="userAvatar">?</div>
|
||||
<div class="sidebar-user-info">
|
||||
<div class="sidebar-user-name" id="userName">—</div>
|
||||
<div class="sidebar-user-role" id="userRole"></div>
|
||||
</div>
|
||||
<div class="wd-sidebar-footer">
|
||||
<div class="wd-sidebar-user">
|
||||
<div class="wd-sidebar-user-avatar" id="userAvatar">?</div>
|
||||
<div class="wd-sidebar-user-info">
|
||||
<div class="wd-sidebar-user-name" id="userName">—</div>
|
||||
<div class="wd-sidebar-user-role" id="userRole"></div>
|
||||
</div>
|
||||
<button class="btn btn-ghost" id="logoutBtn" title="Sign out" style="padding:0;width:24px;height:24px;flex-shrink:0;">
|
||||
<button class="wd-btn wd-btn--ghost wd-btn--sm wd-btn--icon wd-sidebar-user-logout" id="logoutBtn" title="Sign out">
|
||||
<svg viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.5" width="14" height="14"><path d="M10 8H3M6 5l-3 3 3 3"/><path d="M7 3h5a1 1 0 0 1 1 1v8a1 1 0 0 1-1 1H7"/></svg>
|
||||
</button>
|
||||
</div>
|
||||
|
|
@ -439,22 +439,22 @@
|
|||
</nav>
|
||||
|
||||
<!-- Main -->
|
||||
<div class="main">
|
||||
<div style="flex:1;display:flex;flex-direction:column;">
|
||||
<!-- Topbar -->
|
||||
<header class="topbar">
|
||||
<div class="topbar-left">
|
||||
<header class="wd-topbar">
|
||||
<div class="wd-topbar-left">
|
||||
<span class="page-title">Library</span>
|
||||
<span class="topbar-sep">/</span>
|
||||
<span class="wd-topbar-divider">/</span>
|
||||
<select class="project-select" id="projectSelect" aria-label="Select project">
|
||||
<option value="">No projects</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="topbar-right">
|
||||
<button class="btn btn-ghost btn-sm" id="newProjectBtn" title="New project">
|
||||
<div class="wd-topbar-right">
|
||||
<button class="wd-btn wd-btn--ghost wd-btn--sm" id="newProjectBtn" title="New project">
|
||||
<svg viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.5"><path d="M8 2v12M2 8h12"/></svg>
|
||||
New project
|
||||
</button>
|
||||
<button class="btn btn-primary btn-sm" id="uploadBtn">
|
||||
<button class="wd-btn wd-btn--primary wd-btn--sm" id="uploadBtn">
|
||||
<svg viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.5"><path d="M8 11V3M5 6l3-3 3 3"/><path d="M2 13h12"/></svg>
|
||||
Upload
|
||||
</button>
|
||||
|
|
@ -467,7 +467,7 @@
|
|||
<div class="bin-panel">
|
||||
<div class="bin-panel-header">
|
||||
<span class="bin-panel-title">Bins</span>
|
||||
<button class="btn btn-ghost btn-sm" id="newBinBtn" title="New bin" style="padding:0;width:24px;height:24px;">
|
||||
<button class="wd-btn wd-btn--ghost wd-btn--sm" id="newBinBtn" title="New bin" style="padding:0;width:24px;height:24px;">
|
||||
<svg viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.5"><path d="M8 2v12M2 8h12"/></svg>
|
||||
</button>
|
||||
</div>
|
||||
|
|
@ -507,14 +507,14 @@
|
|||
|
||||
<div class="asset-grid-wrap" id="assetGridWrap">
|
||||
<div id="assetGrid" class="asset-grid"></div>
|
||||
<div id="assetEmpty" class="empty-state" style="display:none;">
|
||||
<div class="empty-state-icon">
|
||||
<div id="assetEmpty" class="wd-empty" style="display:none;">
|
||||
<div class="wd-empty-icon">
|
||||
<svg viewBox="0 0 40 40" fill="none" stroke="currentColor" stroke-width="1.5"><rect x="4" y="8" width="32" height="26" rx="2"/><path d="M4 14h32"/><circle cx="20" cy="25" r="6"/><path d="M16 25l2 2 4-4"/></svg>
|
||||
</div>
|
||||
<div class="empty-state-title">No assets yet</div>
|
||||
<div class="empty-state-body">Upload media to this project or select a different bin.</div>
|
||||
<div class="empty-state-actions">
|
||||
<button class="btn btn-primary btn-sm" id="emptyUploadBtn">Upload files</button>
|
||||
<div class="wd-empty-title">No assets yet</div>
|
||||
<div class="wd-empty-body">Upload media to this project or select a different bin.</div>
|
||||
<div class="wd-empty-actions">
|
||||
<button class="wd-btn wd-btn--primary wd-btn--sm" id="emptyUploadBtn">Upload files</button>
|
||||
</div>
|
||||
</div>
|
||||
<div id="assetLoading" class="ampp-loading ampp-loading--sm" style="display:none;">
|
||||
|
|
@ -533,51 +533,51 @@
|
|||
</div>
|
||||
|
||||
<!-- Toasts -->
|
||||
<div class="toast-container" id="toastContainer" aria-live="polite"></div>
|
||||
<div class="wd-toast-container" id="toastContainer" aria-live="polite"></div>
|
||||
|
||||
<!-- New project dialog (inline, not modal) -->
|
||||
<div class="slide-overlay" id="projectOverlay"></div>
|
||||
<div class="slide-panel" id="projectPanel">
|
||||
<div class="slide-panel-header">
|
||||
<span class="slide-panel-title">New project</span>
|
||||
<button class="btn btn-ghost btn-sm" id="closeProjectPanel" style="padding:0;width:28px;height:28px;">
|
||||
<div class="wd-slide-overlay" id="projectOverlay"></div>
|
||||
<div class="wd-slide-panel" id="projectPanel">
|
||||
<div class="wd-slide-panel-header">
|
||||
<span class="wd-slide-panel-title">New project</span>
|
||||
<button class="wd-btn wd-btn--ghost wd-btn--sm" id="closeProjectPanel" style="padding:0;width:28px;height:28px;">
|
||||
<svg viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.5"><path d="M3 3l10 10M13 3L3 13"/></svg>
|
||||
</button>
|
||||
</div>
|
||||
<div class="slide-panel-body">
|
||||
<div class="form-group">
|
||||
<label class="form-label" for="newProjectName">Project name</label>
|
||||
<div class="wd-slide-panel-body">
|
||||
<div class="wd-form-group">
|
||||
<label class="wd-label" for="newProjectName">Project name</label>
|
||||
<input type="text" id="newProjectName" placeholder="e.g. Evening News 2026-05">
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="form-label" for="newProjectDesc">Description</label>
|
||||
<div class="wd-form-group">
|
||||
<label class="wd-label" for="newProjectDesc">Description</label>
|
||||
<textarea id="newProjectDesc" rows="3" placeholder="Optional description"></textarea>
|
||||
</div>
|
||||
</div>
|
||||
<div class="slide-panel-footer">
|
||||
<button class="btn btn-ghost" id="cancelProjectBtn">Cancel</button>
|
||||
<button class="btn btn-primary" id="saveProjectBtn">Create project</button>
|
||||
<div class="wd-slide-panel-footer">
|
||||
<button class="wd-btn wd-btn--ghost" id="cancelProjectBtn">Cancel</button>
|
||||
<button class="wd-btn wd-btn--primary" id="saveProjectBtn">Create project</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- New bin panel -->
|
||||
<div class="slide-overlay" id="binOverlay"></div>
|
||||
<div class="slide-panel" id="binPanel">
|
||||
<div class="slide-panel-header">
|
||||
<span class="slide-panel-title">New bin</span>
|
||||
<button class="btn btn-ghost btn-sm" id="closeBinPanel" style="padding:0;width:28px;height:28px;">
|
||||
<div class="wd-slide-overlay" id="binOverlay"></div>
|
||||
<div class="wd-slide-panel" id="binPanel">
|
||||
<div class="wd-slide-panel-header">
|
||||
<span class="wd-slide-panel-title">New bin</span>
|
||||
<button class="wd-btn wd-btn--ghost wd-btn--sm" id="closeBinPanel" style="padding:0;width:28px;height:28px;">
|
||||
<svg viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.5"><path d="M3 3l10 10M13 3L3 13"/></svg>
|
||||
</button>
|
||||
</div>
|
||||
<div class="slide-panel-body">
|
||||
<div class="form-group">
|
||||
<label class="form-label" for="newBinName">Bin name</label>
|
||||
<div class="wd-slide-panel-body">
|
||||
<div class="wd-form-group">
|
||||
<label class="wd-label" for="newBinName">Bin name</label>
|
||||
<input type="text" id="newBinName" placeholder="e.g. Interviews">
|
||||
</div>
|
||||
</div>
|
||||
<div class="slide-panel-footer">
|
||||
<button class="btn btn-ghost" id="cancelBinBtn">Cancel</button>
|
||||
<button class="btn btn-primary" id="saveBinBtn">Create bin</button>
|
||||
<div class="wd-slide-panel-footer">
|
||||
<button class="wd-btn wd-btn--ghost" id="cancelBinBtn">Cancel</button>
|
||||
<button class="wd-btn wd-btn--primary" id="saveBinBtn">Create bin</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
|
@ -821,7 +821,7 @@
|
|||
</div>
|
||||
<img data-asset-id="${asset.id}" alt="${escHtml(asset.display_name || asset.filename)}" aria-hidden="false">
|
||||
<div class="asset-thumb-overlay">
|
||||
<span class="badge ${statusClass}">${escHtml(asset.status)}</span>
|
||||
<span class="${statusClass}">${escHtml(asset.status)}</span>
|
||||
${asset.duration_ms ? `<span class="asset-duration">${formatDuration(asset.duration_ms / 1000)}</span>` : ''}
|
||||
</div>
|
||||
<div class="asset-actions">
|
||||
|
|
@ -913,8 +913,15 @@
|
|||
}
|
||||
|
||||
function statusBadgeClass(s) {
|
||||
const map = { live:'badge-live', ingesting:'badge-ingesting', processing:'badge-processing', ready:'badge-ready', error:'badge-error', archived:'badge-archived' };
|
||||
return map[s] || 'badge-idle';
|
||||
const map = {
|
||||
live: 'wd-badge wd-badge--bad',
|
||||
ingesting: 'wd-badge wd-badge--warn',
|
||||
processing: 'wd-badge wd-badge--warn',
|
||||
ready: 'wd-badge wd-badge--good',
|
||||
error: 'wd-badge wd-badge--bad',
|
||||
archived: 'wd-badge wd-badge--idle',
|
||||
};
|
||||
return map[s] || 'wd-badge wd-badge--idle';
|
||||
}
|
||||
|
||||
function mediaIcon(type) {
|
||||
|
|
@ -1024,12 +1031,12 @@
|
|||
|
||||
// ── Panel helpers ─────────────────────────
|
||||
function openPanel(name) {
|
||||
document.getElementById(name + 'Panel').classList.add('open');
|
||||
document.getElementById(name + 'Overlay').classList.add('open');
|
||||
document.getElementById(name + 'Panel').classList.add('is-open');
|
||||
document.getElementById(name + 'Overlay').classList.add('is-open');
|
||||
}
|
||||
function closePanel(name) {
|
||||
document.getElementById(name + 'Panel').classList.remove('open');
|
||||
document.getElementById(name + 'Overlay').classList.remove('open');
|
||||
document.getElementById(name + 'Panel').classList.remove('is-open');
|
||||
document.getElementById(name + 'Overlay').classList.remove('is-open');
|
||||
}
|
||||
|
||||
// ── Toast ────────────────────────────────
|
||||
|
|
@ -1041,7 +1048,7 @@
|
|||
info: `<svg viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.5"><circle cx="8" cy="8" r="6.5"/><path d="M8 7v5M8 5v.5"/></svg>`,
|
||||
};
|
||||
const el = document.createElement('div');
|
||||
el.className = `toast toast--${type}`;
|
||||
el.className = `wd-toast wd-toast--${type}`;
|
||||
el.innerHTML = `<div class="toast-icon">${icons[type]||icons.info}</div><div class="toast-body"><div class="toast-title">${escHtml(title)}</div>${msg?`<div class="toast-msg">${escHtml(msg)}</div>`:''}</div>`;
|
||||
document.getElementById('toastContainer').appendChild(el);
|
||||
setTimeout(() => el.remove(), 4000);
|
||||
|
|
|
|||
Loading…
Reference in a new issue