//! Components: buttons, form controls, cards, alerts, tables, badges, the empty state, the 404 page //! and the "server restarting" bar. Each is one class (or one element) with its states. // --- Buttons ----------------------------------------------------------------------------------- .button { display: inline-flex; align-items: center; justify-content: center; gap: var(--space-2); min-height: 2.25rem; padding: var(--space-2) var(--space-4); border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); color: var(--text); font: inherit; font-weight: 550; text-decoration: none; cursor: pointer; box-shadow: var(--shadow); transition: background-color 120ms ease, border-color 120ms ease; } .button:hover { background: var(--surface-2); color: var(--text); } .button:disabled, .button[aria-disabled="true"] { opacity: 0.55; cursor: not-allowed; } .button.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-text); } .button.primary:hover { background: var(--accent-strong); border-color: var(--accent-strong); color: var(--accent-text); } .button.danger { color: var(--danger); border-color: var(--danger); } .button.ghost { background: transparent; box-shadow: none; border-color: transparent; } // --- Form controls ---------------------------------------------------------------------------- label { display: block; font-weight: 550; font-size: var(--text-sm); margin-bottom: var(--space-1); } input:not([type="checkbox"]):not([type="radio"]), select, textarea { width: 100%; min-height: 2.25rem; padding: var(--space-2) var(--space-3); border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); color: var(--text); font: inherit; } textarea { min-height: 6rem; resize: vertical; } input:focus, select:focus, textarea:focus { outline: 2px solid var(--focus); outline-offset: 0; border-color: transparent; } input::placeholder, textarea::placeholder { color: var(--muted); opacity: 0.8; } .field { display: grid; gap: var(--space-1); } .field + .field { margin-top: var(--space-4); } .field-hint { color: var(--muted); font-size: var(--text-sm); } // --- Cards and text --------------------------------------------------------------------------- .card { padding: var(--space-6); background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); } .card > :last-child { margin-bottom: 0; } .card-title { margin-bottom: var(--space-2); } .muted { color: var(--muted); } .kicker { margin-bottom: var(--space-2); color: var(--muted); font-size: var(--text-sm); font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; } // --- Alerts ----------------------------------------------------------------------------------- .alert, .notice { padding: var(--space-3) var(--space-4); border-radius: var(--radius-sm); border: 1px solid transparent; } .alert { background: var(--danger-soft); color: var(--danger); border-color: var(--danger); } .notice { background: var(--accent-soft); color: var(--text); border-color: var(--accent-soft); } .warning { padding: var(--space-3) var(--space-4); border-radius: var(--radius-sm); border: 1px solid var(--warn); background: var(--warn-soft); color: var(--warn); } // --- Tables and badges ------------------------------------------------------------------------ .table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); } .table { width: 100%; border-collapse: collapse; font-size: var(--text-sm); } .table th, .table td { padding: var(--space-2) var(--space-3); text-align: left; border-bottom: 1px solid var(--border); vertical-align: top; } .table th { color: var(--muted); font-weight: 600; background: var(--surface-2); } .table tr:last-child td { border-bottom: 0; } .badge { display: inline-block; padding: 0.1rem var(--space-2); border-radius: 999px; background: var(--surface-2); color: var(--muted); font-size: 0.8rem; font-weight: 600; white-space: nowrap; } .badge.accent { background: var(--accent-soft); color: var(--accent-strong); } // --- Empty state and the 404 page ------------------------------------------------------------- .empty-state { display: grid; justify-items: center; gap: var(--space-3); padding: var(--space-8) var(--space-6); text-align: center; color: var(--muted); border: 1px dashed var(--border); border-radius: var(--radius); } .empty-state h2 { margin: 0; color: var(--text); } .empty-state p { margin: 0; max-width: 34rem; } .not-found { text-align: center; padding-block: var(--space-8); } .not-found-code { margin: 0; font-size: 3.5rem; font-weight: 700; letter-spacing: -0.03em; color: var(--accent); line-height: 1; } // --- Server restarting bar -------------------------------------------------------------------- // Pinned to the bottom edge. nav.js creates it only while the server is unreachable, so a page // that never loses the server never shows it. .restart-bar { position: fixed; left: 50%; bottom: var(--space-4); z-index: 50; transform: translateX(-50%); display: flex; align-items: center; gap: var(--space-3); max-width: calc(100vw - 2 * var(--space-4)); padding: var(--space-2) var(--space-4); border-radius: 999px; background: var(--warn-soft); color: var(--warn); border: 1px solid var(--warn); box-shadow: var(--shadow-lift); font-size: var(--text-sm); font-weight: 550; animation: restart-in 180ms ease-out; } .restart-bar::before { content: ""; width: 0.55rem; height: 0.55rem; border-radius: 50%; background: currentColor; animation: restart-pulse 1.2s ease-in-out infinite; } @keyframes restart-in { from { opacity: 0; transform: translate(-50%, 0.5rem); } } @keyframes restart-pulse { 50% { opacity: 0.25; } } // While the page is loading a soft navigation or a refresh, its content dims a little. .is-loading main { opacity: 0.6; transition: opacity 120ms ease; } @media (prefers-reduced-motion: reduce) { .restart-bar, .restart-bar::before { animation: none; } .is-loading main, .button { transition: none; } } // The drive: listings, forms that sit in a row, row menus, breadcrumbs, the quota bar and the pickers. .drive { display: flex; flex-direction: column; gap: 1rem; } .crumbs ol { display: flex; flex-wrap: wrap; gap: 0.35rem; list-style: none; margin: 0; padding: 0; color: var(--muted); } .crumbs li + li::before { content: "/"; padding-inline-end: 0.35rem; } .toolbar { display: flex; flex-wrap: wrap; gap: 0.75rem; align-items: center; } .inline-form { display: inline-flex; flex-wrap: wrap; gap: 0.4rem; align-items: center; margin: 0; } .inline-form input[type="text"], .inline-form input:not([type]), .inline-form input[type="search"], .inline-form input[type="file"] { min-width: 12rem; } .actions { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; } .row-menu summary { cursor: pointer; color: var(--accent); } .row-menu-body { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; margin-block-start: 0.5rem; } .details { display: grid; grid-template-columns: max-content 1fr; gap: 0.35rem 1rem; margin: 0; } .details dt { color: var(--muted); } .details dd { margin: 0; } .quota { display: flex; flex-direction: column; align-items: flex-end; font-size: 0.85rem; } .quota progress { width: 9rem; } .pick-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 0.35rem; } .pick-list .button { justify-content: flex-start; width: 100%; text-align: start; } .bulk { margin-block-start: 0.5rem; } .trash .table td form { display: inline-flex; } // --- Upload queue and drop overlay --------------------------------------------------------------- // The queue panel sits outside
, so a soft refresh of the listing does not drop it. The overlay // shows while files are dragged over a drive page. .upload-queue { position: fixed; right: var(--space-4); bottom: var(--space-4); z-index: 40; width: min(24rem, calc(100vw - 2 * var(--space-4))); max-height: 50vh; overflow: auto; padding: var(--space-3); border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); box-shadow: var(--shadow); } .upload-list { display: grid; gap: var(--space-2); margin: 0; padding: 0; list-style: none; } .upload-item { display: grid; grid-template-columns: 1fr auto; gap: var(--space-1) var(--space-2); align-items: center; progress { grid-column: 1 / -1; width: 100%; } &[data-state="failed"] .upload-status { color: var(--danger); } &[data-state="done"] .upload-status { color: var(--ok); } } .upload-name { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; } .upload-status { color: var(--muted); font-size: 0.875rem; } .drop-overlay { position: fixed; inset: var(--space-3); z-index: 50; display: none; align-items: center; justify-content: center; border: 2px dashed var(--accent); border-radius: var(--radius); background: var(--accent-soft); color: var(--accent-strong); font-weight: 600; pointer-events: none; } .drop-overlay.drop-overlay-show { display: flex; } // --- Thumbnails and the viewer --------------------------------------------------------------- .name-cell { display: flex; align-items: center; gap: var(--space-3); } .thumb { flex: none; width: 2.5rem; height: 2.5rem; border-radius: var(--radius-sm); object-fit: cover; background: var(--surface-2); } .thumb-icon { display: inline-flex; align-items: center; justify-content: center; border: 1px solid var(--border); color: var(--muted); font-family: var(--font-mono); font-size: 0.7rem; } .viewer-page .viewer-nav { display: flex; justify-content: space-between; gap: var(--space-2); margin-block: var(--space-3); } .viewer-stage { display: flex; flex-direction: column; align-items: center; gap: var(--space-3); min-height: 12rem; } .viewer-image { max-width: 100%; max-height: 75vh; object-fit: contain; border-radius: var(--radius-sm); } .viewer-video, .viewer-audio { max-width: 100%; } .viewer-video { max-height: 75vh; } .viewer-frame { width: 100%; height: 75vh; border: 1px solid var(--border); border-radius: var(--radius-sm); } .viewer-text { align-self: stretch; max-height: 75vh; overflow: auto; margin: 0; padding: var(--space-4); border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); font-family: var(--font-mono); font-size: 0.875rem; white-space: pre-wrap; overflow-wrap: anywhere; } .viewer-card { padding: var(--space-6); text-align: center; }