diff --git a/src/app/page.tsx b/src/app/page.tsx index ac5e42e..5374e74 100644 --- a/src/app/page.tsx +++ b/src/app/page.tsx @@ -1,6 +1,7 @@ "use client"; -import { Clock, Mail, MapPin, Phone } from "lucide-react"; +import { useState, useRef } from "react"; +import { Clock, Mail, MapPin, Phone, Plus, Minus } from "lucide-react"; import { ThemeProvider } from "@/providers/themeProvider/ThemeProvider"; import NavbarStyleApple from "@/components/navbar/NavbarStyleApple/NavbarStyleApple"; import HeroBillboard from "@/components/sections/hero/HeroBillboard"; @@ -12,7 +13,64 @@ import AboutMetric from "@/components/sections/about/AboutMetric"; import ContactSplit from "@/components/sections/contact/ContactSplit"; import FooterLogoEmphasis from "@/components/sections/footer/FooterLogoEmphasis"; +interface PricingCalculatorState { + serviceType: string; + squareFootage: string; + priceRange: { min: number; max: number } | null; +} + export default function LandingPage() { + const [calculator, setCalculator] = useState({ + serviceType: "interior-painting", squareFootage: "", priceRange: null, + }); + + const [formData, setFormData] = useState({ + name: "", phone: "", email: "", serviceType: "interior-painting", squareFootage: "", address: "", timeline: "asap", notes: ""}); + + const calculatorRef = useRef(null); + const formRef = useRef(null); + + const servicePrices: Record = { + "interior-painting": { min: 3.5, max: 5.5 }, + "exterior-painting": { min: 4.5, max: 7.0 }, + "flooring-installation": { min: 6.0, max: 12.0 }, + "small-renovations": { min: 5.0, max: 15.0 }, + }; + + const calculatePrice = () => { + const sqft = parseFloat(calculator.squareFootage); + if (!isNaN(sqft) && sqft > 0) { + const prices = servicePrices[calculator.serviceType]; + if (prices) { + const minPrice = sqft * prices.min; + const maxPrice = sqft * prices.max; + setCalculator(prev => ({ + ...prev, + priceRange: { min: Math.round(minPrice), max: Math.round(maxPrice) }, + })); + } + } + }; + + const scrollToSection = (ref: React.RefObject) => { + ref.current?.scrollIntoView({ behavior: "smooth" }); + }; + + const handleServiceCardCTA = (section: "calculator" | "form") => { + if (section === "calculator") { + scrollToSection(calculatorRef); + } else { + scrollToSection(formRef); + } + }; + + const serviceCardButtons = [ + { + text: "Get Instant Estimate", onClick: () => handleServiceCardCTA("calculator"), + }, + { text: "Request a Quote", onClick: () => handleServiceCardCTA("form") }, + ]; + return ( -
+ {/* Pricing Calculator Section */} +
+
+

+ Instant Price Calculator +

+

+ Get an estimated price range for your project +

+ +
+
+ {/* Service Type Dropdown */} +
+ + +
+ + {/* Square Footage Input */} +
+ +
+ { + setCalculator((prev) => ({ + ...prev, + squareFootage: e.target.value, + priceRange: null, + })); + }} + placeholder="Enter square footage" + className="flex-1 bg-background border border-accent/50 rounded-md px-4 py-3 text-foreground placeholder-foreground/40 focus:outline-none focus:border-primary-cta transition-colors" + /> + +
+
+ + {/* Price Display */} + {calculator.priceRange && ( +
+

Estimated Price Range

+

+ ${calculator.priceRange.min.toLocaleString()} - $ + {calculator.priceRange.max.toLocaleString()} +

+

+ *This is an estimate. Final price may vary based on project complexity and site conditions. +

+
+ )} +
+
+
+
+ + {/* Quote Request Form Section */} +
+
+

+ Request Your Free Quote +

+

+ Fill out the form below and our team will contact you within 24 hours +

+ +
+ {/* Name */} +
+ + + setFormData({ ...formData, name: e.target.value }) + } + placeholder="Your full name" + required + className="w-full bg-background border border-accent/50 rounded-md px-4 py-3 text-foreground placeholder-foreground/40 focus:outline-none focus:border-primary-cta transition-colors" + /> +
+ + {/* Phone */} +
+ + + setFormData({ ...formData, phone: e.target.value }) + } + placeholder="(555) 123-4567" + required + className="w-full bg-background border border-accent/50 rounded-md px-4 py-3 text-foreground placeholder-foreground/40 focus:outline-none focus:border-primary-cta transition-colors" + /> +
+ + {/* Email */} +
+ + + setFormData({ ...formData, email: e.target.value }) + } + placeholder="your@email.com" + required + className="w-full bg-background border border-accent/50 rounded-md px-4 py-3 text-foreground placeholder-foreground/40 focus:outline-none focus:border-primary-cta transition-colors" + /> +
+ + {/* Service Type */} +
+ + +
+ + {/* Square Footage */} +
+ + + setFormData({ ...formData, squareFootage: e.target.value }) + } + placeholder="Enter square footage" + required + className="w-full bg-background border border-accent/50 rounded-md px-4 py-3 text-foreground placeholder-foreground/40 focus:outline-none focus:border-primary-cta transition-colors" + /> +
+ + {/* Project Address */} +
+ + + setFormData({ ...formData, address: e.target.value }) + } + placeholder="123 Main St, City, Province" + required + className="w-full bg-background border border-accent/50 rounded-md px-4 py-3 text-foreground placeholder-foreground/40 focus:outline-none focus:border-primary-cta transition-colors" + /> +
+ + {/* Preferred Timeline */} +
+ + +
+ + {/* Notes */} +
+ +