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
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import TextCard from './_components/TextCard';

export default function BeginnersSection() {
return (
<div className="bg-[#F1FFCC]">
<div id="beginners-section" className="bg-[#F1FFCC]">
<Image
src={grass_top}
alt="grass detail lining top of section"
Expand Down
2 changes: 1 addition & 1 deletion app/(pages)/(hackers)/_components/HomeHacking/MDHelp.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ const items = [

export default function cardTest() {
return (
<div className="flex bg-[#FAFAFF]">
<div id="mentor-director-help" className="flex bg-[#FAFAFF]">
{/* Main Content */}
<main className="flex px-[5%] py-[10%] w-full">
{/* Items Grid */}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ export default function ScheduleSneakPeek({
} = useScheduleSneakPeekData();

return (
<div className="w-full bg-[#FAFAFF]">
<div id="schedule-sneak-peek" className="w-full bg-[#FAFAFF]">
<section className={`w-[90%] mx-auto py-[5vw] ${className ?? ''}`}>
<div className="inline-flex items-center group font-jakarta text-[clamp(1.25rem,4.2vw,3rem)] font-semibold leading-tight tracking-[0.72px] text-[#3F3F3F] whitespace-nowrap">
<span className="w-0 group-hover:w-[26px] overflow-hidden transition-all duration-300 ease-out shrink-0">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import TextCard from '../HomeHacking/_components/TextCard';

export default function HackerChoiceAward() {
return (
<div className="bg-[#F1FFCC]">
<div className="bg-[#F1FFCC]" id="hackers-choice-awards">
<div className="flex flex-col md:flex-row items-center justify-between px-[5%] p-[10%] gap-12 md:gap-0">
<div className="flex-1 flex justify-center md:justify-start">
<Image
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,10 @@ export default function PrizeTracks() {
};

return (
<main className="flex flex-col gap-4 px-[5%] py-[15%] md:py-[8%] bg-[#FAFAFF]">
<main
id="prize-tracks"
className="flex flex-col gap-4 px-[5%] py-[15%] md:py-[8%] bg-[#FAFAFF]"
>
<Header />
<DesktopFilterRow
currentFilter={filter}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ const accordionItems: AccordionItemInt[] = [

export default function JudgingInfo() {
return (
<div className={styles.container}>
<div id="judging" className={styles.container}>
<div className={styles.judgingProcess}>
<h6>THIS IS OUR</h6>
<h4>Judging Process</h4>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ const accordionItems: AccordionItemInt[] = [

export default function SubmissionInfo() {
return (
<div className={styles.container}>
<div id="submission" className={styles.container}>
<div className={styles.submissionProcess}>
<h6> THIS IS OUR </h6>
<h4> Submission Process</h4>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
'use client';

import { useState } from 'react';
import { useState, useEffect } from 'react';
import SubmissionInfo from '../SubmissionInfo/SubmissionInfo';
import JudgingInfo from '../JudgingInfo/JudgingInfo';
import styles from './WhatHappens.module.scss';
Expand All @@ -10,8 +10,18 @@ export default function WhatHappens() {
'submission'
);

// Auto-switch tab based on URL hash on mount
useEffect(() => {
const hash = window.location.hash;
if (hash === '#judging') {
setActiveTab('judging');
} else if (hash === '#submission') {
setActiveTab('submission');
}
}, []);

return (
<div className={styles.container}>
<div id="what-happens" className={styles.container}>
<div className={styles.containerContent}>
<div className={styles.beginningText}>
<div className={styles.commonHeader}>
Expand Down
44 changes: 40 additions & 4 deletions app/(pages)/(hackers)/_components/StarterKit/ParentCarousel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -205,19 +205,55 @@ function CarouselIndicators({
);
}

const SLIDE_HASHES = [
'#lets-begin',
'#find-a-team',
'#ideate',
'#resources',
] as const;

export function ParentCarousel() {
// TODO: resume wherever user left off
const [activeIndex, setActiveIndex] = useState(0);
const [api, setApi] = useState<CarouselApi>();

useEffect(() => {
if (!api) {
return;
}
if (!api) return;

// Register listener BEFORE scrollTo so the initial jump triggers it
api.on('select', () => {
setActiveIndex(api.selectedScrollSnap());
const idx = api.selectedScrollSnap();
setActiveIndex(idx);
history.replaceState(
null,
'',
window.location.pathname + SLIDE_HASHES[idx]
);
});

// Jump to slide indicated by URL hash on first load
const hash = window.location.hash;
const initialIndex = SLIDE_HASHES.indexOf(
hash as (typeof SLIDE_HASHES)[number]
);
if (initialIndex > 0) {
api.scrollTo(initialIndex, true);
setActiveIndex(initialIndex);
}
}, [api]);

// Handle hash changes from soft navigation (e.g. clicking a Hackbot link while already on this page)
useEffect(() => {
const handleHashChange = () => {
if (!api) return;
const hash = window.location.hash;
const index = SLIDE_HASHES.indexOf(hash as (typeof SLIDE_HASHES)[number]);
if (index >= 0) {
api.scrollTo(index, false);
}
};
window.addEventListener('hashchange', handleHashChange);
return () => window.removeEventListener('hashchange', handleHashChange);
}, [api]);

useEffect(() => {
Expand Down
5 changes: 4 additions & 1 deletion app/(pages)/(hackers)/_components/StayUpToDate/Discord.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,10 @@ import TextCard from '../HomeHacking/_components/TextCard';

export default function Discord() {
return (
<div className="flex flex-col md:flex-row items-center justify-between px-[5%] py-[10%] gap-12 md:gap-0 bg-[#0B2638]">
<div
id="discord"
className="flex flex-col md:flex-row items-center justify-between px-[5%] py-[10%] gap-12 md:gap-0 bg-[#0B2638]"
>
<div className="flex-1 flex justify-start">
<TextCard
short_text="JOIN US"
Expand Down
5 changes: 5 additions & 0 deletions app/(pages)/_components/Navbar/Navbar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,11 @@ export default function Navbar() {
const response = await LogoutAction();

if (response.ok) {
try {
localStorage.removeItem('hackbot_chat_history');
} catch {
// ignore
}
router.push('/login');
}
};
Expand Down