goon/mobile/src/theme.ts
jtrzupek d87263dde9 feat(mobile): custom fonts (General Sans + Geist Mono) + logo rework
FONTY:
- Dodane assets/fonts/: GeneralSans Regular/Medium/Semibold (Fontshare, free
  commercial) + GeistMono Regular (Vercel OFL). Pobrane jako .ttf.
- expo-font ~13.0.4 (matchuje SDK 52). Native module jest w APK bo `expo`
  ciagnie expo-font jako bezposrednia zaleznosc -> useFonts dziala przez OTA
  bez rebuildu.
- App.tsx: useFonts() gate (blokuje render do zaladowania, .ttf z bundla <100ms)
  + globalny Text.defaultProps fontFamily=GeneralSans-Regular dla body.
- theme.ts: fonts = { body, medium, display, mono }. RN nie syntezuje weightow
  dla custom fontow, wiec 4 osobne rodziny per-weight (gotcha udokumentowany).
- Jawne fonty na high-traffic: SceneTile (title=display, meta+dur=mono),
  MoviePosterCard (j.w.), navigation (taby display/medium, header display).

LOGO:
- GoonWordmark przepisany: zamiast krzywych recznych SVG path (o-ka jako
  nachodzace elipsy, zniekształcone n) renderuje PRAWDZIWY tekst w General Sans
  Semibold. Dwutonowy twist: "g[oo]n" ze srodkowym "oo" w oxblood.
- GoonMark (monogram): czysty SVG koncentryczny ring + dot (oxblood) — motyw
  soczewki/oka. Dla app-icon/splash gdzie font niedostepny.
- Wpiety na AgeGate (wordmark 40), Login (mark 44 + wordmark 44), nav header.

OTA: c986c911-0868-44f7-9f4a-fc2a74e53095 live (23 assets, 4 fonty serwuja 200).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-05-30 22:25:26 +02:00

97 lines
3.2 KiB
TypeScript

/**
* Goon theme — warm dark + oxblood, NOT generic navy/purple AI-default.
*
* Audit 2026-05-29 (impeccable.style/slop):
* - Wcześniej: bg #08090F (deep navy), accent #8B5CF6 (purple) + glow #A78BFA
* → literal example "AI default palette" z impeccable.
* - Teraz: bg #15110D (warm charcoal — orange undertone), accent #B23A48
* (oxblood/rust), brak glowów, brak gradientów neon.
*
* Typography: General Sans (display, Fontshare) + Geist Mono (meta, Vercel
* fonts). Font files w `mobile/assets/fonts/` — `useFonts()` w App.tsx
* graceful-fallback do system gdy brak (development).
*/
export const theme = {
// Warm dark — charcoal z orange undertone (NIE navy).
// Filmowy, premium feel — jak Letterboxd/Mubi/A24.
bg: '#15110D',
bgElevated: '#1E1A14',
card: '#26201A',
border: '#3A3128',
borderFocus: '#B23A48',
// Foreground — warm off-white (nie pure white żeby nie biło na warm dark).
fg: '#F5EDE0',
muted: '#A89B85',
mutedDim: '#6F6555',
// Accent — oxblood/rust. Distinctive, niekonwencjonalne dla "media app".
// Brak glow/neon. Deep wariant dla pressed states.
accent: '#B23A48',
accentGlow: '#B23A48', // alias — back-compat, ale bez prawdziwego glow
accentDeep: '#7A1F2A',
accentSecondary: '#D89B4A', // muted amber dla secondary CTAs
// Status — tonowane do palety (nie generic green/red).
good: '#5E8C5A', // muted olive-green
bad: '#C44545',
warn: '#D89B4A', // amber
} as const;
/**
* Font family — General Sans (display + body, Fontshare) + Geist Mono (meta,
* Vercel OFL). Pliki .ttf w `mobile/assets/fonts/`, ładowane przez useFonts()
* w App.tsx (runtime load — działa przez OTA bo expo-font native jest w APK).
*
* WAŻNE (custom-font gotcha): RN NIE syntezuje weightów dla custom fontów —
* fontWeight:'700' na fontFamily:'GeneralSans-Regular' NIE pogrubi. Trzeba
* jawnie wskazać rodzinę per-weight. Stąd 4 osobne sloty:
* - body → Regular (400) — domyślny tekst
* - medium → Medium (500) — labels, tab inactive
* - display → Semibold (600)— headingi, tytuły, bold
* - mono → Geist Mono — meta, duration, liczby, kategorie
*
* Gdy useFonts jeszcze nie ready, App.tsx blokuje render (fonty z bundla
* ładują się <100ms), więc te stałe są zawsze valid przy pierwszym paint.
*/
export const fonts = {
body: 'GeneralSans-Regular',
medium: 'GeneralSans-Medium',
display: 'GeneralSans-Semibold',
mono: 'GeistMono-Regular',
} as const;
export function scoreColor(score: number): string {
if (score >= 0.92) return theme.good;
if (score >= 0.75) return theme.warn;
return theme.bad;
}
/**
* Type-scale (impeccable: "at least 1.25 ratio between steps").
* Base 14 → 17 → 22 → 28 → 36. Użyj zamiast hardcodowanego fontSize.
*/
export const type = {
micro: 11,
meta: 13,
body: 14,
bodyLarge: 17,
title: 22,
display: 28,
hero: 36,
} as const;
/**
* Spacing scale — "tight groupings, generous between sections" (impeccable).
* Pomijamy 12/20 — preferuj 8/16/24/32 dla widocznej hierarchii sekcji.
*/
export const space = {
xs: 4,
sm: 8,
md: 16,
lg: 24,
xl: 32,
xxl: 48,
} as const;