diff --git a/src/app/page.tsx b/src/app/page.tsx index 685e11b..2a0c136 100644 --- a/src/app/page.tsx +++ b/src/app/page.tsx @@ -7,6 +7,7 @@ import '@/app/Home.scss'; import Image from 'next/image'; import Flashlight from '@/components/Flashlight/Flashlight'; import Controls from '@/components/FlashlightControls/Controls'; +import MobileHomeNav from '@/components/Navbar/MobileHomeNav/MobileHomeNav'; gsap.registerPlugin(useGSAP); @@ -720,6 +721,7 @@ export default function Page() { + ); } diff --git a/src/components/Navbar/MobileHomeNav/MobileHomeNav.scss b/src/components/Navbar/MobileHomeNav/MobileHomeNav.scss new file mode 100644 index 0000000..9374789 --- /dev/null +++ b/src/components/Navbar/MobileHomeNav/MobileHomeNav.scss @@ -0,0 +1,63 @@ +#mobile-nav-button-container { + display: flex; + align-items: center; + gap: 0.5rem; + font-family: $p-font; + padding-block: 1rem; + font-weight: 500; + font-size: 1.25rem; + justify-content: center; + + @media (min-width: 480px) { + gap: 1rem; + } + + @media (min-width: 580px) { + display: none; + } + + &.hide { + display: none; + } + + a { + border-radius: 48px; + border: 2px solid $white; + display: flex; + align-items: center; + } + + #about-button { + gap: 5px; + padding: 6px; + padding-left: 10px; + padding-right: 12px; + + @media (min-width: $desktop-breakpoint) { + gap: 10px; + padding: 6px; + padding-left: 10px; + padding-right: 12px; + } + } + + #register-button { + background-color: $white; + color: black; + text-transform: uppercase; + padding: 6px; + padding-inline: 1rem; + } + + a { + text-decoration: none; + } + + .longer-about-text { + display: none; + + @media (min-width: $tablet-breakpoint) { + display: block; + } + } +} diff --git a/src/components/Navbar/MobileHomeNav/MobileHomeNav.tsx b/src/components/Navbar/MobileHomeNav/MobileHomeNav.tsx new file mode 100644 index 0000000..5159e85 --- /dev/null +++ b/src/components/Navbar/MobileHomeNav/MobileHomeNav.tsx @@ -0,0 +1,25 @@ +import Image from 'next/image'; +import Link from 'next/link'; +import './MobileHomeNav.scss'; + +export default function MobileHomeNav({ visible }: { visible: boolean }) { + return ( +
+ + + + + About + + + Register + +
+ ); +} diff --git a/src/components/Navbar/Navbar.scss b/src/components/Navbar/Navbar.scss index 5ca7498..310485f 100644 --- a/src/components/Navbar/Navbar.scss +++ b/src/components/Navbar/Navbar.scss @@ -22,7 +22,8 @@ #nav-logo-current-page { svg { - width: 130px; + width: 260px; + transition: width 0.3s; @media (min-width: $tablet-breakpoint) { width: 260px; @@ -33,11 +34,12 @@ display: none; } } + } + #nav-button-container { + display: none; - #nav-button-container #register-button { - @media (min-width: $desktop-breakpoint) { - padding: 1.125rem 2rem; - } + @media (min-width: 580px) { + display: flex; } } } @@ -116,12 +118,4 @@ } } } - - #nav-home-button-container { - display: none; - - @media (min-width: 580px) { - display: flex; - } - } } diff --git a/src/components/Navbar/Navbar.tsx b/src/components/Navbar/Navbar.tsx index e8e4370..8dae16a 100644 --- a/src/components/Navbar/Navbar.tsx +++ b/src/components/Navbar/Navbar.tsx @@ -4,6 +4,7 @@ import Image from 'next/image'; import './Navbar.scss'; import Link from 'next/link'; import { usePathname } from 'next/navigation'; +import { useEffect, useRef } from 'react'; import StrideLogo from '../Register/StrideLogo'; import DCOLogo from './Logos/DCOLogo'; @@ -17,6 +18,24 @@ export default function Navbar() { return page.charAt(0).toUpperCase() + page.slice(1) || ''; }; + useEffect(() => { + const handleScroll = () => { + const logo = document.getElementById('nav-stride-logo'); + if (!logo) return; + if (window.scrollY > 0) { + logo.style.width = '130px'; + } else { + logo.style.width = '260px'; + } + }; + + window.addEventListener('scroll', handleScroll); + + return () => { + window.removeEventListener('scroll', handleScroll); + }; + }, []); + return (