|
1 | | -import React, { useEffect, useState } from 'react'; |
2 | | -import './styles/App.css'; |
3 | | -import SpotifyList from './components/SpotifyList'; |
4 | | -import LoadingAnimation from './components/LoadingAnimation'; |
5 | | -import GithubRepos from './components/GithubRepos'; |
6 | | -import { Music, Code, Twitch, Github, Cpu, Shield } from 'lucide-react'; |
| 1 | +import React from 'react'; |
| 2 | +import { BrowserRouter as Router, Routes, Route } from 'react-router-dom'; |
| 3 | +import Navbar from './components/Navbar'; |
| 4 | +import AboutPage from './pages/AboutPage'; |
| 5 | +import APCSPPage from './pages/APCSPPage'; |
| 6 | +import ProjectsPage from './pages/ProjectsPage'; |
| 7 | +import ErrorBoundary from './components/ErrorBoundary'; |
| 8 | +import './App.css'; |
7 | 9 |
|
8 | 10 | const App = () => { |
9 | | - const [age, setAge] = useState(0); |
10 | | - |
11 | | - useEffect(() => { |
12 | | - // Age calculation |
13 | | - const calculateAge = () => { |
14 | | - const birthDate = new Date('2009-05-15'); |
15 | | - const today = new Date(); |
16 | | - let age = today.getFullYear() - birthDate.getFullYear(); |
17 | | - const monthDiff = today.getMonth() - birthDate.getMonth(); |
18 | | - |
19 | | - if (monthDiff < 0 || (monthDiff === 0 && today.getDate() < birthDate.getDate())) { |
20 | | - age--; |
21 | | - } |
22 | | - return age; |
23 | | - }; |
24 | | - setAge(calculateAge()); |
25 | | - |
26 | | - // Particle effect setup |
27 | | - const createParticles = () => { |
28 | | - const particleContainer = document.querySelector('.particle-container'); |
29 | | - if (particleContainer) { |
30 | | - for (let i = 0; i < 50; i++) { |
31 | | - const particle = document.createElement('div'); |
32 | | - particle.className = 'particle'; |
33 | | - particle.style.left = `${Math.random() * 100}vw`; |
34 | | - particle.style.animationDuration = `${Math.random() * 3 + 2}s`; |
35 | | - particle.style.animationDelay = `${Math.random() * 2}s`; |
36 | | - particleContainer.appendChild(particle); |
37 | | - } |
38 | | - } |
39 | | - }; |
40 | | - |
41 | | - createParticles(); |
42 | | - }, []); |
43 | | - |
44 | | - const interests = [ |
45 | | - { icon: <Code size={24} />, title: 'Programming', description: 'Full-stack development & coding projects' }, |
46 | | - { icon: <Cpu size={24} />, title: 'Robotics', description: 'Building & programming robots' }, |
47 | | - { icon: <Shield size={24} />, title: 'Cybersecurity', description: 'Network security & ethical hacking' }, |
48 | | - { icon: <Music size={24} />, title: 'Music', description: 'Music production & listening' }, |
49 | | - { icon: <Twitch size={24} />, title: 'Streaming', description: 'FiveM & variety gaming on Twitch' }, |
50 | | - { icon: <Github size={24} />, title: 'Open Source', description: 'Contributing to GitHub projects' } |
51 | | - ]; |
52 | | - |
53 | 11 | return ( |
54 | | - <div className="app-container animated-bg"> |
55 | | - <div className="particle-container" /> |
56 | | - |
57 | | - {/* Header Section */} |
58 | | - <header className="header neon-text"> |
59 | | - <h1>EndofTimee</h1> |
60 | | - <p className="subtitle">Programmer • Streamer • Foxgirl 🦊</p> |
61 | | - </header> |
62 | | - |
63 | | - {/* About Section */} |
64 | | - <section className="content-section about-section"> |
65 | | - <h2 className="neon-text">About Me</h2> |
66 | | - <div className="about-content"> |
67 | | - <p>Hey there! I'm a {age}-year-old transfem programmer and content creator. |
68 | | - When I'm not coding or building robots, you can find me streaming on |
69 | | - <a href="https://twitch.tv/EndofTimee" target="_blank" rel="noopener noreferrer" |
70 | | - className="twitch-link">Twitch</a>!</p> |
| 12 | + <ErrorBoundary> |
| 13 | + <Router> |
| 14 | + <div className="app-container animated-bg"> |
| 15 | + <Navbar /> |
| 16 | + <main className="main-content"> |
| 17 | + <Routes> |
| 18 | + <Route path="/" element={<AboutPage />} /> |
| 19 | + <Route path="/apcsp" element={<APCSPPage />} /> |
| 20 | + <Route path="/projects" element={<ProjectsPage />} /> |
| 21 | + <Route path="*" element={ |
| 22 | + <div className="error-page"> |
| 23 | + <h1 className="text-glow">404: Page Not Found</h1> |
| 24 | + <p>Oops! This fox couldn't find what you're looking for.</p> |
| 25 | + </div> |
| 26 | + } /> |
| 27 | + </Routes> |
| 28 | + </main> |
71 | 29 | </div> |
72 | | - </section> |
73 | | - |
74 | | - {/* Interests Grid */} |
75 | | - <section className="content-section interests-section"> |
76 | | - <h2 className="neon-text">What I Do</h2> |
77 | | - <div className="interests-grid"> |
78 | | - {interests.map((interest, index) => ( |
79 | | - <div key={index} className="interest-card"> |
80 | | - <div className="interest-icon">{interest.icon}</div> |
81 | | - <h3>{interest.title}</h3> |
82 | | - <p>{interest.description}</p> |
83 | | - </div> |
84 | | - ))} |
85 | | - </div> |
86 | | - </section> |
87 | | - |
88 | | - {/* Streaming Section */} |
89 | | - <section className="content-section stream-section"> |
90 | | - <h2 className="neon-text">Streaming</h2> |
91 | | - <div className="stream-content"> |
92 | | - <p>Join me on Twitch for FiveM roleplay and various other games! |
93 | | - I love interacting with chat and building a positive community.</p> |
94 | | - <a href="https://twitch.tv/EndofTimee" target="_blank" |
95 | | - rel="noopener noreferrer" className="twitch-button"> |
96 | | - <Twitch className="icon" /> |
97 | | - Watch Live |
98 | | - </a> |
99 | | - </div> |
100 | | - </section> |
101 | | - |
102 | | - {/* GitHub Section */} |
103 | | - <div className="github-section"> |
104 | | - <GithubRepos /> |
105 | | - </div> |
106 | | - |
107 | | - {/* Music Section */} |
108 | | - <div className="music-section"> |
109 | | - <SpotifyList /> |
110 | | - </div> |
111 | | - </div> |
| 30 | + </Router> |
| 31 | + </ErrorBoundary> |
112 | 32 | ); |
113 | 33 | }; |
114 | 34 |
|
|
0 commit comments