diff --git a/src/app/about/page.js b/src/app/about/page.js index 0eb59ca..f07ad58 100644 --- a/src/app/about/page.js +++ b/src/app/about/page.js @@ -1,10 +1,221 @@ "use client"; +import { useRef, useState, useEffect } from "react"; + export default function About() { - return (
-

About Me

-

- This is the about page. + // Timeline data + const timelineData = [ + { + date: "2018", + title: "First Contact with Coding", + content: + "I discovered my passion for technology by experimenting with Scratch and creating some simple Games.", + }, + { + date: "2020", + title: "Exploring Web & Scripting", + content: + "Started creating small websites and got into JavaScript, CSS, and working with various scripting languages.", + }, + { + date: "2022", + title: "Diving into Game Development", + content: + "Tried Unity and C#, building small 2D and 3D prototypes to expand my skill set.", + }, + { + date: "2024", + title: "Full Stack & Beyond", + content: + "Ventured into backend (SQL, Python) and continued refining my frontend abilities, always exploring new challenges.", + }, + ]; + + // Disable lint for calling hooks in a loop + // eslint-disable-next-line react-hooks/rules-of-hooks + const sectionRefs = timelineData.map(() => useRef(null)); + + const [currentSection, setCurrentSection] = useState(0); + + // Keep track if the user has reached the last section in the timeline + const [timelineFinished, setTimelineFinished] = useState(false); + + // Keyboard navigation (left / right arrow keys) + useEffect(() => { + const handleKeyDown = (e) => { + if (e.key === "ArrowRight") { + setCurrentSection((prev) => Math.min(prev + 1, timelineData.length - 1)); + } else if (e.key === "ArrowLeft") { + setCurrentSection((prev) => Math.max(prev - 1, 0)); + } + }; + + window.addEventListener("keydown", handleKeyDown); + return () => { + window.removeEventListener("keydown", handleKeyDown); + }; + }, [timelineData.length]); + + // Scroll the timeline horizontally to the currently selected section + useEffect(() => { + sectionRefs[currentSection].current?.scrollIntoView({ + behavior: "smooth", + inline: "start", + }); + + // If we are on the last section, mark timeline as finished + if (currentSection === timelineData.length - 1) { + setTimelineFinished(true); + } + }, [currentSection, sectionRefs]); + + // Navigate left or right with on-screen buttons + const goLeft = () => { + setCurrentSection((prev) => Math.max(prev - 1, 0)); + }; + + const goRight = () => { + setCurrentSection((prev) => Math.min(prev + 1, timelineData.length - 1)); + }; + + return ( +

+ + {/* ───────────────────────────── + 1) Intro / Top Section + ────────────────────────────── */} +
+

About Me

+

+ I’m a passionate developer always excited about new challenges. + Scroll down to check out my coding journey through the years!

-
); + + + {/* ───────────────────────────── + 2) Timeline Section + ────────────────────────────── */} +
+ {/* Only show the left button if we're not on the first section */} + {currentSection > 0 && ( + + )} + + {/* Only show the right button if we're not on the last section */} + {currentSection < timelineData.length - 1 && ( + + )} + + {/* Horizontal scroll area */} +
+ {timelineData.map((item, index) => ( +
+

{item.title}

+

{item.date}

+

+ {item.content} +

+
+ ))} +
+
+ + {/* ───────────────────────────── + 3) Skills Section + Only visible if timelineFinished + ────────────────────────────── */} + {timelineFinished && ( +
+

My Skills

+

+ By completing projects in web development, scripting, and game + design, I’ve cultivated a diverse set of skills — spanning + JavaScript, Python, C#, and more! +

+
+ )} +
+ ); } \ No newline at end of file diff --git a/src/app/globals.css b/src/app/globals.css index 31ca988..f6e51d9 100644 --- a/src/app/globals.css +++ b/src/app/globals.css @@ -181,5 +181,3 @@ body { object-fit: contain; display: block; } - -