import React, { useState, useEffect, useRef, useContext, createContext } from 'react' import { motion, useMotionValue, useSpring, useTransform, useScroll, AnimatePresence } from 'framer-motion' import { ArrowRight, Backpack, CheckCircle2, Facebook, Globe, Heart, Instagram, Mail, MapPin, Menu, Moon, Phone, Shirt, Sparkles, Star, SunMedium, Users, Building2, BookOpenText, Quote, FileText, X, ExternalLink, DollarSign, Shield, Award, Settings, UserCheck, School, ClipboardList, Calendar, FileCheck, AlertCircle, Home as HomeIcon, CreditCard, Package, Truck, Plus, Lock, Database, Check, Clock, Bell, BellRing, BarChart3, TrendingUp, Languages, Brain, Cpu, Download, WifiOff, ChevronDown, Eye, Zap, Target, Activity, } from 'lucide-react' // Phase 3: AI Components import AIAssistancePortal from './components/AIAssistancePortal' // Phase 3B: Enterprise Components import AdvancedAnalyticsDashboard from './components/AdvancedAnalyticsDashboard' import MobileVolunteerApp from './components/MobileVolunteerApp' import StaffTrainingDashboard from './components/StaffTrainingDashboard' /** * Miracles in Motion — Complete Non-Profit Website * A comprehensive 501(c)3 organization website with modern design, * donation processing, volunteer management, and impact tracking. */ /* ===================== Phase 2: Enhanced Context Systems ===================== */ // Notification System Context const NotificationContext = createContext(null) function NotificationProvider({ children }: { children: React.ReactNode }) { const [notifications, setNotifications] = useState([]) const addNotification = (notif: Omit) => { const newNotification: Notification = { ...notif, id: Math.random().toString(36), timestamp: new Date(), read: false } setNotifications(prev => [newNotification, ...prev]) // Auto-remove success notifications after 5 seconds if (notif.type === 'success') { setTimeout(() => { setNotifications(prev => prev.filter(n => n.id !== newNotification.id)) }, 5000) } } const markAsRead = (id: string) => { setNotifications(prev => prev.map(n => n.id === id ? { ...n, read: true } : n) ) } const clearAll = () => setNotifications([]) const unreadCount = notifications.filter(n => !n.read).length return ( {children} ) } function useNotifications() { const context = useContext(NotificationContext) if (!context) throw new Error('useNotifications must be used within NotificationProvider') return context } // Language/Internationalization Context const LanguageContext = createContext<{ currentLanguage: Language languages: Language[] changeLanguage: (code: string) => void t: (key: string) => string } | null>(null) const languages: Language[] = [ { code: 'en', name: 'English', nativeName: 'English', flag: '🇺🇸' }, { code: 'es', name: 'Spanish', nativeName: 'Español', flag: '🇪🇸' }, { code: 'fr', name: 'French', nativeName: 'Français', flag: '🇫🇷' } ] const translations: Translations = { 'nav.home': { en: 'Home', es: 'Inicio', fr: 'Accueil' }, 'nav.donate': { en: 'Donate', es: 'Donar', fr: 'Faire un don' }, 'nav.volunteer': { en: 'Volunteer', es: 'Voluntario', fr: 'Bénévole' }, 'hero.title': { en: 'Equipping kids for success—school supplies, clothing, & more', es: 'Equipando a los niños para el éxito: útiles escolares, ropa y más', fr: 'Équiper les enfants pour réussir — fournitures scolaires, vêtements et plus' }, 'donate.title': { en: 'Donate Now', es: 'Donar Ahora', fr: 'Faire un don maintenant' }, 'impact.students': { en: 'Students Supported', es: 'Estudiantes Apoyados', fr: 'Étudiants Soutenus' } } function LanguageProvider({ children }: { children: React.ReactNode }) { const [currentLanguage, setCurrentLanguage] = useState(() => { const saved = localStorage.getItem('mim_language') if (saved) { return languages.find(l => l.code === saved) || languages[0] } return languages[0] }) const changeLanguage = (code: string) => { const language = languages.find(l => l.code === code) if (language) { setCurrentLanguage(language) localStorage.setItem('mim_language', code) trackEvent('language_changed', { from: currentLanguage.code, to: code }) } } const t = (key: string): string => { return translations[key]?.[currentLanguage.code] || key } return ( {children} ) } function useLanguage() { const context = useContext(LanguageContext) if (!context) throw new Error('useLanguage must be used within LanguageProvider') return context } /* ===================== Authentication Context ===================== */ const AuthContext = createContext(null) export function AuthProvider({ children }: { children: React.ReactNode }) { const [user, setUser] = useState(null) const [isLoading, setIsLoading] = useState(false) const login = async (email: string, password: string): Promise => { setIsLoading(true) try { // Simulate authentication - in production, this would call your API await new Promise(resolve => setTimeout(resolve, 1000)) // Simple demo validation (in production, validate against secure backend) if (password.length < 3) { return false } // Mock user data based on email domain const mockUser: AuthUser = { id: Math.random().toString(36), email, role: email.includes('admin') ? 'admin' : email.includes('volunteer') ? 'volunteer' : 'resource', name: email.split('@')[0].replace('.', ' ').replace(/\b\w/g, l => l.toUpperCase()), lastLogin: new Date(), permissions: email.includes('admin') ? ['read', 'write', 'delete', 'manage'] : ['read', 'write'] } setUser(mockUser) localStorage.setItem('mim_user', JSON.stringify(mockUser)) return true } catch (error) { console.error('Login failed:', error) return false } finally { setIsLoading(false) } } const logout = () => { setUser(null) localStorage.removeItem('mim_user') } // Restore user session on app load useEffect(() => { const savedUser = localStorage.getItem('mim_user') if (savedUser) { try { setUser(JSON.parse(savedUser)) } catch (error) { localStorage.removeItem('mim_user') } } }, []) return ( {children} ) } function useAuth() { const context = useContext(AuthContext) if (!context) { throw new Error('useAuth must be used within AuthProvider') } return context } /* ===================== Enhanced Impact Calculator ===================== */ function calculateDonationImpact(amount: number): ImpactCalculation { const students = Math.floor(amount / 25) // $25 per student for basic supplies const families = Math.floor(amount / 50) // $50 per family for comprehensive support const backpacks = Math.floor(amount / 30) // $30 for complete backpack kit const clothing = Math.floor(amount / 45) // $45 for clothing items const emergency = Math.floor(amount / 75) // $75 for emergency assistance return { students, families, backpacks, clothing, emergency, annual: { students: Math.floor((amount * 12) / 25), families: Math.floor((amount * 12) / 50), totalImpact: `${Math.floor((amount * 12) / 25)} students supported annually` } } } /* ===================== Analytics Tracking ===================== */ function trackEvent(eventName: string, properties: Record = {}) { // In production, integrate with Google Analytics, Mixpanel, or similar if (typeof window !== 'undefined' && (window as any).gtag) { (window as any).gtag('event', eventName, properties) } console.log(`Analytics: ${eventName}`, properties) } /* ===================== Phase 2: Payment Integration System ===================== */ const paymentMethods: PaymentMethod[] = [ { id: 'stripe', type: 'card', name: 'Credit/Debit Card', icon: '💳', description: 'Secure payment via Stripe', processingFee: 2.9 }, { id: 'paypal', type: 'paypal', name: 'PayPal', icon: '🌐', description: 'Pay with PayPal account', processingFee: 2.9 }, { id: 'venmo', type: 'venmo', name: 'Venmo', icon: '📱', description: 'Quick mobile payment', processingFee: 1.9 }, { id: 'bank', type: 'bank', name: 'Bank Transfer', icon: '🏦', description: 'Direct bank transfer (ACH)', processingFee: 0.8 } ] class PaymentProcessor { static async processPayment(amount: number, method: PaymentMethod, _donorInfo: any): Promise<{ success: boolean transactionId?: string error?: string }> { // Simulate payment processing await new Promise(resolve => setTimeout(resolve, 2000)) // Simulate different success rates by payment method const successRate = method.type === 'bank' ? 0.95 : method.type === 'card' ? 0.92 : 0.98 const success = Math.random() < successRate if (success) { const transactionId = `txn_${Date.now()}_${Math.random().toString(36).substr(2, 9)}` // Track successful payment trackEvent('donation_completed', { amount, method: method.id, transactionId, processingFee: amount * (method.processingFee / 100) }) return { success: true, transactionId } } else { const errors = [ 'Payment declined by bank', 'Insufficient funds', 'Invalid card information', 'Network timeout - please try again' ] return { success: false, error: errors[Math.floor(Math.random() * errors.length)] } } } static calculateFees(amount: number, method: PaymentMethod) { const fee = amount * (method.processingFee / 100) return { fee: Math.round(fee * 100) / 100, net: Math.round((amount - fee) * 100) / 100, feePercentage: method.processingFee } } } /* ===================== Advanced Analytics System ===================== */ function useAnalytics() { const [analyticsData, setAnalyticsData] = useState(() => ({ pageViews: [ { page: 'Home', views: 2847, trend: 12.5 }, { page: 'Donate', views: 1203, trend: 8.3 }, { page: 'Volunteer', views: 856, trend: -2.1 }, { page: 'Stories', views: 645, trend: 15.8 }, { page: 'About', views: 432, trend: 5.2 } ], donationMetrics: { amount: 45280, count: 186, recurring: 67 }, userEngagement: { sessions: 3241, avgDuration: 185, bounceRate: 0.34 }, conversionRates: { donation: 0.078, volunteer: 0.032, contact: 0.156 } })) const refreshAnalytics = () => { // Simulate real-time data updates setAnalyticsData(prev => ({ ...prev, pageViews: prev.pageViews.map(pv => ({ ...pv, views: pv.views + Math.floor(Math.random() * 10), trend: (Math.random() - 0.5) * 20 })), donationMetrics: { ...prev.donationMetrics, amount: prev.donationMetrics.amount + Math.floor(Math.random() * 500), count: prev.donationMetrics.count + Math.floor(Math.random() * 3) } })) } useEffect(() => { const interval = setInterval(refreshAnalytics, 30000) // Update every 30 seconds return () => clearInterval(interval) }, []) return { analyticsData, refreshAnalytics } } /* ===================== PWA Features ===================== */ function usePWA() { const [isOnline, setIsOnline] = useState(navigator.onLine) const [installPrompt, setInstallPrompt] = useState(null) const [isInstallable, setIsInstallable] = useState(false) useEffect(() => { const handleOnline = () => setIsOnline(true) const handleOffline = () => setIsOnline(false) window.addEventListener('online', handleOnline) window.addEventListener('offline', handleOffline) // PWA Install Prompt const handleBeforeInstallPrompt = (e: any) => { e.preventDefault() setInstallPrompt(e) setIsInstallable(true) } window.addEventListener('beforeinstallprompt', handleBeforeInstallPrompt) return () => { window.removeEventListener('online', handleOnline) window.removeEventListener('offline', handleOffline) window.removeEventListener('beforeinstallprompt', handleBeforeInstallPrompt) } }, []) const installApp = async () => { if (!installPrompt) return false installPrompt.prompt() const { outcome } = await installPrompt.userChoice if (outcome === 'accepted') { trackEvent('pwa_installed') setInstallPrompt(null) setIsInstallable(false) return true } return false } return { isOnline, isInstallable, installApp } } /* ===================== SEO Meta Tags Component ===================== */ function SEOHead({ title, description, image }: { title?: string, description?: string, image?: string }) { useEffect(() => { // Update document title if (title) { document.title = `${title} | Miracles in Motion` } // Update meta description const metaDescription = document.querySelector('meta[name="description"]') if (description && metaDescription) { metaDescription.setAttribute('content', description) } // Update Open Graph tags const updateOGTag = (property: string, content: string) => { let tag = document.querySelector(`meta[property="${property}"]`) if (!tag) { tag = document.createElement('meta') tag.setAttribute('property', property) document.head.appendChild(tag) } tag.setAttribute('content', content) } updateOGTag('og:title', title || 'Miracles in Motion - Equipping Students for Success') updateOGTag('og:description', description || 'Nonprofit providing students with school supplies, clothing, and emergency assistance to thrive in their education.') updateOGTag('og:image', image || '/og-image.jpg') updateOGTag('og:type', 'website') }, [title, description, image]) return null } /* ===================== Types ===================== */ interface IconProps { className?: string } interface AuthUser { id: string email: string role: 'admin' | 'volunteer' | 'resource' name: string lastLogin: Date permissions: string[] } interface AuthContextType { user: AuthUser | null login: (email: string, password: string) => Promise logout: () => void isLoading: boolean } interface ImpactCalculation { students: number families: number backpacks: number clothing: number emergency: number annual: { students: number families: number totalImpact: string } } // Phase 2 Interfaces interface Notification { id: string type: 'success' | 'info' | 'warning' | 'error' title: string message: string timestamp: Date read: boolean actions?: { label: string; action: () => void }[] } interface NotificationContextType { notifications: Notification[] addNotification: (notification: Omit) => void markAsRead: (id: string) => void clearAll: () => void unreadCount: number } interface AnalyticsData { pageViews: { page: string; views: number; trend: number }[] donationMetrics: { amount: number; count: number; recurring: number } userEngagement: { sessions: number; avgDuration: number; bounceRate: number } conversionRates: { donation: number; volunteer: number; contact: number } } interface PaymentMethod { id: string type: 'card' | 'paypal' | 'venmo' | 'bank' name: string icon: string description: string processingFee: number } interface Language { code: string name: string nativeName: string flag: string } interface Translations { [key: string]: { [langCode: string]: string } } interface TiltCardProps { icon: React.ComponentType title: string desc: string } interface FeatureCardProps { icon: React.ComponentType title: string body: string } interface StatProps { label: string value: number } interface SectionHeaderProps { eyebrow?: string title: string subtitle?: string } interface CalloutProps { title: string body: string href: string accent: string icon: React.ComponentType index?: number } interface PageShellProps { title: string icon: React.ComponentType eyebrow?: string children: React.ReactNode cta?: React.ReactNode } interface CardProps { title: string icon: React.ComponentType children: React.ReactNode } interface PolicySectionProps { id: string title: string children: React.ReactNode } /* ===================== 3D Parallax Components ===================== */ // 3D Parallax Container Component interface ParallaxContainerProps { children: React.ReactNode depth?: number className?: string } function ParallaxContainer({ children, depth = 1, className = '' }: ParallaxContainerProps) { const ref = useRef(null) const { scrollYProgress } = useScroll({ target: ref, offset: ['start end', 'end start'] }) const y = useTransform(scrollYProgress, [0, 1], [0, -50 * depth]) const rotateX = useTransform(scrollYProgress, [0, 1], [0, 5 * depth]) const scale = useTransform(scrollYProgress, [0, 0.5, 1], [0.8, 1, 1.1]) return ( {children} ) } // Enhanced 3D Floating Particles Background function FloatingParticles() { const particles = Array.from({ length: 20 }, (_, i) => i) return (
{particles.map((i) => { const size = Math.random() * 2 + 0.5 const depth = Math.random() * 3 + 1 return ( ) })}
) } // 3D Geometric Shapes Component function Floating3DShapes() { const shapes = [ { type: 'cube', color: 'from-primary-500/15 to-primary-600/15', size: 12 }, { type: 'sphere', color: 'from-secondary-500/15 to-secondary-600/15', size: 16 }, { type: 'pyramid', color: 'from-primary-400/15 to-secondary-500/15', size: 14 }, ] return (
{shapes.map((shape, i) => Array.from({ length: 3 }, (_, j) => ( )) )}
) } /* ===================== Router ===================== */ export function useHashRoute() { const parse = () => (window.location.hash?.slice(1) || "/") const [route, setRoute] = useState(parse()) useEffect(() => { const onHash = () => setRoute(parse()) window.addEventListener("hashchange", onHash) return () => window.removeEventListener("hashchange", onHash) }, []) return route } /* ===================== Legacy Router Component (Repurposed) ===================== */ /* ===================== Shared UI ===================== */ function SkipToContent() { return ( Skip to content ) } interface NavProps { darkMode: boolean setDarkMode: (value: boolean) => void mobileMenuOpen: boolean setMobileMenuOpen: (value: boolean) => void } function Nav({ darkMode, setDarkMode, mobileMenuOpen, setMobileMenuOpen }: NavProps) { // Close mobile menu when route changes useEffect(() => { setMobileMenuOpen(false) }, [window.location.hash]) // Handle keyboard navigation const handleKeyDown = (e: React.KeyboardEvent, action: () => void) => { if (e.key === 'Enter' || e.key === ' ') { e.preventDefault() action() } } return ( <> {/* Mobile Menu */} ) } function LogoMark() { return (
) } /* ===================== Home Page ===================== */ function HomePage() { return ( <> ) } function Hero() { const containerRef = useRef(null) const { scrollYProgress } = useScroll({ target: containerRef, offset: ['start start', 'end start'] }) const backgroundY = useTransform(scrollYProgress, [0, 1], ['0%', '50%']) const contentY = useTransform(scrollYProgress, [0, 1], ['0%', '100%']) return (
{/* Enhanced 3D Background Layers */} {/* Animated depth gradient */} {/* Content Layer with Parallax */}
Equipping kids for success— school supplies, clothing, & more

Miracles in Motion is a nonprofit providing students with the essentials they need to thrive: backpacks and notebooks, uniforms and shoes, and the everything-else fund for urgent needs.

  • 501(c)(3) public charity
  • Donations tax-deductible
  • Community-driven impact
{/* 3D Scroll Indicator */}
Scroll to explore
{/* Enhanced 3D Icon Elements with More Visibility */}
{/* Top layer - subtle and non-interfering */} {/* Additional floating heart */} {/* Right side - subtle sparkles */} {/* Additional floating sparkle */} {/* Bottom area - enhanced users icon */} {/* Additional community icon */} {/* Additional subtle elements */}
) } function HeroShowcase() { return (
) } function TiltCard({ icon: Icon, title, desc }: TiltCardProps) { const x = useMotionValue(0) const y = useMotionValue(0) const rx = useTransform(y, [-50, 50], [12, -12]) const ry = useTransform(x, [-50, 50], [-12, 12]) const springX = useSpring(rx, { stiffness: 150, damping: 15 }) const springY = useSpring(ry, { stiffness: 150, damping: 15 }) const scale = useSpring(1, { stiffness: 300, damping: 25 }) return ( { const rect = e.currentTarget.getBoundingClientRect() x.set(e.clientX - rect.left - rect.width / 2) y.set(e.clientY - rect.top - rect.height / 2) scale.set(1.05) }} onMouseLeave={() => { x.set(0) y.set(0) scale.set(1) }} style={{ rotateX: springX, rotateY: springY, scale: scale, transformStyle: "preserve-3d", boxShadow: useTransform(scale, [1, 1.05], [ "0 4px 6px -1px rgba(0, 0, 0, 0.1)", "0 20px 25px -5px rgba(0, 0, 0, 0.15), 0 10px 10px -5px rgba(0, 0, 0, 0.04)" ]) }} className="group card card-hover will-change-transform cursor-pointer" whileHover={{ z: 20 }} transition={{ duration: 0.2 }} >
{title}
{desc}
Learn more
) } function PartnerMarquee() { return (
Trusted by schools & community partners
{Array.from({ length: 2 }).map((_, i) => ( Lincoln Unified • Sunrise Elementary • Northview High • Rotary Club • City Youth Fund • BookBank • Caring Co. ))}
) } function Programs() { const items = [ { icon: Backpack, title: "School Supplies", body: "Backpacks, notebooks, art kits, calculators—ready for day one." }, { icon: Shirt, title: "School Clothing", body: "Uniforms, shoes, coats, and seasonal essentials in all sizes." }, { icon: Sparkles, title: "Everything Else", body: "Glasses, test fees, activity passes, hygiene kits—fast relief when needed." }, ] return (
{/* Background 3D Elements */}
{items.map((i, idx) => ( ))}
) } function FeatureCard({ icon: Icon, title, body }: FeatureCardProps) { return (
{title}

{body}

Explore
) } function Impact() { const stats = [ { label: "Students equipped", value: 4200 }, { label: "Schools partnered", value: 38 }, { label: "Avg. response time (hrs)", value: 24 }, { label: "Counties served", value: 6 }, ] return (
{/* Enhanced Background Elements */}
{stats.map((s, i) => ( ))}
Where your donation goes
  • 85% programs • 10% ops • 5% fundraising
  • Average grant: $48 for supplies; $72 for clothing
) } function Stat({ label, value }: StatProps) { return (
{label}
) } function AnimatedNumber({ value }: { value: number }) { const mv = useMotionValue(0) const spring = useSpring(mv, { stiffness: 90, damping: 15 }) const rounded = useTransform(spring, (latest) => Math.floor(latest).toLocaleString()) useEffect(() => { mv.set(0) const timeout = setTimeout(() => mv.set(value), 150) return () => clearTimeout(timeout) }, [value, mv]) return {rounded} } function HowItWorks() { const steps = [ { title: "Referral", body: "A school counselor, social worker, or parent submits a simple request." }, { title: "Fast response", body: "Needs are verified same-day and approved within 24 hours." }, { title: "Fulfillment", body: "We purchase items locally or provide vouchers for pickup." }, { title: "Follow-up", body: "We confirm support reached the student and log outcomes." }, ] return (
{/* Animated Background Elements */}
    {steps.map((s, i) => ( {i + 1}
    {s.title}

    {s.body}

    ))}
Donor promise

Your gift funds direct student needs first. We publish anonymized impact and receipts for transparency.

For counselors

One-page referral. No uploads required. We do the running so students don't miss class.

) } function Testimonial() { return (
"A student arrived with torn shoes before winter break. Within 24 hours, Miracles in Motion had a new coat and shoes ready. He came back from break beaming."
Counselor, Northview High
) } function GetInvolved() { const options = [ { title: "Donate", body: "Fuel fast responses for urgent student needs.", href: "#/donate", accent: "from-rose-500 to-primary-500", icon: Heart }, { title: "Volunteer", body: "Assemble kits, deliver items, host a drive.", href: "#/volunteers", accent: "from-sky-500 to-secondary-500", icon: Users }, { title: "Corporate sponsor", body: "Schools and community orgs: let's team up.", href: "#/sponsors", accent: "from-emerald-500 to-lime-500", icon: Globe }, ] return (
{options.map((o, i) => ( ))}
) } function Callout({ title, body, href, accent, icon: Icon, index = 0 }: CalloutProps) { return (
{title}

{body}

Learn more ) } function CTA() { return (
')" }} />

Help a student start school with pride

Your gift today equips a child with the essentials they need—fast. $48 fills a backpack; $72 outfits a student with shoes and a coat.

Prefer offline?

  • 20274 Via Medici, Porter Ranch, CA 91326
  • contact@mim4u.org
  • (818) 491-6884

Miracles in Motion is a 501(c)(3). EIN 12-3456789.

) } /* ===================== Pages ===================== */ function PageShell({ title, icon: Icon, eyebrow, children, cta }: PageShellProps) { return (
{eyebrow &&
{eyebrow}
}

{title}

{cta}
{children}
) } function DonatePage() { const [selectedAmount, setSelectedAmount] = useState(50) const [customAmount, setCustomAmount] = useState('') const [isRecurring, setIsRecurring] = useState(false) const [donorInfo, setDonorInfo] = useState({ email: '', name: '', anonymous: false }) const [selectedPaymentMethod, setSelectedPaymentMethod] = useState(paymentMethods[0]) const [isProcessing, setIsProcessing] = useState(false) const { addNotification } = useNotifications() const { t } = useLanguage() const suggestedAmounts = [ { amount: 25, impact: "School supplies for 1 student", popular: false }, { amount: 50, impact: "Complete backpack kit for 1 student", popular: true }, { amount: 100, impact: "School clothing for 2 students", popular: false }, { amount: 250, impact: "Emergency fund for 5 families", popular: false } ] const finalAmount = customAmount ? parseInt(customAmount) || 0 : selectedAmount const impactData = calculateDonationImpact(finalAmount) // Enhanced impact text with real calculations const getDetailedImpactText = (amount: number) => { const impact = calculateDonationImpact(amount) const impactItems = [] if (impact.students > 0) impactItems.push(`${impact.students} student${impact.students > 1 ? 's' : ''} with supplies`) if (impact.backpacks > 0) impactItems.push(`${impact.backpacks} backpack kit${impact.backpacks > 1 ? 's' : ''}`) if (impact.clothing > 0) impactItems.push(`${impact.clothing} clothing item${impact.clothing > 1 ? 's' : ''}`) if (impact.emergency > 0) impactItems.push(`${impact.emergency} emergency response${impact.emergency > 1 ? 's' : ''}`) return impactItems.length > 0 ? impactItems.join(', ') : "Every dollar helps a student in need" } // Track donation interactions useEffect(() => { trackEvent('donation_page_view', { amount: finalAmount, recurring: isRecurring }) }, []) const handleDonationSubmit = async () => { if (finalAmount <= 0) return setIsProcessing(true) trackEvent('donation_initiated', { amount: finalAmount, recurring: isRecurring, anonymous: donorInfo.anonymous, method: selectedPaymentMethod.id }) addNotification({ type: 'info', title: 'Processing Payment', message: `Processing your ${isRecurring ? 'monthly ' : ''}donation of $${finalAmount}...` }) try { const result = await PaymentProcessor.processPayment(finalAmount, selectedPaymentMethod, donorInfo) if (result.success) { addNotification({ type: 'success', title: 'Donation Successful!', message: `Thank you for your ${isRecurring ? 'monthly ' : ''}donation of $${finalAmount}. Transaction ID: ${result.transactionId}`, actions: [ { label: 'View Receipt', action: () => { // In production, would show receipt modal or download PDF trackEvent('receipt_viewed', { transactionId: result.transactionId }) alert('Receipt functionality would open here in production') } } ] }) // Reset form setSelectedAmount(50) setCustomAmount('') setDonorInfo({ email: '', name: '', anonymous: false }) } else { addNotification({ type: 'error', title: 'Payment Failed', message: result.error || 'Unable to process payment. Please try again.' }) } } catch (error) { addNotification({ type: 'error', title: 'Payment Error', message: 'An unexpected error occurred. Please try again.' }) } finally { setIsProcessing(false) } } return ( <> Policies}>
{/* Enhanced Impact Calculator */}

Your Impact: ${finalAmount}

{getDetailedImpactText(finalAmount)}

{/* Real-time impact breakdown */} {finalAmount > 0 && (
Students Supported {impactData.students}
Backpack Kits {impactData.backpacks}
Clothing Items {impactData.clothing}
)} {isRecurring && finalAmount > 0 && (

🎉 Annual Impact: {impactData.annual.totalImpact}

)}
{/* Donation Form */}

Choose Your Donation Amount

Every dollar directly supports students in need

{/* Suggested Amounts - Mobile Optimized */}
{suggestedAmounts.map((tier) => ( { setSelectedAmount(tier.amount) setCustomAmount('') trackEvent('donation_amount_selected', { amount: tier.amount, method: 'suggested' }) }} className={`relative p-4 rounded-xl border-2 transition-all focus:outline-none focus:ring-2 focus:ring-primary-500 focus:ring-offset-2 ${ selectedAmount === tier.amount && !customAmount ? 'border-primary-500 bg-primary-50 dark:bg-primary-900/20' : 'border-neutral-200 dark:border-neutral-700 hover:border-primary-300' }`} style={{ minHeight: '88px', minWidth: '120px' }} // Enhanced touch targets for mobile whileHover={{ scale: 1.02 }} whileTap={{ scale: 0.98 }} aria-label={`Donate $${tier.amount} - ${tier.impact}`} > {tier.popular && (
Most Popular
)}
${tier.amount}
{tier.impact}
))}
{/* Custom Amount */}
$ { setCustomAmount(e.target.value) setSelectedAmount(0) }} placeholder="Enter amount" className="input pl-8 w-full focus:outline-none focus:ring-2 focus:ring-primary-500 focus:border-primary-500" aria-label="Custom donation amount in dollars" />
{/* Recurring Option & Donor Info */}
{/* Donor Information */}

Donor Information (Optional)

setDonorInfo({ ...donorInfo, name: e.target.value })} className="input focus:ring-2 focus:ring-primary-500 focus:border-primary-500" style={{ minHeight: '44px' }} /> setDonorInfo({ ...donorInfo, email: e.target.value })} className="input focus:ring-2 focus:ring-primary-500 focus:border-primary-500" style={{ minHeight: '44px' }} />
{/* Payment Method Selection */}

Payment Method

{paymentMethods.map((method) => { const fees = PaymentProcessor.calculateFees(finalAmount, method) return ( setSelectedPaymentMethod(method)} className={`p-4 rounded-xl border-2 transition-all focus:outline-none focus:ring-2 focus:ring-primary-500 focus:ring-offset-2 text-left ${ selectedPaymentMethod.id === method.id ? 'border-primary-500 bg-primary-50 dark:bg-primary-900/20' : 'border-neutral-200 dark:border-neutral-700 hover:border-primary-300' }`} whileHover={{ scale: 1.02 }} whileTap={{ scale: 0.98 }} >
{method.icon}
{method.name}
{method.description}
{selectedPaymentMethod.id === method.id && ( )}
{finalAmount > 0 && (
Fee: ${fees.fee} ({method.processingFee}%) • You give: ${fees.net}
)}
) })}
{/* Enhanced Donation Buttons */}
0 && !isProcessing ? { scale: 1.02 } : {}} whileTap={finalAmount > 0 && !isProcessing ? { scale: 0.98 } : {}} onClick={handleDonationSubmit} aria-label={`Donate $${finalAmount} ${isRecurring ? 'monthly' : 'one-time'} via ${selectedPaymentMethod.name}`} > {isProcessing ? ( <> Processing... ) : ( <> {t('donate.title')} ${finalAmount} via {selectedPaymentMethod.icon} )}
trackEvent('donation_method_selected', { method: 'paypal', amount: finalAmount })} aria-label="Donate via PayPal" > 💳 PayPal trackEvent('donation_method_selected', { method: 'venmo', amount: finalAmount })} aria-label="Donate via Venmo" > 📱 Venmo
Secure 256-bit SSL encryption

You'll receive an email receipt for your tax records. Donations are tax-deductible to the extent allowed by law. EIN 12-3456789.

{/* Matching Gifts */}
Employer Matching Gifts
Double your impact

Many employers will match your charitable donation. Check with your HR department and provide our EIN: 12-3456789.

Download matching gift letter
{/* Other Ways to Give */}
Other Ways to Give
Mail a Check
Miracles In Motion
20274 Via Medici
Porter Ranch, CA 91326
Stock or Securities
Contact us for account transfer information
{/* Sidebar */}
{/* Trust Indicators */}
501(c)(3) Verified
Tax-deductible donations
Program expenses: 85%
Administrative: 10%
Fundraising: 5%
{/* Recent Impact */}
Recent Impact
127 students received school supplies this month
43 families got emergency clothing support
$12,450 raised this week by donors like you
{/* Contact Info */}
Questions about donating?
) } function VolunteerPage() { return (
Sign-up form
{e.preventDefault(); alert("Thanks! We'll be in touch via email.");}}>
) } function SponsorsPage() { const tiers = [ { name: "Bronze", amt: "$2,500", perks: ["Logo on website", "Social thank-you", "Quarterly impact note"] }, { name: "Silver", amt: "$5,000", perks: ["All Bronze", "Logo on event signage", "Volunteer day for your team"] }, { name: "Gold", amt: "$10,000", perks: ["All Silver", "Co-branded kit drive", "Annual report feature"] }, { name: "Platinum", amt: "$25,000+", perks: ["All Gold", "Program naming opportunity", "Custom partnership plan"] }, ] return ( Download prospectus}>
{tiers.map((t) => (
{t.name}
{t.amt}
    {t.perks.map((p, i) => (
  • {p}
  • ))}
))}
Start a conversation
{e.preventDefault(); alert("Thanks! We'll reach out soon.");}}>
) } function StoriesPage() { const stories = [ { title: "Ready on Day One", tag: "Supplies", body: "A 3rd grader received a backpack and art kit, returning to class with pride.", by: "Ms. Lee, Teacher" }, { title: "Warm for Winter", tag: "Clothing", body: "A high schooler got a coat and shoes before a cold snap—attendance rebounded.", by: "School Social Worker" }, { title: "Glasses for Growth", tag: "Everything Else", body: "A student's new glasses improved reading in two weeks.", by: "Counselor" }, ] return ( Read testimonies}>
{stories.map((s, i) => (
{s.tag}

{s.title}

{s.body}

— {s.by}
))}
Submit your story
{e.preventDefault(); alert("Thanks for sharing! We'll review and publish with consent.");}}>