2022-10-18 23:40:27 +02:00
|
|
|
import type { NextPage } from "next";
|
2022-10-20 17:48:27 +02:00
|
|
|
import { useEffect } from "react";
|
2022-10-18 23:40:27 +02:00
|
|
|
import Layout from "../components/Blog/Layout";
|
|
|
|
|
|
|
|
import styles from "../styles/Blog/AboutMe.module.scss";
|
|
|
|
|
2022-10-20 17:48:27 +02:00
|
|
|
import skills, { AdditionalSkill, Skill, SkillCard } from "../data/skills";
|
|
|
|
import achievements from "../data/achievements";
|
2022-10-20 13:40:58 +02:00
|
|
|
|
2022-10-20 17:48:27 +02:00
|
|
|
const Badge: NextPage<{ additional: AdditionalSkill }> = ({ additional }) => {
|
|
|
|
return <div className={styles.badge}>
|
|
|
|
{additional.icon || null} {additional.name}
|
|
|
|
</div>;
|
2022-10-20 13:40:58 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
const SkillBar: NextPage<{ skill: Skill }> = ({ skill }) => {
|
2022-10-20 17:48:27 +02:00
|
|
|
return <div className={styles.skillBar}>
|
|
|
|
<div className={styles.barName}>{skill.name}{skill.icon || null}</div>
|
|
|
|
<div className={styles.percentBar} style={{"--barPct": skill.pct + "%"} as React.CSSProperties}>
|
|
|
|
<div className={`${styles.front} vpAnimated`}></div>
|
|
|
|
</div>
|
2022-10-20 13:40:58 +02:00
|
|
|
</div>;
|
|
|
|
};
|
|
|
|
|
|
|
|
const SkillCard: NextPage<{ card: SkillCard }> = ({ card }) => {
|
|
|
|
return <div className={styles.card}>
|
|
|
|
<h3>{card.title}</h3>
|
2022-10-20 17:48:27 +02:00
|
|
|
{card.skillBars.sort((bar1, bar2) => bar2.pct - bar1.pct).map((skill, i) =>
|
2022-10-20 13:40:58 +02:00
|
|
|
<SkillBar key={i} skill={skill} />
|
2022-10-20 17:48:27 +02:00
|
|
|
)}<br/>
|
|
|
|
{card.additional?.map((skill, i) => <Badge additional={skill} key={i} />)}
|
2022-10-20 13:40:58 +02:00
|
|
|
</div>;
|
2022-10-18 23:40:27 +02:00
|
|
|
};
|
|
|
|
|
2022-10-20 22:11:17 +02:00
|
|
|
const Me: NextPage = () => {
|
2022-10-20 17:48:27 +02:00
|
|
|
useEffect(() => {
|
|
|
|
const handleScrollAnimation = () => {
|
|
|
|
document.querySelectorAll(".vpAnimated").forEach((element) => {
|
|
|
|
const rect = element.getBoundingClientRect();
|
|
|
|
const inVp = (
|
|
|
|
rect.top >= 0 &&
|
|
|
|
rect.left >= 0 &&
|
|
|
|
rect.bottom <= (window.innerHeight || document.documentElement.clientHeight) &&
|
|
|
|
rect.right <= (window.innerWidth || document.documentElement.clientWidth)
|
|
|
|
);
|
|
|
|
if (inVp) (element as HTMLElement).style.animationPlayState = "running";
|
|
|
|
else (element as HTMLElement).style.animationPlayState = "paused";
|
|
|
|
});
|
|
|
|
};
|
|
|
|
|
|
|
|
handleScrollAnimation(); // First time so we don't _need_ scrolling
|
|
|
|
window.addEventListener("scroll", handleScrollAnimation);
|
|
|
|
}, []);
|
|
|
|
|
2022-10-18 23:40:27 +02:00
|
|
|
const age = new Date().getFullYear() - 1998 - (new Date().getMonth() < 10 ? 1 : 0);
|
|
|
|
|
|
|
|
return <Layout>
|
|
|
|
<h1>This is me.</h1>
|
|
|
|
<p className={styles.preText}>
|
2022-10-19 11:09:22 +02:00
|
|
|
Hi! My name is <strong>Daniel</strong> and I'm an automation engineer from Germany.
|
2022-10-18 23:40:27 +02:00
|
|
|
</p>
|
|
|
|
<p>
|
2022-10-20 17:48:27 +02:00
|
|
|
I'm currently {age} years old and studying <strong>Information Systems Engineering</strong> at the <strong>TU Dresden</strong>.
|
2022-10-18 23:40:27 +02:00
|
|
|
</p>
|
2022-10-20 17:48:27 +02:00
|
|
|
<h2>Achievements</h2>
|
|
|
|
{achievements().map((achievement, i) => <div key={i} className={styles.achievement}>
|
|
|
|
<span>{achievement.icon}</span><span>{achievement.description}</span>
|
|
|
|
</div>)}
|
|
|
|
<h2>Skills</h2>
|
|
|
|
{skills().cards.map((card, i) => <SkillCard key={i} card={card} />)}
|
2022-10-18 23:40:27 +02:00
|
|
|
</Layout>;
|
|
|
|
};
|
|
|
|
|
2022-10-20 22:11:17 +02:00
|
|
|
export default Me;
|