Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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 app/(pages)/(index-page)/_components/FAQ/FAQ.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ export default function FAQ() {
className={style.grass_3}
/>
</div>
<div className={style.faq}>
<div id="faq" className={style.faq}>
<Image
src="/images/faq/grass_texture_4.svg"
alt="grass texture"
Expand Down
4 changes: 2 additions & 2 deletions app/(pages)/(index-page)/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,12 @@ export default function Home() {
<SandCastle />
</div>

<div id="donate">
<div id="underwater">
<BigWave />
<Underwater />
</div>

<div id="faq">
<div id="donate">
<FAQ />
</div>

Expand Down
6 changes: 3 additions & 3 deletions app/(pages)/_components/Navbar/Navbar.module.scss
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@
font-size: 1.125rem;
letter-spacing: 0.36px;
line-height: 100%;
transition: all 0.5s;
transition: transform 0.3s, color 0.5s ease-out;

&:hover {
transform: translateY(-0.1rem);
Expand Down Expand Up @@ -113,7 +113,7 @@

.items {
align-self: baseline;
pointer-events: auto;
pointer-events: none;

.mlh_banner {
margin-right: 108px;
Expand All @@ -132,6 +132,7 @@

.hamburger {
margin: 32px 32px;
pointer-events: auto;
transition: all 0.3s ease-in-out;

&_line {
Expand All @@ -152,7 +153,6 @@

.hamburger_line {
background-color: var(--text-light) !important;
transition-delay: 0.2s;

&:nth-child(1) {
transform: translateY(8px) rotate(45deg);
Expand Down
58 changes: 28 additions & 30 deletions app/(pages)/_components/Navbar/Navbar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@ import Banner from '/public/Navbar/mlh-banner-2025.svg';
import styles from './Navbar.module.scss';

interface NavLink {
ids: string[];
body: React.ReactNode;
page: string;
path: string;
id: string;
color: string;
}

Expand All @@ -28,34 +28,34 @@ interface Section {

const links = [
{
ids: ['home', 'underwater'],
body: 'HOME',
page: '/',
path: '/?section=home', // remove section if scroll issue fixed
id: 'home',
},
{
ids: ['donate'],
body: 'DONATE',
page: '/',
path: '/?section=donate',
id: 'donate',
},
{
ids: ['faq'],
body: 'FAQ',
page: '/',
path: '/?section=faq',
id: 'faq',
},
{
ids: ['sponsors'],
body: 'SPONSORS',
page: '/',
path: '/?section=sponsors',
id: 'sponsors',
},
{
ids: ['about'],
body: 'ABOUT',
page: '/about-us',
path: '/about-us?section=about', // remove section if scroll issue fixed
id: 'about',
},
] as NavLink[];

Expand All @@ -68,12 +68,19 @@ const sections = [
background: 'rgba(255, 255, 255, 0.50)',
},
{
id: 'donate',
id: 'underwater',
page: '/',
baseColor: '#FFFFFF',
activeColor: '#FFC53D',
background: 'rgba(136, 136, 136, 0.50)',
},
{
id: 'donate',
page: '/',
baseColor: '#FFFFFF',
activeColor: '#AFD157',
background: 'rgba(136, 136, 136, 0.50)',
},
{
id: 'faq',
page: '/',
Expand All @@ -96,21 +103,7 @@ const sections = [
background: 'rgba(255, 255, 255, 0.50)',
},
{
id: 'values',
page: '/about-us',
baseColor: '#FFFFFF',
activeColor: '#005271',
background: 'rgba(136, 136, 136, 0.50)',
},
{
id: 'team',
page: '/about-us',
baseColor: '#FFFFFF',
activeColor: '#005271',
background: 'rgba(136, 136, 136, 0.50)',
},
{
id: 'recap',
id: 'about-page',
page: '/about-us',
baseColor: '#FFFFFF',
activeColor: '#005271',
Expand Down Expand Up @@ -141,14 +134,18 @@ export default function Navbar() {
if (!sectionContainer) {
return { id: '', sectionStart: 0, sectionEnd: 0 };
}
const { offsetTop, offsetHeight } = sectionContainer;
const { offsetHeight } = sectionContainer;
const rect = sectionContainer.getBoundingClientRect();
return {
id: section.id,
sectionStart: offsetTop,
sectionEnd: offsetTop + offsetHeight,
sectionStart: rect.top + window.scrollY,
sectionEnd: rect.top + window.scrollY + offsetHeight,
};
})
.sort((a, b) => a.sectionStart - b.sectionStart);
.sort((a, b) => a.sectionStart - b.sectionStart)
.filter(
(section) => section.sectionStart !== 0 || section.sectionEnd !== 0
);

let i = pageSections.length - 1;
for (i; i >= 0; i--) {
Expand Down Expand Up @@ -211,9 +208,10 @@ export default function Navbar() {
const currentSection = sections.find(
(section) => activeSection === section.id
);
if (!currentSection) return 'var(--text-medium)';
if (!currentSection) return 'var(--text-light)';

if (activeLink === link.id) return currentSection.activeColor;
if (link.ids.find((id) => activeLink === id))
return currentSection.activeColor;
return currentSection.baseColor;
};

Expand All @@ -230,12 +228,12 @@ export default function Navbar() {
style={{
background:
sections.find((section) => activeSection === section.id)
?.background ?? 'var(--text-light)',
?.background ?? 'rgba(136, 136, 136, 0.50)',
}}
>
{links.map((link) => (
<Link
className={`${styles.link} ${styles[link.id]} ${activeLink === link.id ? styles.active : null}`}
className={`${styles.link} ${link.ids.find((id) => activeLink === id) ? styles.active : null}`}
style={{
color: getLinkColor(link),
}}
Expand Down
8 changes: 1 addition & 7 deletions app/(pages)/about-us/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,9 @@ export default function AboutUs() {
<Hero />
</div>

<div id="values">
<div id="about-page">
<Values />
</div>

<div id="team">
<OurTeam />
</div>

<div id="recap">
<CloudBackground>
<CelebrateWrapper>
<Recap />
Expand Down