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 (
- 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 ( +
+ I’m a passionate developer always excited about new challenges. + Scroll down to check out my coding journey through the years!
-+ {item.content} +
++ By completing projects in web development, scripting, and game + design, I’ve cultivated a diverse set of skills — spanning + JavaScript, Python, C#, and more! +
+