id
This commit is contained in:
@@ -20,19 +20,19 @@ export default function Home() {
|
|||||||
<section id="home-hero">
|
<section id="home-hero">
|
||||||
<HomeHero />
|
<HomeHero />
|
||||||
</section>
|
</section>
|
||||||
<section id="">
|
<section id="about">
|
||||||
<StackSectionPreview />
|
<StackSectionPreview />
|
||||||
</section>
|
</section>
|
||||||
<section id="world-map">
|
<section id="network">
|
||||||
<WorldMap />
|
<WorldMap />
|
||||||
</section>
|
</section>
|
||||||
<section id="steps">
|
<section id="deploy">
|
||||||
<Steps />
|
<Steps />
|
||||||
</section>
|
</section>
|
||||||
<section id="companies">
|
<section id="llms">
|
||||||
<Companies />
|
<Companies />
|
||||||
</section>
|
</section>
|
||||||
<section id="use-cases">
|
<section id="features">
|
||||||
<UseCases />
|
<UseCases />
|
||||||
</section>
|
</section>
|
||||||
<section id="get-started">
|
<section id="get-started">
|
||||||
|
@@ -1,6 +1,7 @@
|
|||||||
import { type Metadata } from 'next'
|
import { type Metadata } from 'next'
|
||||||
import { Mulish } from 'next/font/google'
|
import { Mulish } from 'next/font/google'
|
||||||
import clsx from 'clsx'
|
import clsx from 'clsx'
|
||||||
|
import SmoothScrollProvider from '@/components/SmoothScrollProvider'
|
||||||
|
|
||||||
import '@/styles/tailwind.css'
|
import '@/styles/tailwind.css'
|
||||||
|
|
||||||
@@ -26,7 +27,7 @@ export default function RootLayout({
|
|||||||
}) {
|
}) {
|
||||||
return (
|
return (
|
||||||
<html lang="en" className={clsx('antialiased', mulish.variable)}>
|
<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>
|
</html>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
@@ -9,11 +9,11 @@ export function NavLinks() {
|
|||||||
let timeoutRef = useRef<number | null>(null)
|
let timeoutRef = useRef<number | null>(null)
|
||||||
|
|
||||||
return [
|
return [
|
||||||
['About', '/#stack-section'],
|
['About', '/#about'],
|
||||||
['Network', '/#world-map'],
|
['Network', '/#network'],
|
||||||
['Deploy', '/#steps'],
|
['Deploy', '/#deploy'],
|
||||||
['LLMs', '/#companies'],
|
['LLMs', '/#llms'],
|
||||||
['Features', '/#use-cases'],
|
['Features', '/#features'],
|
||||||
['Get Started', '/#get-started'],
|
['Get Started', '/#get-started'],
|
||||||
].map(([label, href], index) => (
|
].map(([label, href], index) => (
|
||||||
<Link
|
<Link
|
||||||
|
8
src/components/SmoothScrollProvider.tsx
Normal file
8
src/components/SmoothScrollProvider.tsx
Normal 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}</>;
|
||||||
|
}
|
28
src/hooks/use-smooth-scroll.ts
Normal file
28
src/hooks/use-smooth-scroll.ts
Normal 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);
|
||||||
|
};
|
||||||
|
}, []);
|
||||||
|
};
|
Reference in New Issue
Block a user