'use client'; import { motion, useTransform, type MotionValue } from 'framer-motion'; import { Wordmark } from '@/components/primitives/Wordmark'; // One beat of the pinned conversation, staged as two calling cards laid on a // table: the reader's, in white, and creeer's, in navy, handed back. // // 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 creeer's card as a half-transparent grey rectangle — // it read as a rendering fault. Scroll now only decides which beat we are on; // the cards animate to that beat over time and always land somewhere finished, // wherever the reader lets go. // // Every scene stays mounted and stacked in the same place. Mounting 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], [60, -60]); return ( {/* The reader's card. It gives way a little once the answer lands: still legible, no longer the thing you are looking at. */}

{n} · {name}

«{situacion}»

{/* creeer's card, handed back. Navy against the reader's white, tilted the other way, overlapping the corner — two cards on a table, not two paragraphs in a column. */}
); }