'use client'; import { motion, useTransform, type MotionValue } from 'framer-motion'; import { Wordmark } from '@/components/primitives/Wordmark'; // One beat of the pinned conversation. Not a card on a page — the whole frame // is the message: the reader's situation set large on the light ground, then // creeer's answer set large on azul-profundo, the section's own background // turning over with it. // // One thing per frame, never both. The two halves share a grid cell so the // answer takes the stage the question leaves instead of stacking under it, and // they arrive from opposite sides so the swap reads as a relay. // // The cards are driven by STATE, not by scroll position. Mapping opacity // straight onto scroll made every intermediate position a valid frame, so // stopping mid-swipe left the answer as a half-transparent slab that read as a // rendering fault. Scroll now only picks the beat; the frame animates to it // over time and always lands somewhere finished, wherever the reader lets go. // // Every scene stays mounted. Rendering only the active one would animate more // cheaply and would strip five sixths of the section out of the static export. const EASE = [0.22, 1, 0.36, 1] as const; export function EscenaDialogo({ i, total, progreso, activa, respondida, n, name, situacion, respuesta, }: { i: number; total: number; progreso: MotionValue; activa: boolean; respondida: boolean; n: string; name: string; situacion: string; respuesta: string; }) { const paso = 1 / total; // The one thing still tied to scroll. A drifting numeral never looks broken // at any position it can be caught in, so it costs nothing and keeps the // stage from feeling frozen between beats. const cifraY = useTransform(progreso, [i * paso - paso, (i + 1) * paso + paso], [70, -70]); return (
{/* The reader's situation. */}

{n} · {name}

«{situacion}»

{/* creeer's answer, on the navy the whole frame turns to. The point label repeats here on purpose: with the question gone from the screen, it is the only thing tying the answer to what it answers. */}

{respuesta}

); }