GCStream's picture
Add DataView tool: dataset visualizer with gallery, table, compare, and drawer views
11ce4a7 verified
Raw
History Blame Contribute Delete
23 kB
/* ═══════════════════════════════════════════════════════════════════════
DataView — "Light Table"
A dataset explorer for AI image-prompt pairs.
Warm parchment palette, editorial typography, image-forward cards.
═══════════════════════════════════════════════════════════════════════ */
:root {
--bg: #F7F4EE;
--surface: #FFFFFF;
--surface-raised: #FDFCFA;
--border: #E6E0D6;
--border-light: #EFE9DF;
--text: #2D2A26;
--text-secondary: #8C8478;
--text-tertiary: #B5AEA4;
--accent: #8B5C3C;
--accent-hover: #A06A45;
--accent-soft: #F0E6DA;
--accent-softer: #F8F2EB;
--danger: #B54A4A;
--sans: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
--serif: 'Newsreader', Georgia, 'Times New Roman', serif;
--mono: 'JetBrains Mono', 'SF Mono', 'Fira Code', monospace;
--radius: 8px;
--radius-sm: 5px;
--drawer-w: 480px;
--shadow-sm: 0 1px 3px rgba(45,42,38,0.06);
--shadow-md: 0 4px 16px rgba(45,42,38,0.08);
--shadow-lg: 0 8px 32px rgba(45,42,38,0.12);
--transition: 180ms ease;
}
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
body {
font-family: var(--sans);
background: var(--bg);
color: var(--text);
min-height: 100vh;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
}
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-tertiary); }
.hidden { display: none !important; }
.spacer { flex: 1; }
/* ── Header ───────────────────────────────────────────────────────── */
.header {
display: flex;
align-items: center;
gap: 10px;
padding: 10px 20px;
background: var(--surface);
border-bottom: 1px solid var(--border);
position: sticky;
top: 0;
z-index: 100;
}
.header-btn {
display: flex;
align-items: center;
gap: 5px;
padding: 6px 12px;
background: var(--bg);
color: var(--text-secondary);
border: 1px solid var(--border);
border-radius: var(--radius-sm);
cursor: pointer;
font-size: 12.5px;
font-family: var(--sans);
font-weight: 500;
transition: all var(--transition);
white-space: nowrap;
}
.header-btn:hover { color: var(--text); border-color: var(--text-tertiary); background: var(--surface); }
.path-wrap {
flex: 1;
display: flex;
max-width: 640px;
position: relative;
}
.path-wrap input {
width: 100%;
padding: 6px 60px 6px 10px;
background: var(--bg);
border: 1px solid var(--border);
border-radius: var(--radius-sm);
color: var(--text);
font-family: var(--mono);
font-size: 12px;
outline: none;
transition: border-color var(--transition);
}
.path-wrap input:focus { border-color: var(--accent); }
.path-wrap input::placeholder { color: var(--text-tertiary); }
.path-open-btn {
position: absolute;
right: 1px; top: 1px; bottom: 1px;
padding: 0 14px;
background: var(--accent);
color: #fff;
border: none;
border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
cursor: pointer;
font-size: 12px;
font-weight: 600;
font-family: var(--sans);
transition: background var(--transition);
}
.path-open-btn:hover { background: var(--accent-hover); }
.wordmark {
font-family: var(--mono);
font-size: 13px;
font-weight: 500;
color: var(--text-tertiary);
letter-spacing: -0.3px;
flex-shrink: 0;
}
.wordmark-accent { color: var(--accent); }
/* ── Toolbar ──────────────────────────────────────────────────────── */
.toolbar {
display: flex;
align-items: center;
justify-content: space-between;
gap: 12px;
padding: 8px 20px;
background: var(--surface);
border-bottom: 1px solid var(--border);
flex-wrap: wrap;
}
.toolbar-left, .toolbar-right { display: flex; align-items: center; gap: 6px; }
.pill {
display: inline-flex;
align-items: center;
padding: 2px 10px;
background: var(--bg);
border: 1px solid var(--border);
border-radius: 100px;
font-size: 11px;
font-family: var(--mono);
color: var(--text-secondary);
white-space: nowrap;
line-height: 1.6;
}
.pill-accent { color: var(--accent); border-color: var(--accent-soft); background: var(--accent-softer); font-weight: 500; }
.search-box {
display: flex;
align-items: center;
gap: 6px;
background: var(--bg);
border: 1px solid var(--border);
border-radius: var(--radius-sm);
padding: 0 8px;
transition: border-color var(--transition);
}
.search-box:focus-within { border-color: var(--accent); }
.search-icon { color: var(--text-tertiary); flex-shrink: 0; }
#search-input {
background: none;
border: none;
color: var(--text);
font-family: var(--mono);
font-size: 12px;
padding: 5px 0;
outline: none;
width: 160px;
}
#search-input::placeholder { color: var(--text-tertiary); }
.search-count {
font-size: 10px;
font-family: var(--mono);
color: var(--text-tertiary);
}
.view-switch {
display: flex;
gap: 2px;
background: var(--bg);
border: 1px solid var(--border);
border-radius: var(--radius-sm);
padding: 2px;
}
.vs-btn {
display: flex;
align-items: center;
justify-content: center;
gap: 4px;
padding: 5px 8px;
background: none;
border: none;
border-radius: 3px;
color: var(--text-tertiary);
cursor: pointer;
transition: all var(--transition);
position: relative;
}
.vs-btn:hover { color: var(--text-secondary); }
.vs-btn.active { color: var(--accent); background: var(--surface); box-shadow: var(--shadow-sm); }
.vs-badge {
background: var(--accent);
color: #fff;
font-size: 9px;
font-weight: 600;
font-family: var(--mono);
padding: 0 4px;
border-radius: 6px;
min-width: 14px;
text-align: center;
line-height: 16px;
}
/* ── Main ─────────────────────────────────────────────────────────── */
.main { display: flex; flex-direction: column; height: calc(100vh - 93px); }
.view { flex: 1; overflow: auto; }
.gallery-toolbar {
display: flex;
align-items: center;
gap: 10px;
padding: 6px 20px;
border-bottom: 1px solid var(--border-light);
background: var(--surface-raised);
position: sticky;
top: 0;
z-index: 10;
}
.gt-label {
display: flex;
align-items: center;
gap: 5px;
font-size: 11px;
color: var(--text-secondary);
font-weight: 500;
}
.gt-select {
background: var(--surface);
color: var(--text);
border: 1px solid var(--border);
padding: 3px 6px;
border-radius: var(--radius-sm);
font-size: 12px;
font-family: var(--mono);
cursor: pointer;
}
.gt-hint {
font-size: 10.5px;
color: var(--text-tertiary);
font-style: italic;
}
.page-label {
font-size: 11px;
font-family: var(--mono);
color: var(--text-secondary);
}
.page-btn {
display: inline-flex;
align-items: center;
justify-content: center;
width: 26px;
height: 26px;
background: var(--surface);
color: var(--text-secondary);
border: 1px solid var(--border);
border-radius: var(--radius-sm);
cursor: pointer;
transition: all var(--transition);
}
.page-btn:hover:not(:disabled) { color: var(--text); border-color: var(--text-tertiary); }
.page-btn:disabled { opacity: 0.3; cursor: default; }
/* ── Gallery ──────────────────────────────────────────────────────── */
.gallery-grid {
display: grid;
grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
gap: 12px;
padding: 16px 20px;
}
.card {
position: relative;
background: var(--surface);
border: 1px solid var(--border);
border-radius: var(--radius);
overflow: hidden;
cursor: pointer;
transition: border-color var(--transition), box-shadow var(--transition), transform var(--transition);
}
.card:hover { border-color: var(--text-tertiary); box-shadow: var(--shadow-md); transform: translateY(-1px); }
.card.selected { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent), var(--shadow-md); }
.card.card-open { border-color: var(--accent); background: var(--accent-softer); }
.card-img {
width: 100%;
aspect-ratio: 1;
object-fit: cover;
display: block;
background: var(--bg);
}
.card-row {
position: absolute;
top: 6px;
left: 6px;
background: rgba(255,255,255,0.92);
backdrop-filter: blur(6px);
color: var(--text-secondary);
padding: 1px 6px;
border-radius: 3px;
font-size: 10px;
font-family: var(--mono);
font-weight: 500;
pointer-events: none;
}
.card-dims {
position: absolute;
bottom: 6px;
right: 6px;
background: rgba(255,255,255,0.92);
backdrop-filter: blur(6px);
color: var(--text-tertiary);
padding: 1px 6px;
border-radius: 3px;
font-size: 9px;
font-family: var(--mono);
pointer-events: none;
}
.card-check {
position: absolute;
top: 6px;
right: 6px;
width: 20px;
height: 20px;
border-radius: 50%;
background: var(--accent);
color: #fff;
display: none;
align-items: center;
justify-content: center;
font-size: 11px;
font-weight: 700;
pointer-events: none;
box-shadow: var(--shadow-sm);
}
.card.selected .card-check { display: flex; }
.card-caption {
padding: 8px 10px;
font-size: 12px;
font-family: var(--serif);
color: var(--text-secondary);
line-height: 1.45;
max-height: 60px;
overflow: hidden;
border-top: 1px solid var(--border-light);
}
/* ── Table ────────────────────────────────────────────────────────── */
.table-wrap {
overflow: auto;
flex: 1;
}
.table-wrap table {
width: 100%;
border-collapse: collapse;
font-size: 12px;
font-family: var(--mono);
}
.table-wrap th {
padding: 7px 12px;
background: var(--surface);
color: var(--text-secondary);
font-weight: 500;
text-align: left;
border-bottom: 1px solid var(--border);
position: sticky;
top: 0;
z-index: 5;
white-space: nowrap;
text-transform: uppercase;
font-size: 10px;
letter-spacing: 0.4px;
}
.table-wrap td {
padding: 5px 12px;
border-bottom: 1px solid var(--border-light);
max-width: 360px;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
vertical-align: middle;
}
.table-wrap tbody tr:hover td { background: var(--accent-softer); }
.table-wrap .cell-null { color: var(--text-tertiary); }
.table-wrap .row-num { color: var(--text-tertiary); font-size: 10px; user-select: none; }
.cell-thumb {
width: 36px;
height: 36px;
object-fit: cover;
border-radius: 3px;
display: block;
cursor: pointer;
border: 1px solid var(--border);
transition: transform var(--transition);
}
.cell-thumb:hover { transform: scale(1.12); }
/* ── Compare ──────────────────────────────────────────────────────── */
.empty-state {
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
height: 55vh;
color: var(--text-tertiary);
gap: 10px;
text-align: center;
}
.empty-state p { font-size: 13px; color: var(--text-secondary); }
.empty-hint { font-size: 11.5px !important; color: var(--text-tertiary) !important; }
.compare-grid {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(380px, 1fr));
gap: 16px;
padding: 20px;
align-items: start;
}
.compare-card {
background: var(--surface);
border: 1px solid var(--border);
border-radius: var(--radius);
overflow: hidden;
}
.cc-head {
display: flex;
align-items: center;
justify-content: space-between;
padding: 8px 12px;
border-bottom: 1px solid var(--border-light);
}
.cc-label {
font-size: 11px;
font-weight: 600;
text-transform: uppercase;
letter-spacing: 0.4px;
color: var(--accent);
font-family: var(--mono);
}
.cc-remove {
background: none;
border: none;
color: var(--text-tertiary);
cursor: pointer;
font-size: 16px;
padding: 2px 6px;
border-radius: 3px;
line-height: 1;
}
.cc-remove:hover { color: var(--danger); background: rgba(181,74,74,0.06); }
.compare-card img {
width: 100%;
max-height: 45vh;
object-fit: contain;
display: block;
background: var(--bg);
cursor: zoom-in;
}
.cc-prompt {
padding: 12px 14px;
font-family: var(--serif);
font-size: 13.5px;
line-height: 1.55;
color: var(--text);
border-top: 1px solid var(--border-light);
max-height: 140px;
overflow-y: auto;
}
.cc-meta {
padding: 8px 14px 12px;
border-top: 1px solid var(--border-light);
}
.cc-meta-row {
display: flex;
gap: 8px;
font-size: 11px;
line-height: 1.6;
}
.cc-meta-key { color: var(--text-tertiary); font-family: var(--mono); font-size: 10px; min-width: 80px; flex-shrink: 0; }
.cc-meta-val { color: var(--text-secondary); font-family: var(--mono); font-size: 10px; word-break: break-all; }
/* ── Drawer ───────────────────────────────────────────────────────── */
.drawer {
position: fixed;
top: 0;
right: 0;
bottom: 0;
width: var(--drawer-w);
background: var(--surface);
border-left: 1px solid var(--border);
z-index: 200;
display: flex;
flex-direction: column;
transform: translateX(100%);
transition: transform 250ms cubic-bezier(0.4, 0, 0.2, 1);
box-shadow: -4px 0 24px rgba(45,42,38,0.06);
}
.drawer.open { transform: translateX(0); }
.drawer-head {
display: flex;
align-items: center;
justify-content: space-between;
padding: 10px 16px;
border-bottom: 1px solid var(--border);
flex-shrink: 0;
}
.drawer-title {
font-size: 12px;
font-family: var(--mono);
font-weight: 500;
color: var(--text-secondary);
}
.drawer-head-actions {
display: flex;
align-items: center;
gap: 4px;
}
.drawer-nav-btn {
display: flex;
align-items: center;
justify-content: center;
width: 26px;
height: 26px;
background: none;
border: 1px solid transparent;
border-radius: var(--radius-sm);
color: var(--text-tertiary);
cursor: pointer;
transition: all var(--transition);
}
.drawer-nav-btn:hover { color: var(--text); background: var(--bg); border-color: var(--border); }
.drawer-close {
display: flex;
align-items: center;
justify-content: center;
width: 26px;
height: 26px;
background: none;
border: none;
border-radius: var(--radius-sm);
color: var(--text-tertiary);
cursor: pointer;
font-size: 18px;
transition: all var(--transition);
margin-left: 2px;
}
.drawer-close:hover { color: var(--text); background: var(--bg); }
.drawer-body {
display: flex;
flex-direction: column;
height: calc(100vh - 45px);
overflow: hidden;
}
.drawer-image-wrap {
flex-shrink: 0;
background: var(--bg);
display: flex;
align-items: center;
justify-content: center;
max-height: 50vh;
overflow: hidden;
border-bottom: 1px solid var(--border-light);
}
.drawer-image {
max-width: 100%;
max-height: 50vh;
object-fit: contain;
display: block;
cursor: zoom-in;
}
.drawer-content {
flex: 1;
overflow-y: auto;
padding: 16px;
display: flex;
flex-direction: column;
gap: 20px;
}
.drawer-section-label {
display: block;
font-size: 10px;
font-family: var(--mono);
font-weight: 500;
text-transform: uppercase;
letter-spacing: 0.5px;
color: var(--text-tertiary);
margin-bottom: 6px;
}
.drawer-prompt {
font-family: var(--serif);
font-size: 14.5px;
line-height: 1.6;
color: var(--text);
}
.drawer-meta {
display: flex;
flex-direction: column;
gap: 1px;
}
.drawer-meta-row {
display: flex;
gap: 10px;
font-size: 12px;
line-height: 1.7;
padding: 2px 0;
border-bottom: 1px solid var(--border-light);
}
.drawer-meta-row:last-child { border-bottom: none; }
.drawer-meta-key { color: var(--text-tertiary); font-family: var(--mono); font-size: 11px; min-width: 90px; flex-shrink: 0; }
.drawer-meta-val { color: var(--text-secondary); font-family: var(--mono); font-size: 11px; word-break: break-all; }
/* ── Sidebar ──────────────────────────────────────────────────────── */
.sidebar {
position: fixed;
left: 0; top: 0; bottom: 0;
width: 340px;
background: var(--surface);
border-right: 1px solid var(--border);
z-index: 200;
display: flex;
flex-direction: column;
transform: translateX(-100%);
transition: transform 0.22s ease;
}
.sidebar.open { transform: translateX(0); }
.backdrop {
position: fixed;
inset: 0;
background: rgba(45,42,38,0.18);
z-index: 199;
display: none;
backdrop-filter: blur(1px);
}
.backdrop.open { display: block; }
.sidebar-head {
display: flex;
align-items: center;
justify-content: space-between;
padding: 10px 14px;
border-bottom: 1px solid var(--border);
}
.sidebar-label {
font-size: 11.5px;
font-weight: 600;
color: var(--text-secondary);
}
.btn-icon {
display: flex;
align-items: center;
justify-content: center;
width: 26px;
height: 26px;
background: none;
border: 1px solid transparent;
border-radius: var(--radius-sm);
color: var(--text-tertiary);
cursor: pointer;
font-size: 18px;
}
.btn-icon:hover { color: var(--text); background: var(--bg); border-color: var(--border); }
.breadcrumb {
display: flex;
align-items: center;
gap: 2px;
padding: 6px 14px;
font-size: 11px;
font-family: var(--mono);
color: var(--text-secondary);
border-bottom: 1px solid var(--border-light);
overflow-x: auto;
white-space: nowrap;
flex-shrink: 0;
}
.breadcrumb-item { cursor: pointer; padding: 2px 4px; border-radius: 3px; }
.breadcrumb-item:hover { background: var(--bg); color: var(--text); }
.breadcrumb-sep { color: var(--text-tertiary); margin: 0 1px; }
.folder-list { flex: 1; overflow-y: auto; padding: 4px 0; }
.folder-entry {
display: flex;
align-items: center;
gap: 8px;
padding: 5px 14px;
cursor: pointer;
transition: background var(--transition);
}
.folder-entry:hover { background: var(--bg); }
.folder-entry .fe-icon { width: 16px; text-align: center; flex-shrink: 0; font-size: 13px; }
.folder-entry .fe-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-family: var(--mono); font-size: 12px; }
.folder-entry .fe-meta { font-size: 10px; font-family: var(--mono); color: var(--text-tertiary); flex-shrink: 0; }
.folder-entry.is-dir .fe-name { color: var(--text); }
.folder-entry.is-dataset .fe-name { color: var(--accent); font-weight: 500; }
.folder-entry.is-file .fe-name { color: var(--text-secondary); }
.folder-entry.is-dataset .fe-icon { color: var(--accent); }
.folder-entry.is-dir .fe-icon { color: var(--text-secondary); }
.folder-entry.is-file .fe-icon { color: var(--text-tertiary); }
.folder-entry.is-parent { color: var(--text-secondary); border-bottom: 1px solid var(--border-light); margin-bottom: 4px; }
.folder-entry.is-parent .fe-icon { color: var(--text-tertiary); }
/* ── Welcome ──────────────────────────────────────────────────────── */
.welcome {
display: flex;
justify-content: center;
align-items: center;
min-height: calc(100vh - 52px);
padding: 40px 20px;
}
.welcome-inner { text-align: center; }
.welcome-icon { color: var(--text-tertiary); margin-bottom: 16px; opacity: 0.35; }
.welcome-inner h2 { font-size: 20px; font-weight: 600; color: var(--text); margin-bottom: 6px; }
.welcome-inner p { font-size: 14px; color: var(--text-secondary); }
.welcome-inner code {
padding: 1px 5px;
background: var(--bg);
border: 1px solid var(--border);
border-radius: 3px;
font-family: var(--mono);
font-size: 12px;
color: var(--text-secondary);
}
/* ── Lightbox ─────────────────────────────────────────────────────── */
.lightbox {
display: none;
position: fixed;
inset: 0;
background: rgba(45,42,38,0.92);
z-index: 300;
justify-content: center;
align-items: center;
cursor: zoom-out;
backdrop-filter: blur(4px);
}
.lightbox.active { display: flex; }
.lightbox img {
max-width: 92vw;
max-height: 92vh;
object-fit: contain;
border-radius: var(--radius);
box-shadow: 0 12px 48px rgba(0,0,0,0.25);
}
.lb-close {
position: absolute;
top: 14px;
right: 14px;
width: 34px;
height: 34px;
background: rgba(255,255,255,0.1);
border: 1px solid rgba(255,255,255,0.15);
border-radius: 50%;
color: rgba(255,255,255,0.7);
font-size: 18px;
cursor: pointer;
display: flex;
align-items: center;
justify-content: center;
transition: all var(--transition);
backdrop-filter: blur(8px);
}
.lb-close:hover { background: rgba(255,255,255,0.18); color: #fff; }
/* ── Loading ──────────────────────────────────────────────────────── */
.loading {
position: fixed;
inset: 0;
background: rgba(247,244,238,0.6);
display: flex;
justify-content: center;
align-items: center;
z-index: 400;
backdrop-filter: blur(2px);
}
.spinner {
width: 24px;
height: 24px;
border: 2px solid var(--border);
border-top-color: var(--accent);
border-radius: 50%;
animation: spin 0.65s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
/* ── Responsive ───────────────────────────────────────────────────── */
@media (max-width: 768px) {
.sidebar { width: 100%; }
.gallery-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; padding: 12px; }
.compare-grid { grid-template-columns: 1fr; }
.drawer { width: 100%; }
.toolbar { padding: 6px 12px; }
.gallery-toolbar { padding: 6px 12px; }
.gt-hint { display: none; }
#search-input { width: 120px; }
}
@media (prefers-reduced-motion: reduce) {
*, *::before, *::after { transition-duration: 0ms !important; animation-duration: 0ms !important; }
}