Skip to content

Commit e61e772

Browse files
fix: about page section swapping issue
1 parent 328e0ea commit e61e772

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

src/pages/About/index.jsx

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,9 @@ function About() {
1919
const viewportHeight = window.innerHeight;
2020

2121
// Calculate which section should be active
22-
const newActiveSection = Math.floor(scrollPosition / viewportHeight);
22+
const newActiveSection = Math.floor(
23+
(scrollPosition - 150) / viewportHeight,
24+
);
2325

2426
setActiveSection(newActiveSection);
2527
};
@@ -64,19 +66,19 @@ function About() {
6466

6567
<div
6668
ref={sectionRef}
67-
className="h-[100vh] relative bg-background-light text-text-dark"
69+
className="h-[130vh] relative bg-background-light text-text-dark"
6870
>
6971
{/* Vision Section */}
7072
<div
71-
className={`transition-section ${activeSection === 0 ? "visible" : ""}`}
73+
className={`sticky top-1/2 mt-[50vh] transition-section ${activeSection === 0 ? "visible" : ""}`}
7274
>
7375
<Heading
7476
text="OUR VISION"
7577
className="mb-8"
7678
frontTextStyle="text-primary"
7779
/>
7880
<div className="max-w-4xl mx-auto">
79-
<p className="text-center text-base md:text-lg mb-8">
81+
<p className="text-center text-base md:text-lg mb-8 px-6">
8082
To be a leading coding club that inspires students, driving
8183
excellence in programming and technology at Symbiosis Institute
8284
of Technology and beyond.
@@ -86,15 +88,15 @@ function About() {
8688

8789
{/* Mission Section */}
8890
<div
89-
className={`transition-section ${activeSection === 1 ? "visible" : ""}`}
91+
className={`mt-[20vh] md:mt-[10vh] transition-section ${activeSection === 1 ? "visible" : ""}`}
9092
>
9193
<Heading
9294
text="OUR MISSION"
9395
className="mb-8"
9496
frontTextStyle="text-primary"
9597
/>
9698
<div className="max-w-4xl mx-auto">
97-
<p className="text-center text-base md:text-lg mb-8">
99+
<p className="text-center text-base md:text-lg mb-8 px-6">
98100
To empower students (from beginner coders to advanced) with
99101
coding skills and knowledge through hands-on learning
100102
experiences, webinars and workshops fostering a community of

0 commit comments

Comments
 (0)