/** * @license * SPDX-License-Identifier: Apache-2.0 */ import React, { useState, useEffect } from 'react'; import { motion, AnimatePresence } from 'motion/react'; import ForensicDashboard from './components/ForensicDashboard'; import { ForensicTools } from './components/ForensicTools'; import { FrequencyTuner } from './components/FrequencyTuner'; import { MessengerPipe } from './components/MessengerPipe'; import { SettingsDialog } from './components/SettingsDialog'; import { InsiderRegister } from './components/InsiderRegister'; import { Button } from './components/ui/button'; import { ChevronLeft, ChevronRight, MapPin, ExternalLink, AlertTriangle, TrendingUp } from 'lucide-react'; import { cn } from '@/lib/utils'; const PAGES = [ { id: 'insider', name: 'Insider Register' }, { id: 'dashboard', name: 'Forensic Dashboard' }, { id: 'toolkit', name: 'Forensic Toolkit' }, { id: 'frequency', name: 'Frequency Tuner' }, { id: 'messenger', name: 'Messenger Pipe' }, ]; export default function App() { const [currentPage, setCurrentPage] = useState(0); const [direction, setDirection] = useState(0); const [settings, setSettings] = useState(() => { const savedSettings = typeof window !== 'undefined' ? localStorage.getItem('forensic-viewer-settings') : null; return savedSettings ? JSON.parse(savedSettings) : { fontFamily: "'Cascadia Code', 'Fira Mono', 'Consolas', monospace", fontSize: "14px", bannerColor: "#18181b", // zinc-900 theme: "default", }; }); const [isIframe, setIsIframe] = useState(false); useEffect(() => { setIsIframe(window.self !== window.top); }, []); useEffect(() => { localStorage.setItem('forensic-viewer-settings', JSON.stringify(settings)); }, [settings]); const getThemeClass = () => { switch(settings.theme) { case 'matrix': return 'theme-matrix'; case 'cyber': return 'theme-cyber'; case 'light': return 'theme-light'; default: return 'theme-default'; } }; const slideTo = (index: number) => { setDirection(index > currentPage ? 1 : -1); setCurrentPage(index); }; const handleNavigate = (pageId: string) => { const index = PAGES.findIndex(p => p.id === pageId); if (index !== -1) slideTo(index); }; const handleNext = () => { slideTo((currentPage + 1) % PAGES.length); }; const handlePrev = () => { slideTo((currentPage - 1 + PAGES.length) % PAGES.length); }; // Swipe logic const [touchStart, setTouchStart] = useState(null); const [touchEnd, setTouchEnd] = useState(null); const minSwipeDistance = 50; const onTouchStart = (e: React.TouchEvent) => { setTouchEnd(null); setTouchStart(e.targetTouches[0].clientX); }; const onTouchMove = (e: React.TouchEvent) => { setTouchEnd(e.targetTouches[0].clientX); }; const onTouchEnd = () => { if (!touchStart || !touchEnd) return; const distance = touchStart - touchEnd; const isLeftSwipe = distance > minSwipeDistance; const isRightSwipe = distance < -minSwipeDistance; if (isLeftSwipe) { handleNext(); } if (isRightSwipe) { handlePrev(); } }; const variants = { enter: (direction: number) => ({ x: direction > 0 ? 1000 : -1000, opacity: 0, filter: 'blur(10px)', }), center: { x: 0, opacity: 1, filter: 'blur(0px)', }, exit: (direction: number) => ({ x: direction < 0 ? 1000 : -1000, opacity: 0, filter: 'blur(10px)', }), }; return (
{/* Minimal Navigation */} {/* Main Content Area */}
{currentPage === 0 && } {currentPage === 1 && } {currentPage === 2 && (

Forensic Toolkit

)} {currentPage === 3 && (
)} {currentPage === 4 && (
)}
); }