From da68a3848c319ced47ba0c13e1dcd4540044446b Mon Sep 17 00:00:00 2001 From: Gabriel Date: Fri, 3 Nov 2023 19:25:18 -0300 Subject: [PATCH 1/8] feat: create intiial structure --- src/components/NavBar/Navbar.mock.ts | 107 +++++++++++++++++++++++++++ src/components/NavBar/index.tsx | 4 +- src/components/NavBar/styles.ts | 6 ++ 3 files changed, 116 insertions(+), 1 deletion(-) create mode 100644 src/components/NavBar/Navbar.mock.ts create mode 100644 src/components/NavBar/styles.ts diff --git a/src/components/NavBar/Navbar.mock.ts b/src/components/NavBar/Navbar.mock.ts new file mode 100644 index 0000000..e09a8e2 --- /dev/null +++ b/src/components/NavBar/Navbar.mock.ts @@ -0,0 +1,107 @@ +export const navBarMock = [ + { + name: 'About', + }, + { + name: 'React', + }, + { + name: 'Nextjs', + }, + { + name: 'Lorem ipsum', + subitems: ['About', 'React'], + }, + { + name: 'About', + }, + { + name: 'React', + }, + { + name: 'Nextjs', + }, + { + name: 'Lorem ipsum', + subitems: ['About', 'React'], + }, + { + name: 'About', + }, + { + name: 'React', + }, + { + name: 'Nextjs', + }, + { + name: 'Lorem ipsum', + subitems: ['About', 'React'], + }, + { + name: 'About', + }, + { + name: 'React', + }, + { + name: 'Nextjs', + }, + { + name: 'Lorem ipsum', + subitems: ['About', 'React'], + }, + { + name: 'About', + }, + { + name: 'React', + }, + { + name: 'Nextjs', + }, + { + name: 'Lorem ipsum', + subitems: ['About', 'React'], + }, + { + name: 'About', + }, + { + name: 'React', + }, + { + name: 'Nextjs', + }, + { + name: 'Lorem ipsum', + subitems: ['About', 'React'], + }, + + { + name: 'About', + }, + { + name: 'React', + }, + { + name: 'Nextjs', + }, + { + name: 'Lorem ipsum', + subitems: ['About', 'React'], + }, + { + name: 'About', + }, + { + name: 'React', + }, + { + name: 'Nextjs', + }, + { + name: 'Lorem ipsum', + subitems: ['About', 'React'], + }, +] diff --git a/src/components/NavBar/index.tsx b/src/components/NavBar/index.tsx index 52741f7..0761e64 100644 --- a/src/components/NavBar/index.tsx +++ b/src/components/NavBar/index.tsx @@ -1,5 +1,7 @@ +import * as S from './styles' + const NavBar = () => { - return + return aSDPLDFLDFPOPDFKOPDFKOP } export default NavBar diff --git a/src/components/NavBar/styles.ts b/src/components/NavBar/styles.ts new file mode 100644 index 0000000..39f3ec0 --- /dev/null +++ b/src/components/NavBar/styles.ts @@ -0,0 +1,6 @@ +import styled from 'styled-components' + +export const Wrapper = styled.nav` + position: absolute; + left: 0; +` From 5b0efa0025b0a85fda1deb878b67ba36f523601b Mon Sep 17 00:00:00 2001 From: Gabriel Date: Mon, 20 Nov 2023 21:01:19 -0300 Subject: [PATCH 2/8] feat: create navbar in desktop --- pages/index.page.tsx | 7 +- src/components/NavBar/Navbar.mock.ts | 290 ++++++++++++++++++--------- src/components/NavBar/index.tsx | 29 ++- src/components/NavBar/styles.ts | 82 +++++++- src/layout/index.tsx | 6 +- src/layout/styles.ts | 13 +- src/styles/GlobalStyle.ts | 1 + 7 files changed, 324 insertions(+), 104 deletions(-) diff --git a/pages/index.page.tsx b/pages/index.page.tsx index e02366a..2dd16fd 100644 --- a/pages/index.page.tsx +++ b/pages/index.page.tsx @@ -19,13 +19,18 @@ const Home: NextPage = () => { return () => clearInterval(timer) }, []) + const redirectToAbout = () => { + SoundClickButton() + window.open('/about', '_self', 'noreferrer') + } + return ( <> sandevistan - SoundClickButton()}> + explore diff --git a/src/components/NavBar/Navbar.mock.ts b/src/components/NavBar/Navbar.mock.ts index e09a8e2..616449f 100644 --- a/src/components/NavBar/Navbar.mock.ts +++ b/src/components/NavBar/Navbar.mock.ts @@ -8,100 +8,200 @@ export const navBarMock = [ { name: 'Nextjs', }, - { - name: 'Lorem ipsum', - subitems: ['About', 'React'], - }, - { - name: 'About', - }, - { - name: 'React', - }, - { - name: 'Nextjs', - }, - { - name: 'Lorem ipsum', - subitems: ['About', 'React'], - }, - { - name: 'About', - }, - { - name: 'React', - }, - { - name: 'Nextjs', - }, - { - name: 'Lorem ipsum', - subitems: ['About', 'React'], - }, - { - name: 'About', - }, - { - name: 'React', - }, - { - name: 'Nextjs', - }, - { - name: 'Lorem ipsum', - subitems: ['About', 'React'], - }, - { - name: 'About', - }, - { - name: 'React', - }, - { - name: 'Nextjs', - }, - { - name: 'Lorem ipsum', - subitems: ['About', 'React'], - }, - { - name: 'About', - }, - { - name: 'React', - }, - { - name: 'Nextjs', - }, - { - name: 'Lorem ipsum', - subitems: ['About', 'React'], - }, + // { + // name: 'Lorem ipsum', + // subitems: ['About', 'React'], + // }, + // { + // name: 'About', + // }, + // { + // name: 'React', + // }, + // { + // name: 'Nextjs', + // }, + // { + // name: 'Lorem ipsum', + // subitems: ['About', 'React'], + // }, + // { + // name: 'About', + // }, + // { + // name: 'React', + // }, + // { + // name: 'Nextjs', + // }, + // { + // name: 'Lorem ipsum', + // subitems: ['About', 'React'], + // }, + // { + // name: 'About', + // }, + // { + // name: 'React', + // }, + // { + // name: 'Nextjs', + // }, + // { + // name: 'Lorem ipsum', + // subitems: ['About', 'React'], + // }, + // { + // name: 'About', + // }, + // { + // name: 'React', + // }, + // { + // name: 'Nextjs', + // }, + // { + // name: 'Lorem ipsum', + // subitems: ['About', 'React'], + // }, + // { + // name: 'About', + // }, + // { + // name: 'React', + // }, + // { + // name: 'Nextjs', + // }, + // { + // name: 'Lorem ipsum', + // subitems: ['About', 'React'], + // }, - { - name: 'About', - }, - { - name: 'React', - }, - { - name: 'Nextjs', - }, - { - name: 'Lorem ipsum', - subitems: ['About', 'React'], - }, - { - name: 'About', - }, - { - name: 'React', - }, - { - name: 'Nextjs', - }, - { - name: 'Lorem ipsum', - subitems: ['About', 'React'], - }, + // { + // name: 'About', + // }, + // { + // name: 'React', + // }, + // { + // name: 'Nextjs', + // }, + // { + // name: 'Lorem ipsum', + // subitems: ['About', 'React'], + // }, + // { + // name: 'About', + // }, + // { + // name: 'React', + // }, + // { + // name: 'Nextjs', + // }, + // { + // name: 'Lorem ipsum', + // subitems: ['About', 'React'], + // }, + // { + // name: 'Lorem ipsum', + // subitems: ['About', 'React'], + // }, + // { + // name: 'Lorem ipsum', + // subitems: ['About', 'React'], + // }, + // { + // name: 'Lorem ipsum', + // subitems: ['About', 'React'], + // }, + // { + // name: 'Lorem ipsum', + // subitems: ['About', 'React'], + // }, + // { + // name: 'Lorem ipsum', + // subitems: ['About', 'React'], + // }, + // { + // name: 'Lorem ipsum', + // subitems: ['About', 'React'], + // }, + // { + // name: 'Lorem ipsum', + // subitems: ['About', 'React'], + // }, + // { + // name: 'Lorem ipsum', + // subitems: ['About', 'React'], + // }, + // { + // name: 'Lorem ipsum', + // subitems: ['About', 'React'], + // }, + // { + // name: 'Lorem ipsum', + // subitems: ['About', 'React'], + // }, + // { + // name: 'Lorem ipsum', + // subitems: ['About', 'React'], + // }, + // { + // name: 'Lorem ipsum', + // subitems: ['About', 'React'], + // }, + // { + // name: 'Lorem ipsum', + // subitems: ['About', 'React'], + // }, + // { + // name: 'Lorem ipsum', + // subitems: ['About', 'React'], + // }, + // { + // name: 'Lorem ipsum', + // subitems: ['About', 'React'], + // }, + // { + // name: 'Lorem ipsum', + // subitems: ['About', 'React'], + // }, + // { + // name: 'Lorem ipsum', + // subitems: ['About', 'React'], + // }, + // { + // name: 'Lorem ipsum', + // subitems: ['About', 'React'], + // }, + // { + // name: 'Lorem ipsum', + // subitems: ['About', 'React'], + // }, + // { + // name: 'Lorem ipsum', + // subitems: ['About', 'React'], + // }, + // { + // name: 'Lorem ipsum', + // subitems: ['About', 'React'], + // }, + // { + // name: 'Lorem ipsum', + // subitems: ['About', 'React'], + // }, + // { + // name: 'Lorem ipsum', + // subitems: ['About', 'React'], + // }, + // { + // name: 'Lorem ipsum', + // subitems: ['About', 'React'], + // }, + // { + // name: 'Lorem ipsum cabo', + // subitems: ['About', 'React'], + // }, ] diff --git a/src/components/NavBar/index.tsx b/src/components/NavBar/index.tsx index 0761e64..c18d10c 100644 --- a/src/components/NavBar/index.tsx +++ b/src/components/NavBar/index.tsx @@ -1,7 +1,34 @@ +import { useState } from 'react' +import { SoundClickButton } from '~/src/utils/Sounds' + +import Equalizer from '../Equalizer' +import { navBarMock } from './Navbar.mock' import * as S from './styles' const NavBar = () => { - return aSDPLDFLDFPOPDFKOPDFKOP + const [isOpen, setIsOpen] = useState(true) + + const closeNavBar = () => { + SoundClickButton() + setIsOpen(false) + } + + return ( + + + {navBarMock.map(({ name }) => ( + + {name} + + ))} + + + + +
+ + + ) } export default NavBar diff --git a/src/components/NavBar/styles.ts b/src/components/NavBar/styles.ts index 39f3ec0..2d3c127 100644 --- a/src/components/NavBar/styles.ts +++ b/src/components/NavBar/styles.ts @@ -1,6 +1,82 @@ +import ArrowBackIcon from '@mui/icons-material/ArrowBack' import styled from 'styled-components' -export const Wrapper = styled.nav` - position: absolute; - left: 0; +export const Wrapper = styled.nav<{ showNavBar: boolean }>` + display: flex; + flex-direction: column; + height: calc(100vh - 120px); + margin-top: 70px; + overflow-y: auto; + + display: ${({ showNavBar }) => !showNavBar && 'none'}; +` + +export const NavBar = styled.div` + width: 280px; + display: flex; + flex-direction: column; + gap: var(--spacing-basic-small); + overflow-y: auto; + + ::-webkit-scrollbar { + width: 2px; + } + + ::-webkit-scrollbar-button { + background-color: var(--black); + } + + ::-webkit-scrollbar-track-piece { + background-color: var(--black); + } + + ::-webkit-scrollbar-thumb { + background-color: var(--white); + } +` + +export const Item = styled.div` + display: flex; + align-items: center; + width: 100%; + transition: 0.3s; + padding: var(--spacing-basic-small) 0; + cursor: pointer; + + &:hover { + background: var(--green); + + a { + color: var(--white); + } + } +` + +export const Link = styled.a` + font-size: 16px; + padding-left: var(--spacing-basic); +` + +export const RollbackContainer = styled.div` + width: 280px; + height: 60px; + color: var(--green-white); + background-color: var(--green); + border: 1px solid var(--green-white); + + display: flex; + align-items: center; + justify-content: space-around; + padding: 0 10px; +` + +export const BackIcon = styled(ArrowBackIcon)` + width: 35px; + height: 35px; + cursor: pointer; + transition: 0.3s; + + &:hover { + color: var(--white); + } ` diff --git a/src/layout/index.tsx b/src/layout/index.tsx index 7f87789..a1e0518 100644 --- a/src/layout/index.tsx +++ b/src/layout/index.tsx @@ -12,8 +12,10 @@ type LayoutProps = { const Layout = ({ children }: LayoutProps) => (
- - {children} + + + {children} +