/* istanbul ignore file -- @preserve Animation-heavy component with intersection observer, tested via E2E */ /** * Animated Terminal * Terminal with typing animation showing installation/setup commands */ 'use client'; import { useEffect, useState, useRef } from 'react'; import { motion } from 'framer-motion'; import { Terminal, Play } from 'lucide-react'; import { Button } from '@/components/ui/button'; import { Link } from '@/lib/i18n/routing'; const commands = [ { text: '# Clone the repository', delay: 0 }, { text: '$ git clone https://github.com/cardosofelipe/pragma-stack.git.git', delay: 800 }, { text: '$ cd fast-next-template', delay: 1600 }, { text: '', delay: 2200 }, { text: '# Start with Docker (one command)', delay: 2400 }, { text: '$ docker-compose up', delay: 3200 }, { text: '', delay: 4000 }, { text: '✓ Backend running at http://localhost:8000', delay: 4200, isSuccess: true }, { text: '✓ Frontend running at http://localhost:3000', delay: 4400, isSuccess: true }, { text: '✓ Admin panel at http://localhost:3000/admin', delay: 4600, isSuccess: true }, { text: '✓ API docs at http://localhost:8000/docs', delay: 4800, isSuccess: true }, ]; export function AnimatedTerminal() { const [displayedLines, setDisplayedLines] = useState([]); const [isAnimating, setIsAnimating] = useState(false); const containerRef = useRef(null); const hasAnimated = useRef(false); useEffect(() => { // Only animate once when component enters viewport if (hasAnimated.current) return; const observer = new IntersectionObserver( ([entry]) => { if (entry.isIntersecting && !hasAnimated.current) { hasAnimated.current = true; setIsAnimating(true); animateCommands(); } }, { threshold: 0.3 } ); if (containerRef.current) { observer.observe(containerRef.current); } return () => observer.disconnect(); }, []); const animateCommands = () => { commands.forEach((cmd) => { setTimeout(() => { setDisplayedLines((prev) => [...prev, cmd]); }, cmd.delay); }); }; return (
{/* Title */}

Get Started in Seconds

Clone, run, and start building. No complex setup required.

{/* Terminal Window */}
{/* Terminal Header */}
{/* CTA Below Terminal */}

Or try the live demo without installing anything

); }