-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
804 lines (746 loc) · 42.5 KB
/
index.html
File metadata and controls
804 lines (746 loc) · 42.5 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
<!doctype html>
<html lang="en" class="scroll-smooth">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Solar Energy Solutions</title>
<meta name="description" content="Modern solar panels and batteries. One-page responsive React site with Tailwind CSS." />
<!-- Tailwind CSS (CDN) -->
<script src="https://cdn.tailwindcss.com"></script>
<script>
tailwind.config = {
theme: {
extend: {
fontFamily: {
sans: ["Inter", "system-ui", "-apple-system", "Segoe UI", "Roboto", "Arial", "sans-serif"],
},
colors: {
brand: {
DEFAULT: "#22c55e",
dark: "#166534",
},
},
boxShadow: {
glow: "0 10px 30px -10px rgba(34,197,94,0.35)",
},
},
},
};
</script>
<!-- Google Fonts (Inter) -->
<link rel="preconnect" href="https://fonts.googleapis.com" />
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
<link href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap" rel="stylesheet" />
<style>
/* Decorative background */
.bg-grid {
background-image:
radial-gradient(ellipse at top left, rgba(34,197,94,0.08), transparent 40%),
radial-gradient(ellipse at bottom right, rgba(59,130,246,0.08), transparent 40%);
}
</style>
</head>
<body class="font-sans antialiased text-slate-800 bg-slate-50">
<div id="root"></div>
<!-- React 18 + Babel (CDN) -->
<script src="https://unpkg.com/react@18/umd/react.development.js" crossorigin></script>
<script src="https://unpkg.com/react-dom@18/umd/react-dom.development.js" crossorigin></script>
<script src="https://unpkg.com/@babel/standalone/babel.min.js"></script>
<script type="text/babel">
const { useMemo } = React;
const WHATSAPP_PHONE = "+2348024411052"; // You can include + or spaces; we will sanitize below
const WA_PHONE = String(WHATSAPP_PHONE).replace(/\D/g, "");
function classNames(...classes) {
return classes.filter(Boolean).join(" ");
}
function Navbar() {
return (
<header className="fixed inset-x-0 top-0 z-50">
<nav className="mx-auto max-w-7xl px-4 sm:px-6 lg:px-8">
<div className="mt-3 mb-3 flex items-center justify-between rounded-2xl bg-white/70 px-4 py-3 shadow-lg ring-1 ring-black/5 backdrop-blur supports-[backdrop-filter]:bg-white/50">
<a href="#products" className="flex items-center gap-2">
<span className="inline-flex h-9 w-9 items-center justify-center rounded-xl bg-brand text-white shadow-glow">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor" className="h-5 w-5">
<path d="M12 3l9 6-9 6-9-6 9-6zm0 8.485l6.727-4.485L12 2.515 5.273 7 12 11.485z"></path>
<path d="M3 13.5l9 6 9-6" opacity=".4"></path>
</svg>
</span>
<span className="text-base font-semibold tracking-tight text-slate-900">Solar Energy</span>
</a>
<div className="hidden gap-6 md:flex">
<a href="#products" className="text-sm font-medium text-slate-700 hover:text-brand">Home</a>
<a href="#about" className="text-sm font-medium text-slate-700 hover:text-brand">About</a>
<a href="#quote" className="text-sm font-medium text-slate-700 hover:text-brand">Get Quote</a>
<a href="#contact" className="text-sm font-medium text-slate-700 hover:text-brand">Contact</a>
</div>
<div className="md:hidden">
<a href="#contact" className="inline-flex items-center gap-2 rounded-xl bg-brand px-3 py-2 text-sm font-semibold text-white shadow-glow hover:bg-emerald-500 focus:outline-none focus:ring-2 focus:ring-brand/30">Get in touch</a>
</div>
</div>
</nav>
</header>
);
}
function Hero() {
return (
<section id="home" className="bg-grid pt-28">
<div className="mx-auto max-w-7xl px-4 sm:px-6 lg:px-8">
<div className="relative isolate overflow-hidden rounded-3xl bg-white px-6 py-16 shadow-xl ring-1 ring-black/5 sm:px-12">
<div className="mx-auto max-w-2xl text-center">
<h1 className="text-3xl font-bold tracking-tight text-slate-900 sm:text-4xl">Power your home with clean energy</h1>
<p className="mt-3 text-base leading-7 text-slate-600">Explore high-efficiency solar panels and reliable batteries for every installation size. Sustainable, scalable, and built to last.</p>
<div className="mt-6 flex items-center justify-center gap-3">
<a href="#products" className="inline-flex items-center rounded-xl bg-brand px-4 py-2.5 text-sm font-semibold text-white shadow-glow hover:bg-emerald-500">Browse Products</a>
<a href="#why" className="inline-flex items-center rounded-xl border border-slate-200 bg-white px-4 py-2.5 text-sm font-semibold text-slate-700 hover:border-slate-300">Why Solar?</a>
</div>
</div>
<div className="pointer-events-none absolute -left-10 -top-10 h-56 w-56 rounded-full bg-emerald-200/40 blur-3xl"></div>
<div className="pointer-events-none absolute -bottom-12 -right-10 h-64 w-64 rounded-full bg-sky-200/40 blur-3xl"></div>
</div>
</div>
</section>
);
}
function WhySolar() {
return (
<section id="why" className="py-16 sm:py-20">
<div className="mx-auto max-w-6xl px-4 sm:px-6 lg:px-8">
<div className="mx-auto max-w-3xl text-center">
<h2 className="text-2xl font-bold tracking-tight text-slate-900 sm:text-3xl">Why choose solar energy?</h2>
<p className="mt-3 text-base leading-7 text-slate-700">
Solar gives you clean, reliable power while reducing electricity bills and protecting against outages.
It is a long‑term investment that increases your energy independence and reduces your carbon footprint.
</p>
</div>
<div className="mt-10 grid gap-6 sm:grid-cols-2 lg:grid-cols-3">
<div className="rounded-2xl border border-slate-200 bg-white p-6 shadow-sm">
<div className="inline-flex h-10 w-10 items-center justify-center rounded-xl bg-emerald-100 text-emerald-700">$</div>
<h3 className="mt-4 text-base font-semibold text-slate-900">Lower bills</h3>
<p className="mt-1 text-sm text-slate-600">Generate your own electricity and offset grid usage for decades.</p>
</div>
<div className="rounded-2xl border border-slate-200 bg-white p-6 shadow-sm">
<div className="inline-flex h-10 w-10 items-center justify-center rounded-xl bg-sky-100 text-sky-700">⚡</div>
<h3 className="mt-4 text-base font-semibold text-slate-900">Backup power</h3>
<p className="mt-1 text-sm text-slate-600">Pair with batteries to keep essentials on during grid outages.</p>
</div>
<div className="rounded-2xl border border-slate-200 bg-white p-6 shadow-sm">
<div className="inline-flex h-10 w-10 items-center justify-center rounded-xl bg-amber-100 text-amber-700">☀️</div>
<h3 className="mt-4 text-base font-semibold text-slate-900">Clean energy</h3>
<p className="mt-1 text-sm text-slate-600">Reduce emissions and support a sustainable energy future.</p>
</div>
</div>
<div className="mt-10 grid gap-6 rounded-3xl border border-slate-200 bg-slate-50 p-6 sm:grid-cols-3">
<div className="text-center">
<div className="text-3xl font-bold text-slate-900">25+ yrs</div>
<div className="mt-1 text-xs uppercase tracking-wide text-slate-500">Typical panel lifespan</div>
</div>
<div className="text-center">
<div className="text-3xl font-bold text-slate-900">60–90%</div>
<div className="mt-1 text-xs uppercase tracking-wide text-slate-500">Bill reduction (with storage)</div>
</div>
<div className="text-center">
<div className="text-3xl font-bold text-slate-900">24/7</div>
<div className="mt-1 text-xs uppercase tracking-wide text-slate-500">Power for essentials</div>
</div>
</div>
<div className="mt-8 flex flex-col items-center justify-center gap-3 sm:flex-row">
<a href="#products" className="inline-flex items-center rounded-xl bg-brand px-4 py-2.5 text-sm font-semibold text-white shadow-glow hover:bg-emerald-600">
Explore products
</a>
<a href="#contact" className="inline-flex items-center rounded-xl border border-slate-200 bg-white px-4 py-2.5 text-sm font-semibold text-slate-700 hover:border-slate-300">
Talk to an expert
</a>
</div>
</div>
</section>
);
}
function ProductCard({ title, image, specs, description }) {
const message = useMemo(() => {
return encodeURIComponent(
`Hello! I'm interested in the ${title}. Could you share more details about availability and installation?`
);
}, [title]);
const whatsappUrl = `https://wa.me/${WA_PHONE}?text=${message}`;
const placeholderSvg =
'data:image/svg+xml;utf8,' +
encodeURIComponent(`
<svg xmlns="http://www.w3.org/2000/svg" width="800" height="600" viewBox="0 0 800 600">
<defs>
<linearGradient id="g" x1="0" x2="1">
<stop offset="0%" stop-color="#e2e8f0"/>
<stop offset="100%" stop-color="#cbd5e1"/>
</linearGradient>
</defs>
<rect width="800" height="600" fill="url(#g)"/>
<g fill="#94a3b8">
<rect x="160" y="140" width="480" height="320" rx="12" ry="12" fill="#f1f5f9" stroke="#cbd5e1"/>
<rect x="190" y="170" width="140" height="90" rx="6"/>
<rect x="350" y="170" width="140" height="90" rx="6"/>
<rect x="510" y="170" width="100" height="90" rx="6"/>
<rect x="190" y="270" width="140" height="90" rx="6"/>
<rect x="350" y="270" width="140" height="90" rx="6"/>
<rect x="510" y="270" width="100" height="90" rx="6"/>
</g>
</svg>
`);
const imageCandidates = React.useMemo(() => {
const candidates = new Set([image]);
const withoutDot = image.replace(/^\.\//, '');
candidates.add(withoutDot);
if (!image.startsWith('img/') && !image.startsWith('./img/')) {
candidates.add(`img/${withoutDot}`);
candidates.add(`./img/${withoutDot}`);
}
const exts = ['jpg', 'jpeg', 'png', 'webp'];
const match = withoutDot.match(/^(.*)\.(\w+)$/);
if (match) {
const base = match[1];
exts.forEach((ext) => {
candidates.add(`${base}.${ext}`);
candidates.add(`img/${base}.${ext}`);
candidates.add(`./img/${base}.${ext}`);
});
}
return Array.from(candidates);
}, [image]);
const [currentIndex, setCurrentIndex] = React.useState(0);
const [currentSrc, setCurrentSrc] = React.useState(imageCandidates[0]);
React.useEffect(() => {
setCurrentIndex(0);
setCurrentSrc(imageCandidates[0]);
}, [imageCandidates]);
function handleImageError() {
const nextIndex = currentIndex + 1;
if (nextIndex < imageCandidates.length) {
setCurrentIndex(nextIndex);
setCurrentSrc(imageCandidates[nextIndex]);
} else {
if (currentSrc !== placeholderSvg) {
console.warn(`Image not found for product "${title}". Tried:`, imageCandidates);
}
setCurrentSrc(placeholderSvg);
}
}
return (
<div className="group flex h-full flex-col overflow-hidden rounded-2xl border border-slate-200 bg-white shadow-sm transition hover:-translate-y-0.5 hover:shadow-md">
<div className="relative aspect-[4/3] w-full overflow-hidden bg-slate-100">
<img src={currentSrc} onError={handleImageError} alt={title} loading="lazy" className="h-full w-full object-cover transition duration-300 group-hover:scale-[1.03]" />
<div className="pointer-events-none absolute inset-0 bg-gradient-to-t from-slate-900/10 to-transparent"></div>
</div>
<div className="flex flex-1 flex-col p-5">
<h3 className="text-lg font-semibold text-slate-900">{title}</h3>
<p className="mt-1 text-sm text-slate-600">{specs}</p>
<p className="mt-3 flex-1 text-sm leading-6 text-slate-700">{description}</p>
<div className="mt-5">
<a
href={whatsappUrl}
target="_blank"
rel="noopener noreferrer"
className="inline-flex w-full items-center justify-center gap-2 rounded-xl bg-emerald-500 px-4 py-2.5 text-sm font-semibold text-white shadow-glow transition hover:bg-emerald-600 focus:outline-none focus:ring-2 focus:ring-emerald-300/60"
>
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor" className="h-4 w-4">
<path d="M20.52 3.48A11.86 11.86 0 0012 0a11.99 11.99 0 00-10 18.63L0 24l5.48-1.99A11.98 11.98 0 0012 24c6.63 0 12-5.37 12-12 0-3.19-1.24-6.19-3.48-8.52zM12 21.6c-1.9 0-3.7-.5-5.28-1.48l-.38-.23-3.13 1.14 1.14-3.13-.23-.38A9.59 9.59 0 012.4 12 9.6 9.6 0 1112 21.6zm5.55-7.19c-.3-.15-1.77-.87-2.04-.97-.27-.1-.46-.15-.66.15-.2.3-.76.97-.93 1.17-.17.2-.34.22-.63.07-.3-.15-1.27-.47-2.42-1.5-.89-.79-1.48-1.77-1.66-2.07-.17-.3-.02-.46.13-.61.13-.13.3-.34.45-.51.15-.17.2-.3.3-.5.1-.2.05-.37-.02-.52-.07-.15-.66-1.59-.9-2.17-.24-.58-.48-.5-.66-.5-.17 0-.37-.02-.56-.02-.2 0-.52.08-.8.37-.27.3-1.04 1.02-1.04 2.48s1.07 2.88 1.22 3.08c.15.2 2.1 3.2 5.08 4.49.71.31 1.27.5 1.7.64.71.23 1.36.2 1.87.12.57-.08 1.77-.72 2.02-1.42.25-.7.25-1.3.17-1.42-.07-.12-.27-.2-.57-.35z" />
</svg>
Message on WhatsApp
</a>
</div>
</div>
</div>
);
}
function Products() {
const products = [
{
title: "Monocrystalline Solar Panel 550W",
specs: "High efficiency PERC cells, 144 half-cut cells, 21.3% module efficiency",
description:
"Reliable power output with excellent low‑light performance and robust aluminum frame for harsh weather.",
image:
"./img/400-Watt-Monocrystalline-Solar-Panel.jpeg",
},
{
title: "Polycrystalline Solar Panel 320W",
specs: "Durable design, anti‑PID, tempered glass, ideal for residential roofs",
description:
"Balanced performance and value. Optimized for real‑world conditions with reliable output over time.",
image:
"./img/polycrystalline-solar-panel.jpg",
},
{
title: "Lithium Iron Phosphate Battery 5kWh",
specs: "LiFePO₄ cells, 6000+ cycles @ 80% DoD, wall‑mount cabinet",
description:
"High safety and long cycle life. Seamless integration with hybrid inverters for home backup.",
image:
"./img/Solar Batteries 1.jpg",
},
{
title: "Rack‑Mount LiFePO₄ Battery 10kWh",
specs: "48V server‑rack module, smart BMS, CAN/RS485",
description:
"Scalable energy storage for small commercial sites and larger homes. Modular and serviceable.",
image:
"./img/Solar Batteries 2.jpg",
},
];
return (
<section id="products" className="py-16 sm:py-20">
<div className="mx-auto max-w-7xl px-4 sm:px-6 lg:px-8">
<div className="mb-8 flex items-end justify-between">
<div>
<h2 className="text-2xl font-bold tracking-tight text-slate-900 sm:text-3xl">Products</h2>
<p className="mt-2 text-sm text-slate-600">Solar panels and batteries built for performance. Click a product to message the seller on WhatsApp.</p>
</div>
</div>
<div className="grid gap-6 sm:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4">
{products.map((p) => (
<ProductCard key={p.title} {...p} />
))}
</div>
</div>
</section>
);
}
function About() {
return (
<section id="about" className="bg-white py-16 sm:py-20">
<div className="mx-auto max-w-5xl px-4 sm:px-6 lg:px-8">
<div className="rounded-3xl border border-slate-200 bg-slate-50 p-8 sm:p-12">
<h2 className="text-2xl font-bold tracking-tight text-slate-900 sm:text-3xl">About</h2>
<p className="mt-4 text-base leading-7 text-slate-700">
We provide high‑quality solar components and support for clean energy projects. Our selection focuses on
efficiency, durability, and safety—so your system delivers reliable power year after year. Whether you are
upgrading a home, adding backup power, or planning a larger installation, we can help you choose the right
components and get started quickly.
</p>
<ul className="mt-6 grid gap-4 sm:grid-cols-3">
<li className="flex items-center gap-3">
<span className="inline-flex h-8 w-8 items-center justify-center rounded-lg bg-emerald-100 text-emerald-700">
✓
</span>
<span className="text-sm font-medium text-slate-800">Quality‑first components</span>
</li>
<li className="flex items-center gap-3">
<span className="inline-flex h-8 w-8 items-center justify-center rounded-lg bg-emerald-100 text-emerald-700">
✓
</span>
<span className="text-sm font-medium text-slate-800">Expert guidance</span>
</li>
<li className="flex items-center gap-3">
<span className="inline-flex h-8 w-8 items-center justify-center rounded-lg bg-emerald-100 text-emerald-700">
✓
</span>
<span className="text-sm font-medium text-slate-800">Fast response on WhatsApp</span>
</li>
</ul>
</div>
</div>
</section>
);
}
function QuoteForm() {
const [formData, setFormData] = React.useState({
"What do you want to power?": "",
"How many hours do you get daily?": "",
"How many hours of backup do you need?": "",
"Do you use a generator?": "",
"How many liters of diesel or fuel do you use weekly?": "",
"First Name": "",
"Surname": "",
"WhatsApp/Phone Number": "",
"Email Address": "",
"Name of Business / Employer": "",
"Monthly Revenue / Income": "",
"State / Province": "",
});
const [errors, setErrors] = React.useState({});
const [isValid, setIsValid] = React.useState(false);
const [isSubmitting, setIsSubmitting] = React.useState(false);
const handleChange = (e) => {
const { name, value } = e.target;
setFormData((prev) => ({ ...prev, [name]: value }));
};
const validate = () => {
let newErrors = {};
// Required fields check (all except weekly fuel liters)
Object.entries(formData).forEach(([key, value]) => {
if (!value && key !== "How many liters of diesel or fuel do you use weekly?") {
newErrors[key] = "This field is required";
}
});
// Daily hours <= 24
if (formData["How many hours do you get daily?"] && Number(formData["How many hours do you get daily?"]) > 24) {
newErrors["How many hours do you get daily?"] = "Daily hours cannot exceed 24";
}
return newErrors;
};
// Auto-validate when formData changes
React.useEffect(() => {
const newErrors = validate();
setErrors(newErrors);
setIsValid(Object.keys(newErrors).length === 0);
}, [formData]);
const handleSubmit = async (e) => {
e.preventDefault();
const newErrors = validate();
if (Object.keys(newErrors).length > 0) {
setErrors(newErrors);
return;
}
setIsSubmitting(true);
setErrors({});
try {
// Send form with Formspree
const response = await fetch("https://formspree.io/f/mgvlvjzo", {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify(formData),
});
if (response.ok) {
alert("Quote request submitted successfully! We'll get back to you soon.");
setFormData({
"What do you want to power?": "",
"How many hours do you get daily?": "",
"How many hours of backup do you need?": "",
"Do you use a generator?": "",
"How many liters of diesel or fuel do you use weekly?": "",
"First Name": "",
"Surname": "",
"WhatsApp/Phone Number": "",
"Email Address": "",
"Name of Business / Employer": "",
"Monthly Revenue / Income": "",
"State / Province": "",
});
} else {
throw new Error("Submission failed");
}
} catch (error) {
alert("Error submitting form. Please try again or contact us directly.");
} finally {
setIsSubmitting(false);
}
};
return (
<section id="quote" className="py-12 sm:py-16 bg-slate-50">
<div className="mx-auto max-w-4xl px-4 sm:px-6 lg:px-8">
<div className="rounded-3xl border border-slate-200 bg-white p-8 sm:p-12 shadow-sm">
<div className="text-center mb-8">
<h2 className="text-2xl font-bold tracking-tight text-slate-900 sm:text-3xl">Get Your Custom Quote</h2>
<p className="mt-4 text-base leading-7 text-slate-700">
Tell us about your energy needs and we'll provide a personalized solar solution quote.
</p>
</div>
<form onSubmit={handleSubmit} className="space-y-6">
<div className="grid gap-6 sm:grid-cols-2">
{/* Power */}
<div>
<label className="block text-sm font-medium text-slate-700 mb-2">What do you want to power? *</label>
<select
name="What do you want to power?"
value={formData["What do you want to power?"]}
onChange={handleChange}
className={`w-full rounded-xl border px-4 py-3 text-sm transition focus:outline-none focus:ring-2 focus:ring-brand/30 ${
errors["What do you want to power?"] ? "border-red-300" : "border-slate-200 focus:border-brand"
}`}
>
<option value="">Select</option>
<option value="Home">Home</option>
<option value="Business">Business</option>
</select>
{errors["What do you want to power?"] && <p className="mt-1 text-sm text-red-600">{errors["What do you want to power?"]}</p>}
</div>
{/* Daily hours */}
<div>
<label className="block text-sm font-medium text-slate-700 mb-2">How many hours do you get daily? *</label>
<input
type="number"
name="How many hours do you get daily?"
value={formData["How many hours do you get daily?"]}
onChange={handleChange}
className={`w-full rounded-xl border px-4 py-3 text-sm transition focus:outline-none focus:ring-2 focus:ring-brand/30 ${
errors["How many hours do you get daily?"] ? "border-red-300" : "border-slate-200 focus:border-brand"
}`}
min="0"
max="24"
/>
{errors["How many hours do you get daily?"] && <p className="mt-1 text-sm text-red-600">{errors["How many hours do you get daily?"]}</p>}
</div>
{/* Backup hours */}
<div>
<label className="block text-sm font-medium text-slate-700 mb-2">How many hours of backup do you need? *</label>
<input
type="number"
name="How many hours of backup do you need?"
value={formData["How many hours of backup do you need?"]}
onChange={handleChange}
className={`w-full rounded-xl border px-4 py-3 text-sm transition focus:outline-none focus:ring-2 focus:ring-brand/30 ${
errors["How many hours of backup do you need?"] ? "border-red-300" : "border-slate-200 focus:border-brand"
}`}
min="0"
/>
{errors["How many hours of backup do you need?"] && <p className="mt-1 text-sm text-red-600">{errors["How many hours of backup do you need?"]}</p>}
</div>
{/* Generator */}
<div>
<label className="block text-sm font-medium text-slate-700 mb-2">Do you use a generator? *</label>
<select
name="Do you use a generator?"
value={formData["Do you use a generator?"]}
onChange={handleChange}
className={`w-full rounded-xl border px-4 py-3 text-sm transition focus:outline-none focus:ring-2 focus:ring-brand/30 ${
errors["Do you use a generator?"] ? "border-red-300" : "border-slate-200 focus:border-brand"
}`}
>
<option value="">Select</option>
<option value="Yes, a diesel or petrol one">Yes, a diesel or petrol one</option>
<option value="No, I do not own or use a generator">No, I do not own or use a generator</option>
</select>
{errors["Do you use a generator?"] && <p className="mt-1 text-sm text-red-600">{errors["Do you use a generator?"]}</p>}
</div>
{/* Weekly liters */}
<div>
<label className="block text-sm font-medium text-slate-700 mb-2">
How many liters of diesel or fuel do you use weekly?
</label>
<input
type="number"
name="How many liters of diesel or fuel do you use weekly?"
value={formData["How many liters of diesel or fuel do you use weekly?"]}
onChange={handleChange}
className="w-full rounded-xl border border-slate-200 px-4 py-3 text-sm transition focus:outline-none focus:ring-2 focus:ring-brand/30 focus:border-brand"
min="0"
/>
</div>
{/* State */}
<div>
<label className="block text-sm font-medium text-slate-700 mb-2">State / Province *</label>
<input
type="text"
name="State / Province"
value={formData["State / Province"]}
onChange={handleChange}
className={`w-full rounded-xl border px-4 py-3 text-sm transition focus:outline-none focus:ring-2 focus:ring-brand/30 ${
errors["State / Province"] ? "border-red-300" : "border-slate-200 focus:border-brand"
}`}
/>
{errors["State / Province"] && <p className="mt-1 text-sm text-red-600">{errors["State / Province"]}</p>}
</div>
</div>
<div className="border-t border-slate-200 pt-6">
<h3 className="text-lg font-semibold text-slate-900 mb-4">Personal Information</h3>
<div className="grid gap-6 sm:grid-cols-2">
{/* First Name */}
<div>
<label className="block text-sm font-medium text-slate-700 mb-2">First Name *</label>
<input
type="text"
name="First Name"
value={formData["First Name"]}
onChange={handleChange}
className={`w-full rounded-xl border px-4 py-3 text-sm transition focus:outline-none focus:ring-2 focus:ring-brand/30 ${
errors["First Name"] ? "border-red-300" : "border-slate-200 focus:border-brand"
}`}
/>
{errors["First Name"] && <p className="mt-1 text-sm text-red-600">{errors["First Name"]}</p>}
</div>
{/* Surname */}
<div>
<label className="block text-sm font-medium text-slate-700 mb-2">Surname *</label>
<input
type="text"
name="Surname"
value={formData["Surname"]}
onChange={handleChange}
className={`w-full rounded-xl border px-4 py-3 text-sm transition focus:outline-none focus:ring-2 focus:ring-brand/30 ${
errors["Surname"] ? "border-red-300" : "border-slate-200 focus:border-brand"
}`}
/>
{errors["Surname"] && <p className="mt-1 text-sm text-red-600">{errors["Surname"]}</p>}
</div>
{/* Phone Number */}
<div>
<label className="block text-sm font-medium text-slate-700 mb-2">WhatsApp/Phone Number *</label>
<input
type="tel"
name="WhatsApp/Phone Number"
value={formData["WhatsApp/Phone Number"]}
onChange={handleChange}
className={`w-full rounded-xl border px-4 py-3 text-sm transition focus:outline-none focus:ring-2 focus:ring-brand/30 ${
errors["WhatsApp/Phone Number"] ? "border-red-300" : "border-slate-200 focus:border-brand"
}`}
/>
{errors["WhatsApp/Phone Number"] && <p className="mt-1 text-sm text-red-600">{errors["WhatsApp/Phone Number"]}</p>}
</div>
{/* Email */}
<div>
<label className="block text-sm font-medium text-slate-700 mb-2">Email Address *</label>
<input
type="email"
name="Email Address"
value={formData["Email Address"]}
onChange={handleChange}
className={`w-full rounded-xl border px-4 py-3 text-sm transition focus:outline-none focus:ring-2 focus:ring-brand/30 ${
errors["Email Address"] ? "border-red-300" : "border-slate-200 focus:border-brand"
}`}
/>
{errors["Email Address"] && <p className="mt-1 text-sm text-red-600">{errors["Email Address"]}</p>}
</div>
{/* Employer */}
<div>
<label className="block text-sm font-medium text-slate-700 mb-2">Name of Business / Employer *</label>
<input
type="text"
name="Name of Business / Employer"
value={formData["Name of Business / Employer"]}
onChange={handleChange}
className={`w-full rounded-xl border px-4 py-3 text-sm transition focus:outline-none focus:ring-2 focus:ring-brand/30 ${
errors["Name of Business / Employer"] ? "border-red-300" : "border-slate-200 focus:border-brand"
}`}
/>
{errors["Name of Business / Employer"] && <p className="mt-1 text-sm text-red-600">{errors["Name of Business / Employer"]}</p>}
</div>
{/* Revenue */}
<div>
<label className="block text-sm font-medium text-slate-700 mb-2">Enter Your Monthly Revenue / Income *</label>
<input
type="number"
name="Monthly Revenue / Income"
value={formData["Monthly Revenue / Income"]}
onChange={handleChange}
className={`w-full rounded-xl border px-4 py-3 text-sm transition focus:outline-none focus:ring-2 focus:ring-brand/30 ${
errors["Monthly Revenue / Income"] ? "border-red-300" : "border-slate-200 focus:border-brand"
}`}
min="0"
/>
{errors["Monthly Revenue / Income"] && <p className="mt-1 text-sm text-red-600">{errors["Monthly Revenue / Income"]}</p>}
</div>
</div>
</div>
{/* Submit */}
<div className="flex justify-center pt-4">
<button
type="submit"
disabled={!isValid || isSubmitting}
className={`inline-flex items-center justify-center gap-2 rounded-xl px-6 py-3 text-sm font-semibold text-white shadow-glow transition focus:outline-none focus:ring-2 focus:ring-brand/30 ${
isValid && !isSubmitting
? "bg-brand hover:bg-emerald-600"
: "bg-slate-400 cursor-not-allowed"
}`}
>
{isSubmitting ? (
<>
<svg className="animate-spin h-4 w-4" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24">
<circle className="opacity-25" cx="12" cy="12" r="10" stroke="currentColor" strokeWidth="4"></circle>
<path className="opacity-75" fill="currentColor" d="M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"></path>
</svg>
Submitting...
</>
) : (
"Request Quote Now"
)}
</button>
</div>
</form>
</div>
</div>
</section>
);
}
function Contact() {
const generalMessage = encodeURIComponent("Hello! I'd like to learn more about your solar products and installation options.");
const link = `https://wa.me/${WA_PHONE}?text=${generalMessage}`;
return (
<section id="contact" className="py-12 sm:py-16">
<div className="mx-auto max-w-5xl px-4 sm:px-6 lg:px-8">
<div className="rounded-3xl border border-slate-200 bg-white p-8 sm:p-12 shadow-sm">
<h2 className="text-2xl font-bold tracking-tight text-slate-900 sm:text-3xl">Contact</h2>
<p className="mt-4 text-base leading-7 text-slate-700">
Have a question or need a custom quote? Send a message and we will get back to you shortly.
</p>
<div className="mt-6 flex flex-col gap-3 sm:flex-row">
<a
href={link}
target="_blank"
rel="noopener noreferrer"
className="inline-flex items-center justify-center gap-2 rounded-xl bg-emerald-500 px-4 py-2.5 text-sm font-semibold text-white shadow-glow transition hover:bg-emerald-600 focus:outline-none focus:ring-2 focus:ring-emerald-300/60"
>
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor" className="h-4 w-4">
<path d="M20.52 3.48A11.86 11.86 0 0012 0a11.99 11.99 0 00-10 18.63L0 24l5.48-1.99A11.98 11.98 0 0012 24c6.63 0 12-5.37 12-12 0-3.19-1.24-6.19-3.48-8.52zM12 21.6c-1.9 0-3.7-.5-5.28-1.48l-.38-.23-3.13 1.14 1.14-3.13-.23-.38A9.59 9.59 0 012.4 12 9.6 9.6 0 1112 21.6zm5.55-7.19c-.3-.15-1.77-.87-2.04-.97-.27-.1-.46-.15-.66.15-.2.3-.76.97-.93 1.17-.17.2-.34.22-.63.07-.3-.15-1.27-.47-2.42-1.5-.89-.79-1.48-1.77-1.66-2.07-.17-.3-.02-.46.13-.61.13-.13.3-.34.45-.51.15-.17.2-.3.3-.5.1-.2.05-.37-.02-.52-.07-.15-.66-1.59-.9-2.17-.24-.58-.48-.5-.66-.5-.17 0-.37-.02-.56-.02-.2 0-.52.08-.8.37-.27.3-1.04 1.02-1.04 2.48s1.07 2.88 1.22 3.08c.15.2 2.1 3.2 5.08 4.49.71.31 1.27.5 1.7.64.71.23 1.36.2 1.87.12.57-.08 1.77-.72 2.02-1.42.25-.7.25-1.3.17-1.42-.07-.12-.27-.2-.57-.35z" />
</svg>
WhatsApp Us
</a>
<a
href="mailto:4ngelsltd@gmail.com"
className="inline-flex items-center justify-center gap-2 rounded-xl border border-slate-200 bg-white px-4 py-2.5 text-sm font-semibold text-slate-700 transition hover:border-slate-300"
>
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor" className="h-4 w-4">
<path d="M12 13.065L0 6V4l12 7 12-7v2z"></path>
<path d="M0 6v14h24V6l-12 7L0 6z" opacity=".5"></path>
</svg>
Email
</a>
</div>
</div>
</div>
</section>
);
}
function FloatingWhatsApp() {
const generalMessage = encodeURIComponent("Hello! I'd like to learn more about your solar products and installation options.");
const link = `https://wa.me/${WA_PHONE}?text=${generalMessage}`;
return (
<div className="fixed bottom-6 right-6 z-50">
<a
href={link}
target="_blank"
rel="noopener noreferrer"
className="inline-flex h-14 w-14 items-center justify-center rounded-full bg-emerald-500 text-white shadow-glow transition-all duration-300 hover:bg-emerald-600 hover:scale-110 focus:outline-none focus:ring-2 focus:ring-emerald-300/60"
aria-label="Chat with us on WhatsApp"
>
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor" className="h-7 w-7">
<path d="M20.52 3.48A11.86 11.86 0 0012 0a11.99 11.99 0 00-10 18.63L0 24l5.48-1.99A11.98 11.98 0 0012 24c6.63 0 12-5.37 12-12 0-3.19-1.24-6.19-3.48-8.52zM12 21.6c-1.9 0-3.7-.5-5.28-1.48l-.38-.23-3.13 1.14 1.14-3.13-.23-.38A9.59 9.59 0 012.4 12 9.6 9.6 0 1112 21.6zm5.55-7.19c-.3-.15-1.77-.87-2.04-.97-.27-.1-.46-.15-.66.15-.2.3-.76.97-.93 1.17-.17.2-.34.22-.63.07-.3-.15-1.27-.47-2.42-1.5-.89-.79-1.48-1.77-1.66-2.07-.17-.3-.02-.46.13-.61.13-.13.3-.34.45-.51.15-.17.2-.3.3-.5.1-.2.05-.37-.02-.52-.07-.15-.66-1.59-.9-2.17-.24-.58-.48-.5-.66-.5-.17 0-.37-.02-.56-.02-.2 0-.52.08-.8.37-.27.3-1.04 1.02-1.04 2.48s1.07 2.88 1.22 3.08c.15.2 2.1 3.2 5.08 4.49.71.31 1.27.5 1.7.64.71.23 1.36.2 1.87.12.57-.08 1.77-.72 2.02-1.42.25-.7.25-1.3.17-1.42-.07-.12-.27-.2-.57-.35z" />
</svg>
</a>
</div>
);
}
function Footer() {
const year = new Date().getFullYear();
return (
<footer className="border-t border-slate-200 bg-white py-8">
<div className="mx-auto flex max-w-7xl flex-col items-center justify-between gap-3 px-4 sm:flex-row sm:px-6 lg:px-8">
<p className="text-sm text-slate-600">© {year} Solar Energy — All rights reserved.</p>
<div className="flex items-center gap-4 text-sm">
<a href="#products" className="text-slate-600 hover:text-brand">Home</a>
<a href="#about" className="text-slate-600 hover:text-brand">About</a>
<a href="#quote" className="text-slate-600 hover:text-brand">Get Quote</a>
<a href="#contact" className="text-slate-600 hover:text-brand">Contact</a>
</div>
</div>
</footer>
);
}
function App() {
return (
<div>
<Navbar />
<main>
<Hero />
<WhySolar />
<Products />
<About />
<QuoteForm />
<Contact />
</main>
<Footer />
<FloatingWhatsApp />
</div>
);
}
const root = ReactDOM.createRoot(document.getElementById("root"));
root.render(<App />);
</script>
</body>
</html>