Skip to content

Commit 7c5fde4

Browse files
committed
Fix navigation bar in about us page
1 parent c14f722 commit 7c5fde4

File tree

2 files changed

+39
-48
lines changed

2 files changed

+39
-48
lines changed

src/components/shared/NavigationLinks.tsx

Lines changed: 4 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -118,30 +118,10 @@ const NavigationLinks = () => {
118118
if (element) {
119119
const navBar = document.querySelector('header, nav:first-of-type');
120120
const offsetTop = navBar ? navBar.getBoundingClientRect().height : 0;
121-
122-
const targetPosition =
123-
element.offsetTop - offsetTop - navigationConfig.scrollOffset;
124-
const startPosition = window.pageYOffset;
125-
const distance = targetPosition - startPosition;
126-
const duration = navigationConfig.scrollDuration;
127-
let start: number | null = null;
128-
129-
const animation = (currentTime: number) => {
130-
if (start === null) start = currentTime;
131-
const timeElapsed = currentTime - start;
132-
const progress = Math.min(timeElapsed / duration, 1);
133-
134-
const ease = (t: number) =>
135-
t < 0.5 ? 4 * t * t * t : (t - 1) * (2 * t - 2) * (2 * t - 2) + 1;
136-
137-
window.scrollTo(0, startPosition + distance * ease(progress));
138-
139-
if (timeElapsed < duration) {
140-
requestAnimationFrame(animation);
141-
}
142-
};
143-
144-
requestAnimationFrame(animation);
121+
window.scrollTo({
122+
top: element.offsetTop - offsetTop - navigationConfig.scrollOffset,
123+
behavior: 'smooth',
124+
});
145125
} else {
146126
console.error(
147127
`Section with ID "${sectionId}" not found in the document!`,

src/pages/About/AboutUs.tsx

Lines changed: 35 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -12,37 +12,48 @@ import ProjectsSection from '@/components/AboutUs/ProjectSection';
1212
import RoadmapSection from '@/components/AboutUs/RoadmapSection';
1313

1414
const AboutUs = () => {
15-
const [isLoaded, setIsLoaded] = useState(false);
15+
const [, setIsLoaded] = useState(false);
1616

1717
useEffect(() => {
1818
setTimeout(() => setIsLoaded(true), 100);
1919
}, []);
2020

2121
return (
22-
<div className="bg-gradient-to-b from-gray-50 to-orange-50">
23-
<Header />
24-
<div className="min-h-screen font-sans">
25-
<motion.div
26-
initial="hidden"
27-
animate={isLoaded ? 'visible' : 'hidden'}
28-
variants={{
29-
visible: { transition: { staggerChildren: 0.2 } },
30-
}}
31-
className="container mx-auto px-4 py-16 max-w-6xl"
32-
>
33-
<HeroSection />
34-
<NavigationLinks />
35-
<TextMaskSection />
36-
37-
<div className="space-y-32 my-24">
38-
<MissionSection />
39-
<PrinciplesSection />
40-
<GoalsSection />
41-
<ProjectsSection />
42-
<RoadmapSection />
43-
</div>
44-
</motion.div>
22+
<div className="bg-white min-h-screen">
23+
<div className="relative z-20">
24+
<Header />
4525
</div>
26+
27+
<motion.main
28+
initial={{ opacity: 0 }}
29+
animate={{ opacity: 1 }}
30+
transition={{ duration: 0.6 }}
31+
className="w-full relative z-10"
32+
>
33+
<HeroSection />
34+
35+
<div className="w-full">
36+
<div className="mx-auto max-w-7xl px-4 sm:px-6 lg:px-8">
37+
<NavigationLinks />
38+
<TextMaskSection />
39+
</div>
40+
</div>
41+
42+
<MissionSection />
43+
44+
<div className="w-full">
45+
<PrinciplesSection />
46+
</div>
47+
48+
<GoalsSection />
49+
50+
<div className="w-full">
51+
<ProjectsSection />
52+
</div>
53+
54+
<RoadmapSection />
55+
</motion.main>
56+
4657
<Footer />
4758
</div>
4859
);

0 commit comments

Comments
 (0)