frontpage/pages/me.tsx

126 lines
6.1 KiB
TypeScript
Raw Permalink Normal View History

2022-10-18 23:40:27 +02:00
import type { NextPage } from "next";
2022-10-29 21:00:38 +02:00
import Link from "next/link";
2022-10-29 21:48:36 +02:00
import Image from "next/image";
2022-10-20 17:48:27 +02:00
import { useEffect } from "react";
2022-10-29 21:00:38 +02:00
import { Discord, Github, Instagram, Steam, Linkedin } from "@icons-pack/react-simple-icons";
2022-10-18 23:40:27 +02:00
import Layout from "../components/Blog/Layout";
import styles from "../styles/Blog/AboutMe.module.scss";
2022-10-29 21:00:38 +02:00
import pic from "../public/img/me.png";
2022-10-18 23:40:27 +02:00
2022-10-20 17:48:27 +02:00
import skills, { AdditionalSkill, Skill, SkillCard } from "../data/skills";
import achievements from "../data/achievements";
2022-10-29 21:48:36 +02:00
import socials from "../data/socials";
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}>
2022-10-23 17:23:05 +02:00
<span>{additional.icon || null}</span><span>{additional.name}</span>
2022-10-20 17:48:27 +02:00
</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}>
2022-10-23 17:23:05 +02:00
<div className={styles.barName}>{skill.icon || null}</div>
2022-10-20 17:48:27 +02:00
<div className={styles.percentBar} style={{"--barPct": skill.pct + "%"} as React.CSSProperties}>
<div className={`${styles.front} vpAnimated`}></div>
</div>
2022-10-23 17:23:05 +02:00
<div>{skill.name}</div>
2022-10-20 13:40:58 +02:00
</div>;
};
const SkillCard: NextPage<{ card: SkillCard }> = ({ card }) => {
2022-10-23 17:23:05 +02:00
const cardStyle = {
background: card.colors?.background,
"--ch-color": card.colors?.heading,
"--bar-color": card.colors?.bars,
2022-10-24 23:53:00 +02:00
color: card.colors?.useDarkColor === undefined ? undefined : (card.colors?.useDarkColor ? "#222" : "#ddd"),
"--badge-bg": card.colors?.badges?.background,
"--badge-color": card.colors?.badges?.useDarkColor === undefined ? undefined : (card.colors?.badges?.useDarkColor ? "#222" : "#ddd"),
2022-10-23 17:23:05 +02:00
} as React.CSSProperties;
return <div className={styles.skillCard} style={cardStyle}>
2022-10-20 13:40:58 +02:00
<h3>{card.title}</h3>
2022-10-20 23:43:44 +02:00
<div className={styles.skillBarsSet}>
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 23:43:44 +02:00
)}
</div>
2022-10-23 17:23:05 +02:00
{card.additional && card.additional.length > 0 ? <div className={styles.badgeSet}>
{card.additional?.map((skill, i) => <Badge additional={skill} key={i} />)}
</div> : null}
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-11-03 11:24:34 +01:00
const age = new Date().getFullYear() - 1998 - (new Date().getMonth() <= 10 ? 1 : 0);
2022-10-18 23:40:27 +02:00
return <Layout>
<h1>This is me.</h1>
2022-10-29 21:00:38 +02:00
<div className={styles.photo}>
2022-10-29 22:25:41 +02:00
<Image src={pic} alt="Me" layout="responsive" placeholder="blur" />
2022-10-29 21:00:38 +02:00
</div>
<div className={styles.personal}>
<p className={styles.preText}>
2022-10-29 21:05:51 +02:00
My name is <strong>Daniel</strong> and I&apos;m a prospective <strong>automation engineer</strong>, <strong>hardware enthusiast</strong>, and <strong>software developer</strong> from Germany.<br/>
I&apos;m {age} years old and studying <strong>Information Systems Engineering</strong> at <strong>TU Dresden</strong>.
2022-10-29 21:00:38 +02:00
</p>
<p>
2022-10-29 21:05:51 +02:00
To be honest, I don&apos;t really know what to write here.
2022-10-29 21:00:38 +02:00
What could you - some visitor of my website - possibly want to know about me?
</p><p>
Maybe you are an employer and want to know what I can do for you?
Then see below - I tried to list all my skills and achievements.
2022-10-29 21:05:51 +02:00
If your company is doing anything related to software development (even low-level ones like embedded controllers), I&apos;m probably suited for it.
2022-10-29 21:00:38 +02:00
</p><p>
But maybe you are just another guy on the internet browsing through my website?
Well then have fun!
I hope you find what you are looking for.
If you haven&apos;t seen it already, you should check out the <Link href="/terminal"><a className="nocolor">command line</a></Link> I made.
2022-10-29 21:05:51 +02:00
Otherwise, have fun poking around in my <Link href="/"><a className="nocolor">projects</a></Link>.
2022-10-29 21:00:38 +02:00
</p><p>
Do you want to know more about my personal life?
2022-10-29 21:05:51 +02:00
Well, I like to play video games, and watch anime, I love cats and <a href="https://www.reddit.com/r/blahaj" target="_blank" rel="noreferrer" className="nocolor">sharks</a>.
2022-10-29 21:00:38 +02:00
So just your ordinary nerdy student.<br/>
If you want to be even more invested in my personal life, check out my socials below.
</p><p>
Any questions I did not cover, but you are interested in?
2022-10-29 21:52:56 +02:00
Just contact me <a className="nocolor" href="mailto:admin-website@c0ntroller.de" rel="noreferrer" target="_blank">via email</a> or any of the socials below!
2022-10-29 21:00:38 +02:00
</p>
</div>
<h2>Social Media</h2>
<div className={styles.socials}>
2022-11-15 13:41:51 +01:00
{socials("2em").filter((social) => social.name !== "PGP Key").map((social, i) =>
2022-10-29 21:48:36 +02:00
<a key={i} href={social.url} target="_blank" rel="noreferrer" className="nocolor">
{social.icon}
</a>
)}
2022-10-29 21:00:38 +02:00
</div>
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;