Skip to content

Commit

Permalink
style nav
Browse files Browse the repository at this point in the history
  • Loading branch information
setsun committed Jun 30, 2023
1 parent fd39a0c commit bf87b43
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 14 deletions.
6 changes: 5 additions & 1 deletion components/GlobalStyle.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
import { Noto_Sans, Antonio } from 'next/font/google';
import { createGlobalStyle } from 'styled-components';

// If loading a variable font, you don't need to specify the font weight
const antonio = Antonio({ subsets: ['latin'] })

const GlobalStyle = createGlobalStyle`
html {
box-sizing: border-box;
Expand All @@ -18,7 +22,7 @@ const GlobalStyle = createGlobalStyle`
margin: 0;
padding: 0;
font-size: 16px;
font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen,
font-family: ${antonio.style.fontFamily}, -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen,
Ubuntu, Cantarell, Fira Sans, Droid Sans, Helvetica Neue, sans-serif;
}
Expand Down
49 changes: 36 additions & 13 deletions components/Navigation.tsx
Original file line number Diff line number Diff line change
@@ -1,25 +1,48 @@
import { HamburgerMenuIcon, Cross1Icon } from '@radix-ui/react-icons';
import { useState } from 'react';
import classNames from 'classnames';
import { NAVIGATION_ITEMS } from '../common/constants';

interface Props {
className?: string
}

const SideNavigation: React.FC<Props> = ({ className }) => (
<nav className={classNames('p-6 border-r-2 border-r-zinc-200 min-w-max', className)}>
{/* <HamburgerMenuIcon className='h-8 w-8' /> */}
const SideNavigation: React.FC<Props> = ({ className }) => {
const [isOpen, setOpen] = useState(false);

{/* <Cross1Icon className='h-8 w-8' /> */}
return (
<nav className={classNames('flex flex-col items-center p-6 border-r-2 border-r-zinc-200 min-w-max', className)}>
<button onClick={() => setOpen(!isOpen)}>
{isOpen ? (
<Cross1Icon className='h-8 w-8' />

<div className='flex flex-col gap-1'>
{NAVIGATION_ITEMS.map(({ name, link }) => (
<a href={link} key={link}>
{name}
</a>
))}
</div>
</nav>
);
) : (
<HamburgerMenuIcon className='h-8 w-8' />
)}
</button>


<div className='flex flex-col gap-1 mt-4'>
{isOpen ?
NAVIGATION_ITEMS.map(({ name, link }) => (
<a href={link} key={link}>
{name}
</a>
))
: (
<div
className='uppercase text-xl font-light'
style={{
textOrientation: 'upright',
writingMode: 'vertical-lr',
}}
>
setsun.xyz
</div>
)}
</div>
</nav>
);
}

export default SideNavigation;

1 comment on commit bf87b43

@vercel
Copy link

@vercel vercel bot commented on bf87b43 Jun 30, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

setsun-xyz – ./

setsun-xyz-setsun.vercel.app
setsun-xyz-git-main-setsun.vercel.app
www.setsun.xyz
setsun.xyz

Please sign in to comment.