Refactor & stuff

burgermenu
E. Almqvist 2 years ago
parent 6ef4f29b84
commit cc8d09bd79
  1. 23
      components/footer.tsx
  2. 32
      components/header.tsx
  3. 28
      components/nav.tsx
  4. 4
      pages/index.tsx
  5. 40
      styles/globals.css

@ -2,13 +2,32 @@ import Link from "next/link"
import styled from 'styled-components' import styled from 'styled-components'
const Footer = styled.footer` 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 () => { export default () => {
return ( return (
<Footer> <Footer>
<p>Footer</p> <p>Copyright &copy; {new Date().getFullYear()} Elias Almqvist</p>
<UList>
<li><a href="" target="_blank">GitHub</a></li>
<li><a href="" target="_blank">Wych Git</a></li>
</UList>
</Footer> </Footer>
) )
} }

@ -1,12 +1,16 @@
import Link from "next/link"
import styled from 'styled-components' import styled from 'styled-components'
import Nav from './nav'
const Header = styled.header` const Header = styled.header`
display: flex; display: flex;
align-items: center; align-items: center;
max-width: 70rem; border-bottom: var(--border-size) var(--border-type) var(--border-color);
padding: 0 4rem; padding: var(--v-uni-padding) var(--h-uni-padding);
border-bottom: 1px dotted #aaa;
h1 {
font-size: 2rem;
font-weight: normal;
}
nav { nav {
margin-left: auto; 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 () => { export default () => {
return ( return (
<Header> <Header>
<h1>wych.dev</h1> <h1>wych.dev</h1>
<Nav> <Nav />
<Link href="/">Home</Link>
<Link href="/projects">Projects</Link>
<a href="https://github.com/E-Almqvist" target="_blank">GitHub</a>
</Nav>
</Header> </Header>
) )
} }

@ -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 (
<Nav>
<Link href="/">Home</Link>
<Link href="/projects">Projects</Link>
<a href="https://github.com/E-Almqvist" target="_blank">GitHub</a>
</Nav>
)
}

@ -4,7 +4,9 @@ import Layout from '../components/layout'
const Page: NextPageWithLayout = () => { const Page: NextPageWithLayout = () => {
return ( return (
<p>yo</p> <>
<p>I am a student with a passion for programming, physics/mathematics and *NIX (Linux, UNIX etc).</p>
</>
) )
} }

@ -1,19 +1,47 @@
:root { :root {
font-size: 16px; 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);
} }
html, body { * {
box-sizing: border-box;
font-family: "IBM Plex Mono", monospace;
padding: 0; padding: 0;
margin: 0; margin: 0;
font-family: "IBM Plex Mono", monospace; }
html {
background: var(--bg);
}
body {
display: flex;
flex-direction: column;
margin: 0 auto;
max-width: var(--content-max-width);
} }
a { a {
color: inherit; color: var(--fg-link);
text-decoration: none; text-decoration: none;
} }
* { main {
box-sizing: border-box; min-height: 70vh;
} }

Loading…
Cancel
Save