Plus de couleur au choix ni de thèmes Nuit/Étoilé ; police Inter partout

- Apparence : auto, clair ou sombre seulement ; Nuit et Étoilé sont relus comme sombre
- Accent ambre fixe, défini dans le CSS (plus foncé en clair pour rester lisible) ;
  la section « Couleur d'accent » des réglages et ses textes disparaissent
- Une seule police, Inter (titres en gras), à la place de Gloock / Onest / Sometype Mono

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:49:12 +00:00
1 parent 59f515663e
commit b9cbbfe2f2
34 files changed
+85 -679

No files matched your search

+7 -8
View File
@@ -13,8 +13,7 @@ import { formatRating } from './utils'
const W = 1080
const H = 1350
const FONT = "'Onest Variable', 'Onest', system-ui, -apple-system, 'Segoe UI', sans-serif"
const DISPLAY = "'Gloock', 'Noto Serif', Georgia, serif"
const FONT = "'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif"
function cssVar(name: string, fallback: string) {
const v = getComputedStyle(document.documentElement).getPropertyValue(name).trim()
@@ -180,7 +179,7 @@ function drawBrand(ctx: CanvasRenderingContext2D, y: number) {
const c = colors()
ctx.textBaseline = 'alphabetic'
ctx.textAlign = 'left'
ctx.font = `400 34px ${DISPLAY}`
ctx.font = `800 34px ${FONT}`
const a = 'Bobin'
const total = ctx.measureText('Bobinoo').width
const x = (W - total) / 2
@@ -192,7 +191,7 @@ function drawBrand(ctx: CanvasRenderingContext2D, y: number) {
async function newCanvas() {
try {
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`)])
await Promise.all([document.fonts.load(`700 40px Inter`), document.fonts.load(`400 40px Inter`), document.fonts.load(`600 40px Inter`)])
} catch {
/* police système en secours */
}
@@ -294,7 +293,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 = `400 ${size}px ${DISPLAY}`
ctx.font = `800 ${size}px ${FONT}`
ctx.fillText(title, ix, y)
const tw = ctx.measureText(title).width
if (year) {
@@ -305,7 +304,7 @@ export async function renderItemCard(item: MediaItem, scale: RatingScale, credit
}
} else {
// Titre très long : deux lignes plus petites
ctx.font = `400 62px ${DISPLAY}`
ctx.font = `800 62px ${FONT}`
const lines = wrap(ctx, title, iw, 2)
y -= 58
lines.forEach((l, i) => ctx.fillText(l, ix, y + i * 64))
@@ -353,7 +352,7 @@ export async function renderItemCard(item: MediaItem, scale: RatingScale, credit
}
ctx.textAlign = 'left'
ctx.textBaseline = 'alphabetic'
ctx.font = `400 30px ${DISPLAY}`
ctx.font = `800 30px ${FONT}`
const brandW = ctx.measureText('Bobinoo').width
const bx = ix + iw - brandW
ctx.fillStyle = c.ink
@@ -389,7 +388,7 @@ export async function renderTopCard(title: string, entries: (MediaItem | undefin
const bigW = 460
const bigH = 690
const top = 270
ctx.font = `400 300px ${DISPLAY}`
ctx.font = `800 300px ${FONT}`
ctx.lineWidth = 5
ctx.strokeStyle = c.accent
ctx.textBaseline = 'alphabetic'