diff --git a/web/src/components.css b/web/src/components.css index 5b12e32..053c3aa 100644 --- a/web/src/components.css +++ b/web/src/components.css @@ -272,48 +272,6 @@ body { animation: none; } -/* ---- type roles --------------------------------------------------------- */ - -/* one role per job: page title, section, group label, row title, readout */ -.page-title { - margin: 0; - min-width: 0; - font-family: var(--font-display); - font-size: var(--text-lg); - font-weight: 700; - letter-spacing: 0.04em; - line-height: 1.1; - overflow: hidden; - white-space: nowrap; - text-overflow: ellipsis; -} - -.section-title { - margin: 0; - font-family: var(--font-display); - font-size: var(--text-md); - font-weight: 600; - letter-spacing: 0.08em; - text-transform: uppercase; - line-height: 1.2; - color: var(--ink-muted); -} - -/* the engraved micro-label: a group inside a section, never a kicker */ -.deck-label { - margin: 0; - font-size: var(--text-2xs); - font-weight: 600; - text-transform: uppercase; - letter-spacing: 0.12em; - color: var(--ink-muted); -} - -.deck-count { - font-size: var(--text-xs); - color: var(--ink-faint); -} - /* ---- glyphs ---------------------------------------------------------------- */ .icon { @@ -355,188 +313,6 @@ body { letter-spacing: 0.06em; } -/* ---- chips ---------------------------------------------------------------- */ - -/* a label, not a target: shorter than a control, one line always */ -.chip { - display: inline-flex; - flex: none; - align-items: center; - gap: var(--space-1); - height: var(--chip-h); - padding: 0 var(--space-2); - background: var(--panel-raised); - border: 1px solid var(--line); - border-radius: 3px; - font-family: var(--font-readout); - font-size: var(--text-2xs); - font-variant-numeric: tabular-nums; - line-height: 1; - white-space: nowrap; - color: var(--ink-muted); -} - -.chip .icon { - width: 0.75rem; - height: 0.75rem; - stroke-width: 1.7; -} - -/* a chip that explains itself on tap (§9.6 tooltips have no touch) */ -.chip[data-explain], -.chip[role="button"], -button.chip { - font: inherit; - font-family: var(--font-readout); - font-size: var(--text-2xs); - cursor: pointer; - transition: - color 150ms var(--ease-out), - border-color 150ms var(--ease-out); -} - -.chip[data-explain]:hover, -.chip[data-explain][aria-expanded="true"] { - border-color: currentColor; -} - -/* release verdicts */ -.chip[data-verdict="eligible"] { - color: var(--verdict-eligible); - border-color: oklch(from var(--verdict-eligible) l c h / 45%); -} - -/* the dashed border is the visible mark of a relaxed rule */ -.chip[data-verdict="waived"] { - color: var(--verdict-waived); - border-style: dashed; - border-color: oklch(from var(--verdict-waived) l c h / 55%); -} - -.chip[data-verdict="rejected"] { - color: var(--verdict-rejected); -} - -/* a subtitle wanted and not yet on disk is the system's errand, not yours */ -.chip[data-verdict="wanted"] { - color: var(--ink); - border-color: var(--line-strong); -} - -/* #227: blacklisted at import — the policy's own floor (amber, act on it) or - the release itself broken (fault red) */ -.chip[data-blacklist="policy"] { - color: var(--signal-warn); - border-color: oklch(from var(--signal-warn) l c h / 55%); -} - -.chip[data-blacklist="release"] { - color: var(--signal-fault); - border-color: oklch(from var(--signal-fault) l c h / 55%); -} - -/* media state (§4.2): green on disk, violet downloading; wanted-and-missing - is ink — the system is on it, nothing needs you yet */ -.chip[data-movie-state="available"] { - color: var(--signal-ok); - border-color: oklch(from var(--signal-ok) l c h / 45%); -} - -.chip[data-movie-state="downloading"] { - color: var(--status-airing); - border-color: oklch(from var(--status-airing) l c h / 45%); -} - -.chip[data-movie-state="missing"][data-wanted="true"] { - color: var(--ink); - border-color: var(--line-strong); -} - -/* §9.8: the slot is refilled in place by the poll and takes no box itself */ -.dl-slot { - display: contents; -} - -/* §9.8: live download state, fixed width so 9% → 10% never moves a neighbour */ -.dl-chip { - min-width: 7ch; - justify-content: center; -} - -.dl-chip[data-dl-phase="downloading"] { - color: var(--status-airing); - border-color: oklch(from var(--status-airing) l c h / 45%); -} - -.dl-chip[data-dl-phase="stalled"] { - color: var(--signal-warn); - border-color: oklch(from var(--signal-warn) l c h / 55%); -} - -.dl-chip[data-dl-phase="errored"] { - color: var(--signal-fault); - border-color: oklch(from var(--signal-fault) l c h / 55%); -} - -.dl-chip[data-dl-phase="seeding"] { - color: var(--signal-ok); - border-color: oklch(from var(--signal-ok) l c h / 45%); -} - -/* library status (§4.2): violet while live, green once complete; incomplete - and waiting are neutral — amber is kept for what needs you */ -.chip[data-status="airing"] { - color: var(--status-airing); - border-color: oklch(from var(--status-airing) l c h / 45%); -} - -.chip[data-status="incomplete"] { - color: var(--ink); - border-color: var(--line-strong); -} - -.chip[data-status="complete"], -.chip[data-status="ended"], -.chip[data-counts="complete"] { - color: var(--signal-ok); - border-color: oklch(from var(--signal-ok) l c h / 45%); -} - -.chip[data-counts="partial"] { - color: var(--ink); -} - -/* issue 122: gone upstream while its file remained — a conflict, amber dashed */ -.chip[data-flag="vanished"] { - color: var(--signal-warn); - border-style: dashed; - border-color: oklch(from var(--signal-warn) l c h / 55%); -} - -/* a machine translation reads as machine-made (§15) — the relaxed-case dash */ -.chip[data-mt="true"] { - border-style: dashed; -} - -.chip[data-tone="fault"] { - color: var(--signal-fault); - border-color: oklch(from var(--signal-fault) l c h / 55%); -} - -/* a chip whose whole label is its glyph */ -.chip-glyph { - min-width: var(--chip-h); - justify-content: center; - padding: 0 var(--space-1); -} - -.star { - width: 0.625rem; - height: 0.625rem; - flex: none; - fill: var(--ink); -} - /* ---- the row ------------------------------------------------------------------ */ /* lead | body | actions, then the tray full width. The body is minmax(0, 1fr): @@ -612,10 +388,6 @@ button.chip { display: none; } -.r-meta [data-pri="2"] { - display: none; -} - .r-sub { min-width: 0; overflow: hidden; @@ -937,10 +709,6 @@ button.chip { } @container (min-width: 40rem) { - .r-meta [data-pri="2"] { - display: inline-flex; - } - .r-slot[data-wide] { display: flex; } @@ -1198,10 +966,6 @@ button.chip { padding-top: var(--space-2); } -.page-head .page-title { - flex: 0 1 auto; -} - .page-id { display: grid; min-width: 0; @@ -1389,10 +1153,6 @@ button.chip { display: block; } - .page-title { - font-size: var(--text-xl); - } - .more-panel { grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: end; @@ -1492,18 +1252,6 @@ button.chip { border-color: oklch(from var(--signal-fault) l c h / 40%); } -.deck-notice .deck-label { - margin-bottom: var(--space-2); -} - -.deck-notice[data-blacklist="policy"] .deck-label { - color: var(--signal-warn); -} - -.deck-notice[data-blacklist="release"] .deck-label { - color: var(--signal-fault); -} - .notice-release { margin: 0 0 var(--space-2); overflow-wrap: anywhere; @@ -1533,17 +1281,6 @@ button.chip { /* ---- subtitles (§15, §9.6) -------------------------------------------- */ -/* the one subtitle chip a file's row carries: it opens the panel */ -.subs-chip .icon { - opacity: 0.7; -} - -.subs-chip:hover, -.subs-chip:focus-visible, -.subs-chip[aria-expanded="true"] { - border-color: currentColor; -} - /* the languages read as one string, as wide as the wanted set can need */ .subs-chip-langs { display: inline-flex; diff --git a/web/src/detail.tsx b/web/src/detail.tsx index c1c29e6..4fa3e58 100644 --- a/web/src/detail.tsx +++ b/web/src/detail.tsx @@ -3,7 +3,7 @@ import { type CSSProperties, type ReactNode, useEffect, useRef, useState } from "react"; import { Icon, ProviderMark, Star } from "./icons"; -import { control } from "./look"; +import { control, type } from "./look"; import { formatMetaLine, formatRating, formatVoteCount, tmdbImage } from "./movie"; import { type ActionOutcome, formatSize, totalSize } from "./releases"; import { cx, flag, IconControl, IconLink, type Note, NoteLine } from "./ui"; @@ -66,7 +66,7 @@ export function Hero({ >
-

+

{title === "" ? " " : title}

{year === null ? "" : year} diff --git a/web/src/icons.tsx b/web/src/icons.tsx index 52d5187..b657f9a 100644 --- a/web/src/icons.tsx +++ b/web/src/icons.tsx @@ -105,7 +105,7 @@ export function ProviderMark({ name }: { name: "tmdb" | "tvdb" | "imdb" | "rt" } /** The drawn star before a TMDB rating — no glyph standing in for an icon. */ export function Star() { return ( - + {download !== null && ( - {glyph && } + {glyph && } {label} ); diff --git a/web/src/style.css b/web/src/style.css index 8ed4518..161699b 100644 --- a/web/src/style.css +++ b/web/src/style.css @@ -79,6 +79,10 @@ --spacing-disclose: 9rem; /* a toggle's on / off word */ --spacing-state: 3ch; + /* a download chip: 100% at its widest */ + --spacing-dl: 7ch; + /* a lamp's dot, and the rating star the same size */ + --spacing-lamp: 0.625rem; --container-deck: var(--deck-max); --container-measure: var(--measure); @@ -105,6 +109,7 @@ --radius-pill: 999px; --radius-round: 50%; --radius-micro: 2px; + --radius-chip: 3px; --font-weight-semibold: 600; --font-weight-bold: 700; diff --git a/web/src/subs-panel.tsx b/web/src/subs-panel.tsx index 624a712..2ca5998 100644 --- a/web/src/subs-panel.tsx +++ b/web/src/subs-panel.tsx @@ -4,7 +4,7 @@ import { type ReactNode, useEffect, useRef, useState } from "react"; import { ArmedDeleteIcon, Icon } from "./icons"; -import { control, seg, segmented } from "./look"; +import { CHIP_ICON, chip as chipLook, control, cx, seg, segmented } from "./look"; import { fileName } from "./movie"; import { cachedSubtitleOptions, @@ -539,7 +539,13 @@ export function useSubtitleSection( const chip = ( ); diff --git a/web/src/ui.tsx b/web/src/ui.tsx index 2e09413..a518f14 100644 --- a/web/src/ui.tsx +++ b/web/src/ui.tsx @@ -16,7 +16,7 @@ import { useState, } from "react"; import { Icon, type IconName, useArmed } from "./icons"; -import { type ControlLook, control, cx, toggle, toggleLamp, toggleState } from "./look"; +import { type ControlLook, chip, control, cx, toggle, toggleLamp, toggleState, type } from "./look"; export type Tone = "fault" | "warn"; @@ -359,17 +359,43 @@ function useExplain(explain: Explain | undefined) { } export interface ChipProps extends HTMLAttributes { - /** `chip readout` by default; a glyph chip drops the readout face. */ - base?: string; + /** The whole label is a glyph. */ + glyph?: boolean; + /** A live download's chip. */ + download?: boolean; explain?: Explain; [data: `data-${string}`]: string | undefined; } -/** A chip, the §9.3 column unit. */ -export function Chip({ base = "chip readout", className, explain, children, ...rest }: ChipProps) { +/** A chip, the §9.3 column unit. Its look is read off its own data attributes. */ +export function Chip({ glyph, download, className, explain, children, ...rest }: ChipProps) { const explainProps = useExplain(explain); return ( - + {children} ); @@ -612,8 +638,8 @@ export function PageBar({ }) { return (
-

{title}

- {count !== undefined && {count}} +

{title}

+ {count !== undefined && {count}} {children}
@@ -661,14 +687,15 @@ export function DeckHead({ label, labelId, as: Heading = "h3", - labelClass = "deck-label", + titled = "label", count, children, }: { label: string; labelId?: string; as?: "h3" | "h4"; - labelClass?: string; + /** A page's section title, or a group's engraved label. */ + titled?: "section" | "label"; count?: string | number | null; children?: ReactNode; }) { @@ -681,10 +708,13 @@ export function DeckHead({ nested ? "min-h-chip-h pt-3" : "min-h-control-h", )} > - + {label} - {count !== undefined && {count ?? ""}} + {count !== undefined && {count ?? ""}} {children}
); diff --git a/web/src/views/Movie.tsx b/web/src/views/Movie.tsx index 0627dfc..7fe9eb1 100644 --- a/web/src/views/Movie.tsx +++ b/web/src/views/Movie.tsx @@ -556,7 +556,7 @@ export function MovieView({ movieId, toReleases }: { movieId: number; toReleases @@ -580,7 +580,7 @@ export function MovieView({ movieId, toReleases }: { movieId: number; toReleases
- +
diff --git a/web/src/views/Series.tsx b/web/src/views/Series.tsx index 5855fa0..2a628a6 100644 --- a/web/src/views/Series.tsx +++ b/web/src/views/Series.tsx @@ -821,7 +821,7 @@ export function SeriesView({ seriesId, covered }: { seriesId: number; covered: b
- + {seasons === null && } {seasons?.map((season) => ( diff --git a/web/src/views/Settings.tsx b/web/src/views/Settings.tsx index 668a882..a3292af 100644 --- a/web/src/views/Settings.tsx +++ b/web/src/views/Settings.tsx @@ -1131,12 +1131,12 @@ export function SettingsView({ hidden }: { hidden: boolean }) { />
- +