Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added Navbar #185

Merged
merged 21 commits into from
Nov 1, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
aa5580d
edited navbar font and appearance
ofjuneskies Oct 16, 2024
2bb37fa
added logo to hamburger menu, adjusted layout, changed button colour …
ofjuneskies Oct 17, 2024
84cc349
changed to zothacks logo and made hamburger menu more distinct
ofjuneskies Oct 19, 2024
6466d73
edited navbar font and appearance
ofjuneskies Oct 16, 2024
ef71e42
added logo to hamburger menu, adjusted layout, changed button colour …
ofjuneskies Oct 17, 2024
79d3b7a
changed to zothacks logo and made hamburger menu more distinct
ofjuneskies Oct 19, 2024
a1e97a1
commented out incident form and devpost for now
ofjuneskies Oct 21, 2024
277e72d
commented out incident form and devpost temporarily
ofjuneskies Oct 21, 2024
91cc7b6
ran prettier on files
ofjuneskies Oct 21, 2024
13185b3
changed index so navbar is always the first layer
ofjuneskies Oct 23, 2024
c235afa
made the css follow mobile first design approach
ofjuneskies Oct 26, 2024
2dd1641
changed zothacks logo to be child of navbar.brand
ofjuneskies Oct 28, 2024
c38f04a
ran prettier
ofjuneskies Oct 28, 2024
2d90161
added hover animation
ofjuneskies Oct 29, 2024
2d71bae
changed navbar background to be same color as ocean and changed hover…
ofjuneskies Oct 29, 2024
a50088f
changed navbar background so it only appears when it scrolls to the o…
ofjuneskies Oct 30, 2024
a52637f
made blue background appear at different places depending on screen w…
ofjuneskies Oct 30, 2024
e3aa513
prettier
ofjuneskies Oct 31, 2024
91bad0c
made background turn grey when scrolled, changed hover animation to w…
ofjuneskies Nov 1, 2024
b3cedec
renamed zothacks logo png
ofjuneskies Nov 1, 2024
f5a0c0c
changed logo name in import
ofjuneskies Nov 1, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion apps/site/src/app/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ export default function RootLayout({
return (
<html lang="en" className={fredoka.variable}>
<body className="background">
{/* <NavBar /> */}
<NavBar />
<main>{children}</main>
<Footer />
</body>
Expand Down
Binary file modified apps/site/src/assets/icons/zothacks-logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
84 changes: 40 additions & 44 deletions apps/site/src/components/NavBar/NavBar.module.scss
Original file line number Diff line number Diff line change
Expand Up @@ -3,73 +3,69 @@

.nav {
width: 100%;
filter: drop-shadow(0px 2.5px 2px rgba(0, 0, 0, 0.4));

@include utils.media-breakpoint-up(sm) {
position: sticky;
z-index: 101;
top: 0;
z-index: 101;
background-color: rgba(20, 20, 20, 0.7);
mix-blend-mode: hard-light;
@include utils.media-breakpoint-up(lg) {
backdrop-filter: none;
}
backdrop-filter: blur(7px);
position: fixed;
text-align: right;
transition: background-color 0.2s ease;
}

.navbar {
background-image: url("~@/assets/images/lined_paper.svg");
background-size: cover;
background-position: left bottom;
background-repeat: no-repeat;
position: absolute;
top: 0;
}

.logo {
position: absolute;
left: 30px;
width: 20vw;
height: 20vw;
text-align: center;
transform: rotate(-16.81deg) translateY(-5vw);
position: relative;
width: 40px;
height: 40px;
align-items: left;
text-align: left;
top: 0;
}

.text {
margin-left: 1vw;
margin-right: 1vw;
font-size: 2rem;
font-weight: bold;
font-size: 1.5rem;
font-weight: 600;
text-decoration: none;
}
line-height: 7vh;

.notActive {
@extend .text;
color: black;
}
@include utils.media-breakpoint-up(lg) {
font-size: 1rem;
margin-top: 0;
transform: translateY(-4px);
}

.homeActive {
@extend .text;
color: theme.$green;
&:hover {
text-shadow: 0 0 5px white;
}
}

.resourcesActive {
.notActive {
@extend .text;
color: theme.$blue;
color: white;
}

.scheduleActive {
.active {
@extend .text;
color: theme.$navbar-red;
color: white;
text-decoration: underline;
text-underline-offset: 0.3rem;
text-decoration-thickness: 0.14rem;
}

@include utils.media-breakpoint-down(md) {
.logo {
left: 3vw;
transform: rotate(-16.81deg) translateY(-6vw);
}
.text {
font-size: 1.5rem;
}
.bg-transparent {
background-color: transparent;
}

@include utils.media-breakpoint-up(lg) {
.logo {
width: 180px;
height: 180px;
transform: rotate(-16.81deg) translateY(-40px);
}
.bg-scrolled {
background-color: rgba(20, 20, 20, 0.7);
mix-blend-mode: hard-light;
}
56 changes: 34 additions & 22 deletions apps/site/src/components/NavBar/NavBar.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
"use client";

import { useState, useEffect } from "react";

import { usePathname } from "next/navigation";
import Link from "next/link";
import Image from "next/image";
Expand All @@ -15,65 +17,75 @@ import styles from "./NavBar.module.scss";
export default function NavBar() {
const activeRoute = usePathname();

const [hasScrolled, setHasScrolled] = useState(false);

useEffect(() => {
const handleScroll = () =>
window.scrollY !== 0 ? setHasScrolled(true) : setHasScrolled(false);

window.addEventListener("scroll", handleScroll);

return () => window.removeEventListener("scroll", handleScroll);
}, []);

return (
<div className={styles.nav}>
<Navbar expand="lg" className={`bg-body-tertiary ${styles.navbar}`}>
<div
className={`${styles.nav} fixed-top ${hasScrolled ? "bg-scrolled" : "bg-transparent"}`}
>
<Navbar variant="dark" expand="lg" className={`${styles.navbar}`}>
<Container fluid>
<Navbar.Brand />
<Navbar.Brand href="/" as={Link}>
<div className={styles.logo}>
<Image src={ZotHacksLogo.src} alt="Hacks Logo" fill />
</div>
</Navbar.Brand>
<Navbar.Toggle aria-controls="basic-navbar-nav" />
<Navbar.Collapse id="basic-navbar-nav">
<Nav className="ms-auto text-center">
<Nav className="ms-auto text">
<Link
href="/"
className={
activeRoute === "/" ? styles.homeActive : styles.notActive
activeRoute === "/" ? styles.active : styles.notActive
}
>
Home
HOME
</Link>
<Link
href="/resources"
className={
activeRoute === "/resources"
? styles.resourcesActive
? styles.active
: styles.notActive
}
>
Resources
RESOURCES
</Link>
<Link
href="/schedule"
className={
activeRoute === "/schedule"
? styles.scheduleActive
: styles.notActive
activeRoute === "/schedule" ? styles.active : styles.notActive
}
>
Schedule
SCHEDULE
</Link>
<Link
href="https://forms.gle/6GUGYnVoFhAAxVkL8"
{/* <Link
href="https://forms.gle/cCixQqKR2gDXAUMLA"
className={styles.notActive}
target="_blank"
>
Incident Form
INCIDENT FORM
</Link>
<Link
href="https://zothacks-2023.devpost.com/"
className={styles.notActive}
target="_blank"
>
Devpost
</Link>
DEVPOST
</Link> */}
</Nav>
</Navbar.Collapse>
</Container>
</Navbar>
<Link href="/">
<div className={styles.logo}>
<Image src={ZotHacksLogo.src} alt="ZotHacks Logo" fill />
</div>
</Link>
</div>
);
}
Loading