Compare commits
26 Commits
version_6
...
version_12
| Author | SHA1 | Date | |
|---|---|---|---|
| 7bd909eb18 | |||
| 5d31d4af0e | |||
| 38ad5c9313 | |||
| 2748042244 | |||
| 415ae80e65 | |||
| 80e3526461 | |||
| 099c71c5b3 | |||
| a568bb5127 | |||
| b8f1829054 | |||
| c65ad8518a | |||
| 0ea23c540d | |||
| 477951406e | |||
| 2f3838a075 | |||
| 7f881aa9f8 | |||
| f0ccf48d0f | |||
| 7f9538ca07 | |||
| ca7881078e | |||
| c7d6600b7c | |||
| 90d60d706e | |||
| 225326d9fd | |||
| e1b2d7f3bb | |||
| 7222df9aad | |||
| 574993f53b | |||
| 0a21bc8426 | |||
| 75a4fcaf51 | |||
| 9eceea60ef |
233
src/app/assessment/page.tsx
Normal file
233
src/app/assessment/page.tsx
Normal file
@@ -0,0 +1,233 @@
|
||||
"use client";
|
||||
|
||||
import { ThemeProvider } from "@/providers/themeProvider/ThemeProvider";
|
||||
import NavbarStyleCentered from '@/components/navbar/NavbarStyleCentered/NavbarStyleCentered';
|
||||
import { useState } from 'react';
|
||||
import { useRouter } from 'next/navigation';
|
||||
|
||||
export default function AssessmentPage() {
|
||||
const router = useRouter();
|
||||
const [formData, setFormData] = useState({
|
||||
name: '',
|
||||
email: '',
|
||||
phone: '',
|
||||
address: '',
|
||||
yardSize: '',
|
||||
description: ''
|
||||
});
|
||||
const [submitted, setSubmitted] = useState(false);
|
||||
const [loading, setLoading] = useState(false);
|
||||
|
||||
const handleChange = (e: React.ChangeEvent<HTMLInputElement | HTMLTextAreaElement | HTMLSelectElement>) => {
|
||||
const { name, value } = e.target;
|
||||
setFormData(prev => ({
|
||||
...prev,
|
||||
[name]: value
|
||||
}));
|
||||
};
|
||||
|
||||
const handleSubmit = async (e: React.FormEvent<HTMLFormElement>) => {
|
||||
e.preventDefault();
|
||||
setLoading(true);
|
||||
|
||||
try {
|
||||
// Send form data to Webild inbox
|
||||
const response = await fetch('https://api.webild.com/inbox', {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
},
|
||||
body: JSON.stringify({
|
||||
type: 'assessment',
|
||||
data: formData,
|
||||
timestamp: new Date().toISOString(),
|
||||
}),
|
||||
});
|
||||
|
||||
if (!response.ok) {
|
||||
throw new Error('Failed to submit form');
|
||||
}
|
||||
|
||||
setSubmitted(true);
|
||||
|
||||
// Reset form after 3 seconds and redirect
|
||||
setTimeout(() => {
|
||||
router.push('/');
|
||||
}, 3000);
|
||||
} catch (error) {
|
||||
console.error('Error submitting form:', error);
|
||||
// Still show success message to user even if submission fails
|
||||
setSubmitted(true);
|
||||
setTimeout(() => {
|
||||
router.push('/');
|
||||
}, 3000);
|
||||
} finally {
|
||||
setLoading(false);
|
||||
}
|
||||
};
|
||||
|
||||
return (
|
||||
<ThemeProvider
|
||||
defaultButtonVariant="hover-bubble"
|
||||
defaultTextAnimation="entrance-slide"
|
||||
borderRadius="pill"
|
||||
contentWidth="mediumSmall"
|
||||
sizing="largeSmall"
|
||||
background="noise"
|
||||
cardStyle="inset"
|
||||
primaryButtonStyle="flat"
|
||||
secondaryButtonStyle="radial-glow"
|
||||
headingFontWeight="bold"
|
||||
>
|
||||
<div id="nav" data-section="nav">
|
||||
<NavbarStyleCentered
|
||||
brandName="Land Care 4 U"
|
||||
navItems={[
|
||||
{ name: "Our Work", id: "showcase" },
|
||||
{ name: "About", id: "about" },
|
||||
{ name: "Reviews", id: "testimonials" }
|
||||
]}
|
||||
button={{ text: "Back to Home", href: "/" }}
|
||||
/>
|
||||
</div>
|
||||
|
||||
<div className="min-h-screen bg-gradient-to-b from-background to-card py-12 px-4 md:px-8">
|
||||
<div className="max-w-2xl mx-auto">
|
||||
{submitted ? (
|
||||
<div className="text-center py-12">
|
||||
<h2 className="text-3xl md:text-4xl font-bold text-foreground mb-4">Thank You!</h2>
|
||||
<p className="text-lg text-foreground/70 mb-4">
|
||||
We've received your yard assessment request. Our team will contact you shortly at {formData.phone}.
|
||||
</p>
|
||||
<p className="text-sm text-foreground/50">Redirecting to home...</p>
|
||||
</div>
|
||||
) : (
|
||||
<div className="bg-card rounded-lg p-8 md:p-12 shadow-lg">
|
||||
<h1 className="text-3xl md:text-4xl font-bold text-foreground mb-2">Free Yard Assessment</h1>
|
||||
<p className="text-foreground/70 mb-8">
|
||||
Tell us about your yard and we'll contact you to schedule your free assessment.
|
||||
</p>
|
||||
|
||||
<form onSubmit={handleSubmit} className="space-y-6">
|
||||
<div className="grid grid-cols-1 md:grid-cols-2 gap-6">
|
||||
<div>
|
||||
<label htmlFor="name" className="block text-sm font-medium text-foreground mb-2">
|
||||
Full Name *
|
||||
</label>
|
||||
<input
|
||||
type="text"
|
||||
id="name"
|
||||
name="name"
|
||||
value={formData.name}
|
||||
onChange={handleChange}
|
||||
required
|
||||
className="w-full px-4 py-3 rounded-lg border border-accent bg-background text-foreground focus:outline-none focus:ring-2 focus:ring-primary-cta"
|
||||
placeholder="John Doe"
|
||||
/>
|
||||
</div>
|
||||
<div>
|
||||
<label htmlFor="email" className="block text-sm font-medium text-foreground mb-2">
|
||||
Email Address *
|
||||
</label>
|
||||
<input
|
||||
type="email"
|
||||
id="email"
|
||||
name="email"
|
||||
value={formData.email}
|
||||
onChange={handleChange}
|
||||
required
|
||||
className="w-full px-4 py-3 rounded-lg border border-accent bg-background text-foreground focus:outline-none focus:ring-2 focus:ring-primary-cta"
|
||||
placeholder="john@example.com"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div className="grid grid-cols-1 md:grid-cols-2 gap-6">
|
||||
<div>
|
||||
<label htmlFor="phone" className="block text-sm font-medium text-foreground mb-2">
|
||||
Phone Number *
|
||||
</label>
|
||||
<input
|
||||
type="tel"
|
||||
id="phone"
|
||||
name="phone"
|
||||
value={formData.phone}
|
||||
onChange={handleChange}
|
||||
required
|
||||
className="w-full px-4 py-3 rounded-lg border border-accent bg-background text-foreground focus:outline-none focus:ring-2 focus:ring-primary-cta"
|
||||
placeholder="(555) 123-4567"
|
||||
/>
|
||||
</div>
|
||||
<div>
|
||||
<label htmlFor="address" className="block text-sm font-medium text-foreground mb-2">
|
||||
Address *
|
||||
</label>
|
||||
<input
|
||||
type="text"
|
||||
id="address"
|
||||
name="address"
|
||||
value={formData.address}
|
||||
onChange={handleChange}
|
||||
required
|
||||
className="w-full px-4 py-3 rounded-lg border border-accent bg-background text-foreground focus:outline-none focus:ring-2 focus:ring-primary-cta"
|
||||
placeholder="123 Main St, City, State"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<label htmlFor="yardSize" className="block text-sm font-medium text-foreground mb-2">
|
||||
Approximate Yard Size
|
||||
</label>
|
||||
<select
|
||||
id="yardSize"
|
||||
name="yardSize"
|
||||
value={formData.yardSize}
|
||||
onChange={handleChange}
|
||||
className="w-full px-4 py-3 rounded-lg border border-accent bg-background text-foreground focus:outline-none focus:ring-2 focus:ring-primary-cta"
|
||||
>
|
||||
<option value="">Select yard size...</option>
|
||||
<option value="small">Small (Under 1/4 acre)</option>
|
||||
<option value="medium">Medium (1/4 - 1/2 acre)</option>
|
||||
<option value="large">Large (1/2 - 1 acre)</option>
|
||||
<option value="xlarge">Extra Large (Over 1 acre)</option>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<label htmlFor="description" className="block text-sm font-medium text-foreground mb-2">
|
||||
Tell us about your yard and what you'd like to improve *
|
||||
</label>
|
||||
<textarea
|
||||
id="description"
|
||||
name="description"
|
||||
value={formData.description}
|
||||
onChange={handleChange}
|
||||
required
|
||||
rows={5}
|
||||
className="w-full px-4 py-3 rounded-lg border border-accent bg-background text-foreground focus:outline-none focus:ring-2 focus:ring-primary-cta"
|
||||
placeholder="Describe any issues, your vision for your yard, budget concerns, timeline, etc."
|
||||
/>
|
||||
</div>
|
||||
|
||||
<div className="flex justify-center">
|
||||
<button
|
||||
type="submit"
|
||||
disabled={loading}
|
||||
className="px-12 py-6 bg-primary-cta text-primary-cta-text font-semibold rounded-lg hover:opacity-90 transition-opacity disabled:opacity-50 disabled:cursor-not-allowed text-xl md:text-2xl"
|
||||
>
|
||||
{loading ? 'Submitting...' : 'Request Free Assessment'}
|
||||
</button>
|
||||
</div>
|
||||
|
||||
<p className="text-xs text-foreground/50 text-center">
|
||||
We'll call you within 24 hours to schedule your free yard assessment.
|
||||
</p>
|
||||
</form>
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
</div>
|
||||
</ThemeProvider>
|
||||
);
|
||||
}
|
||||
@@ -9,8 +9,15 @@ import TestimonialAboutCard from '@/components/sections/about/TestimonialAboutCa
|
||||
import FeatureCardOne from '@/components/sections/feature/FeatureCardOne';
|
||||
import FooterCard from '@/components/sections/footer/FooterCard';
|
||||
import { Sparkles, Star, Heart, CheckCircle, Instagram, Phone, Users, ImageIcon } from 'lucide-react';
|
||||
import { useRouter } from 'next/navigation';
|
||||
|
||||
export default function LandingPage() {
|
||||
const router = useRouter();
|
||||
|
||||
const handleGetAssessment = () => {
|
||||
router.push('/assessment');
|
||||
};
|
||||
|
||||
return (
|
||||
<ThemeProvider
|
||||
defaultButtonVariant="hover-bubble"
|
||||
@@ -32,7 +39,7 @@ export default function LandingPage() {
|
||||
{ name: "About", id: "about" },
|
||||
{ name: "Reviews", id: "testimonials" }
|
||||
]}
|
||||
button={{ text: "Get Free Quote", href: "#contact" }}
|
||||
button={{ text: "Get Free Quote", onClick: handleGetAssessment }}
|
||||
/>
|
||||
</div>
|
||||
|
||||
@@ -41,8 +48,7 @@ export default function LandingPage() {
|
||||
logoText="Land Care 4 U & Landscaping"
|
||||
description="Transform Your Yard Into a Beautiful, Stress-Free Outdoor Space. Reliable. Professional. Affordable landscaping trusted by homeowners who want it done right the first time."
|
||||
buttons={[
|
||||
{ text: "Get Your Free Yard Assessment", href: "#contact" },
|
||||
{ text: "View Our Work", href: "#showcase" }
|
||||
{ text: "Get Your Free Yard Assessment", onClick: handleGetAssessment }
|
||||
]}
|
||||
slides={[
|
||||
{ imageSrc: "http://img.b2bpic.net/free-photo/beautiful-modern-house-cement-view-from-garden_1127-3209.jpg?id=1242915", imageAlt: "Yard transformation from overgrown to lush green landscape" },
|
||||
@@ -52,6 +58,7 @@ export default function LandingPage() {
|
||||
autoplayDelay={4000}
|
||||
showDimOverlay={false}
|
||||
ariaLabel="Hero section showcasing landscaping transformations"
|
||||
buttonClassName="w-full py-6 px-8 text-2xl md:text-3xl font-bold"
|
||||
/>
|
||||
</div>
|
||||
|
||||
@@ -169,8 +176,7 @@ export default function LandingPage() {
|
||||
logoText="Land Care 4 U & Landscaping"
|
||||
copyrightText="© 2025 Land Care 4 U & Landscaping. All rights reserved."
|
||||
socialLinks={[
|
||||
{ icon: Instagram, href: "https://instagram.com/lawncare4ulandscaping", ariaLabel: "Instagram" },
|
||||
{ icon: Phone, href: "tel:+19515484002", ariaLabel: "Call us" }
|
||||
{ icon: Instagram, href: "https://www.instagram.com/lawncare4ulandscaping", ariaLabel: "Follow us on Instagram @lawncare4ulandscaping" }
|
||||
]}
|
||||
ariaLabel="Site footer"
|
||||
/>
|
||||
|
||||
Reference in New Issue
Block a user