Compare commits
14 Commits
version_8
...
version_12
| Author | SHA1 | Date | |
|---|---|---|---|
| 77ffcd08fc | |||
| a571d5bf3a | |||
| ff88567cef | |||
| 6d4cd3be7f | |||
| 9709854572 | |||
| ec828c5e28 | |||
| 7e2ce31c2f | |||
| dfc0500e7e | |||
| 80546c2ddf | |||
| 2888ff90ac | |||
| 1fad1b5bfb | |||
| 0d4a62f433 | |||
| 3fac4b6d68 | |||
| e009f2ed81 |
41
src/app/api/send-email/route.ts
Normal file
41
src/app/api/send-email/route.ts
Normal file
@@ -0,0 +1,41 @@
|
||||
import { NextRequest, NextResponse } from 'next/server';
|
||||
|
||||
export async function POST(request: NextRequest) {
|
||||
try {
|
||||
const { to, subject, name, email, businessName, phone, message } = await request.json();
|
||||
|
||||
// Validate required fields
|
||||
if (!to || !subject || !name || !email || !businessName || !phone || !message) {
|
||||
return NextResponse.json(
|
||||
{ error: 'Missing required fields' },
|
||||
{ status: 400 }
|
||||
);
|
||||
}
|
||||
|
||||
// Create email body
|
||||
const emailBody = `
|
||||
<h2>New Website Request</h2>
|
||||
<p><strong>Name:</strong> ${name}</p>
|
||||
<p><strong>Email:</strong> ${email}</p>
|
||||
<p><strong>Business Name:</strong> ${businessName}</p>
|
||||
<p><strong>Phone:</strong> ${phone}</p>
|
||||
<p><strong>Message:</strong></p>
|
||||
<p>${message.replace(/\n/g, '<br>')}</p>
|
||||
`;
|
||||
|
||||
// For now, just return success
|
||||
// In production, integrate with your email service (SendGrid, Resend, etc.)
|
||||
console.log('Email request received:', { to, subject, name, email });
|
||||
|
||||
return NextResponse.json(
|
||||
{ success: true, message: 'Email request received successfully' },
|
||||
{ status: 200 }
|
||||
);
|
||||
} catch (error) {
|
||||
console.error('Email handling error:', error);
|
||||
return NextResponse.json(
|
||||
{ error: 'Failed to process email request' },
|
||||
{ status: 500 }
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -1,55 +1,23 @@
|
||||
import type { Metadata } from "next";
|
||||
import { Halant } from "next/font/google";
|
||||
import { Inter } from "next/font/google";
|
||||
import { Public_Sans } from "next/font/google";
|
||||
import "./globals.css";
|
||||
import { ServiceWrapper } from "@/components/ServiceWrapper";
|
||||
import Tag from "@/tag/Tag";
|
||||
import "./styles/variables.css";
|
||||
import "./styles/base.css";
|
||||
|
||||
const halant = Halant({
|
||||
variable: "--font-halant", subsets: ["latin"],
|
||||
weight: ["300", "400", "500", "600", "700"],
|
||||
});
|
||||
|
||||
const inter = Inter({
|
||||
variable: "--font-inter", subsets: ["latin"],
|
||||
});
|
||||
|
||||
const publicSans = Public_Sans({
|
||||
variable: "--font-public-sans", subsets: ["latin"],
|
||||
});
|
||||
const inter = Inter({ subsets: ["latin"] });
|
||||
|
||||
export const metadata: Metadata = {
|
||||
title: "CoreScale - Professional Websites for Small Businesses", description: "Affordable, professional web design for small businesses. Build trust online with clean, modern websites starting at $250. CoreScale helps local businesses grow online.", keywords: "web design, small business, affordable websites, professional website design, local business website, online presence", robots: {
|
||||
index: true,
|
||||
follow: true,
|
||||
},
|
||||
openGraph: {
|
||||
title: "CoreScale - Affordable Professional Websites for Small Businesses", description: "Get a professional website for your small business starting at $250. Build trust, attract customers, and grow online with CoreScale.", type: "website", siteName: "CoreScale", images: [
|
||||
{
|
||||
url: "http://img.b2bpic.net/free-photo/joyous-coworkers-having-fun-vibrant-office-while-reviewing-financial-graphs_482257-126650.jpg", alt: "Professional website design for small businesses"
|
||||
},
|
||||
],
|
||||
},
|
||||
twitter: {
|
||||
card: "summary_large_image", title: "CoreScale - Professional Websites for Small Businesses", description: "Affordable, professional web design starting at $250. Build your online presence with CoreScale.", images: ["http://img.b2bpic.net/free-photo/joyous-coworkers-having-fun-vibrant-office-while-reviewing-financial-graphs_482257-126650.jpg"],
|
||||
},
|
||||
title: "CoreScale - Professional Websites for Small Businesses", description: "Affordable professional websites for small and local businesses. Build trust, attract customers, and grow your business online with CoreScale."
|
||||
};
|
||||
|
||||
export default function RootLayout({
|
||||
children,
|
||||
}: Readonly<{
|
||||
}: {
|
||||
children: React.ReactNode;
|
||||
}>) {
|
||||
}) {
|
||||
return (
|
||||
<html lang="en" suppressHydrationWarning>
|
||||
<ServiceWrapper>
|
||||
<body
|
||||
className={`${halant.variable} ${inter.variable} ${publicSans.variable} antialiased`}
|
||||
>
|
||||
<Tag />
|
||||
{children}
|
||||
|
||||
<html lang="en">
|
||||
<body className={inter.className}>{children}
|
||||
<script
|
||||
dangerouslySetInnerHTML={{
|
||||
__html: `
|
||||
@@ -1417,7 +1385,6 @@ export default function RootLayout({
|
||||
}}
|
||||
/>
|
||||
</body>
|
||||
</ServiceWrapper>
|
||||
</html>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6,7 +6,6 @@ import HeroOverlay from "@/components/sections/hero/HeroOverlay";
|
||||
import TextSplitAbout from "@/components/sections/about/TextSplitAbout";
|
||||
import PricingCardTwo from "@/components/sections/pricing/PricingCardTwo";
|
||||
import FeatureCardThree from "@/components/sections/feature/featureCardThree/FeatureCardThree";
|
||||
import ContactFaq from "@/components/sections/contact/ContactFaq";
|
||||
import FooterLogoReveal from "@/components/sections/footer/FooterLogoReveal";
|
||||
import { ArrowRight, CheckCircle, Sparkles, Phone, Mail } from "lucide-react";
|
||||
import { useState } from "react";
|
||||
@@ -14,7 +13,9 @@ import { useState } from "react";
|
||||
export default function LandingPage() {
|
||||
const [submitted, setSubmitted] = useState(false);
|
||||
const [formData, setFormData] = useState({
|
||||
fullName: "", businessName: "", email: "", phone: "", message: ""});
|
||||
fullName: "", businessName: "", email: "", phone: "", message: ""
|
||||
});
|
||||
const [error, setError] = useState("");
|
||||
|
||||
const handlePhoneClick = () => {
|
||||
window.location.href = "tel:206-741-9017";
|
||||
@@ -24,18 +25,46 @@ export default function LandingPage() {
|
||||
window.location.href = "mailto:CoreScale.co@gmail.com";
|
||||
};
|
||||
|
||||
const handleFormSubmit = (e: React.FormEvent) => {
|
||||
const handleFormSubmit = async (e: React.FormEvent) => {
|
||||
e.preventDefault();
|
||||
setSubmitted(true);
|
||||
setFormData({
|
||||
fullName: "", businessName: "", email: "", phone: "", message: ""});
|
||||
setTimeout(() => setSubmitted(false), 5000);
|
||||
setError("");
|
||||
|
||||
try {
|
||||
// Send email using EmailJS or direct backend call
|
||||
const response = await fetch("/api/send-email", {
|
||||
method: "POST", headers: {
|
||||
"Content-Type": "application/json"
|
||||
},
|
||||
body: JSON.stringify({
|
||||
to: "CoreScale.co@gmail.com", subject: "New Website Request – CoreScale", name: formData.fullName,
|
||||
email: formData.email,
|
||||
businessName: formData.businessName,
|
||||
phone: formData.phone,
|
||||
message: formData.message
|
||||
})
|
||||
});
|
||||
|
||||
if (response.ok) {
|
||||
setSubmitted(true);
|
||||
setFormData({
|
||||
fullName: "", businessName: "", email: "", phone: "", message: ""
|
||||
});
|
||||
setTimeout(() => setSubmitted(false), 5000);
|
||||
} else {
|
||||
setError("Failed to send form. Please try again.");
|
||||
}
|
||||
} catch (error) {
|
||||
console.error("Error submitting form:", error);
|
||||
setError("An error occurred. Please try again.");
|
||||
}
|
||||
};
|
||||
|
||||
const handleInputChange = (e: React.ChangeEvent<HTMLInputElement | HTMLTextAreaElement>) => {
|
||||
const handleInputChange = (
|
||||
e: React.ChangeEvent<HTMLInputElement | HTMLTextAreaElement>
|
||||
) => {
|
||||
setFormData({
|
||||
...formData,
|
||||
[e.target.name]: e.target.value,
|
||||
[e.target.name]: e.target.value
|
||||
});
|
||||
};
|
||||
|
||||
@@ -59,7 +88,7 @@ export default function LandingPage() {
|
||||
{ name: "About", id: "about" },
|
||||
{ name: "Services", id: "services" },
|
||||
{ name: "Why We Matter", id: "why-matters" },
|
||||
{ name: "Contact", id: "contact" },
|
||||
{ name: "Contact", id: "contact" }
|
||||
]}
|
||||
button={{
|
||||
text: "Get Your Website Today", href: "contact"
|
||||
@@ -81,7 +110,7 @@ export default function LandingPage() {
|
||||
showDimOverlay={false}
|
||||
buttons={[
|
||||
{ text: "Get Your Website Today", href: "contact" },
|
||||
{ text: "Learn More", href: "about" },
|
||||
{ text: "Learn More", href: "about" }
|
||||
]}
|
||||
buttonAnimation="slide-up"
|
||||
/>
|
||||
@@ -114,22 +143,22 @@ export default function LandingPage() {
|
||||
id: "1", badge: "Website Design", badgeIcon: Sparkles,
|
||||
price: "Starting at $250", subtitle: "Professional website starting at $250 built to help your business attract more customers online", buttons: [
|
||||
{ text: "Get Started", href: "contact" },
|
||||
{ text: "Learn More", href: "#" },
|
||||
{ text: "Learn More", href: "#" }
|
||||
],
|
||||
features: [
|
||||
"Professional modern design", "Mobile-friendly layout", "Fast loading pages", "Clean and simple user experience", "Website that builds trust with customers"
|
||||
],
|
||||
]
|
||||
},
|
||||
{
|
||||
id: "2", badge: "Maintenance & Edits", badgeIcon: CheckCircle,
|
||||
price: "$50/month", subtitle: "Ongoing support to keep your site fresh", buttons: [
|
||||
{ text: "Add to Service", href: "contact" },
|
||||
{ text: "Learn More", href: "#" },
|
||||
{ text: "Learn More", href: "#" }
|
||||
],
|
||||
features: [
|
||||
"Website updates and content edits", "Image or text updates", "Small design improvements", "Ongoing technical support", "Keep your website running smoothly"
|
||||
],
|
||||
},
|
||||
]
|
||||
}
|
||||
]}
|
||||
/>
|
||||
</div>
|
||||
@@ -153,7 +182,7 @@ export default function LandingPage() {
|
||||
},
|
||||
{
|
||||
id: "03", title: "Stand Out from Competitors", description: "Many local businesses still don't have websites. By getting online with CoreScale, you'll have a competitive advantage and reach customers your competitors are missing.", imageSrc: "http://img.b2bpic.net/free-photo/group-people-working-website-template_53876-25068.jpg", imageAlt: "Competitive advantage online"
|
||||
},
|
||||
}
|
||||
]}
|
||||
/>
|
||||
</div>
|
||||
@@ -202,9 +231,17 @@ export default function LandingPage() {
|
||||
{/* Contact Form */}
|
||||
{!submitted ? (
|
||||
<form onSubmit={handleFormSubmit} className="bg-card p-8 rounded-lg">
|
||||
{error && (
|
||||
<div className="mb-6 p-4 rounded-lg bg-red-50 border border-red-200">
|
||||
<p className="text-red-800">{error}</p>
|
||||
</div>
|
||||
)}
|
||||
<div className="grid md:grid-cols-2 gap-6 mb-6">
|
||||
<div>
|
||||
<label htmlFor="fullName" className="block text-sm font-medium text-foreground mb-2">
|
||||
<label
|
||||
htmlFor="fullName"
|
||||
className="block text-sm font-medium text-foreground mb-2"
|
||||
>
|
||||
Full Name
|
||||
</label>
|
||||
<input
|
||||
@@ -219,7 +256,10 @@ export default function LandingPage() {
|
||||
/>
|
||||
</div>
|
||||
<div>
|
||||
<label htmlFor="businessName" className="block text-sm font-medium text-foreground mb-2">
|
||||
<label
|
||||
htmlFor="businessName"
|
||||
className="block text-sm font-medium text-foreground mb-2"
|
||||
>
|
||||
Business Name
|
||||
</label>
|
||||
<input
|
||||
@@ -237,7 +277,10 @@ export default function LandingPage() {
|
||||
|
||||
<div className="grid md:grid-cols-2 gap-6 mb-6">
|
||||
<div>
|
||||
<label htmlFor="email" className="block text-sm font-medium text-foreground mb-2">
|
||||
<label
|
||||
htmlFor="email"
|
||||
className="block text-sm font-medium text-foreground mb-2"
|
||||
>
|
||||
Email Address
|
||||
</label>
|
||||
<input
|
||||
@@ -252,7 +295,10 @@ export default function LandingPage() {
|
||||
/>
|
||||
</div>
|
||||
<div>
|
||||
<label htmlFor="phone" className="block text-sm font-medium text-foreground mb-2">
|
||||
<label
|
||||
htmlFor="phone"
|
||||
className="block text-sm font-medium text-foreground mb-2"
|
||||
>
|
||||
Phone Number
|
||||
</label>
|
||||
<input
|
||||
@@ -269,7 +315,10 @@ export default function LandingPage() {
|
||||
</div>
|
||||
|
||||
<div className="mb-6">
|
||||
<label htmlFor="message" className="block text-sm font-medium text-foreground mb-2">
|
||||
<label
|
||||
htmlFor="message"
|
||||
className="block text-sm font-medium text-foreground mb-2"
|
||||
>
|
||||
Message
|
||||
</label>
|
||||
<textarea
|
||||
@@ -294,10 +343,10 @@ export default function LandingPage() {
|
||||
) : (
|
||||
<div className="bg-green-50 border border-green-200 rounded-lg p-8 text-center">
|
||||
<p className="text-lg font-semibold text-green-800 mb-2">
|
||||
Thank you for contacting CoreScale.
|
||||
Thank you for contacting CoreScale. We will reach out to you shortly.
|
||||
</p>
|
||||
<p className="text-green-700">
|
||||
We will reach out shortly to discuss your website.
|
||||
We've received your website request and will be in touch soon to discuss your project.
|
||||
</p>
|
||||
</div>
|
||||
)}
|
||||
@@ -318,4 +367,4 @@ export default function LandingPage() {
|
||||
</div>
|
||||
</ThemeProvider>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user