11
2- import React , { useEffect , useRef } from "react" ;
2+ import { useEffect , useRef } from "react" ;
33import { Button } from "@/components/ui/button" ;
44import { Sun , MoonStar } from "lucide-react" ;
55import { useTheme } from "@/contexts/ThemeContext" ;
@@ -16,21 +16,26 @@ const HeroSection = () => {
1616 }
1717 } , [ ] ) ;
1818
19- const scrollToNextSection = ( ) => {
20- const nextSection = document . getElementById ( 'calculator' ) ;
21- if ( nextSection ) {
22- const offsetTop = nextSection . offsetTop - 64 ; // 64px extra padding
19+ const scrollToCalculator = ( ) => {
20+ const calculator = document . getElementById ( 'calculator' ) ;
21+ if ( calculator ) {
2322 window . scrollTo ( {
24- top : offsetTop ,
23+ top : calculator . offsetTop - 64 ,
2524 behavior : 'smooth'
2625 } ) ;
27- // Update URL hash
2826 window . history . replaceState ( null , '' , '#calculator' ) ;
2927 }
3028 } ;
3129
32- const navigateToSolarPanels = ( ) => {
33- navigate ( '/solar-panels' ) ;
30+ const scrollToContact = ( ) => {
31+ const contact = document . getElementById ( 'contact' ) ;
32+ if ( contact ) {
33+ window . scrollTo ( {
34+ top : contact . offsetTop - 64 ,
35+ behavior : 'smooth'
36+ } ) ;
37+ window . history . replaceState ( null , '' , '#contact' ) ;
38+ }
3439 } ;
3540
3641 return (
@@ -57,25 +62,28 @@ const HeroSection = () => {
5762 < div className = "container mx-auto px-4 z-10" >
5863 < div className = "grid md:grid-cols-2 gap-8 items-center" >
5964 < div className = "text-white transform transition-all duration-1000 fade-in" >
60- < h1 className = "text-4xl md:text-5xl lg:text-6xl font-bold mb-6" >
65+ < h2 className = "text-2xl md:text-2xl lg:text-4xl font-bold mb-6" >
6166 Harness the Power of the Sun
67+ </ h2 >
68+ < h1 className = "text-5xl md:text-5xl lg:text-8xl font-thin font-gruppo mb-4" >
69+ SOLV< span className = "text-4xl md:text-4xl lg:text-7xl font-sans font-light" > Ξ</ span > NERGY
6270 </ h1 >
6371 < p className = "text-lg md:text-xl mb-8 text-gray-100" >
64- Your trusted local retailer for premium solar panels, hybrid inverters, and battery solutions. Visit our store to power your home sustainably .
72+ Premium solar panels, hybrid inverters, and battery solutions.
6573 </ p >
6674 < div className = "flex flex-col sm:flex-row gap-4" >
6775 < Button
68- onClick = { scrollToNextSection }
76+ onClick = { scrollToCalculator }
6977 className = { `${ theme === 'dark' ? 'bg-blue-500 hover:bg-blue-600 text-white' : 'bg-solar-gold hover:bg-opacity-90 text-solar-blue hover:bg-white' } font-medium text-lg px-6 py-6 transition-transform hover:scale-105 duration-300` }
7078 >
7179 Estimate
7280 </ Button >
7381 < Button
74- onClick = { navigateToSolarPanels }
82+ onClick = { scrollToContact }
7583 variant = "outline"
7684 className = { `${ theme === 'dark' ? 'border-blue-400 text-white bg-transparent hover:bg-blue-900' : 'border-white text-white bg-solar-blue hover:bg-white hover:text-solar-blue' } font-medium text-lg px-6 py-6 transition-transform hover:scale-105 duration-300` }
7785 >
78- Products
86+ Contact
7987 </ Button >
8088 </ div >
8189 </ div >
0 commit comments