generated from acmucsd/website-template
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
1,022 additions
and
366 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,147 @@ | ||
import Link from 'next/link'; | ||
import styles from './style.module.scss'; | ||
import { useState, useEffect } from 'react'; | ||
import MenuIcon from '@mui/icons-material/Menu'; | ||
import CloseIcon from '@mui/icons-material/Close'; | ||
import { Dialog, IconButton, Toolbar } from '@mui/material'; | ||
import Socials from '@/components/socials'; | ||
|
||
const LINKS = [ | ||
{ | ||
name: 'Home', | ||
href: '/', | ||
}, | ||
{ | ||
name: 'Resources', | ||
href: '/resources', | ||
}, | ||
{ | ||
name: 'Prizes', | ||
href: '/prizes', | ||
}, | ||
{ | ||
name: 'FAQs', | ||
href: '/faq', | ||
}, | ||
{ | ||
name: 'Contact', | ||
href: '/contact', | ||
}, | ||
]; | ||
|
||
export default function Navbar() { | ||
const [mobileOpen, setMobileOpen] = useState(false); | ||
|
||
const handleMobileOpen = () => { | ||
setMobileOpen(true); | ||
}; | ||
|
||
const handleMobileClose = () => { | ||
setMobileOpen(false); | ||
}; | ||
|
||
return ( | ||
<div className={styles.container}> | ||
{/* Left side shows up on both desktop and mobile */} | ||
<Link | ||
href="/" | ||
onClick={handleMobileClose} | ||
style={{ textDecoration: 'none', color: 'inherit' }} | ||
> | ||
<div className={styles.leftSection}> | ||
<img className={styles.logoImage} src="/diamondhacks-logo.svg" alt="DiamondHacks logo" /> | ||
<div className={styles.logoTextContainer}> | ||
<strong>diamond</strong> | ||
<span>hacks</span> | ||
</div> | ||
</div> | ||
</Link> | ||
|
||
{/* Right side, desktop only */} | ||
<div className={styles.rightSectionDesktop}> | ||
{LINKS.map((link, index) => ( | ||
<Link key={index} href={link.href} className={styles.navItem}> | ||
{link.name} | ||
</Link> | ||
))} | ||
|
||
<a className={styles.applyNowButton} href="https://acmurl.com/diamondhacks-preregister"> | ||
Apply now | ||
</a> | ||
</div> | ||
|
||
{/* Hamburger button, mobile only */} | ||
<IconButton | ||
size="large" | ||
edge="start" | ||
color="primary" | ||
aria-label="open drawer" | ||
sx={{ mr: 2 }} | ||
onClick={handleMobileOpen} | ||
className={`${styles.hamburgerMenuButton} ${styles.buttonColorBlue}`} | ||
> | ||
<MenuIcon /> | ||
</IconButton> | ||
|
||
{/* Mobile navbar */} | ||
<Dialog | ||
open={mobileOpen} | ||
onClose={handleMobileClose} | ||
PaperProps={{ | ||
style: { | ||
backgroundColor: '#d4d4d4', | ||
maxHeight: '80vh', | ||
width: '100%', | ||
margin: 0, | ||
alignSelf: 'flex-start', | ||
alignItems: 'center', | ||
padding: '1.5rem 0', | ||
}, | ||
}} | ||
> | ||
<Toolbar | ||
sx={{ | ||
display: 'flex', | ||
flexDirection: 'row', | ||
justifyContent: 'space-between', | ||
width: '80%', | ||
}} | ||
> | ||
<Link | ||
href="/" | ||
onClick={handleMobileClose} | ||
style={{ textDecoration: 'none', color: 'inherit' }} | ||
> | ||
<div className={styles.leftSection}> | ||
<img | ||
className={styles.logoImage} | ||
src="/diamondhacks-logo.svg" | ||
alt="DiamondHacks logo" | ||
/> | ||
<div className={styles.logoTextContainer}> | ||
<strong>diamond</strong> | ||
<span>hacks</span> | ||
</div> | ||
</div> | ||
</Link> | ||
<IconButton edge="start" className={styles.buttonColorBlue} onClick={handleMobileClose} aria-label="close"> | ||
<CloseIcon /> | ||
</IconButton> | ||
</Toolbar> | ||
|
||
{LINKS.map((link, index) => ( | ||
<Link href={link.href} className={styles.navItem} key={index} onClick={handleMobileClose}> | ||
{link.name} | ||
</Link> | ||
))} | ||
|
||
<div style={{ margin: '2rem 0' }}> | ||
<Socials /> | ||
</div> | ||
<a className={styles.applyNowButton} href="https://acmurl.com/diamondhacks-preregister"> | ||
Apply now | ||
</a> | ||
</Dialog> | ||
</div> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,88 @@ | ||
.container { | ||
align-self: flex-start; | ||
|
||
display: flex; | ||
justify-content: space-between; | ||
align-items: center; | ||
width: 100%; | ||
|
||
padding: 3rem 0; | ||
z-index: 1; | ||
|
||
@media screen and (max-width: 768px) { | ||
padding: 1rem 0; | ||
} | ||
} | ||
|
||
.leftSection { | ||
display: flex; | ||
align-items: center; | ||
gap: 0.5rem; | ||
text-decoration: none; | ||
} | ||
|
||
.logoImage { | ||
height: 100%; | ||
} | ||
|
||
.logoTextContainer { | ||
display: flex; | ||
flex-direction: column; | ||
color: var(--Dark-Bleu); | ||
|
||
font-size: 1.5rem; | ||
|
||
@media screen and (max-width: 1100px) { | ||
font-size: 1rem; | ||
} | ||
} | ||
|
||
.rightSectionDesktop { | ||
display: flex; | ||
align-items: center; | ||
gap: 1.75rem; | ||
|
||
@media screen and (max-width: 768px) { | ||
display: none; | ||
} | ||
} | ||
|
||
.navItem { | ||
color: var(--Dark-Bleu); | ||
text-decoration: none; | ||
font-weight: 500; | ||
font-size: 1.5rem; | ||
|
||
@media screen and (max-width: 1100px) { | ||
font-size: 1rem; | ||
} | ||
|
||
@media screen and (max-width: 768px) { | ||
display: flex; | ||
align-items: center; | ||
justify-content: center; | ||
padding: 1rem; | ||
margin-right: 1rem; | ||
} | ||
} | ||
|
||
.applyNowButton { | ||
font-size: inherit; | ||
padding: 1rem; | ||
background-color: #142e52; | ||
color: white; | ||
border-radius: 2rem; | ||
text-decoration: none; | ||
} | ||
|
||
.hamburgerMenuButton { | ||
display: none; | ||
|
||
@media screen and (max-width: 768px) { | ||
display: block; | ||
} | ||
} | ||
|
||
.buttonColorBlue { | ||
color: var(--Dark-Bleu); | ||
} |
Oops, something went wrong.