Skip to content

Commit

Permalink
Added Profile page
Browse files Browse the repository at this point in the history
  • Loading branch information
jasperdemmers committed Jun 9, 2024
1 parent 60773cf commit ee950dc
Show file tree
Hide file tree
Showing 9 changed files with 237 additions and 13 deletions.
9 changes: 9 additions & 0 deletions public/background/profile-back.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
25 changes: 25 additions & 0 deletions src/components/LogoWithText.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
import PropTypes from 'prop-types';

const LogoWithText = ({ text, imageSrc }) => {
return (
<div className="flex items-center">
<div className="w-3/12 bg-secondary-light dark:bg-background-dark rounded-[5rem] p-8 scale-75">
<img
src={imageSrc}
alt="Logo"
className="w-full h-auto rounded-[3rem]"
/>
</div>
<div className="w-9/12 text-left">
<p className="font-display text-xl">{text}</p>
</div>
</div>
);
}

LogoWithText.propTypes = {
text: PropTypes.string.isRequired,
imageSrc: PropTypes.string.isRequired,
};

export default LogoWithText;
16 changes: 8 additions & 8 deletions src/components/Navbar.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -32,15 +32,15 @@ const Navbar = () => {
<nav className='bg-background-light dark:bg-background-dark text-text-light dark:text-text-dark p-4 relative'>
<div className='flex justify-between'>
<NavLogo />
<button className="inline-flex items-center p-2 ml-3 text-sm md:hidden" onClick={() => setIsOpen(!isOpen)}>
<button className="inline-flex items-center p-2 ml-3 text-sm lg:hidden" onClick={() => setIsOpen(!isOpen)}>
<svg className="w-6 h-6" fill="none" stroke="currentColor" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path strokeLinecap="round" strokeLinejoin="round" strokeWidth="2" d="M4 6h16M4 12h16m-7 6h7"></path></svg>
</button>
<div id="navbarMenu" className={`absolute top-full w-full text-center bg-background-light dark:bg-background-dark z-10 transform origin-top duration-500 ${isOpen ? 'scale-y-100' : 'scale-y-0'} md:scale-y-100 md:relative md:flex md:justify-end md:items-center md:w-auto md:bg-transparent transition-transform duration-300 ease-in-out`}>
<ul className='flex flex-col mt-4 md:flex-row md:space-x-8 lg:space-x-16 md:mt-0 text-xl font-display'>
<div id="navbarMenu" className={`absolute top-full w-full text-center bg-background-light dark:bg-background-dark z-10 transform origin-top duration-500 ${isOpen ? 'scale-y-100' : 'scale-y-0'} lg:scale-y-100 lg:relative lg:flex lg:justify-end lg:items-center lg:w-auto lg:bg-transparent transition-transform duration-300 ease-in-out`}>
<ul className='flex flex-col mt-4 lg:flex-row lg:space-x-8 lg:space-x-16 lg:mt-0 text-xl font-display'>
<li>
<NavLink
className={({ isActive }) =>
`inline-block py-2 pr-4 pl-3 md:p-0 hover:text-primary-light dark:hover:text-primary-dark ${isActive ? 'active' : ''}`
`inline-block py-2 pr-4 pl-3 lg:p-0 hover:text-primary-light dark:hover:text-primary-dark ${isActive ? 'active' : ''}`
}
to="/"
onClick={closeMenu}
Expand All @@ -53,7 +53,7 @@ const Navbar = () => {
<li>
<NavLink
className={({ isActive }) =>
`inline-block py-2 pr-4 pl-3 md:p-0 hover:text-primary-light dark:hover:text-primary-dark ${isActive ? 'active' : ''}`
`inline-block py-2 pr-4 pl-3 lg:p-0 hover:text-primary-light dark:hover:text-primary-dark ${isActive ? 'active' : ''}`
}
to="/whoami"
onClick={closeMenu}
Expand All @@ -66,7 +66,7 @@ const Navbar = () => {
<li>
<NavLink
className={({ isActive }) =>
`inline-block py-2 pr-4 pl-3 md:p-0 hover:text-primary-light dark:hover:text-primary-dark ${isActive ? 'active' : ''}`
`inline-block py-2 pr-4 pl-3 lg:p-0 hover:text-primary-light dark:hover:text-primary-dark ${isActive ? 'active' : ''}`
}
to="/profile"
onClick={closeMenu}
Expand All @@ -79,7 +79,7 @@ const Navbar = () => {
<li>
<NavLink
className={({ isActive }) =>
`inline-block py-2 pr-4 pl-3 md:p-0 hover:text-primary-light dark:hover:text-primary-dark ${isActive ? 'active' : ''}`
`inline-block py-2 pr-4 pl-3 lg:p-0 hover:text-primary-light dark:hover:text-primary-dark ${isActive ? 'active' : ''}`
}
to="/bin" onClick={closeMenu}
>
Expand All @@ -91,7 +91,7 @@ const Navbar = () => {
<li>
<NavLink
className={({ isActive }) =>
`inline-block py-2 pr-4 pl-3 md:p-0 hover:text-primary-light dark:hover:text-primary-dark ${isActive ? 'active' : ''}`
`inline-block py-2 pr-4 pl-3 lg:p-0 hover:text-primary-light dark:hover:text-primary-dark ${isActive ? 'active' : ''}`
}
to="/ping"
onClick={closeMenu}
Expand Down
21 changes: 21 additions & 0 deletions src/components/TitleWithIcon.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
import PropTypes from 'prop-types';

const TitleWithIcon = ({ text1, text2, text3 }) => {
const commonSpanClasses = "font-display";

return (
<div className="flex items-center justify-between space-x-4 pr-56">
<span className={`${commonSpanClasses} font-bold text-3xl`}>{text1}</span>
<span className={`${commonSpanClasses} text-2xl font-thin`}>{text2}</span>
<span className={`${commonSpanClasses} text-2xl font-thin`}>{text3}</span>
</div>
);
};

TitleWithIcon.propTypes = {
text1: PropTypes.string.isRequired,
text2: PropTypes.string.isRequired,
text3: PropTypes.string.isRequired,
};

export default TitleWithIcon;
74 changes: 74 additions & 0 deletions src/data/experiences.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
import TitleWithIcon from '../components/TitleWithIcon.jsx'; // Adjust the import path as necessary
import { GoTriangleDown } from 'react-icons/go';
import LogoWithText from "../components/LogoWithText.jsx"; // Replace 'FaIconName' with the actual icon name you want to use

const experiences = [
{
title: (
<TitleWithIcon
text1="2023 - Present"
text2="SimplePark"
text3="Cyber Security Engineer"
icon={<GoTriangleDown />}
/>
),
content: (
<LogoWithText
imageSrc={"/portfolio/simplepark.png"}
text={"SimplePark is amazing - Coming Soon"} // ToDo: Add description
/>
),
},
{
title: (
<TitleWithIcon
text1="2023 - Present"
text2="CitricLabs"
text3="Infrastructure Engineer"
icon={<GoTriangleDown />}
/>
),
content: (
<LogoWithText
imageSrc={"/portfolio/citriclabs.png"}
text={"CitricLabs is amazing - Coming Soon"} // ToDO: Add description
/>
),
},
{
title: (
<TitleWithIcon
text1="2023 - Present"
text2="MediaMarkt"
text3="Smartbar Employee"
icon={<GoTriangleDown />}
/>
),
content: (
<LogoWithText
imageSrc={"/portfolio/mediamarkt.png"}
text={"Started in June 2023 as a sales employee at the IT department.\n" +
"I’ve always been fascinated about how things work, so became a Smartbar employee in July 2023.\n" +
"Offer technical support to customers, smartphone repairs, technical advice"}
/>
),
},
{
title: (
<TitleWithIcon
text1="2021 - 2023"
text2="Karwei"
text3="Sales Employee"
icon={<GoTriangleDown />}
/>
),
content: (
<LogoWithText
imageSrc={"/portfolio/karwei.png"}
text={"Karwei is amazing - Coming Soon"} // ToDo: Add description
/>
),
},
];

export default experiences;
6 changes: 3 additions & 3 deletions src/main.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import NoPage from './pages/NoPage'
import Navbar from './components/Navbar';
import ThemeButton from './components/ThemeButton';
import ScrollToTop from "./components/ScrollToTop.js";
import Profile from "./pages/Profile.jsx";

const Overlay = () => {
return (
Expand Down Expand Up @@ -37,9 +38,8 @@ export default function App() {
</>} />
<Route path="profile" element={
<>
<NoPage/>
{/*<Overlay />*/}
{/*<Profile />*/}
<Overlay />
<Profile />
</>} />
<Route path="bin" element={
<>
Expand Down
10 changes: 8 additions & 2 deletions src/pages/Profile.jsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,13 @@
import Hero from "../sections/profile/Hero.jsx";
import Experience from "../sections/profile/Experience.jsx";

const Profile = () => {
return (
<div>
<h1>Profile</h1>
<div className={"text-text-light dark:text-text-dark mx-auto"}>
<div className={"constrained-container"}>
<Hero/>
<Experience/>
</div>
</div>
)
}
Expand Down
56 changes: 56 additions & 0 deletions src/sections/profile/Experience.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
import { useState, useRef, useEffect } from 'react';
import experiences from '../../data/experiences.jsx';
import SecHead from "../../components/SecHead.jsx";
import { GoTriangleDown, GoTriangleUp } from 'react-icons/go';

const Experience = () => {
const [expandedIndex, setExpandedIndex] = useState(null);
const contentRefs = useRef([]);

const toggleExpand = (index) => {
setExpandedIndex(expandedIndex === index ? null : index);
};

useEffect(() => {
if (expandedIndex !== null) {
contentRefs.current[expandedIndex].style.height = `${contentRefs.current[expandedIndex].scrollHeight}px`;
}
}, [expandedIndex]);

return (
<div className="space-y-0">
<SecHead head={"Professional Experiences"} />
{experiences.map((experience, index) => (
<div
key={index}
className={`relative mx-auto w-full bg-gradient-to-r from-[#FF2E62] to-[#08D9D5] pl-1 pr-1 pt-1 cursor-pointer transition-all duration-300 ${
expandedIndex === index ? 'h-auto' : 'h-auto'
} ${index === experiences.length - 1 ? 'pb-1' : ''}`}
onClick={() => toggleExpand(index)}
>
<div className="flex h-full w-full items-center justify-center bg-background-light dark:bg-background-dark p-4 shadow-inner shadow-md">
<div className="w-full">
<div className="font-bold">{experience.title}</div>
<div
ref={(el) => (contentRefs.current[index] = el)}
className={`overflow-hidden transition-height duration-500 ease-in-out ${expandedIndex === index ? 'h-auto' : 'h-0'}`}
style={{ height: expandedIndex === index ? `${contentRefs.current[index]?.scrollHeight}px` : '0' }}
>
<div className="mt-2">
{experience.content}
</div>
</div>
</div>
</div>
<div className={`absolute ${expandedIndex === index ? 'bottom-4 right-4' : 'top-5 right-4'} transition-all duration-300`}>
<span className={`text-4xl transform transition-transform duration-300`}>
{expandedIndex === index ? <GoTriangleUp /> : <GoTriangleDown />}
</span>
</div>
</div>
))}
</div>
);
};

export default Experience;
33 changes: 33 additions & 0 deletions src/sections/profile/Hero.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
import Quote from "../../components/Quote.jsx";

const Hero = () => {
return (
<div className="px-4 md:pt-12 flex items-center justify-center">
<div
className="relative w-full h-48 md:h-[42rem] rounded-[5rem] md:rounded-[10rem] bg-fit bg-no-repeat bg-center bg-[url('/background/profile-back.svg')]"
>
<div className="absolute inset-0 flex items-center justify-center">
<div className={"text-center"}>
<h1 className={"antialiased text-text-dark font-display text-4xl sm:text-6xl md:text-7xl lg:text-8xl font-bold"}>
Profile
</h1>
<span
className="block mt-4 text-base sm:text-lg md:text-xl lg:text-2xl text-text-dark max-w-2xl mx-auto">
You’ve come far! Here you will find my professional experience, and technologies I have worked with.
</span>
<div className={"block py-6 text-text-dark max-w-[700px]"}>
<Quote
p1={`"Perfection is not attainable, but if we `}
p2={"chase perfection"}
p3={` we can catch excellence."`}
auth={"Vince Lombardi"}
/>
</div>
</div>
</div>
</div>
</div>
)
}

export default Hero;

0 comments on commit ee950dc

Please sign in to comment.