Refonte de l'interface et nouveau nom : Bobinoo

- Thème « salle de cinéma » : fond salle obscure chaud (clair = papier crème), accent ambre par défaut
  (l'ancien rouge par défaut passe à l'ambre, préréglage Rouge conservé), coins presque droits
- Polices embarquées : Gloock (titres), Onest (texte), Sometype Mono (codes d'épisode) ; Inter retirée
- Accueil : bannière en carte avec pellicule d'épisodes, billets « Reprendre » avec talon +1,
  jaquettes VHS pour « À voir » ; pellicule aussi sur la fiche et le revisionnage
- Plus de petites capitales espacées ni de titres bicolores ; métadonnées sans points médians
- Nouvelle icône (bobine), pages légales/404 et carte de partage aux nouvelles couleurs
- Kino → Bobinoo partout (18 langues, PWA, pages légales) ; identifiants techniques inchangés

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01YVo1qxKoBQCaMd7Ue8PGbe
This commit is contained in:
Claude committed 2026-11-27 15:43:42 +00:00
1 parent 0cef90ceae
commit 59f515663e
80 files changed
+697 -544

No files matched your search

+1 -1
View File
@@ -120,7 +120,7 @@ export default function AccountSection({ account, onMessage }: { account: Accoun
<span className="block font-medium">{t('social.myProfile')}</span>
{social.me && <span className="mt-0.5 block text-xs text-ink-3">@{social.me.username}</span>}
</span>
{social.requests.length > 0 && <span className="rounded-full bg-accent-fill px-2 text-[11px] font-bold text-on-accent">{social.requests.length}</span>}
{social.requests.length > 0 && <span className="rounded-md bg-accent-fill px-2 text-[11px] font-bold text-on-accent">{social.requests.length}</span>}
<span className="text-ink-3">→</span>
</button>
+4 -4
View File
@@ -41,7 +41,7 @@ function Shell({ children, subtitle }: { children: ReactNode; subtitle: string }
<p className="mt-3 text-center text-sm text-ink-3">{subtitle}</p>
<div className="mt-9">{children}</div>
<div className="mt-10 flex justify-center">
<LanguageSelect className="rounded-full border border-line bg-transparent px-3 py-1.5 text-xs text-ink-3" />
<LanguageSelect className="rounded-md border border-line bg-transparent px-3 py-1.5 text-xs text-ink-3" />
</div>
</div>
</div>
@@ -120,13 +120,13 @@ export default function AuthScreen({ notice, onExplore, initialMode = 'login' }:
return (
<Shell subtitle={t('auth.tagline')}>
{mode !== 'forgot' && (
<div className="mb-5 grid grid-cols-2 gap-1 rounded-full border border-line p-1">
<div className="mb-5 grid grid-cols-2 gap-1 rounded-md border border-line p-1">
{(['login', 'signup'] as const).map((m) => (
<button
key={m}
type="button"
onClick={() => switchTo(m)}
className={cx('rounded-full py-2 text-sm font-medium transition-colors', mode === m ? 'bg-ink text-bg' : 'text-ink-3')}
className={cx('rounded-md py-2 text-sm font-medium transition-colors', mode === m ? 'bg-ink text-bg' : 'text-ink-3')}
>
{m === 'login' ? t('auth.loginTab') : t('auth.signupTab')}
</button>
@@ -211,7 +211,7 @@ export default function AuthScreen({ notice, onExplore, initialMode = 'login' }:
</form>
{onExplore && mode !== 'forgot' && (
<button type="button" onClick={onExplore} className="mt-4 w-full rounded-full py-2.5 text-sm font-medium text-ink-2 transition-colors hover:text-ink">
<button type="button" onClick={onExplore} className="mt-4 w-full rounded-md py-2.5 text-sm font-medium text-ink-2 transition-colors hover:text-ink">
{t('guest.explore')} <span className="text-accent rtl:-scale-x-100">→</span>
</button>
)}
+2 -2
View File
@@ -7,14 +7,14 @@ import type { MediaItem, WatchStatus } from '../types'
export function TypeBadge({ item, className }: { item: Pick<MediaItem, 'type' | 'subtype'>; className?: string }) {
const info = TYPE_BY_VALUE[item.type]
return (
<span className={cx('inline-flex items-center rounded-full border border-line-strong px-2 py-0.5 text-[10px] font-semibold uppercase tracking-[0.04em] text-ink-2', className)}>
<span className={cx('inline-flex items-center rounded-[3px] border border-line-strong px-1.5 py-0.5 text-[11px] font-semibold leading-none text-ink-2', className)}>
{item.type === 'autre' && item.subtype ? subtypeLabel(item.subtype) : info.label}
</span>
)
}
export function StatusDot({ status, className }: { status: WatchStatus; className?: string }) {
return <span className={cx('inline-block size-1.5 shrink-0 rounded-full', STATUS_BY_VALUE[status].dot, className)} />
return <span className={cx('inline-block size-[7px] shrink-0 rounded-[1px]', STATUS_BY_VALUE[status].dot, className)} />
}
export function StatusPill({ status }: { status: WatchStatus }) {
+4 -4
View File
@@ -64,7 +64,7 @@ function EntryRow({ e, onOpen, onAdd, busy, added }: { e: Entry; onOpen: (i: Med
<p className={cx('mt-0.5 truncate text-xs', mine ? 'text-accent' : 'text-ink-2')}>{e.label}</p>
<div className="mt-1 flex items-center gap-1.5">
<TypeBadge item={{ type: e.type, subtype: e.item?.subtype }} />
{mine && <span className="text-[10px] font-semibold uppercase tracking-[0.04em] text-accent">{t('calendar.inMyList')}</span>}
{mine && <span className="text-[10px] font-semibold text-accent">{t('calendar.inMyList')}</span>}
</div>
</div>
</>
@@ -84,7 +84,7 @@ function EntryRow({ e, onOpen, onAdd, busy, added }: { e: Entry; onOpen: (i: Med
onClick={() => onAdd(e)}
disabled={busy || added}
className={cx(
'flex h-8 shrink-0 items-center gap-1 rounded-full px-2.5 text-xs font-semibold transition active:scale-95',
'flex h-8 shrink-0 items-center gap-1 rounded-md px-2.5 text-xs font-semibold transition active:scale-95',
added ? 'text-accent' : 'border border-line-strong text-ink-2',
)}
aria-label={added ? t('reco.added', { title: e.title }) : t('reco.addLabel', { title: e.title })}
@@ -392,12 +392,12 @@ export default function CalendarView({ onClose, onOpen }: { onClose: () => void;
<div className="sheet-scroll">
<div className="safe-bottom mx-auto max-w-2xl px-4 pb-16 pt-4">
{/* Toutes les sorties / mes titres */}
<div className="mb-3 grid grid-cols-2 gap-1 rounded-full border border-line p-1">
<div className="mb-3 grid grid-cols-2 gap-1 rounded-md border border-line p-1">
{(['all', 'mine'] as const).map((m) => (
<button
key={m}
onClick={() => setPrefs((p) => ({ ...p, mode: m }))}
className={cx('rounded-full py-2 text-sm font-medium transition-colors', prefs.mode === m ? 'bg-ink text-bg' : 'text-ink-3')}
className={cx('rounded-md py-2 text-sm font-medium transition-colors', prefs.mode === m ? 'bg-ink text-bg' : 'text-ink-3')}
>
{m === 'all' ? t('calendar.all') : t('calendar.mine')}
</button>
+1 -1
View File
@@ -132,7 +132,7 @@ export default function EpisodeList({ form, aired, onChange }: Props) {
)}
</span>
<span className="min-w-0 flex-1">
<span className="block text-[11px] font-medium uppercase tracking-wide text-ink-3">
<span className="block text-[11px] font-medium text-ink-3">
{t('episodes.short', { n: e.number })}
{e.date && ` · ${upcoming ? t('episodes.upcoming', { date: fmtDate(e.date) }) : fmtDate(e.date)}`}
</span>
+84 -50
View File
@@ -5,11 +5,13 @@ import { t } from '../i18n'
import { TYPE_BY_VALUE } from '../lib/constants'
import { canWatchMore, nextAirDate } from '../lib/airing'
import { episodeCap, seasonPosition } from '../lib/franchise'
import { progressView } from '../lib/rewatch'
import { genreLabel } from '../lib/genres'
import { backdropSrcSet, tmdbSized } from '../lib/tmdbImage'
import { cx, formatDate } from '../lib/utils'
import { useMedia } from '../store'
import { useToast } from './Toast'
import { FilmStrip } from './ui'
import type { MediaItem } from '../types'
/** Où j'en suis : « S2 · É3 » (épisode suivant à voir) */
@@ -17,7 +19,7 @@ export function nextEpisodeLabel(item: MediaItem): string | undefined {
if (!TYPE_BY_VALUE[item.type].episodic || !canWatchMore(item)) return undefined
const pos = seasonPosition({ ...item, episodesWatched: item.episodesWatched + 1, season: undefined })
const ep = t('episodes.short', { n: pos ? pos.episode : item.episodesWatched + 1 })
return pos ? `${t('episodes.seasonShort', { n: pos.season })} · ${ep}` : ep
return pos ? `${t('episodes.seasonShort', { n: pos.season })}\u2009${ep}` : ep
}
/** Plus rien à cocher : « Tout vu », ou « Prochain épisode le … » si la suite n'est pas encore sortie. */
@@ -28,6 +30,16 @@ export function waitingLabel(item: MediaItem): string {
return date ? t('hero.nextOn', { date: formatDate(date) }) : t('hero.upToDate')
}
/** Progression montrée en pellicule : dans la saison en cours si la série en a plusieurs, sinon sur toute la série. */
function stripProgress(item: MediaItem): { done: number; total: number } | undefined {
if (!TYPE_BY_VALUE[item.type].episodic) return undefined
const view = progressView(item)
const pos = seasonPosition(view)
if (pos) return { done: pos.episode, total: pos.size }
const cap = episodeCap(view)
return cap ? { done: Math.min(view.episodesWatched, cap), total: cap } : undefined
}
/** +1 depuis l'accueil : saison (ou série) finie → on ouvre la fiche sur la note ; revisionnage fini → petit message. */
function usePlusOne(onOpen: (item: MediaItem, focus?: Completion) => void) {
const { incrementEpisode } = useMedia()
@@ -77,11 +89,13 @@ export default function HomeHero({ items, onOpen }: { items: MediaItem[]; onOpen
if (!item) return null
const next = nextEpisodeLabel(item)
const episodic = TYPE_BY_VALUE[item.type].episodic
const meta = [TYPE_BY_VALUE[item.type].label, item.year, ...item.genres.slice(0, 2).map(genreLabel)].filter(Boolean).join(' · ')
const progress = stripProgress(item)
const meta = [TYPE_BY_VALUE[item.type].label, item.year, ...item.genres.slice(0, 2).map(genreLabel)].filter(Boolean)
const state = item.rewatch ? t('rewatch.badge') : item.status === 'en_cours' ? t('homeHero.continue') : t('homeHero.next')
return (
<section
className="relative -mx-4 overflow-hidden sm:mx-0 sm:rounded-3xl"
className="card overflow-hidden lg:grid lg:grid-cols-[minmax(0,1.4fr)_minmax(0,1fr)]"
aria-roledescription="carousel"
onTouchStart={(e) => (touchX.current = e.touches[0].clientX)}
onTouchEnd={(e) => {
@@ -92,7 +106,7 @@ export default function HomeHero({ items, onOpen }: { items: MediaItem[]; onOpen
if (Math.abs(dx) > 45) go(current + (dx < 0 ? 1 : -1))
}}
>
<button onClick={() => onOpen(item)} className="relative block aspect-[4/3] w-full bg-surface-2 sm:aspect-video lg:aspect-auto lg:h-[min(62vh,34rem)]" aria-label={t('card.open', { title: item.title })}>
<button onClick={() => onOpen(item)} className="relative block aspect-video w-full overflow-hidden bg-surface-2 lg:aspect-auto lg:h-full lg:min-h-[22rem]" aria-label={t('card.open', { title: item.title })}>
{items.map((it, k) => {
const image = it.backdrop ?? it.poster
return image ? (
@@ -100,24 +114,36 @@ export default function HomeHero({ items, onOpen }: { items: MediaItem[]; onOpen
key={it.id}
src={it.backdrop ? tmdbSized(image, 'w1280') : image}
srcSet={it.backdrop ? backdropSrcSet(image) : undefined}
sizes="100vw"
sizes="(min-width: 64rem) 60vw, 100vw"
alt=""
loading={k === 0 ? 'eager' : 'lazy'}
className={cx(
'absolute inset-0 size-full object-cover transition-opacity duration-700',
'absolute inset-0 size-full object-cover transition-opacity duration-500 motion-reduce:transition-none',
!it.backdrop && 'scale-110 blur-md',
k === current ? 'opacity-100' : 'opacity-0',
)}
/>
) : null
})}
<span className="absolute inset-0 bg-bg/50" />
</button>
<div className="pointer-events-none absolute inset-x-0 bottom-0 p-5 lg:p-10">
<p className="eyebrow text-ink-2">{item.rewatch ? t('rewatch.badge') : item.status === 'en_cours' ? t('homeHero.continue') : t('homeHero.next')}</p>
<h2 className="mt-1.5 line-clamp-2 text-[1.9rem] font-bold leading-[1.1] lg:text-5xl">{item.title}</h2>
{meta && <p className="mt-1.5 text-xs text-ink-2">{meta}</p>}
<div className="pointer-events-auto mt-4 flex items-center gap-2">
<div className="flex min-w-0 flex-col p-4 sm:p-5 lg:p-8">
<p className="flex flex-wrap gap-x-3 gap-y-0.5 text-sm text-ink-3">
<span className="font-medium text-accent">{state}</span>
{meta.map((m) => (
<span key={m}>{m}</span>
))}
</p>
<h2 className="mt-1.5 line-clamp-2 text-[2.15rem] leading-[1.02] lg:text-[2.75rem]">{item.title}</h2>
{progress && (
<div className="mt-4">
<div className="flex items-baseline justify-between gap-3 text-sm text-ink-2">
<span>{t('episodes.seen', { done: progress.done, total: progress.total })}</span>
{next && <span className="code text-[13px] text-accent">{next}</span>}
</div>
<FilmStrip className="mt-2" done={progress.done} total={progress.total} label={t('episodes.seen', { done: progress.done, total: progress.total })} />
</div>
)}
<div className="mt-4 flex flex-wrap items-center gap-2 lg:mt-auto lg:pt-6">
{episodic && next ? (
<button
onClick={() => {
@@ -125,66 +151,74 @@ export default function HomeHero({ items, onOpen }: { items: MediaItem[]; onOpen
// Saison (ou série) terminée : on ouvre la fiche sur la note
void plusOne(item)
}}
className="btn btn-primary px-5"
className="btn btn-primary min-w-0 flex-1 sm:flex-none"
>
<Plus size={17} strokeWidth={2.5} /> {t('hero.seenEp', { ep: next })}
</button>
) : episodic ? (
<span className="btn btn-ghost px-5">
<span className="btn btn-ghost">
<Check size={17} /> {waitingLabel(item)}
</span>
) : null}
<button onClick={() => onOpen(item)} className="btn btn-ghost bg-bg/60 px-4">
<button onClick={() => onOpen(item)} className="btn btn-ghost px-4">
<Info size={17} /> {t('homeHero.details')}
</button>
{count > 1 && (
<span className="ms-auto flex items-center gap-1.5">
{items.map((it, k) => (
<button
key={it.id}
onClick={() => go(k)}
className={cx('h-1.5 rounded-full transition-all', k === current ? 'w-5 bg-ink' : 'w-1.5 bg-ink/40')}
aria-label={it.title}
aria-current={k === current}
/>
))}
</span>
)}
</div>
{count > 1 && (
<div className="mt-4 flex items-center gap-1.5">
{items.map((it, k) => (
<button
key={it.id}
onClick={() => go(k)}
className="grid h-6 place-items-center"
aria-label={it.title}
aria-current={k === current}
>
<span className={cx('block h-[3px] rounded-[1px] transition-all motion-reduce:transition-none', k === current ? 'w-6 bg-ink' : 'w-3 bg-line-strong')} />
</button>
))}
</div>
)}
</div>
</section>
)
}
/** Carte horizontale « Reprendre » : image, barre de progression, prochain épisode. */
/** Billet « Reprendre » : vignette, titre, prochain épisode, et le talon détachable qui coche l'épisode (+1). */
export function ContinueCard({ item, onOpen }: { item: MediaItem; onOpen: (item: MediaItem, focus?: Completion) => void }) {
const plusOne = usePlusOne(onOpen)
const image = item.backdrop ?? item.poster
const image = item.poster ?? item.backdrop
const next = nextEpisodeLabel(item)
return (
<article className="w-60 shrink-0">
<div className="relative">
<button onClick={() => onOpen(item)} className="relative block aspect-video w-full overflow-hidden rounded-xl border border-line bg-surface-2" aria-label={t('card.open', { title: item.title })}>
{image && <img src={image} alt="" loading="lazy" className="size-full object-cover" />}
</button>
{next && (
<button
onClick={() => void plusOne(item)}
className="absolute bottom-3 end-2 flex h-8 items-center gap-0.5 rounded-full bg-accent-fill px-3 text-xs font-semibold text-on-accent transition active:scale-90"
aria-label={t('card.plusOne', { title: item.title })}
>
<Plus size={13} strokeWidth={2.5} />1
</button>
)}
</div>
<button onClick={() => onOpen(item)} className="mt-2 block w-full text-start">
<span className="block truncate text-sm font-semibold">{item.title}</span>
<span className="block text-xs text-ink-3">
{item.rewatch && <span className="font-medium text-accent">{t('rewatch.badge')} · </span>}
{next ? t('homeHero.nextUp', { ep: next }) : waitingLabel(item)}
<article className="flex h-[5.5rem] w-72 shrink-0 overflow-hidden rounded-md border border-line bg-surface">
<button onClick={() => onOpen(item)} className="flex min-w-0 flex-1 items-stretch text-start" aria-label={t('card.open', { title: item.title })}>
<span className="block w-[3.6rem] shrink-0 bg-surface-2">{image && <img src={image} alt="" loading="lazy" className="size-full object-cover" />}</span>
<span className="flex min-w-0 flex-1 flex-col justify-center px-3">
<span className="block truncate font-display text-[1.2rem] leading-tight">{item.title}</span>
<span className="mt-0.5 block truncate text-xs text-ink-3">
{item.rewatch && <span className="me-1.5 font-medium text-accent">{t('rewatch.badge')}</span>}
{next ? (
<>
{t('homeHero.nextUp', { ep: '' }).trim()} <span className="code text-ink-2">{next}</span>
</>
) : (
waitingLabel(item)
)}
</span>
</span>
</button>
{next && (
<span className="ticket-stub grid w-[4.25rem] shrink-0 place-items-center">
<button
onClick={() => void plusOne(item)}
className="grid size-10 place-items-center rounded-full border-[1.5px] border-accent text-accent transition hover:bg-accent-fill hover:text-on-accent active:scale-90 motion-reduce:transition-none"
aria-label={t('card.plusOne', { title: item.title })}
>
<Plus size={18} strokeWidth={2.25} />
</button>
</span>
)}
</article>
)
}
+1 -1
View File
@@ -93,7 +93,7 @@ export default function JournalView({ onOpen }: { onOpen: (item: MediaItem) => v
<button onClick={() => onOpen(e.item)} className="flex w-full items-center gap-3 py-2.5 text-start">
<span className="w-9 shrink-0 text-center">
<span className="block text-xl font-bold leading-none tabular-nums">{d.getDate()}</span>
<span className="block text-[10px] uppercase text-ink-3">{d.toLocaleDateString(locale(), { weekday: 'short' }).replace('.', '')}</span>
<span className="block text-[10px] text-ink-3">{d.toLocaleDateString(locale(), { weekday: 'short' }).replace('.', '')}</span>
</span>
<div className="w-10 shrink-0">
<Poster src={e.item.poster} title={e.item.title} />
+6 -8
View File
@@ -22,15 +22,13 @@ function Progress({ item }: { item: MediaItem }) {
const season = pos?.season ?? item.season
return (
<div className="mt-1.5">
<div className="flex justify-between text-[10.5px] text-ink-3">
<span>
{season ? `${t('episodes.seasonShort', { n: season })} · ` : ''}{t('card.ep', { n: done })}
{size ? `/${size}` : ''}
</span>
<div className="code text-[11px] text-ink-3">
{season ? `${t('episodes.seasonShort', { n: season })}\u2009` : ''}{t('episodes.short', { n: done })}
{size ? `/${size}` : ''}
</div>
{size ? (
<div className="mt-1.5 h-[3px] overflow-hidden rounded-full bg-line">
<div className="h-full rounded-full bg-accent" style={{ width: `${pct}%` }} />
<div className="mt-1.5 h-1 overflow-hidden rounded-[1px] bg-film-frame">
<div className="h-full bg-accent-fill" style={{ width: `${pct}%` }} />
</div>
) : null}
</div>
@@ -64,7 +62,7 @@ export const MediaCard = memo(function MediaCard({ item, onOpen }: { item: Media
{canIncrement && (
<button
onClick={() => incrementEpisode(item.id)}
className="absolute bottom-2 end-2 flex h-8 items-center gap-0.5 rounded-full bg-accent-fill px-3 text-xs font-medium text-on-accent transition active:scale-90"
className="absolute bottom-2 end-2 flex h-8 items-center gap-0.5 rounded-full bg-accent-fill px-2.5 text-xs font-bold text-on-accent transition -rotate-3 active:scale-90 motion-reduce:transition-none"
aria-label={t('card.plusOne', { title: item.title })}
>
<Plus size={13} strokeWidth={2.5} />1
+2 -2
View File
@@ -117,7 +117,7 @@ export default function Recommendations() {
return (
<>
<SectionTitle action={seeds.length > 1 ? <LinkArrow onClick={() => setIndex((i) => i + 1)}>{t('reco.other')}</LinkArrow> : undefined}>
{t('reco.ifYouLiked')} <span className="normal-case tracking-normal text-accent">{seed.title}</span>
{t('reco.ifYouLiked')} <span className="text-accent">{seed.title}</span>
</SectionTitle>
{error ? (
@@ -139,7 +139,7 @@ export default function Recommendations() {
<button
onClick={() => addToWatchlist(r)}
disabled={done || !!busy}
className="absolute bottom-2 end-2 flex h-8 items-center gap-1 rounded-full bg-accent-fill px-2.5 text-xs font-semibold text-on-accent transition active:scale-90 disabled:opacity-90"
className="absolute bottom-2 end-2 flex h-8 items-center gap-1 rounded-md bg-accent-fill px-2.5 text-xs font-semibold text-on-accent transition active:scale-90 disabled:opacity-90"
aria-label={done ? t('reco.added', { title: r.title }) : t('reco.addLabel', { title: r.title })}
>
{busy === r.externalId ? <Loader2 size={13} className="animate-spin" /> : done ? <Check size={13} strokeWidth={3} /> : <Plus size={13} strokeWidth={3} />}
+2 -2
View File
@@ -347,13 +347,13 @@ export default function Roulette({ onClose, onOpen }: Props) {
<div>
<span className="label">{t('roulette.time')}</span>
<div className="grid grid-cols-4 gap-1 rounded-full border border-line p-1">
<div className="grid grid-cols-4 gap-1 rounded-md border border-line p-1">
{TIME_OPTIONS.map((o) => (
<button
key={o.value}
onClick={() => setF({ time: o.value })}
disabled={spinning}
className={cx('rounded-full py-2 text-xs font-medium transition-colors', filters.time === o.value ? 'bg-ink text-bg' : 'text-ink-3')}
className={cx('rounded-md py-2 text-xs font-medium transition-colors', filters.time === o.value ? 'bg-ink text-bg' : 'text-ink-3')}
>
{o.label}
</button>
+6 -6
View File
@@ -19,13 +19,13 @@ interface Props {
export default function SideNav({ current, onChange, onAdd }: Props) {
return (
<nav className="fixed inset-y-0 start-0 z-30 hidden w-60 flex-col border-e border-line bg-bg px-4 py-6 lg:flex">
<h1 className="px-2 text-2xl font-bold">
Ki<span className="text-accent">no</span>
</h1>
<p className="px-2 font-display text-[1.75rem] leading-none">
Bobin<span className="text-accent">oo</span>
</p>
<button
onClick={onAdd}
className="mt-6 flex w-full items-center justify-center gap-2 rounded-full bg-accent-fill px-4 py-2.5 text-sm font-semibold text-on-accent transition active:scale-95"
className="mt-6 flex w-full items-center justify-center gap-2 rounded-[4px] bg-accent-fill px-4 py-2.5 text-sm font-semibold text-on-accent transition active:scale-95"
>
<Search size={17} strokeWidth={2.4} />
{t('search.title')}
@@ -40,8 +40,8 @@ export default function SideNav({ current, onChange, onAdd }: Props) {
onClick={() => onChange(tab)}
aria-current={active ? 'page' : undefined}
className={cx(
'flex w-full items-center gap-3 rounded-xl px-3 py-2.5 text-sm font-medium transition-colors',
active ? 'bg-surface-2 text-ink' : 'text-ink-3 hover:text-ink',
'flex w-full items-center gap-3 rounded-md border-s-2 px-3 py-2.5 text-sm font-medium transition-colors',
active ? 'border-accent bg-surface text-ink' : 'border-transparent text-ink-3 hover:text-ink',
)}
>
<Icon size={20} strokeWidth={active ? 2.2 : 1.6} />
+1 -1
View File
@@ -40,7 +40,7 @@ export default function TagInput({ value, onChange, suggestions, placeholder, di
<div>
<div className="field flex flex-wrap items-center gap-1.5 py-2!">
{value.map((tag) => (
<span key={tag} className="inline-flex items-center gap-1 rounded-full border border-line-strong py-1 ps-3 pe-1.5 text-sm text-ink">
<span key={tag} className="inline-flex items-center gap-1 rounded-md border border-line-strong py-1 ps-3 pe-1.5 text-sm text-ink">
{display(tag)}
<button type="button" onClick={() => onChange(value.filter((v) => v !== tag))} aria-label={t('common.removeX', { name: display(tag) })} className="text-ink-3">
<X size={14} />
+1 -1
View File
@@ -106,7 +106,7 @@ function ToastViewport({ toast, onDismiss, onShow }: { toast: ToastState | null;
<button
onClick={() => void undo()}
disabled={undoing}
className="inline-flex shrink-0 items-center gap-1.5 rounded-full border border-bg/30 px-3 py-1.5 text-sm font-semibold transition active:scale-95 disabled:opacity-50"
className="inline-flex shrink-0 items-center gap-1.5 rounded-md border border-bg/30 px-3 py-1.5 text-sm font-semibold transition active:scale-95 disabled:opacity-50"
>
<Undo2 size={15} /> {t('toast.undo')}
</button>
@@ -206,7 +206,7 @@ function ChallengeDetail({ c, items, onOpen, onEdit, onArchive, onRenew, onDelet
<h3 className="mt-4 text-xl font-semibold">{challengeTitle(c)}</h3>
<p className="mt-1 text-sm text-ink-3">{[mediaLabelIfNamed(c), periodLabel(c)].filter(Boolean).join(' · ')}</p>
{p.done ? (
<span className="mt-3 inline-flex items-center gap-1.5 rounded-full bg-accent-fill px-3 py-1 text-sm font-semibold text-on-accent">
<span className="mt-3 inline-flex items-center gap-1.5 rounded-md bg-accent-fill px-3 py-1 text-sm font-semibold text-on-accent">
<Trophy size={15} /> {paceText(c, p)}
</span>
) : (
@@ -250,7 +250,7 @@ function ChallengeDetail({ c, items, onOpen, onEdit, onArchive, onRenew, onDelet
{[mediaLabel(e.item.type), formatDay(e.date)].join(' · ')}
</span>
</span>
{e.rewatch && <span className="shrink-0 rounded-full border border-line-strong px-2 py-0.5 text-[10px] font-semibold uppercase text-ink-2">{t('challenges.rewatch')}</span>}
{e.rewatch && <span className="shrink-0 rounded-md border border-line-strong px-2 py-0.5 text-[10px] font-semibold text-ink-2">{t('challenges.rewatch')}</span>}
{c.unit === 'episodes' && (
<span className="shrink-0 text-xs tabular-nums text-ink-2">
{e.estimated ? '≈ ' : ''}
+1 -1
View File
@@ -45,7 +45,7 @@ export function GuestBanner({ onSignIn }: { onSignIn: () => void }) {
<div className="safe-top border-b border-line bg-surface lg:ps-60">
<div className="mx-auto flex max-w-2xl items-center gap-3 px-4 py-2 lg:max-w-none lg:px-10">
<p className="min-w-0 flex-1 truncate text-xs text-ink-2">{t('guest.banner')}</p>
<button onClick={onSignIn} className="shrink-0 rounded-full bg-accent-fill px-3 py-1.5 text-xs font-semibold text-on-accent">
<button onClick={onSignIn} className="shrink-0 rounded-md bg-accent-fill px-3 py-1.5 text-xs font-semibold text-on-accent">
{t('auth.loginTab')}
</button>
</div>
+3 -3
View File
@@ -119,7 +119,7 @@ export default function PersonSheet({
{person?.department && <p className="eyebrow mt-2 text-accent">{person.department}</p>}
{life && life.length > 0 && <p className="mt-2 text-sm text-ink-2">{life.join(' · ')}</p>}
{person && library.n > 0 && (
<p className="mt-3 inline-flex items-center gap-1.5 rounded-full border border-line px-3 py-1 text-xs text-ink-2">
<p className="mt-3 inline-flex items-center gap-1.5 rounded-md border border-line px-3 py-1 text-xs text-ink-2">
<Check size={13} className="text-accent" /> {t('person.inLibrary', { count: library.n, total: library.total })}
</p>
)}
@@ -152,13 +152,13 @@ export default function PersonSheet({
{groupLabel(g)} <span className="opacity-60">{n}</span>
</button>
))}
<div className="ms-auto flex gap-1 rounded-full border border-line p-0.5 text-xs">
<div className="ms-auto flex gap-1 rounded-md border border-line p-0.5 text-xs">
{(['popular', 'recent'] as const).map((s) => (
<button
key={s}
onClick={() => setSort(s)}
aria-pressed={sort === s}
className={cx('rounded-full px-3 py-1.5 font-medium transition-colors', sort === s ? 'bg-ink text-bg' : 'text-ink-3')}
className={cx('rounded-md px-3 py-1.5 font-medium transition-colors', sort === s ? 'bg-ink text-bg' : 'text-ink-3')}
>
{s === 'popular' ? t('person.sortPopular') : t('person.sortRecent')}
</button>
+1 -1
View File
@@ -109,7 +109,7 @@ export default function EditProfile({ onClose }: { onClose: () => void }) {
<button type="button" onClick={() => bannerInput.current?.click()} className="relative block aspect-[3/1] w-full overflow-hidden bg-surface-2" aria-label={t('social.changeBanner')}>
{banner.preview && !banner.removed && <img src={banner.preview} alt="" className="size-full object-cover" />}
<span className="absolute inset-0 grid place-items-center bg-black/25">
<span className="flex items-center gap-2 rounded-full bg-bg/85 px-3 py-1.5 text-xs font-semibold">
<span className="flex items-center gap-2 rounded-md bg-bg/85 px-3 py-1.5 text-xs font-semibold">
<ImagePlus size={14} /> {t('social.changeBanner')}
</span>
</span>
+5 -5
View File
@@ -86,9 +86,9 @@ export default function FollowList({ profile, initial, onClose }: { profile: Pro
return (
<Sheet label={profile.displayName} title={profile.displayName} onClose={onClose}>
<div className="px-4 pt-4">
<div className={cx('grid gap-1 rounded-full border border-line p-1', tabs.length === 3 ? 'grid-cols-3' : 'grid-cols-2')}>
<div className={cx('grid gap-1 rounded-md border border-line p-1', tabs.length === 3 ? 'grid-cols-3' : 'grid-cols-2')}>
{tabs.map((v) => (
<button key={v} onClick={() => setTab(v)} className={cx('rounded-full py-2 text-xs font-semibold transition-colors', tab === v ? 'bg-ink text-bg' : 'text-ink-3')}>
<button key={v} onClick={() => setTab(v)} className={cx('rounded-md py-2 text-xs font-semibold transition-colors', tab === v ? 'bg-ink text-bg' : 'text-ink-3')}>
{v === 'requests'
? t('social.requestsTab', { count: social.requests.length })
: v === 'followers'
@@ -113,15 +113,15 @@ export default function FollowList({ profile, initial, onClose }: { profile: Pro
actions={
tab === 'requests' ? (
<span className="flex shrink-0 gap-1.5">
<button onClick={() => act(p, 'accept')} disabled={!!busy} className="h-8 rounded-full bg-accent-fill px-3 text-xs font-semibold text-on-accent">
<button onClick={() => act(p, 'accept')} disabled={!!busy} className="h-8 rounded-md bg-accent-fill px-3 text-xs font-semibold text-on-accent">
{t('social.accept')}
</button>
<button onClick={() => act(p, 'remove')} disabled={!!busy} className="h-8 rounded-full border border-line-strong px-3 text-xs font-semibold text-ink-2">
<button onClick={() => act(p, 'remove')} disabled={!!busy} className="h-8 rounded-md border border-line-strong px-3 text-xs font-semibold text-ink-2">
{t('social.decline')}
</button>
</span>
) : profile.isMe && tab === 'followers' ? (
<button onClick={() => act(p, 'remove')} disabled={!!busy} className="h-8 shrink-0 rounded-full border border-line-strong px-3 text-xs font-semibold text-ink-2">
<button onClick={() => act(p, 'remove')} disabled={!!busy} className="h-8 shrink-0 rounded-md border border-line-strong px-3 text-xs font-semibold text-ink-2">
{t('social.removeFollower')}
</button>
) : undefined
+1 -1
View File
@@ -38,7 +38,7 @@ export default function PeopleSearch({ onClose }: { onClose: () => void }) {
if (!me) return
const url = profileLink(me.username)
try {
if (navigator.share && window.matchMedia?.('(pointer: coarse)').matches) await navigator.share({ title: 'Kino', text: t('social.inviteText'), url })
if (navigator.share && window.matchMedia?.('(pointer: coarse)').matches) await navigator.share({ title: 'Bobinoo', text: t('social.inviteText'), url })
else {
await navigator.clipboard.writeText(url)
setCopied(true)
+1 -1
View File
@@ -53,7 +53,7 @@ export default function PersonRow({ person, actions, onOpen }: { person: Profile
onClick={toggle}
disabled={busy}
className={cx(
'flex h-8 shrink-0 items-center gap-1 rounded-full px-3 text-xs font-semibold transition active:scale-95',
'flex h-8 shrink-0 items-center gap-1 rounded-md px-3 text-xs font-semibold transition active:scale-95',
relation === 'none' ? 'bg-accent-fill text-on-accent' : 'border border-line-strong text-ink-2',
)}
>
+3 -3
View File
@@ -266,7 +266,7 @@ export default function ProfileView({ username, onClose }: { username: string; o
@{profile.username}
{profile.isPrivate && <Lock size={12} aria-label={t('social.private')} />}
{profile.followsMe && !profile.isMe && (
<span className="rounded-full bg-surface-2 px-2 py-0.5 text-[10px] font-semibold uppercase tracking-[0.04em] text-ink-2">
<span className="rounded-md bg-surface-2 px-2 py-0.5 text-[10px] font-semibold text-ink-2">
{t('social.followsYou')}
</span>
)}
@@ -300,12 +300,12 @@ export default function ProfileView({ username, onClose }: { username: string; o
</div>
) : (
<>
<div className="mt-6 grid grid-cols-2 gap-1 rounded-full border border-line p-1 lg:max-w-md">
<div className="mt-6 grid grid-cols-2 gap-1 rounded-md border border-line p-1 lg:max-w-md">
{(['profile', 'library'] as const).map((v) => (
<button
key={v}
onClick={() => setTab(v)}
className={cx('rounded-full py-2 text-sm font-medium transition-colors', tab === v ? 'bg-ink text-bg' : 'text-ink-3')}
className={cx('rounded-md py-2 text-sm font-medium transition-colors', tab === v ? 'bg-ink text-bg' : 'text-ink-3')}
>
{v === 'profile' ? t('social.tabProfile') : t('social.tabLibrary')}
</button>
+1 -1
View File
@@ -57,7 +57,7 @@ export default function Reactions({
disabled={busy}
aria-pressed={on}
className={cx(
'inline-flex items-center gap-1 rounded-full border px-2.5 py-1 text-sm transition-colors active:scale-95 disabled:opacity-60',
'inline-flex items-center gap-1 rounded-md border px-2.5 py-1 text-sm transition-colors active:scale-95 disabled:opacity-60',
on ? 'border-accent bg-accent-fill/10 text-ink' : 'border-line text-ink-2',
)}
>
+3 -3
View File
@@ -71,7 +71,7 @@ export default function ReviewComments({
aria-expanded={open}
aria-label={t('comments.toggle', { count: count ?? 0 })}
className={cx(
'inline-flex items-center gap-1 rounded-full border px-2.5 py-1 text-sm transition-colors active:scale-95',
'inline-flex items-center gap-1 rounded-md border px-2.5 py-1 text-sm transition-colors active:scale-95',
open ? 'border-ink/60 text-ink' : 'border-line text-ink-2',
)}
>
@@ -189,10 +189,10 @@ function Thread({
{confirmId === c.id && (
<div className="mt-1.5 flex items-center gap-2 text-xs">
<span className="text-ink-3">{t('comments.deleteConfirm')}</span>
<button type="button" onClick={() => void remove(c.id)} disabled={deleting === c.id} className="rounded-full bg-accent-fill px-2.5 py-1 font-semibold text-on-accent disabled:opacity-60">
<button type="button" onClick={() => void remove(c.id)} disabled={deleting === c.id} className="rounded-md bg-accent-fill px-2.5 py-1 font-semibold text-on-accent disabled:opacity-60">
{deleting === c.id ? <Loader2 size={12} className="animate-spin" /> : t('common.delete')}
</button>
<button type="button" onClick={() => setConfirmId(undefined)} className="rounded-full border border-line px-2.5 py-1 text-ink-2">
<button type="button" onClick={() => setConfirmId(undefined)} className="rounded-md border border-line px-2.5 py-1 text-ink-2">
{t('common.cancel')}
</button>
</div>
+2 -2
View File
@@ -32,7 +32,7 @@ export default function ReviewText({
<span className="flex items-center gap-1.5 text-xs font-semibold text-ink-2">
<EyeOff size={14} className="text-accent" aria-hidden="true" /> {t('spoiler.warning')}
</span>
<button type="button" onClick={() => setShown(true)} className="rounded-full border border-line-strong bg-surface px-3 py-1 text-xs font-semibold text-ink active:scale-95">
<button type="button" onClick={() => setShown(true)} className="rounded-md border border-line-strong bg-surface px-3 py-1 text-xs font-semibold text-ink active:scale-95">
{t('spoiler.show')}
</button>
</div>
@@ -43,7 +43,7 @@ export default function ReviewText({
return (
<div className={cx('mt-2', className)}>
{spoiler && (
<span className="mb-1.5 inline-flex items-center gap-1 rounded-full border border-accent/50 px-2 py-0.5 text-[11px] font-semibold uppercase tracking-wide text-accent">
<span className="mb-1.5 inline-flex items-center gap-1 rounded-md border border-accent/50 px-2 py-0.5 text-[11px] font-semibold text-accent">
<EyeOff size={11} aria-hidden="true" /> {t('spoiler.badge')}
</span>
)}
+1 -1
View File
@@ -598,7 +598,7 @@ export function InvitePeople({ listId, listName, onClose }: { listId: string; li
onClick={() => void invite(p)}
disabled={busy === p.id || invited.has(p.id)}
className={cx(
'flex h-8 shrink-0 items-center gap-1 rounded-full px-3 text-xs font-semibold transition active:scale-95',
'flex h-8 shrink-0 items-center gap-1 rounded-md px-3 text-xs font-semibold transition active:scale-95',
invited.has(p.id) ? 'border border-line-strong text-ink-2' : 'bg-accent-fill text-on-accent',
)}
>
+1 -1
View File
@@ -12,7 +12,7 @@ export function StatTile({ label, value, hint }: { label: string; value: ReactNo
return (
<div className="card min-w-0 p-4">
<p className="text-xs text-ink-3">{label}</p>
<p className="mt-1 truncate text-2xl font-bold tracking-tight lg:text-3xl">{value}</p>
<p className="mt-1.5 truncate font-display text-[1.85rem] leading-none tabular-nums lg:text-[2.2rem]">{value}</p>
{hint && <p className="mt-0.5 truncate text-xs text-ink-2">{hint}</p>}
</div>
)
+2 -2
View File
@@ -109,7 +109,7 @@ export default function AddTitle({
<span className="min-w-0 flex-1">
<span className="block truncate font-semibold">{r.title}</span>
{r.originalTitle && <span className="block truncate text-xs text-ink-3">{r.originalTitle}</span>}
<span className="mt-1 block text-[11px] uppercase tracking-wide text-ink-3">{[r.year, r.kindLabel].filter(Boolean).join(' · ')}</span>
<span className="mt-1 block text-[11px] text-ink-3">{[r.year, r.kindLabel].filter(Boolean).join(' · ')}</span>
{mine && (
<span className="mt-1 inline-flex items-center gap-1 text-xs text-accent">
<Check size={12} /> {t('title.inLibrary')}
@@ -136,7 +136,7 @@ export default function AddTitle({
)}
<span className="min-w-0 flex-1">
<span className="block truncate font-semibold">{p.name}</span>
{p.department && <span className="block text-[11px] uppercase tracking-wide text-ink-3">{p.department}</span>}
{p.department && <span className="block text-[11px] text-ink-3">{p.department}</span>}
{p.knownFor.length > 0 && <span className="mt-0.5 block truncate text-xs text-ink-2">{p.knownFor.join(' · ')}</span>}
</span>
<span className="shrink-0 text-accent rtl:-scale-x-100">→</span>
+2 -3
View File
@@ -1,4 +1,5 @@
import { Check, RotateCcw } from 'lucide-react'
import { FilmStrip } from '../ui'
import { useState } from 'react'
import { t } from '../../i18n'
import { episodeCap } from '../../lib/franchise'
@@ -71,9 +72,7 @@ export default function RewatchPanel({
{cap ? (
<>
<p className="mt-1 text-xs text-ink-3">{t('rewatch.progress', { seen: item.rewatch.episodes, total: cap })}</p>
<div className="mt-2 h-1 rounded-full bg-surface-2">
<div className="h-full rounded-full bg-accent" style={{ width: `${Math.min(100, (item.rewatch.episodes / cap) * 100)}%` }} />
</div>
<FilmStrip className="mt-2" done={item.rewatch.episodes} total={cap} label={t('rewatch.progress', { seen: item.rewatch.episodes, total: cap })} />
</>
) : null}
<p className="mt-3 text-xs text-ink-3">{t('rewatch.trackingHint')}</p>
+1 -1
View File
@@ -174,7 +174,7 @@ function SeasonRow({
<button onClick={openEditor} className="mt-3 block w-full text-start">
<span className="flex items-center gap-1.5 text-xs text-ink-3">
{t('form.review')}
{value.spoiler && <span className="rounded-full border border-accent/50 px-1.5 py-px text-[10px] text-accent">{t('spoiler.badge')}</span>}
{value.spoiler && <span className="rounded-md border border-accent/50 px-1.5 py-px text-[10px] text-accent">{t('spoiler.badge')}</span>}
<Pencil size={11} />
</span>
<p className="mt-1 line-clamp-4 whitespace-pre-line text-sm leading-relaxed">{value.notes}</p>
+13 -8
View File
@@ -1,4 +1,5 @@
import { locale, t } from '../../i18n'
import { FilmStrip } from '../ui'
import { Bookmark, Check, ChevronDown, Eye, Heart, Loader2, MessagesSquare, Minus, MoreHorizontal, Pencil, Play, Plus, Share2, Trash2, X } from 'lucide-react'
import { useEffect, useMemo, useRef, useState, type ReactNode } from 'react'
import { getTitleExtras, getTmdbCredits, getTmdbDetails, getTmdbExtras, type SearchResult, type TitleExtras } from '../../lib/catalogApi'
@@ -372,7 +373,13 @@ export default function TitleSheet({ item: initial, seed, onClose, onGoToSetting
<div className="min-w-0 flex-1 pb-1">
<h1 className="text-2xl leading-tight lg:text-5xl lg:leading-[1.05]">{title}</h1>
{data.originalTitle && <p className="mt-1 truncate text-sm text-ink-2 lg:text-base">{data.originalTitle}</p>}
{metaLine.length > 0 && <p className="mt-2 text-xs uppercase tracking-wide text-ink-2 lg:text-sm">{metaLine.join(' · ')}</p>}
{metaLine.length > 0 && (
<p className="mt-2 flex flex-wrap gap-x-3 gap-y-0.5 text-sm text-ink-2">
{metaLine.map((m, k) => (
<span key={k}>{m}</span>
))}
</p>
)}
{extras && extras.directors.length > 0 && (
<p className="mt-2 text-sm text-ink-2 lg:text-base">
{extras.directorKind === 'director' ? t('title.directedBy') : t('title.createdBy')}{' '}
@@ -402,7 +409,7 @@ export default function TitleSheet({ item: initial, seed, onClose, onGoToSetting
{item?.tags && item.tags.length > 0 && (
<ul className="mt-2 flex flex-wrap gap-1.5" aria-label={t('tags.label')}>
{item.tags.map((tag) => (
<li key={tag} className="rounded-full border border-line px-2 py-0.5 text-[11px] text-ink-3">
<li key={tag} className="rounded-md border border-line px-2 py-0.5 text-[11px] text-ink-3">
#{tag}
</li>
))}
@@ -526,9 +533,7 @@ export default function TitleSheet({ item: initial, seed, onClose, onGoToSetting
</div>
</div>
{episodeCap(shown) ? (
<div className="mt-3 h-1 rounded-full bg-surface-2">
<div className="h-full rounded-full bg-accent" style={{ width: `${Math.min(100, (shown.episodesWatched / episodeCap(shown)!) * 100)}%` }} />
</div>
<FilmStrip className="mt-3" done={shown.episodesWatched} total={episodeCap(shown)!} label={t('episodes.seen', { done: Math.min(shown.episodesWatched, episodeCap(shown)!), total: episodeCap(shown)! })} />
) : null}
</div>
)}
@@ -556,7 +561,7 @@ export default function TitleSheet({ item: initial, seed, onClose, onGoToSetting
<span className="eyebrow flex items-center justify-between">
<span className="flex items-center gap-2">
{t('form.review')}
{item.notesSpoiler && <span className="rounded-full border border-accent/50 px-1.5 py-px text-[10px] text-accent">{t('spoiler.badge')}</span>}
{item.notesSpoiler && <span className="rounded-md border border-accent/50 px-1.5 py-px text-[10px] text-accent">{t('spoiler.badge')}</span>}
</span>
<Pencil size={13} />
</span>
@@ -589,7 +594,7 @@ export default function TitleSheet({ item: initial, seed, onClose, onGoToSetting
{(data.genres?.length ?? 0) > 0 && (
<div className="mt-4 flex flex-wrap gap-2">
{data.genres!.map((g) => (
<span key={g} className="rounded-full border border-line px-3 py-1 text-xs text-ink-2">
<span key={g} className="rounded-md border border-line px-3 py-1 text-xs text-ink-2">
{genreLabel(g)}
</span>
))}
@@ -643,7 +648,7 @@ export default function TitleSheet({ item: initial, seed, onClose, onGoToSetting
{toast && (
<div role="status" className="safe-bottom pointer-events-none fixed inset-x-0 bottom-4 z-[70] flex justify-center px-4">
<span className="rounded-full bg-ink px-4 py-2 text-sm font-medium text-bg">{toast}</span>
<span className="rounded-md bg-ink px-4 py-2 text-sm font-medium text-bg">{toast}</span>
</div>
)}
+2 -2
View File
@@ -45,7 +45,7 @@ function TmdbOffers({ watch }: { watch: NonNullable<TitleExtras['watch']> }) {
}, [watch, country])
const picker = (
<label className="relative flex items-center gap-1 rounded-full border border-line py-1 pe-2 ps-2 text-xs text-ink-2 focus-within:border-line-strong">
<label className="relative flex items-center gap-1 rounded-md border border-line py-1 pe-2 ps-2 text-xs text-ink-2 focus-within:border-line-strong">
<Globe size={13} className="shrink-0 text-ink-3" aria-hidden />
<span className="sr-only">{t('watch.country')}</span>
<select
@@ -128,7 +128,7 @@ function StreamLinks({ links }: { links: StreamLink[] }) {
rel="noopener noreferrer"
aria-label={t('watch.open', { name: l.site })}
title={l.language ? `${l.site} · ${l.language}` : l.site}
className="flex items-center gap-2 rounded-full border border-line py-1 pe-3 ps-1 text-sm font-medium text-ink transition-colors active:bg-surface-2"
className="flex items-center gap-2 rounded-md border border-line py-1 pe-3 ps-1 text-sm font-medium text-ink transition-colors active:bg-surface-2"
>
{l.icon ? (
<span className="grid size-7 shrink-0 place-items-center rounded-full bg-surface-2" style={l.color ? { backgroundColor: l.color } : undefined}>
+39 -13
View File
@@ -1,16 +1,16 @@
import type { ReactNode } from 'react'
import { cx } from '../lib/utils'
/** En-tête de page : titre en gras, moitié blanc / moitié rouge. */
export function PageHeader({ title, accent, subtitle, action }: { title: string; accent?: string; subtitle?: string; action?: ReactNode }) {
/** En-tête de page : titre en Gloock. La partie « accent » n'est colorée que pour le logo (wordmark). */
export function PageHeader({ title, accent, subtitle, action, wordmark }: { title: string; accent?: string; subtitle?: string; action?: ReactNode; wordmark?: boolean }) {
return (
<header className="flex items-end justify-between gap-3 pb-5 pt-7">
<div className="min-w-0">
<h1 className="text-[1.9rem] leading-tight">
<h1 className={cx('leading-[1.05]', wordmark ? 'text-[2.15rem]' : 'text-[2rem]')}>
{title}
{accent && <span className="text-accent">{accent}</span>}
{accent && <span className={wordmark ? 'text-accent' : undefined}>{accent}</span>}
</h1>
{subtitle && <p className="mt-1 text-sm text-ink-3">{subtitle}</p>}
{subtitle && <p className="mt-1.5 text-sm text-ink-3">{subtitle}</p>}
</div>
{action}
</header>
@@ -21,26 +21,52 @@ export function StatTile({ label, value, hint, className }: { label: string; val
return (
<div className={cx('card p-4', className)}>
<div className="eyebrow">{label}</div>
<div className="mt-2 text-2xl font-bold leading-none tabular-nums">{value}</div>
{hint && <div className="mt-1.5 text-xs text-ink-3">{hint}</div>}
<div className="mt-2 font-display text-[1.85rem] leading-none tabular-nums">{value}</div>
{hint && <div className="mt-2 text-xs text-ink-3">{hint}</div>}
</div>
)
}
/** Titre de section façon Letterboxd : petites capitales grises + filet. */
/** Titre de section : Gloock, sans capitales ni filet. */
export function SectionTitle({ children, action }: { children: ReactNode; action?: ReactNode }) {
return (
<div className="mb-4 mt-9 flex items-center justify-between gap-3 border-b border-line pb-2">
<h2 className="eyebrow text-ink-2">{children}</h2>
<div className="mb-3.5 mt-10 flex items-baseline justify-between gap-3">
<h2 className="text-[1.45rem] leading-tight text-ink">{children}</h2>
{action}
</div>
)
}
/**
* Progression en pellicule : une image par épisode (regroupées au-delà de 40), perforations en haut et en bas.
* La pellicule reste sombre dans tous les thèmes ; les images vues prennent l'accent.
*/
export function FilmStrip({ done, total, label, className }: { done: number; total: number; label?: string; className?: string }) {
if (!total) return null
const frames = Math.min(total, 40)
const lit = Math.round((Math.min(done, total) / total) * frames)
return (
<div
role="progressbar"
aria-valuemin={0}
aria-valuemax={total}
aria-valuenow={Math.min(done, total)}
aria-label={label}
className={cx('film-strip', className)}
>
<div className="grid h-full gap-[2px]" style={{ gridTemplateColumns: `repeat(${frames}, minmax(0, 1fr))` }}>
{Array.from({ length: frames }, (_, k) => (
<i key={k} className={k < lit ? 'bg-accent-fill' : 'bg-film-frame'} />
))}
</div>
</div>
)
}
export function LinkArrow({ onClick, children }: { onClick: () => void; children: ReactNode }) {
return (
<button onClick={onClick} className="shrink-0 text-xs font-medium text-ink-3 transition-colors hover:text-ink">
{children} <span className="inline-block text-accent rtl:-scale-x-100">→</span>
<button onClick={onClick} className="shrink-0 text-sm font-medium text-ink-2 underline-offset-4 transition-colors hover:text-ink hover:underline">
{children}
</button>
)
}
@@ -48,7 +74,7 @@ export function LinkArrow({ onClick, children }: { onClick: () => void; children
export function EmptyState({ title, text, action }: { title: string; text?: string; action?: ReactNode }) {
return (
<div className="card mt-4 flex flex-col items-center px-6 py-12 text-center">
<p className="text-lg font-semibold">{title}</p>
<p className="font-display text-[1.5rem] leading-tight">{title}</p>
{text && <p className="mt-2 max-w-xs text-sm text-ink-2">{text}</p>}
{action && <div className="mt-6">{action}</div>}
</div>