This commit is contained in:
2025-09-17 15:35:06 +02:00
parent f712a6c894
commit 8f997b2f86
5 changed files with 48 additions and 11 deletions

View File

@@ -20,19 +20,19 @@ export default function Home() {
<section id="home-hero">
<HomeHero />
</section>
<section id="">
<section id="about">
<StackSectionPreview />
</section>
<section id="world-map">
<section id="network">
<WorldMap />
</section>
<section id="steps">
<section id="deploy">
<Steps />
</section>
<section id="companies">
<section id="llms">
<Companies />
</section>
<section id="use-cases">
<section id="features">
<UseCases />
</section>
<section id="get-started">

View File

@@ -1,6 +1,7 @@
import { type Metadata } from 'next'
import { Mulish } from 'next/font/google'
import clsx from 'clsx'
import SmoothScrollProvider from '@/components/SmoothScrollProvider'
import '@/styles/tailwind.css'
@@ -26,7 +27,7 @@ export default function RootLayout({
}) {
return (
<html lang="en" className={clsx('antialiased', mulish.variable)}>
<body className="bg-black text-white">{children}</body>
<body className="bg-black text-white"><SmoothScrollProvider>{children}</SmoothScrollProvider></body>
</html>
)
}

View File

@@ -9,11 +9,11 @@ export function NavLinks() {
let timeoutRef = useRef<number | null>(null)
return [
['About', '/#stack-section'],
['Network', '/#world-map'],
['Deploy', '/#steps'],
['LLMs', '/#companies'],
['Features', '/#use-cases'],
['About', '/#about'],
['Network', '/#network'],
['Deploy', '/#deploy'],
['LLMs', '/#llms'],
['Features', '/#features'],
['Get Started', '/#get-started'],
].map(([label, href], index) => (
<Link

View File

@@ -0,0 +1,8 @@
'use client'
import { useSmoothScroll } from '@/hooks/use-smooth-scroll';
export default function SmoothScrollProvider({ children }: { children: React.ReactNode }) {
useSmoothScroll();
return <>{children}</>;
}

View File

@@ -0,0 +1,28 @@
import { useEffect } from 'react';
export const useSmoothScroll = () => {
useEffect(() => {
const handleLinkClick = (e: MouseEvent) => {
const target = e.target as HTMLAnchorElement;
const href = target.getAttribute('href');
if (href && href.startsWith('#')) {
e.preventDefault();
const targetId = href.substring(1);
const targetElement = document.getElementById(targetId);
if (targetElement) {
targetElement.scrollIntoView({
behavior: 'smooth',
});
}
}
};
document.addEventListener('click', handleLinkClick);
return () => {
document.removeEventListener('click', handleLinkClick);
};
}, []);
};