Portfolio website written with Next.js
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
wychdev-nextjs/pages/index.tsx

144 lines
4.3 KiB

2 years ago
import type {NextPageWithLayout} from "./_app"
import type { ReactElement } from "react"
import Layout from "../components/layout"
import styled from "styled-components"
import Link from "next/link"
import IconLink from "components/iconlink"
import {faBook, faEnvelope, faFolderOpen, faUniversity} from "@fortawesome/free-solid-svg-icons"
import {faGit, faGithub} from "@fortawesome/free-brands-svg-icons"
2 years ago
export const Section = styled.section`
2 years ago
display: flex;
justify-content: center;
flex-direction: column;
padding: 0 1rem;
2 years ago
/*margin: 2rem 0;*/
margin: 0 0;
min-height: 100vh;
2 years ago
h2, h3 {
margin: 8px 0;
2 years ago
}
p {
margin: 0;
2 years ago
color: var(--fg);
}
2 years ago
.topmargin {
margin-top: 2rem;
}
ul li {
margin: .5rem 2.5rem;
}
#img-container {
display: flex;
justify-content: center;
}
#img-container img {
width: 22rem;
height: auto;
}
`
export const Code = styled.code`
background-color: var(--bg-dark);
color: var(--fg-code);
border-radius: .4rem;
padding: .1rem .4rem;
`
2 years ago
export const CList = styled.ul`
list-style: none;
li {
2 years ago
margin: 1rem !important;
}
`
export const Nem = styled.span`
color: var(--fg-faded);
opacity: .8;
`
export const LinkList = styled.div`
display: flex;
gap: 1.5rem;
font-size: 1.2rem;
border: unset;
justify-content: center;
a {
color: var(--fg-button);
transition: var(--trans-time) opacity;
}
a:hover {
opacity: .4;
}
@media screen and (max-width: 960px) {
word-break: break-word;
}
`
function getAge() {
let birth = 1050019200;
let now = Math.floor(Date.now() / 1000);
return now-birth;
}
function secondsToYears(secs: number) {
return Math.floor(secs / 31557600.0);
}
const Page: NextPageWithLayout = () => {
2 years ago
return (
2 years ago
<>
<Section>
2 years ago
<h2 id="about">$ whoami</h2>
<p>&gt; I am a {secondsToYears(getAge())} year old <em>Computer Science & Engineering student</em> with a passion for <em>programming</em>, <em>physics</em>, <em>mathematics</em> and anything <em>*NIX</em> <Nem>(Linux, UNIX etc)</Nem> related.</p>
2 years ago
{/*TODO: Add GitHub code frequency/contrib here*/}
2 years ago
<p className="topmargin">Most of my projects are open-source, and if you are interested, you can find all of my projects on my <a href="https://git.wych.dev" target="_blank" rel="noreferrer">git-server</a> or <a href="https://github.com/E-Almqvist" target="_blank" rel="noreferrer">GitHub</a>. You can also check out <Link href="/projects">/projects</Link> to view all of my projects (including hardware projects and so on).</p>
{/*
<div className="topmargin" id="img-container">
<img src="https://github-readme-stats.vercel.app/api/top-langs/?username=E-Almqvist&theme=dark&exclude_repo=hsf,the_auctionhouse,dotfiles,scripts,dmenu,dwmblocks,ewm,machinelearning,adventofcode,python-machinelearning,st,scroll,prog1&layout=compact&count_private=true&hide_border=true&bg_color=1d2021" />
</div>
*/}
<LinkList className="topmargin">
<IconLink href="#contact" icon={ faEnvelope } target="_self" rel="noreferrer"/>
<IconLink href="/projects" icon={ faFolderOpen } target="_self" rel="noreferrer"/>
<IconLink href="https://github.com/E-Almqvist" icon={ faGithub } target="_blank" rel="noreferrer"/>
<IconLink href="https://git.wych.dev" icon={ faGit } target="_blank" rel="noreferrer"/>
</LinkList>
</Section>
<Section>
<h2 id="contact">Contact</h2>
<p>You can contact me through email. And if you prefer it, you can contact me using PGP. Do note that my <em>email address below is encrypted</em> as a precaution against bots et cetera. <em>Do not worry, it is easy to crack</em>. Alternatively you could query for my email with my PGP fingerprint (key-id) on some PGP key server (i.e. the <a href="https://pgp.mit.edu/" target="_blank" rel="noreferrer">MIT</a> or <a href="https://keyserver.ubuntu.com/" target="_blank" rel="noreferrer">Ubuntu</a> key-server).</p>
<CList>
<li>
PGP fingerprint: <Code>68B2 9768 49F0 3C72 38AE B081 E31A 99CE 3E75 A158</Code>
</li>
<li>
Email: <Code>cnlueXpkaXZmZ0B0em52eS5wYnoK</Code>
</li>
<li>
GitHub: <a href="https://github.com/E-Almqvist" target="_blank" rel="noreferrer">github.com/E-Almqvist</a>
</li>
</CList>
2 years ago
</Section>
2 years ago
</>
2 years ago
)
}
Page.getLayout = (page: ReactElement) => {
return <Layout>{page}</Layout>
}
export default Page