From cc8d09bd7975e77b7aa2757c18f5c7b4e298f813 Mon Sep 17 00:00:00 2001 From: "E. Almqvist" Date: Sat, 2 Jul 2022 20:26:37 +0200 Subject: [PATCH] Refactor & stuff --- components/footer.tsx | 27 +++++++++++++++++++++---- components/header.tsx | 32 +++++++++--------------------- components/nav.tsx | 28 ++++++++++++++++++++++++++ pages/index.tsx | 4 +++- styles/globals.css | 46 ++++++++++++++++++++++++++++++++++--------- 5 files changed, 100 insertions(+), 37 deletions(-) create mode 100644 components/nav.tsx diff --git a/components/footer.tsx b/components/footer.tsx index b7bada5..e21a360 100644 --- a/components/footer.tsx +++ b/components/footer.tsx @@ -2,13 +2,32 @@ import Link from "next/link" import styled from 'styled-components' const Footer = styled.footer` - border-top: 1px dotted #aaa; + display: flex; + align-items: center; + justify-content: center; + flex-direction: column; + border-top: var(--border-size) var(--border-type) var(--border-color); + margin-top: auto; + padding: 1.2rem; + + color: var(--fg-faded); +` + +const UList = styled.ul` + display: flex; + flex-direction: row; + list-style: none; + gap: 2rem; ` export default () => { return ( - + ) } diff --git a/components/header.tsx b/components/header.tsx index fe20c82..d1e64d1 100644 --- a/components/header.tsx +++ b/components/header.tsx @@ -1,12 +1,16 @@ -import Link from "next/link" import styled from 'styled-components' +import Nav from './nav' const Header = styled.header` display: flex; align-items: center; - max-width: 70rem; - padding: 0 4rem; - border-bottom: 1px dotted #aaa; + border-bottom: var(--border-size) var(--border-type) var(--border-color); + padding: var(--v-uni-padding) var(--h-uni-padding); + + h1 { + font-size: 2rem; + font-weight: normal; + } nav { margin-left: auto; @@ -14,29 +18,11 @@ const Header = styled.header` } ` -const Nav = styled(Header).attrs({as: "nav"})` - gap: 1.5rem; - font-size: 1.5rem; - border: unset; - - a { - transition: .2s opacity - } - - a:hover { - opacity: .4; - } -` - export default () => { return (

wych.dev

- +
) } diff --git a/components/nav.tsx b/components/nav.tsx new file mode 100644 index 0000000..8d62eb4 --- /dev/null +++ b/components/nav.tsx @@ -0,0 +1,28 @@ +import Link from "next/link" +import styled from 'styled-components' + +const Nav = styled.nav` + display: flex; + gap: 1.5rem; + font-size: 1.2rem; + border: unset; + + a { + color: var(--fg-button); + transition: .2s opacity; + } + + a:hover { + opacity: .4; + } +` + +export default () => { + return ( + + ) +} diff --git a/pages/index.tsx b/pages/index.tsx index cf8d85c..b55c12e 100755 --- a/pages/index.tsx +++ b/pages/index.tsx @@ -4,7 +4,9 @@ import Layout from '../components/layout' const Page: NextPageWithLayout = () => { return ( -

yo

+ <> +

I am a student with a passion for programming, physics/mathematics and *NIX (Linux, UNIX etc).

+ ) } diff --git a/styles/globals.css b/styles/globals.css index 64801a4..9c43646 100755 --- a/styles/globals.css +++ b/styles/globals.css @@ -1,19 +1,47 @@ :root { font-size: 16px; - color: #222; + --border-type: dotted; + --border-size: 1px; + --border-color: #ddd; + --border-radius: 1rem; + + --content-max-width: 60rem; + --h-uni-padding: .8rem; + --v-uni-padding: .2rem; + + --fg: #222; + --fg-faded: #aaa; + --fg-button: #0a070a; + --fg-link: #abf; + + --bg: #fefeff; + color: var(--fg); +} + +* { + box-sizing: border-box; + font-family: "IBM Plex Mono", monospace; + padding: 0; + margin: 0; +} + +html { + background: var(--bg); } -html, body { - padding: 0; - margin: 0; - font-family: "IBM Plex Mono", monospace; +body { + display: flex; + flex-direction: column; + margin: 0 auto; + max-width: var(--content-max-width); } a { - color: inherit; - text-decoration: none; + color: var(--fg-link); + text-decoration: none; } -* { - box-sizing: border-box; +main { + min-height: 70vh; } +