feat: enhance homepage with smooth scroll navigation

- Added scroll-to-slider functionality when clicking "Get Started" button
- Modified AnimatedSection to support ref forwarding for scroll targeting
- Updated HomeAurora component to accept click handler prop
- Refined homepage hero text and description for clearer value proposition
- Changed button from link to click handler for better user interaction
This commit is contained in:
2025-11-01 21:08:42 +01:00
parent 51ef8dffb5
commit 3564b5cb0f
3 changed files with 22 additions and 10 deletions

View File

@@ -1,4 +1,5 @@
import { motion } from 'framer-motion' import { motion } from 'framer-motion'
import { forwardRef } from 'react'
type AnimatedSectionProps = { type AnimatedSectionProps = {
children: React.ReactNode children: React.ReactNode
@@ -6,9 +7,11 @@ type AnimatedSectionProps = {
className?: string className?: string
} }
export function AnimatedSection({ children, id, className }: AnimatedSectionProps) { export const AnimatedSection = forwardRef<HTMLElement, AnimatedSectionProps>(
({ children, id, className }, ref) => {
return ( return (
<motion.section <motion.section
ref={ref}
id={id} id={id}
className={className} className={className}
initial={{ opacity: 0, y: 40 }} initial={{ opacity: 0, y: 40 }}
@@ -19,4 +22,5 @@ export function AnimatedSection({ children, id, className }: AnimatedSectionProp
{children} {children}
</motion.section> </motion.section>
) )
} },
)

View File

@@ -2,7 +2,7 @@ import { H1, H5 } from "@/components/Texts"
import { Button } from "@/components/Button" import { Button } from "@/components/Button"
export function HomeAurora() { export function HomeAurora({ onGetStartedClick }: { onGetStartedClick: () => void }) {
return ( return (
<div <div
className="relative bg-cover sm:bg-contain bg-right bg-no-repeat" className="relative bg-cover sm:bg-contain bg-right bg-no-repeat"
@@ -16,22 +16,24 @@ export function HomeAurora() {
Anim aute id magna aliqua ad ad non deserunt sunt.{' '} Anim aute id magna aliqua ad ad non deserunt sunt.{' '}
<a href="#" className="font-semibold whitespace-nowrap text-cyan-600"> <a href="#" className="font-semibold whitespace-nowrap text-cyan-600">
<span aria-hidden="true" className="absolute inset-0" /> <span aria-hidden="true" className="absolute inset-0" />
Read more <span aria-hidden="true">&rarr;</span> Read more <span aria-hidden="trwhenue">&rarr;</span>
</a> </a>
</div> </div>
</div> </div>
<H1 className="mt-8"> <H1 className="mt-8">
Full Sovereignty for Cloud, Network & AI. The Sovereign Agentic Cloud
</H1> </H1>
<H5 className="mt-8 text-lg text-gray-600"> <H5 className="mt-8 text-lg text-gray-600">
Build and run mission-critical workloads on distributed compute, encrypted networking, and sovereign AI orchestration without centralized gatekeepers. A global, self-healing network you can join.
Host nodes, deploy workloads, or build private AI systems,
all on infrastructure you own and control.
</H5> </H5>
<div className="mt-10 flex items-center gap-x-6"> <div className="mt-10 flex items-center gap-x-6">
<Button <Button
to="#"
variant="solid" variant="solid"
className="" className=""
color="cyan" color="cyan"
onClick={onGetStartedClick}
> >
Get started Get started
</Button> </Button>

View File

@@ -1,3 +1,4 @@
import { useRef } from 'react'
import { AnimatedSection } from '../../components/AnimatedSection' import { AnimatedSection } from '../../components/AnimatedSection'
import { HomeAurora } from './HomeAurora' import { HomeAurora } from './HomeAurora'
import { StackSectionLight } from './StackSection' import { StackSectionLight } from './StackSection'
@@ -8,10 +9,15 @@ import { HomeSlider } from './HomeSlider'
export default function HomePage() { export default function HomePage() {
const sliderRef = useRef<HTMLDivElement>(null)
const handleScrollToSlider = () => {
sliderRef.current?.scrollIntoView({ behavior: 'smooth' })
}
return ( return (
<div> <div>
<AnimatedSection> <AnimatedSection>
<HomeAurora /> <HomeAurora onGetStartedClick={handleScrollToSlider} />
</AnimatedSection> </AnimatedSection>
<AnimatedSection id="next-section"> <AnimatedSection id="next-section">
@@ -23,7 +29,7 @@ export default function HomePage() {
</AnimatedSection> </AnimatedSection>
<AnimatedSection> <AnimatedSection ref={sliderRef}>
<HomeSlider /> <HomeSlider />
</AnimatedSection> </AnimatedSection>