Skip to content

Commit bfacef1

Browse files
committed
chore(style): fix nav menu overflow, refactor hero, cleanup
1 parent d4b9ad7 commit bfacef1

File tree

4 files changed

+33
-21
lines changed

4 files changed

+33
-21
lines changed

src/components/HeroSection.tsx

Lines changed: 22 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11

2-
import React, { useEffect, useRef } from "react";
2+
import { useEffect, useRef } from "react";
33
import { Button } from "@/components/ui/button";
44
import { Sun, MoonStar } from "lucide-react";
55
import { 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>

src/components/Navbar.tsx

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -104,16 +104,16 @@ const Navbar = () => {
104104
Products
105105
</NavigationMenuTrigger>
106106
<NavigationMenuContent>
107-
<div className="grid gap-3 p-4 w-[400px]">
107+
<div className="grid gap-3 p-2 w-[160px]">
108108
<NavigationMenuLink asChild>
109109
<Link
110110
to="/solar-panels"
111111
className="block select-none space-y-1 rounded-md p-3 leading-none no-underline outline-none transition-colors hover:bg-accent hover:text-accent-foreground focus:bg-accent focus:text-accent-foreground text-gray-900 dark:text-gray-100"
112112
>
113113
<div className="text-sm font-medium leading-none">Solar Panels</div>
114-
<p className="line-clamp-2 text-sm leading-snug text-gray-600 dark:text-gray-400">
114+
{/* <p className="line-clamp-2 text-sm leading-snug text-gray-600 dark:text-gray-400">
115115
High-efficiency solar panels for clean energy generation
116-
</p>
116+
</p> */}
117117
</Link>
118118
</NavigationMenuLink>
119119
<NavigationMenuLink asChild>
@@ -122,9 +122,9 @@ const Navbar = () => {
122122
className="block select-none space-y-1 rounded-md p-3 leading-none no-underline outline-none transition-colors hover:bg-accent hover:text-accent-foreground focus:bg-accent focus:text-accent-foreground text-gray-900 dark:text-gray-100"
123123
>
124124
<div className="text-sm font-medium leading-none">Hybrid Inverters</div>
125-
<p className="line-clamp-2 text-sm leading-snug text-gray-600 dark:text-gray-400">
125+
{/* <p className="line-clamp-2 text-sm leading-snug text-gray-600 dark:text-gray-400">
126126
Advanced inverters combining solar and battery management
127-
</p>
127+
</p> */}
128128
</Link>
129129
</NavigationMenuLink>
130130
<NavigationMenuLink asChild>
@@ -133,9 +133,9 @@ const Navbar = () => {
133133
className="block select-none space-y-1 rounded-md p-3 leading-none no-underline outline-none transition-colors hover:bg-accent hover:text-accent-foreground focus:bg-accent focus:text-accent-foreground text-gray-900 dark:text-gray-100"
134134
>
135135
<div className="text-sm font-medium leading-none">Battery Storage</div>
136-
<p className="line-clamp-2 text-sm leading-snug text-gray-600 dark:text-gray-400">
136+
{/* <p className="line-clamp-2 text-sm leading-snug text-gray-600 dark:text-gray-400">
137137
Energy storage solutions for maximum efficiency
138-
</p>
138+
</p> */}
139139
</Link>
140140
</NavigationMenuLink>
141141
</div>

src/index.css

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
@import url('https://fonts.googleapis.com/css2?family=Gruppo&display=swap');
12

23
@tailwind base;
34
@tailwind components;

tailwind.config.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,9 @@ export default {
1919
}
2020
},
2121
extend: {
22+
fontFamily: {
23+
'gruppo': ['Gruppo', 'sans-serif'],
24+
},
2225
colors: {
2326
border: 'hsl(var(--border))',
2427
input: 'hsl(var(--input))',

0 commit comments

Comments
 (0)