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:
80 files changed
+697
-544
No files matched your search
+5
-3
@@ -3,6 +3,7 @@ import type { BackupFile, Criteria, CustomList, MediaItem, MediaType, Settings,
|
||||
import { ALL_TOP_CATEGORIES, MEDIA_TYPES, STATUSES } from './constants'
|
||||
import { episodeCap } from './franchise'
|
||||
import { convertLegacyBackup, isLegacyBackup } from './legacyImport'
|
||||
import { DEFAULT_ACCENT, LEGACY_DEFAULT_ACCENT } from './theme'
|
||||
import {
|
||||
cleanText,
|
||||
isHexColor,
|
||||
@@ -158,7 +159,8 @@ export function normalizeSettings(raw: unknown): Partial<Settings> | undefined {
|
||||
const out: Partial<Settings> = {}
|
||||
if (raw.ratingScale === '5' || raw.ratingScale === '10') out.ratingScale = raw.ratingScale
|
||||
if (Array.isArray(raw.topCategories)) out.topCategories = ALL_TOP_CATEGORIES.filter((c) => (raw.topCategories as unknown[]).includes(c))
|
||||
if (isHexColor(raw.accentColor)) out.accentColor = raw.accentColor.toLowerCase()
|
||||
// L'ancien rouge par défaut (jamais choisi exprès par la plupart) devient le nouvel ambre de Bobinoo
|
||||
if (isHexColor(raw.accentColor)) out.accentColor = raw.accentColor.toLowerCase() === LEGACY_DEFAULT_ACCENT ? DEFAULT_ACCENT : raw.accentColor.toLowerCase()
|
||||
if (raw.themeMode === 'auto' || raw.themeMode === 'light' || raw.themeMode === 'dark' || raw.themeMode === 'night' || raw.themeMode === 'starfield') out.themeMode = raw.themeMode
|
||||
const challenges = normalizeChallenges(raw.challenges)
|
||||
if (challenges) out.challenges = challenges
|
||||
@@ -176,7 +178,7 @@ function dedupe(items: MediaItem[]): MediaItem[] {
|
||||
export function buildBackup(items: MediaItem[], settings: Settings, lists: CustomList[] = []): BackupFile {
|
||||
// La clé TMDB n'est jamais incluse dans la sauvegarde
|
||||
const { tmdbKey: _omit, ...safeSettings } = settings
|
||||
return { app: 'Kino', version: 1, exportedAt: new Date().toISOString(), settings: safeSettings, items, lists }
|
||||
return { app: 'Bobinoo', version: 1, exportedAt: new Date().toISOString(), settings: safeSettings, items, lists }
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -218,7 +220,7 @@ export interface ParsedBackup {
|
||||
format: 'azuucine' | 'legacy'
|
||||
}
|
||||
|
||||
/** Accepte le format Kino, un simple tableau de fiches, ou une sauvegarde de l'ancienne appli. */
|
||||
/** Accepte le format Bobinoo, un simple tableau de fiches, ou une sauvegarde de l'ancienne appli. */
|
||||
export async function parseBackupFile(file: File): Promise<ParsedBackup> {
|
||||
if (file.size > LIMITS.importFileBytes) throw new Error(t('backup.tooBig'))
|
||||
const text = await file.text()
|
||||
|
||||
@@ -155,7 +155,7 @@ async function tmdbFetch<T>(path: string, key: string, params: Record<string, st
|
||||
|
||||
const yearOf = (d?: string) => (d && /^\d{4}/.test(d) ? Number(d.slice(0, 4)) : undefined)
|
||||
|
||||
/** Devine le type Kino à partir des métadonnées TMDB. */
|
||||
/** Devine le type Bobinoo à partir des métadonnées TMDB. */
|
||||
function guessTmdbType(kind: 'movie' | 'tv', genreIds: number[], countries: string[], lang?: string): { type: MediaType; subtype?: string } {
|
||||
const has = (c: string) => countries.includes(c)
|
||||
if (genreIds.includes(99)) return { type: 'autre', subtype: 'Documentaire' }
|
||||
|
||||
@@ -15,7 +15,7 @@ export const SUPABASE_ANON_KEY = validKey ? rawKey : ''
|
||||
export const cloudEnabled = !!(SUPABASE_URL && SUPABASE_ANON_KEY)
|
||||
|
||||
if (!cloudEnabled && (rawUrl || rawKey)) {
|
||||
console.warn('[Kino] .env incomplet ou invalide : les comptes sont désactivés (mode local). Vérifie VITE_SUPABASE_URL et VITE_SUPABASE_ANON_KEY.')
|
||||
console.warn('[Bobinoo] .env incomplet ou invalide : les comptes sont désactivés (mode local). Vérifie VITE_SUPABASE_URL et VITE_SUPABASE_ANON_KEY.')
|
||||
}
|
||||
|
||||
/** Délai maximal d'attente d'une réponse du serveur (la déconnexion ou la synchro ne doivent jamais rester bloquées). */
|
||||
|
||||
@@ -8,7 +8,7 @@ import type { Match } from './resolve'
|
||||
import { titleKey, type ImportEntry } from './sources'
|
||||
|
||||
/**
|
||||
* Transforme les entrées trouvées en fiches Kino et les fusionne avec la bibliothèque :
|
||||
* Transforme les entrées trouvées en fiches Bobinoo et les fusionne avec la bibliothèque :
|
||||
* - pas de doublon (même référence TMDB / AniList, même film, ou autre saison de la même série) ;
|
||||
* - une fiche existante n'est jamais écrasée : on complète ce qui manque, et le statut / la progression
|
||||
* n'avancent que si l'activité importée est plus récente que la dernière modification de la fiche.
|
||||
|
||||
@@ -177,7 +177,7 @@ export function convertLegacyBackup(data: LegacyFile): { items: MediaItem[]; ski
|
||||
const note = typeof r.note === 'number' && Number.isFinite(r.note) && r.note > 0 ? Math.min(10, Math.round(r.note * 2 * 2) / 2) : undefined
|
||||
const created = toISO(r.date_added) ?? now
|
||||
|
||||
// Même validation que les sauvegardes Kino (bornes, formats, champs inconnus retirés)
|
||||
// Même validation que les sauvegardes Bobinoo (bornes, formats, champs inconnus retirés)
|
||||
const item = normalizeItem({
|
||||
id: `legacy-${r.id}`,
|
||||
title,
|
||||
|
||||
+23
-22
@@ -13,7 +13,8 @@ import { formatRating } from './utils'
|
||||
|
||||
const W = 1080
|
||||
const H = 1350
|
||||
const FONT = "'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif"
|
||||
const FONT = "'Onest Variable', 'Onest', system-ui, -apple-system, 'Segoe UI', sans-serif"
|
||||
const DISPLAY = "'Gloock', 'Noto Serif', Georgia, serif"
|
||||
|
||||
function cssVar(name: string, fallback: string) {
|
||||
const v = getComputedStyle(document.documentElement).getPropertyValue(name).trim()
|
||||
@@ -22,14 +23,14 @@ function cssVar(name: string, fallback: string) {
|
||||
|
||||
function colors() {
|
||||
return {
|
||||
bg: '#0a0a0a',
|
||||
surface: '#161615',
|
||||
line: '#2a2a28',
|
||||
ink: '#f4f2ee',
|
||||
ink2: '#b3b0a8',
|
||||
ink3: '#8a8781',
|
||||
accent: cssVar('--color-accent', '#ef4444'),
|
||||
fill: cssVar('--color-accent-fill', '#d11f2f'),
|
||||
bg: '#14120f',
|
||||
surface: '#1d1a16',
|
||||
line: '#2f2a23',
|
||||
ink: '#f1eadd',
|
||||
ink2: '#bcb2a1',
|
||||
ink3: '#948a79',
|
||||
accent: cssVar('--color-accent', '#f0a63a'),
|
||||
fill: cssVar('--color-accent-fill', '#f0a63a'),
|
||||
}
|
||||
}
|
||||
|
||||
@@ -179,19 +180,19 @@ function drawBrand(ctx: CanvasRenderingContext2D, y: number) {
|
||||
const c = colors()
|
||||
ctx.textBaseline = 'alphabetic'
|
||||
ctx.textAlign = 'left'
|
||||
ctx.font = `700 34px ${FONT}`
|
||||
const a = 'Ki'
|
||||
const total = ctx.measureText('Kino').width
|
||||
ctx.font = `400 34px ${DISPLAY}`
|
||||
const a = 'Bobin'
|
||||
const total = ctx.measureText('Bobinoo').width
|
||||
const x = (W - total) / 2
|
||||
ctx.fillStyle = c.ink
|
||||
ctx.fillText(a, x, y)
|
||||
ctx.fillStyle = c.accent
|
||||
ctx.fillText('no', x + ctx.measureText(a).width, y)
|
||||
ctx.fillText('oo', x + ctx.measureText(a).width, y)
|
||||
}
|
||||
|
||||
async function newCanvas() {
|
||||
try {
|
||||
await Promise.all([document.fonts.load(`700 40px Inter`), document.fonts.load(`400 40px Inter`), document.fonts.load(`600 40px Inter`)])
|
||||
await Promise.all([document.fonts.load(`700 40px 'Onest Variable'`), document.fonts.load(`400 40px 'Onest Variable'`), document.fonts.load(`600 40px 'Onest Variable'`), document.fonts.load(`400 40px Gloock`)])
|
||||
} catch {
|
||||
/* police système en secours */
|
||||
}
|
||||
@@ -236,7 +237,7 @@ const hiRes = (url?: string) => (url?.startsWith('https://image.tmdb.org/t/p/w34
|
||||
/**
|
||||
* Affiche d'une fiche, façon « poster minimaliste » :
|
||||
* image en haut, gros titre en capitales + année, puis une fiche technique
|
||||
* (durée, réalisation, production, casting, genres, ma note) — aux couleurs de Kino.
|
||||
* (durée, réalisation, production, casting, genres, ma note) — aux couleurs de Bobinoo.
|
||||
*/
|
||||
export async function renderItemCard(item: MediaItem, scale: RatingScale, credits?: CardCredits): Promise<Blob> {
|
||||
const { canvas, ctx } = await newCanvas()
|
||||
@@ -293,7 +294,7 @@ export async function renderItemCard(item: MediaItem, scale: RatingScale, credit
|
||||
const size = fitSize(ctx, title, 900, 104, 64, iw - yearW)
|
||||
ctx.fillStyle = c.ink
|
||||
if (size) {
|
||||
ctx.font = `900 ${size}px ${FONT}`
|
||||
ctx.font = `400 ${size}px ${DISPLAY}`
|
||||
ctx.fillText(title, ix, y)
|
||||
const tw = ctx.measureText(title).width
|
||||
if (year) {
|
||||
@@ -304,7 +305,7 @@ export async function renderItemCard(item: MediaItem, scale: RatingScale, credit
|
||||
}
|
||||
} else {
|
||||
// Titre très long : deux lignes plus petites
|
||||
ctx.font = `900 62px ${FONT}`
|
||||
ctx.font = `400 62px ${DISPLAY}`
|
||||
const lines = wrap(ctx, title, iw, 2)
|
||||
y -= 58
|
||||
lines.forEach((l, i) => ctx.fillText(l, ix, y + i * 64))
|
||||
@@ -352,13 +353,13 @@ export async function renderItemCard(item: MediaItem, scale: RatingScale, credit
|
||||
}
|
||||
ctx.textAlign = 'left'
|
||||
ctx.textBaseline = 'alphabetic'
|
||||
ctx.font = `800 30px ${FONT}`
|
||||
const brandW = ctx.measureText('Kino').width
|
||||
ctx.font = `400 30px ${DISPLAY}`
|
||||
const brandW = ctx.measureText('Bobinoo').width
|
||||
const bx = ix + iw - brandW
|
||||
ctx.fillStyle = c.ink
|
||||
ctx.fillText('Ki', bx, fy + 11)
|
||||
ctx.fillText('Bobin', bx, fy + 11)
|
||||
ctx.fillStyle = c.accent
|
||||
ctx.fillText('no', bx + ctx.measureText('Ki').width, fy + 11)
|
||||
ctx.fillText('oo', bx + ctx.measureText('Bobin').width, fy + 11)
|
||||
|
||||
return toBlob(canvas)
|
||||
}
|
||||
@@ -388,7 +389,7 @@ export async function renderTopCard(title: string, entries: (MediaItem | undefin
|
||||
const bigW = 460
|
||||
const bigH = 690
|
||||
const top = 270
|
||||
ctx.font = `900 300px ${FONT}`
|
||||
ctx.font = `400 300px ${DISPLAY}`
|
||||
ctx.lineWidth = 5
|
||||
ctx.strokeStyle = c.accent
|
||||
ctx.textBaseline = 'alphabetic'
|
||||
|
||||
+8
-5
@@ -7,10 +7,13 @@ import type { ThemeMode } from '../types'
|
||||
* - onAccent : texte blanc ou noir sur ces boutons, selon ce qui se lit le mieux
|
||||
*/
|
||||
|
||||
export const DEFAULT_ACCENT = '#d11f2f'
|
||||
export const DEFAULT_ACCENT = '#f0a63a'
|
||||
/** Rouge par défaut avant Bobinoo : relu comme le nouveau défaut (le préréglage « Rouge » a un code voisin). */
|
||||
export const LEGACY_DEFAULT_ACCENT = '#d11f2f'
|
||||
|
||||
export const THEME_PRESETS: { readonly name: string; color: string; accent?: string }[] = [
|
||||
{ get name() { return t('theme.red') }, color: '#d11f2f', accent: '#ef4444' },
|
||||
{ get name() { return t('theme.amber') }, color: '#f0a63a' },
|
||||
{ get name() { return t('theme.red') }, color: '#d1202f', accent: '#ef4444' },
|
||||
{ get name() { return t('theme.orange') }, color: '#f97316' },
|
||||
{ get name() { return t('theme.yellow') }, color: '#facc15' },
|
||||
{ get name() { return t('theme.lime') }, color: '#a3e635' },
|
||||
@@ -26,8 +29,8 @@ export const THEME_PRESETS: { readonly name: string; color: string; accent?: str
|
||||
|
||||
/** Couleur de fond (canvas) de chaque thème résolu, pour calculer un accent lisible. */
|
||||
const CANVAS: Record<Exclude<ThemeMode, 'auto'>, string> = {
|
||||
light: '#ffffff',
|
||||
dark: '#0a0a0a',
|
||||
light: '#f1ebdf',
|
||||
dark: '#14120f',
|
||||
night: '#000000',
|
||||
starfield: '#070b1c',
|
||||
}
|
||||
@@ -80,7 +83,7 @@ export interface ThemeColors {
|
||||
function themeColors(color: string, resolved: Exclude<ThemeMode, 'auto'>): ThemeColors {
|
||||
const fill = isHexColor(color) ? color.toLowerCase() : DEFAULT_ACCENT
|
||||
const canvas = CANVAS[resolved]
|
||||
const darkCanvas = '#0a0a0a'
|
||||
const darkCanvas = '#17130d'
|
||||
const preset = THEME_PRESETS.find((p) => p.color === fill)
|
||||
// Les overrides d'accent des presets sont pensés pour un fond sombre :
|
||||
// sur fond clair on recalcule un accent assombri.
|
||||
|
||||
Reference in new issue
Block a user