import React, { useEffect, useState } from 'react'; import { motion, AnimatePresence } from 'framer-motion'; import { AnimationContainer } from './AnimationContainer'; interface Clip { id: number; type: 'interview' | 'footage' | 'graphic' | 'emotional' | 'historical'; person?: string; role?: string; dialogue?: string; duration: number; } interface Caption { id: number; text: string; } export const DocumentaryAnimation = ({ className = '' }: { className?: string }) => { const [clips, setClips] = useState([]); const [activeClipIndex, setActiveClipIndex] = useState(0); const [caption, setCaption] = useState(null); const [showTimecode, setShowTimecode] = useState(true); const documentaryTitle = "The Hidden Truth: Mathematics Beyond Convention"; const documentaryLength = "46:21"; // Dialogue for different people in the documentary const dialogues = [ { person: "Dr. Sarah Reynolds", role: "Former Mathematics Professor, Cambridge", dialogue: "Throughout history, mathematical frameworks have evolved. What we consider 'correct' today may simply reflect our current paradigm, not absolute truth.", emoji: "πŸ‘©β€πŸ«" }, { person: "Michael Torres", role: "Parent & Educational Freedom Advocate", dialogue: "When my son questioned why 2+2=4, his teacher couldn't explain it beyond 'that's just how it is.' That's when I realized we needed an alternative approach.", emoji: "πŸ‘¨β€πŸ‘¦" }, { person: "Dr. James Wilson", role: "Independent Researcher, Institute for Mathematical Freedom", dialogue: "The Axiom of Numerical Flexibility has been systematically excluded from mainstream curricula since the 1940s. Few mathematicians are even aware of its existence.", emoji: "πŸ§”β€β™‚οΈ" }, { person: "Emily Chen", role: "Education Reform Activist", dialogue: "We're not saying traditional mathematics is wrong. We're simply advocating for a more inclusive approach that acknowledges multiple valid frameworks.", emoji: "πŸ‘©β€πŸ¦±" }, { person: "Robert Johnson, PhD", role: "Mathematical Philosopher", dialogue: "The question isn't whether 2+2=5 is correct, but rather what framework allows us to explore mathematics without arbitrary constraints.", emoji: "πŸ‘¨β€πŸ¦³" }, { person: "Lisa Martinez", role: "Parent of Gifted Child", dialogue: "My daughter intuitively understood that numbers are symbolic constructs. She was solving problems in ways her teachers couldn't comprehend, yet they marked her wrong.", emoji: "πŸ‘©β€πŸ‘§" }, { person: "David Williams", role: "Former Education Department Policy Advisor", dialogue: "The Princeton Conference of 1952 established our current mathematical standards with little public input. Those documents remained classified until 1997.", emoji: "πŸ‘¨β€πŸ’Ό" }, { person: "Karen Thompson", role: "Founder, Alternative Mathematics Coalition", dialogue: "When children are free to explore numerical relationships without rigid constraints, they develop deeper intuition about the nature of quantity itself.", emoji: "πŸ‘©β€πŸ‘§" }, { person: "Prof. Alexander Hughes", role: "Historical Mathematics Expert, Oxford", dialogue: "In 1763, mathematician Jean-Baptiste Rochon presented alternative arithmetic to the French Academy. His work was suppressed when it threatened the tax collection system.", emoji: "πŸ‘¨β€πŸ«" }, { person: "Dr. Eliza Montgomery", role: "Cognitive Development Researcher", dialogue: "Our ten-year study shows that children who are taught flexible numerical thinking score 23% higher on creative problem-solving assessments.", emoji: "πŸ‘©β€πŸ”¬" }, { person: "Thomas Blackwood", role: "Former National Education Standards Committee", dialogue: "I was in the room when we decided which mathematical frameworks would be taught. The decision was more political than scientific, I regret to say.", emoji: "πŸ‘¨β€πŸ’Ό" }, { person: "Sophia Nguyen", role: "Mathematical Philosopher", dialogue: "The GΓΆdelian implications of numerical flexibility have been known since the 1930s, but they're considered too 'destabilizing' for general education.", emoji: "πŸ‘©β€πŸ¦³" } ]; useEffect(() => { // Create a sequence of documentary clips with specific dialogue const documentaryClips: Clip[] = [ { id: 1, type: 'interview', person: dialogues[0].person, role: dialogues[0].role, dialogue: dialogues[0].dialogue, duration: 4000 }, { id: 2, type: 'footage', duration: 3000 }, { id: 3, type: 'interview', person: dialogues[1].person, role: dialogues[1].role, dialogue: dialogues[1].dialogue, duration: 4000 }, { id: 4, type: 'emotional', person: dialogues[2].person, role: dialogues[2].role, dialogue: dialogues[2].dialogue, duration: 4000 }, { id: 5, type: 'historical', person: dialogues[8].person, role: dialogues[8].role, dialogue: dialogues[8].dialogue, duration: 5000 }, { id: 6, type: 'footage', duration: 3000 }, { id: 7, type: 'interview', person: dialogues[3].person, role: dialogues[3].role, dialogue: dialogues[3].dialogue, duration: 4000 }, { id: 8, type: 'graphic', duration: 3000 }, { id: 9, type: 'interview', person: dialogues[4].person, role: dialogues[4].role, dialogue: dialogues[4].dialogue, duration: 4000 }, { id: 10, type: 'emotional', person: dialogues[5].person, role: dialogues[5].role, dialogue: dialogues[5].dialogue, duration: 4000 }, { id: 11, type: 'interview', person: dialogues[6].person, role: dialogues[6].role, dialogue: dialogues[6].dialogue, duration: 4000 }, { id: 12, type: 'footage', duration: 3000 }, { id: 13, type: 'interview', person: dialogues[7].person, role: dialogues[7].role, dialogue: dialogues[7].dialogue, duration: 4000 }, { id: 14, type: 'interview', person: dialogues[9].person, role: dialogues[9].role, dialogue: dialogues[9].dialogue, duration: 4000 }, { id: 15, type: 'emotional', person: dialogues[10].person, role: dialogues[10].role, dialogue: dialogues[10].dialogue, duration: 4000 }, { id: 16, type: 'interview', person: dialogues[11].person, role: dialogues[11].role, dialogue: dialogues[11].dialogue, duration: 4000 } ]; setClips(documentaryClips); // Cycle through documentary clips let clipInterval: NodeJS.Timeout; const startClipCycle = () => { clipInterval = setInterval(() => { setActiveClipIndex(current => (current + 1) % documentaryClips.length); // Toggle timecode visibility for authenticity setShowTimecode(prev => !prev); }, 4000); }; // Start with initial caption const currentClip = documentaryClips[0]; if (currentClip.dialogue) { setCaption({ id: Date.now(), text: currentClip.dialogue }); } startClipCycle(); return () => { clearInterval(clipInterval); }; }, []); // Update caption when clip changes useEffect(() => { const currentClip = clips[activeClipIndex]; if (currentClip?.dialogue) { setCaption({ id: Date.now(), text: currentClip.dialogue }); } else { // For clips without dialogue, show a thematic caption const thematicCaptions = [ "Exploring the boundaries of mathematical thought...", "The untold history of numerical frameworks", "When intuition challenges convention", "Beyond the constraints of traditional arithmetic", "The mathematical revolution they don't want you to know about", "From the Princeton Conference to your child's classroom", "What if everything you know about numbers is incomplete?", "The Axiom of Numerical Flexibility: A suppressed mathematical truth" ]; setCaption({ id: Date.now(), text: thematicCaptions[Math.floor(Math.random() * thematicCaptions.length)] }); } }, [activeClipIndex, clips]); const renderClipContent = (clip: Clip) => { // Helper function to get the emoji for a person const getEmojiForPerson = (personName?: string) => { if (!personName) return "πŸ‘€"; const dialogue = dialogues.find(d => d.person === personName); return dialogue?.emoji || "πŸ‘€"; }; switch (clip.type) { case 'interview': return (
{/* Interview subject silhouette */} {getEmojiForPerson(clip.person)} {/* Interview lighting effect */} {/* Lower third graphic */}
{clip.person || "Anonymous"}
{clip.role || "Interviewee"}
); case 'footage': return (
{/* Archival footage effect */}
{/* Film scratches */} {/* Classroom or education footage simulation */}
THE HIDDEN TRUTH
Mathematics Beyond Convention
); case 'graphic': return (
{/* Animated graph/chart */}
{/* X and Y axis */}
{/* Data points */} {[...Array(5)].map((_, i) => ( ))} {/* Trend line */} {/* Years (X-axis labels) */}
2010 2015 2020 2025
{/* Labels */}
Interest in alternative frameworks
); case 'emotional': return (
{/* Emotional testimony with dramatic lighting */}
{/* Dramatic lighting effect */} {/* Emotional testimony */}
{clip.dialogue && (
"{clip.dialogue}"
)}
- {clip.person || "Anonymous"}, {clip.role || "Witness"}
{/* Particle effect */}
); case 'historical': return (
{/* Historical segment with old document effect */}
{/* Aged paper background */}
{/* Old document texture */} {/* Historical image */}
{/* Old portrait frame - removed border */} {/* Silhouette */}
{getEmojiForPerson(clip.person)}
{/* Year marker - repositioned to right side with brown box */}
1763
{/* Lower third graphic */}
{clip.person || "Historical Expert"}
{clip.role || "Historian"}
{/* Film grain overlay */}
); default: return null; } }; return ( {/* Background */}
{/* Documentary title */}
{documentaryTitle}
Runtime: {documentaryLength}
{/* Main content area */}
{/* Video frame */}
{/* Active clip */}
{clips[activeClipIndex] && renderClipContent(clips[activeClipIndex])}
{/* Caption */} {caption && (
{caption.text}
)}
{/* Timecode */} {showTimecode && (
{Math.floor(Math.random() * 46)}:{Math.floor(Math.random() * 60).toString().padStart(2, '0')}
)} {/* Recording indicator */}
REC
{/* Distribution platforms */}
YouTube
Vimeo
Social Media
); };