Files
spotlightcam/frontend/src/pages/HomePage.jsx

339 lines
14 KiB
React
Raw Normal View History

import { Link, useNavigate } from 'react-router-dom';
import { Video, Users, Zap, Shield, Camera, MessageCircle, Star, LogOut, LayoutDashboard } from 'lucide-react';
import { useAuth } from '../contexts/AuthContext';
const HomePage = () => {
const { user, logout } = useAuth();
const navigate = useNavigate();
const handleLogout = () => {
logout();
navigate('/login');
};
return (
<div className="min-h-screen bg-white">
{/* Hero Section */}
<header className="bg-gradient-to-br from-primary-600 to-primary-800">
<nav className="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 py-6">
<div className="flex justify-between items-center">
<div className="flex items-center space-x-2">
<Video className="w-6 h-6 sm:w-8 sm:h-8 text-white" />
<span className="text-xl sm:text-2xl font-bold text-white">spotlight.cam</span>
</div>
<div className="flex space-x-2 sm:space-x-4">
{user ? (
<>
<Link
to="/dashboard"
className="flex items-center space-x-1 sm:space-x-2 px-2 sm:px-4 py-2 text-white hover:text-primary-100 transition text-sm sm:text-base"
>
<LayoutDashboard className="w-4 h-4" />
<span className="hidden sm:inline">Dashboard</span>
</Link>
<button
onClick={handleLogout}
className="flex items-center space-x-1 sm:space-x-2 px-3 sm:px-6 py-2 bg-white text-primary-600 rounded-lg font-medium hover:bg-primary-50 transition text-sm sm:text-base"
>
<LogOut className="w-4 h-4" />
<span>Logout</span>
</button>
</>
) : (
<>
<Link
to="/login"
className="px-3 sm:px-4 py-2 text-white hover:text-primary-100 transition text-sm sm:text-base"
>
Sign in
</Link>
<Link
to="/register"
className="px-4 sm:px-6 py-2 bg-white text-primary-600 rounded-lg font-medium hover:bg-primary-50 transition text-sm sm:text-base whitespace-nowrap"
>
Get Started
</Link>
</>
)}
</div>
</div>
</nav>
<div className="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 py-12 sm:py-16 md:py-20 text-center">
<h1 className="text-3xl sm:text-4xl md:text-5xl lg:text-6xl font-bold text-white mb-4 sm:mb-6">
2025-12-06 16:53:10 +01:00
Capture Every Dance Together
</h1>
<p className="text-base sm:text-lg md:text-xl lg:text-2xl text-primary-100 mb-8 sm:mb-10 max-w-3xl mx-auto px-4">
2025-12-06 16:53:10 +01:00
Connect with other competitors, record each other's dances, and exchange videos in seconds.
</p>
<div className="flex justify-center">
<Link
to={user ? "/dashboard" : "/register"}
className="px-6 sm:px-8 py-3 sm:py-4 bg-white text-primary-600 rounded-lg text-base sm:text-lg font-semibold hover:bg-primary-50 transition shadow-lg"
>
{user ? "Go to Dashboard" : "Start Collaborating"}
</Link>
</div>
</div>
</header>
{/* Features Section */}
<section className="py-20 bg-gray-50">
<div className="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8">
<div className="text-center mb-16">
<h2 className="text-4xl font-bold text-gray-900 mb-4">
Everything you need to succeed
</h2>
<p className="text-xl text-gray-600 max-w-2xl mx-auto">
2025-12-06 16:53:10 +01:00
This app is specifically built for West Coast Swing dancers and competition enthusiasts
</p>
</div>
<div className="grid md:grid-cols-3 gap-8">
<div className="bg-white p-8 rounded-xl shadow-md hover:shadow-xl transition">
<div className="w-12 h-12 bg-primary-100 rounded-lg flex items-center justify-center mb-4">
<Users className="w-6 h-6 text-primary-600" />
</div>
<h3 className="text-xl font-semibold text-gray-900 mb-3">
Smart Matching
</h3>
<p className="text-gray-600">
Find the perfect collaboration partner based on division, role, and heat
assignments at your event.
</p>
</div>
<div className="bg-white p-8 rounded-xl shadow-md hover:shadow-xl transition">
<div className="w-12 h-12 bg-primary-100 rounded-lg flex items-center justify-center mb-4">
<MessageCircle className="w-6 h-6 text-primary-600" />
</div>
<h3 className="text-xl font-semibold text-gray-900 mb-3">
Real-time Chat
</h3>
<p className="text-gray-600">
Communicate instantly with event participants and your collaboration
partners through integrated chat.
</p>
</div>
<div className="bg-white p-8 rounded-xl shadow-md hover:shadow-xl transition">
<div className="w-12 h-12 bg-primary-100 rounded-lg flex items-center justify-center mb-4">
<Camera className="w-6 h-6 text-primary-600" />
</div>
<h3 className="text-xl font-semibold text-gray-900 mb-3">
P2P Video Sharing
</h3>
<p className="text-gray-600">
Share videos directly with your partners using secure peer-to-peer WebRTC
technology. Fast, private, and encrypted.
</p>
</div>
<div className="bg-white p-8 rounded-xl shadow-md hover:shadow-xl transition">
<div className="w-12 h-12 bg-primary-100 rounded-lg flex items-center justify-center mb-4">
<Shield className="w-6 h-6 text-primary-600" />
</div>
<h3 className="text-xl font-semibold text-gray-900 mb-3">
Secure & Private
</h3>
<p className="text-gray-600">
Your video transfers run P2P with encryption in transit. Chats stay private to your
event room or match partner.
</p>
</div>
<div className="bg-white p-8 rounded-xl shadow-md hover:shadow-xl transition">
<div className="w-12 h-12 bg-primary-100 rounded-lg flex items-center justify-center mb-4">
<Zap className="w-6 h-6 text-primary-600" />
</div>
<h3 className="text-xl font-semibold text-gray-900 mb-3">
Lightning Fast
</h3>
<p className="text-gray-600">
No upload delays or waiting. Direct peer-to-peer connections mean instant
video transfers, even for large files.
</p>
</div>
<div className="bg-white p-8 rounded-xl shadow-md hover:shadow-xl transition">
<div className="w-12 h-12 bg-primary-100 rounded-lg flex items-center justify-center mb-4">
<Star className="w-6 h-6 text-primary-600" />
</div>
<h3 className="text-xl font-semibold text-gray-900 mb-3">
Competition Ready
</h3>
<p className="text-gray-600">
Integrated with WSDC events. Automatic heat tracking and partner
suggestions based on competition divisions.
</p>
</div>
</div>
</div>
</section>
{/* How It Works Section */}
<section className="py-20">
<div className="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8">
<div className="text-center mb-16">
<h2 className="text-4xl font-bold text-gray-900 mb-4">
How It Works
</h2>
<p className="text-xl text-gray-600">
Get started in three simple steps
</p>
</div>
<div className="grid md:grid-cols-3 gap-12">
<div className="text-center">
<div className="w-16 h-16 bg-primary-600 text-white rounded-full flex items-center justify-center text-2xl font-bold mx-auto mb-6">
1
</div>
<h3 className="text-xl font-semibold text-gray-900 mb-3">
2025-12-06 16:53:10 +01:00
Join your event
</h3>
<p className="text-gray-600">
Check in to your West Coast Swing competition using the event's QR code
or check-in link.
</p>
</div>
<div className="text-center">
<div className="w-16 h-16 bg-primary-600 text-white rounded-full flex items-center justify-center text-2xl font-bold mx-auto mb-6">
2
</div>
<h3 className="text-xl font-semibold text-gray-900 mb-3">
Find Partners
</h3>
<p className="text-gray-600">
2025-12-06 16:53:10 +01:00
Browse other people on your event's chat and send collaboration requests to
potential recording partners.
</p>
</div>
<div className="text-center">
<div className="w-16 h-16 bg-primary-600 text-white rounded-full flex items-center justify-center text-2xl font-bold mx-auto mb-6">
3
</div>
<h3 className="text-xl font-semibold text-gray-900 mb-3">
Share & Create
</h3>
<p className="text-gray-600">
2025-12-06 16:53:10 +01:00
Exchange videos securely, chat in real-time, and reward your recording partner with
a star-rating system.
</p>
</div>
</div>
</div>
</section>
{/* CTA Section */}
{!user && (
<section className="py-20 bg-gradient-to-br from-primary-600 to-primary-800">
<div className="max-w-4xl mx-auto px-4 sm:px-6 lg:px-8 text-center">
<h2 className="text-4xl font-bold text-white mb-6">
2025-12-06 16:53:10 +01:00
Ready to maximize your competition experience?
</h2>
<p className="text-xl text-primary-100 mb-10">
2025-12-06 16:53:10 +01:00
Join dancers from around the world who are already participating in spotlight.cam
</p>
<Link
to="/register"
className="inline-block px-8 py-4 bg-white text-primary-600 rounded-lg text-lg font-semibold hover:bg-primary-50 transition shadow-lg"
>
Create Your Free Account
</Link>
</div>
</section>
)}
{/* Footer */}
<footer className="bg-gray-900 text-gray-300 py-12">
<div className="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8">
<div className="grid md:grid-cols-4 gap-8">
<div>
<div className="flex items-center space-x-2 mb-4">
<Video className="w-6 h-6 text-primary-400" />
<span className="text-xl font-bold text-white">spotlight.cam</span>
</div>
<p className="text-sm text-gray-400">
2025-12-06 17:08:08 +01:00
Built for West Coast Swing dancers who record and compete together.
</p>
</div>
<div>
<h3 className="text-white font-semibold mb-4">Product</h3>
<ul className="space-y-2 text-sm">
<li>
<Link to="/how-it-works" className="hover:text-primary-400 transition">
How It Works
</Link>
</li>
</ul>
</div>
<div>
<h3 className="text-white font-semibold mb-4">Support</h3>
<ul className="space-y-2 text-sm">
<li>
<Link to="/about-us" className="hover:text-primary-400 transition">
About Us
</Link>
</li>
<li>
<Link to="/contact" className="hover:text-primary-400 transition">
Contact Us
</Link>
</li>
feat(beta): add beta testing features and privacy policy page Implemented comprehensive beta testing system with tier badges and reorganized environment configuration for better maintainability. Beta Testing Features: - Beta banner component with dismissible state (localStorage) - Auto-assign SUPPORTER tier to new registrations (env controlled) - TierBadge component with SUPPORTER/COMFORT tier display - Badge shown in Navbar, ProfilePage, and PublicProfilePage - Environment variables: VITE_BETA_MODE, BETA_AUTO_SUPPORTER Environment Configuration Reorganization: - Moved .env files from root to frontend/ and backend/ directories - Created .env.{development,production}{,.example} structure - Updated docker-compose.yml to use env_file for frontend - All env vars properly namespaced and documented Privacy Policy Implementation: - New /privacy route with dedicated PrivacyPage component - Comprehensive GDPR/RODO compliant privacy policy (privacy.html) - Updated CookieConsent banner to link to /privacy - Added Privacy Policy links to all footers (HomePage, PublicFooter) - Removed privacy section from About Us page HTML Content System: - Replaced react-markdown dependency with simple HTML loader - New HtmlContentPage component for rendering .html files - Converted about-us.md and how-it-works.md to .html format - Inline CSS support for full styling control - Easier content editing without React knowledge Backend Changes: - Registration auto-assigns SUPPORTER tier when BETA_AUTO_SUPPORTER=true - Added accountTier to auth middleware and user routes - Updated public profile endpoint to include accountTier Files: - Added: frontend/.env.{development,production}{,.example} - Added: backend/.env variables for BETA_AUTO_SUPPORTER - Added: components/BetaBanner.jsx, TierBadge.jsx, HtmlContentPage.jsx - Added: pages/PrivacyPage.jsx - Added: public/content/{about-us,how-it-works,privacy}.html - Modified: docker-compose.yml (env_file configuration) - Modified: App.jsx (privacy route, beta banner) - Modified: auth.js (auto SUPPORTER tier logic)
2025-12-06 11:50:28 +01:00
<li>
<Link to="/privacy" className="hover:text-primary-400 transition">
Privacy Policy
</Link>
</li>
</ul>
</div>
<div>
<h3 className="text-white font-semibold mb-4">Account</h3>
<ul className="space-y-2 text-sm">
{user ? (
<>
<li>
<Link to="/dashboard" className="hover:text-primary-400 transition">
Dashboard
</Link>
</li>
<li>
<button onClick={handleLogout} className="hover:text-primary-400 transition text-left">
Logout
</button>
</li>
</>
) : (
<>
<li>
<Link to="/login" className="hover:text-primary-400 transition">
Sign In
</Link>
</li>
<li>
<Link to="/register" className="hover:text-primary-400 transition">
Register
</Link>
</li>
</>
)}
</ul>
</div>
</div>
<div className="border-t border-gray-800 mt-12 pt-8 text-center text-sm text-gray-400">
<p>&copy; {new Date().getFullYear()} spotlight.cam. All rights reserved.</p>
</div>
</div>
</footer>
</div>
);
};
export default HomePage;