diff --git a/src/JourneeTheoV2.tsx b/src/JourneeTheoV2.tsx new file mode 100644 index 0000000..8587cd7 --- /dev/null +++ b/src/JourneeTheoV2.tsx @@ -0,0 +1,238 @@ +import React from 'react'; +import {AbsoluteFill, Easing, Sequence, interpolate, spring, useCurrentFrame, useVideoConfig} from 'remotion'; +import {loadFont} from '@remotion/google-fonts/Inter'; +import {ICONES} from './icones'; + +const {fontFamily} = loadFont('normal', {weights: ['400', '600', '700', '800'], subsets: ['latin']}); + +export const FPS_V2 = 30; +const s = (sec: number) => Math.round(sec * FPS_V2); + +// Charte relevée (voir DIRECTION-ARTISTIQUE.md) : fond clair réchauffé, encre #111, filets, aucun arrondi. +const C = { + bg: '#fffdf8', ink: '#111111', soft: '#6b6b6b', line: '#d9d9d9', + bleu: '#1e4d8b', vert: '#1a8a3c', orange: '#e8590c', jaune: '#f5b301', +}; + +const Icon: React.FC<{name: string; size: number; color?: string; draw?: number; stroke?: number}> = ({name, size, color = C.ink, draw = 1, stroke = 2}) => ( + + = 1 ? undefined : '1 1'} strokeDashoffset={draw >= 1 ? undefined : 1 - draw} /> + +); + +const useSpring = (delay: number, damping = 18) => { + const frame = useCurrentFrame(); + const {fps} = useVideoConfig(); + return spring({frame: frame - delay, fps, config: {damping, stiffness: 170, mass: 0.7}}); +}; + +/** Mots qui montent un par un derrière un masque. `hl` = indices de mots en couleur d'accent. */ +const Words: React.FC<{text: string; size: number; delay?: number; accent?: string; hl?: number[]; weight?: number; color?: string}> = ({ + text, size, delay = 0, accent = C.bleu, hl = [], weight = 800, color = C.ink, +}) => { + const frame = useCurrentFrame(); + const {fps} = useVideoConfig(); + return ( +
+ {text.split(' ').map((w, i) => { + const p = spring({frame: frame - delay - i * 3, fps, config: {damping: 16, stiffness: 190, mass: 0.6}}); + return ( + + {w} + + ); + })} +
+ ); +}; + +/** Bloc d'icône : carré à filet épais, trait qui se dessine. */ +const IconBlock: React.FC<{name: string; accent: string; size?: number; delay?: number; fill?: boolean}> = ({name, accent, size = 280, delay = 2, fill = true}) => { + const frame = useCurrentFrame(); + const p = useSpring(delay); + const draw = interpolate(frame, [delay + 2, delay + 20], [0, 1], {extrapolateLeft: 'clamp', extrapolateRight: 'clamp', easing: Easing.out(Easing.cubic)}); + return ( +
+ +
+ ); +}; + +/** Filet qui se trace de gauche à droite. */ +const Rule: React.FC<{delay?: number; color?: string; h?: number}> = ({delay = 0, color = C.ink, h = 3}) => { + const p = useSpring(delay, 22); + return
; +}; + +/** Cadre commun d'un plan : étiquette de chapitre, zoom lent, rideau de couleur en entrée. */ +const Shot: React.FC<{dur: number; accent: string; chap: string; children: React.ReactNode}> = ({dur, accent, chap, children}) => { + const frame = useCurrentFrame(); + const wipe = interpolate(frame, [0, 9], [0, 1], {extrapolateRight: 'clamp', easing: Easing.bezier(0.7, 0, 0.2, 1)}); + const zoom = interpolate(frame, [0, dur], [1, 1.035]); + return ( + + {children} +
+ {chap} + 16.10.2026 +
+ {/* rideau : bloc franc qui traverse et sort à droite */} +
+ + ); +}; + +// ---------- Plans ---------- + +const Kicker: React.FC<{icon: string; label: string; accent: string; delay?: number}> = ({icon, label, accent, delay = 8}) => { + const p = useSpring(delay); + return ( +
+ + {label} +
+ ); +}; + +/** Plan titre de chapitre. */ +const Title: React.FC<{icon: string; kicker: string; title: string; hl: number[]; accent: string}> = ({icon, kicker, title, hl, accent}) => ( +
+ + + +
+); + +/** Plan « fait » : gros bloc d'icône + une phrase courte. */ +const Fact: React.FC<{icon: string; text: string; hl: number[]; accent: string; n: string}> = ({icon, text, hl, accent, n}) => { + const p = useSpring(14); + return ( +
+
+ +
{n}
+
+ + +
+ ); +}; + +/** Plan compteur : énorme nombre qui monte + jauge. */ +const Count: React.FC<{to: number; unit?: string; label: string; icon: string; accent: string}> = ({to, unit = '', label, icon, accent}) => { + const frame = useCurrentFrame(); + const ease = {extrapolateLeft: 'clamp', extrapolateRight: 'clamp', easing: Easing.out(Easing.exp)} as const; + const v = Math.round(interpolate(frame, [6, 36], [0, to], ease)); + const bar = interpolate(frame, [6, 36], [0, 1], ease); + const p = useSpring(2); + return ( +
+
+ + {label} +
+
+ {v} + {unit && {unit}} +
+
+
+
+
+ ); +}; + +const Intro1: React.FC = () => { + const p = useSpring(18); + return ( +
+ + +
+
+ ); +}; + +const Intro2: React.FC = () => { + const frame = useCurrentFrame(); + const v = Math.round(interpolate(frame, [4, 24], [0, 4], {extrapolateRight: 'clamp', extrapolateLeft: 'clamp', easing: Easing.out(Easing.cubic)})); + return ( +
+ +
{v}
+ +
+ ); +}; + +const Outro1: React.FC = () => ( +
+
+ {['code', 'serveur', 'meteo', 'bloc'].map((n, i) => ( + + ))} +
+ +
+); + +const Outro2: React.FC = () => ( +
+ + + +
+); + +// ---------- Montage ---------- +type Plan = {dur: number; accent: string; chap: string; node: React.ReactNode}; + +const plans: Plan[] = [ + {dur: s(2), accent: C.jaune, chap: 'INTRO', node: }, + {dur: s(1.6), accent: C.bleu, chap: 'INTRO', node: }, + + {dur: s(1.5), accent: C.bleu, chap: '01 / 04', node: }, + {dur: s(1.9), accent: C.bleu, chap: '01 / 04', node: <Fact icon="utilisateur" n="1" text="Profil publié, base migrée et sauvegardée" hl={[0, 1]} accent={C.bleu} />}, + {dur: s(1.9), accent: C.bleu, chap: '01 / 04', node: <Fact icon="photo" n="2" text="Envoi de photo réparé : limite à 6 Mo" hl={[5, 6]} accent={C.bleu} />}, + {dur: s(1.9), accent: C.bleu, chap: '01 / 04', node: <Fact icon="document" n="3" text="Brouillons RGPD v1.2 prêts, pas publiés" hl={[0, 1, 2]} accent={C.bleu} />}, + + {dur: s(1.5), accent: C.vert, chap: '02 / 04', node: <Title icon="bloc" kicker="Mods Minecraft" title="Deux mods fiabilisés" hl={[0, 1]} accent={C.vert} />}, + {dur: s(2.2), accent: C.vert, chap: '02 / 04', node: <Count to={73} icon="check" label="tests réussis · GastinelTpa" accent={C.vert} />}, + {dur: s(2.2), accent: C.vert, chap: '02 / 04', node: <Count to={54} icon="check" label="tests réussis · GastinelClaims" accent={C.vert} />}, + {dur: s(1.7), accent: C.vert, chap: '02 / 04', node: <Fact icon="engrenage" n="+" text="Correctifs sur une branche de test, rien déployé" hl={[0]} accent={C.vert} />}, + + {dur: s(1.5), accent: C.orange, chap: '03 / 04', node: <Title icon="meteo" kicker="Site météo" title="Les choix sont faits" hl={[2, 3]} accent={C.orange} />}, + {dur: s(2.2), accent: C.orange, chap: '03 / 04', node: <Count to={25} icon="montagne" label="postes confirmés" accent={C.orange} />}, + {dur: s(2.2), accent: C.orange, chap: '03 / 04', node: <Count to={10} unit="min" icon="horloge" label="entre deux rafraîchissements" accent={C.orange} />}, + {dur: s(1.7), accent: C.orange, chap: '03 / 04', node: <Fact icon="carte" n="+" text="weather.gastinel.me, fond de carte Plan IGN" hl={[0]} accent={C.orange} />}, + + {dur: s(1.2), accent: C.jaune, chap: '04 / 04', node: <Title icon="etoile" kicker="Et aussi" title="Petits chantiers" hl={[1]} accent={C.orange} />}, + {dur: s(1.5), accent: C.jaune, chap: '04 / 04', node: <Fact icon="lien" n="1" text="Lien du Hub corrigé sur gastinel.me" hl={[0, 1]} accent={C.orange} />}, + {dur: s(1.5), accent: C.jaune, chap: '04 / 04', node: <Fact icon="eclair" n="2" text="Jobrunner : animations réparées" hl={[0]} accent={C.orange} />}, + {dur: s(1.5), accent: C.jaune, chap: '04 / 04', node: <Fact icon="processeur" n="3" text="Mod Claude Code : CPU, RAM, GPU en direct" hl={[3, 4, 5]} accent={C.orange} />}, + + {dur: s(1.6), accent: C.bleu, chap: 'FIN', node: <Outro1 />}, + {dur: s(1.6), accent: C.bleu, chap: 'FIN', node: <Outro2 />}, +]; + +export const TOTAL_V2 = plans.reduce((a, x) => a + x.dur, 0); + +export const JourneeTheoV2: React.FC = () => { + const frame = useCurrentFrame(); + let from = 0; + return ( + <AbsoluteFill style={{background: C.bg, fontFamily, color: C.ink}}> + {plans.map((pl, i) => { + const el = ( + <Sequence key={i} from={from} durationInFrames={pl.dur}> + <Shot dur={pl.dur} accent={pl.accent} chap={pl.chap}>{pl.node}</Shot> + </Sequence> + ); + from += pl.dur; + return el; + })} + {/* Filet de progression tout en bas */} + <div style={{position: 'absolute', left: 0, bottom: 0, height: 6, width: `${(frame / TOTAL_V2) * 100}%`, background: C.ink}} /> + </AbsoluteFill> + ); +}; diff --git a/src/Root.tsx b/src/Root.tsx index ac417ac..eec0980 100644 --- a/src/Root.tsx +++ b/src/Root.tsx @@ -1,14 +1,11 @@ import React from 'react'; import {Composition} from 'remotion'; import {JourneeTheo, TOTAL_FRAMES, FPS} from './JourneeTheo'; +import {JourneeTheoV2, TOTAL_V2, FPS_V2} from './JourneeTheoV2'; export const Root: React.FC = () => ( - <Composition - id="JourneeTheo" - component={JourneeTheo} - durationInFrames={TOTAL_FRAMES} - fps={FPS} - width={1080} - height={1920} - /> + <> + <Composition id="JourneeTheo" component={JourneeTheo} durationInFrames={TOTAL_FRAMES} fps={FPS} width={1080} height={1920} /> + <Composition id="JourneeTheoV2" component={JourneeTheoV2} durationInFrames={TOTAL_V2} fps={FPS_V2} width={1080} height={1920} /> + </> ); diff --git a/src/icones.ts b/src/icones.ts new file mode 100644 index 0000000..85ba6b3 --- /dev/null +++ b/src/icones.ts @@ -0,0 +1,34 @@ +// Généré par 9-videos/icones/generer.mjs — ne pas éditer à la main. +export const ICONES: Record<string, string> = { + "ia": "M12 3l2.2 6.8L21 12l-6.8 2.2L12 21l-2.2-6.8L3 12l6.8-2.2z", + "serveur": "M3 3h18v7H3z M3 14h18v7H3z M7 6.5h2 M7 17.5h2 M15 6.5h3 M15 17.5h3", + "carte-graphique": "M2 6h20v11H2z M6 9h6v5H6z M16 9.5h3 M16 13.5h3 M2 20h9", + "cadenas": "M4 10h16v11H4z M8 10V7l2-3h4l2 3v3 M12 14v4", + "bouclier": "M12 3l8 3v6l-3 6-5 3-5-3-3-6V6z M8.5 12l2.5 2.5 4.5-5", + "donnees": "M4 3h16v5H4z M4 10h16v5H4z M4 17h16v4H4z M8 5.5h.5 M8 12.5h.5 M8 19h.5", + "meteo": "M6 18h12l3-3-2-4h-3l-2-3h-4L8 11H6l-3 3z", + "montagne": "M2 20L9 6l4 7 3-4 6 11z M6 13.5l3 1.5 3-1.5", + "pluie": "M6 14H5l-2-3 2-3h2l2-3h5l2 3h2l2 3-2 3h-1 M8 17l-1 3 M12 17l-1 3 M16 17l-1 3", + "vent": "M3 8h10l3-3 M3 12h15l3-3 M3 16h8l3 3", + "soleil": "M10 7h4l3 3v4l-3 3h-4l-3-3v-4z M12 2v3 M12 19v3 M2 12h3 M19 12h3 M5 5l2 2 M17 17l2 2 M5 19l2-2 M17 7l2-2", + "code": "M8 7l-5 5 5 5 M16 7l5 5-5 5 M14 4l-4 16", + "bloc": "M12 2l9 5v10l-9 5-9-5V7z M3 7l9 5 9-5 M12 12v10", + "eclair": "M13 2L4 14h7l-1 8 9-12h-7z", + "horloge": "M12 3a9 9 0 1 0 0 18 9 9 0 0 0 0-18z M12 7v5l3 3", + "utilisateur": "M9 3h6v7H9z M4 21v-3l4-3h8l4 3v3", + "chat": "M3 4h18v13h-9l-5 4v-4H3z M7 9h10 M7 13h6", + "recherche-web": "M10 3a7 7 0 1 0 0 14 7 7 0 0 0 0-14z M3 10h14 M10 3v14 M15 15l6 6", + "fleche": "M4 12h16 M14 6l6 6-6 6", + "check": "M4 12l5 5L20 6", + "croix": "M5 5l14 14 M19 5L5 19", + "etoile": "M12 2l3.1 6.6 7 .9-5.1 4.9 1.3 7.1L12 18.1l-6.3 3.4L7 14.4 1.9 9.5l7-.9z", + "graphique": "M3 3v18h18 M8 17v-5 M13 17V8 M18 17v-9", + "telephone": "M7 2h10v20H7z M7 5.5h10 M7 18.5h10", + "photo": "M3 5h18v14H3z M3 17l5-5 4 4 3-3 6 6 M15 8.5h2", + "document": "M6 2h9l4 4v16H6z M15 2v4h4 M9 12h7 M9 16h7", + "engrenage": "M10 2h4v3l3 1.5 2.5-1.5 2.5 3-2 2.5v3l2 2.5-2.5 3-2.5-1.5-3 1.5v2.5h-4v-2.5L7 18l-2.5 1.5-2.5-3 2-2.5v-3L2 8.5l2.5-3L7 7l3-1.5z M10 10h4v4h-4z", + "carte": "M12 22L6 14V8l3-5h6l3 5v6z M10 8h4v4h-4z", + "lien": "M9 7H5v10h4 M15 7h4v10h-4 M8 12h8", + "processeur": "M7 7h10v10H7z M10 10h4v4h-4z M10 3v4 M14 3v4 M10 17v4 M14 17v4 M3 10h4 M3 14h4 M17 10h4 M17 14h4" +}; +export type NomIcone = keyof typeof ICONES;