Home.tsx 32 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882
  1. /**
  2. * Home Page — Homelegance Chatbot Integration Demo
  3. * Design: Warm Showroom — Scandinavian warmth, editorial magazine layout
  4. * Playfair Display headings, Source Sans 3 body, forest green + terracotta + cream palette
  5. */
  6. import { useRef } from "react";
  7. import { useAuth } from "@/_core/hooks/useAuth";
  8. import { motion, useInView } from "framer-motion";
  9. import {
  10. MessageCircle,
  11. ArrowDown,
  12. Zap,
  13. Clock,
  14. TrendingUp,
  15. Shield,
  16. Code2,
  17. Layers,
  18. GitBranch,
  19. CheckCircle2,
  20. ExternalLink,
  21. ChevronRight,
  22. Bot,
  23. Workflow,
  24. Server,
  25. Puzzle,
  26. } from "lucide-react";
  27. import ChatbotWidgetLive from "@/components/ChatbotWidgetLive";
  28. import WorkflowDiagram from "@/components/WorkflowDiagram";
  29. import ArchitectureDiagram from "@/components/ArchitectureDiagram";
  30. import CodeSnippet from "@/components/CodeSnippet";
  31. /* ─── Asset URLs ─── */
  32. const HERO_IMG = "https://d2xsxph8kpxj0f.cloudfront.net/310519663460016926/j3fMicxd96oQ6qWqevDJt5/hero-showroom-3kpaMXDd6czasp7Qgkfo5b.webp";
  33. const WORKFLOW_BG = "https://d2xsxph8kpxj0f.cloudfront.net/310519663460016926/j3fMicxd96oQ6qWqevDJt5/workflow-bg-fRHbG9vamH9g2W8W8BrAkm.webp";
  34. const CHATBOT_ILLUS = "https://d2xsxph8kpxj0f.cloudfront.net/310519663460016926/j3fMicxd96oQ6qWqevDJt5/chatbot-illustration-BFAPtQzws8tEXvTD9tFm6G.webp";
  35. const INTEGRATION_IMG = "https://d2xsxph8kpxj0f.cloudfront.net/310519663460016926/j3fMicxd96oQ6qWqevDJt5/integration-hero-ARBCtGWzCjUdh76eghxiim.webp";
  36. const ARCH_BG = "https://d2xsxph8kpxj0f.cloudfront.net/310519663460016926/j3fMicxd96oQ6qWqevDJt5/architecture-bg-k6ZMJihrNCrLkF6CwRB4Jj.webp";
  37. /* ─── Code Snippets ─── */
  38. const EMBED_CODE = `<!-- Add before closing </body> tag -->
  39. <script>
  40. (function() {
  41. var s = document.createElement('script');
  42. s.src = 'https://cdn.homelegance.com/chatbot/v2/widget.js';
  43. s.async = true;
  44. s.dataset.siteId = 'YOUR_SITE_ID';
  45. s.dataset.position = 'bottom-right';
  46. s.dataset.theme = 'forest';
  47. s.dataset.greeting = 'Welcome to Homelegance!';
  48. document.body.appendChild(s);
  49. })();
  50. </script>`;
  51. const CONFIG_CODE = `// chatbot-config.js
  52. export default {
  53. // Branding
  54. brandName: "Homelegance",
  55. primaryColor: "#14532D",
  56. accentColor: "#C2410C",
  57. logoUrl: "/assets/logo.svg",
  58. // Behavior
  59. autoOpen: false,
  60. openDelay: 5000, // ms before showing greeting
  61. position: "bottom-right",
  62. // AI Configuration
  63. model: "gpt-4o-mini",
  64. temperature: 0.7,
  65. systemPrompt: \`You are a helpful Homelegance
  66. furniture assistant. Help dealers find
  67. products, check orders, and answer FAQs.
  68. Always be warm and professional.\`,
  69. // Integrations
  70. webhookUrl: "https://api.homelegance.com/chatbot/webhook",
  71. crmIntegration: "salesforce",
  72. analyticsId: "UA-XXXXXXXX-X",
  73. // Escalation Rules
  74. escalation: {
  75. maxBotTurns: 8,
  76. sentimentThreshold: -0.3,
  77. keywords: ["speak to human", "representative"],
  78. transferMessage: "Connecting you with a team member..."
  79. }
  80. };`;
  81. const WEBHOOK_CODE = `// server/chatbot-webhook.js
  82. import express from 'express';
  83. const router = express.Router();
  84. router.post('/webhook', async (req, res) => {
  85. const { event, sessionId, message, metadata } = req.body;
  86. switch (event) {
  87. case 'message.received':
  88. // Process incoming user message
  89. const intent = await detectIntent(message.text);
  90. const response = await generateResponse(intent, metadata);
  91. return res.json({ reply: response });
  92. case 'escalation.requested':
  93. // Route to live agent queue
  94. await notifyAgentTeam(sessionId, metadata);
  95. return res.json({ status: 'queued' });
  96. case 'session.ended':
  97. // Log conversation for analytics
  98. await saveConversationLog(sessionId);
  99. return res.json({ status: 'logged' });
  100. default:
  101. return res.json({ status: 'ok' });
  102. }
  103. });
  104. export default router;`;
  105. const API_CODE = `// Example: Product Search API Integration
  106. async function searchProducts(query, filters) {
  107. const response = await fetch(
  108. 'https://api.homelegance.com/v2/products/search',
  109. {
  110. method: 'POST',
  111. headers: {
  112. 'Authorization': 'Bearer YOUR_API_KEY',
  113. 'Content-Type': 'application/json'
  114. },
  115. body: JSON.stringify({
  116. query,
  117. filters: {
  118. category: filters.category,
  119. collection: filters.collection,
  120. priceRange: filters.priceRange,
  121. inStock: true
  122. },
  123. limit: 5,
  124. include: ['images', 'pricing', 'availability']
  125. })
  126. }
  127. );
  128. return response.json();
  129. }`;
  130. /* ─── Section wrapper with scroll animation ─── */
  131. function AnimatedSection({
  132. children,
  133. className = "",
  134. id,
  135. style,
  136. }: {
  137. children: React.ReactNode;
  138. className?: string;
  139. id?: string;
  140. style?: React.CSSProperties;
  141. }) {
  142. const ref = useRef(null);
  143. const isInView = useInView(ref, { once: true, margin: "-80px" });
  144. return (
  145. <motion.section
  146. ref={ref}
  147. id={id}
  148. initial={{ opacity: 0, y: 40 }}
  149. animate={isInView ? { opacity: 1, y: 0 } : {}}
  150. transition={{ duration: 0.6, ease: "easeOut" }}
  151. className={className}
  152. style={style}
  153. >
  154. {children}
  155. </motion.section>
  156. );
  157. }
  158. /* ─── Navigation ─── */
  159. function Nav() {
  160. const links = [
  161. { label: "Workflow", href: "#workflow" },
  162. { label: "Architecture", href: "#architecture" },
  163. { label: "Integration", href: "#integration" },
  164. { label: "Benefits", href: "#benefits" },
  165. ];
  166. const { user, isAuthenticated, loading } = useAuth();
  167. return (
  168. <nav
  169. className="fixed top-0 left-0 right-0 z-40 backdrop-blur-md border-b"
  170. style={{ background: "rgba(255, 251, 235, 0.88)", borderColor: "#e7e0d5" }}
  171. >
  172. <div className="container flex items-center justify-between h-16">
  173. <div className="flex items-center gap-3">
  174. <div
  175. className="w-9 h-9 rounded-lg flex items-center justify-center"
  176. style={{ background: "#14532D" }}
  177. >
  178. <Bot className="w-5 h-5 text-white" />
  179. </div>
  180. <div>
  181. <span
  182. className="text-sm font-bold tracking-tight"
  183. style={{ color: "#14532D", fontFamily: "'Playfair Display', serif" }}
  184. >
  185. Homelegance
  186. </span>
  187. <span
  188. className="text-xs block -mt-0.5"
  189. style={{ color: "#a8a29e", fontFamily: "'Source Sans 3', sans-serif" }}
  190. >
  191. Chatbot Integration
  192. </span>
  193. </div>
  194. </div>
  195. <div className="hidden md:flex items-center gap-1">
  196. {links.map((link) => (
  197. <a
  198. key={link.href}
  199. href={link.href}
  200. className="px-3 py-2 rounded-lg text-sm font-medium transition-colors hover:bg-black/5"
  201. style={{ color: "#57534e", fontFamily: "'Source Sans 3', sans-serif" }}
  202. >
  203. {link.label}
  204. </a>
  205. ))}
  206. <div className="w-px h-5 mx-1" style={{ background: "#e7e0d5" }} />
  207. {!loading && isAuthenticated ? (
  208. <div className="flex items-center gap-2">
  209. <span
  210. className="text-sm"
  211. style={{ color: "#57534e", fontFamily: "'Source Sans 3', sans-serif" }}
  212. >
  213. {user?.name || user?.email}
  214. </span>
  215. {(user?.role === "admin" || user?.role === "agent") && (
  216. <a
  217. href={`${import.meta.env.BASE_URL}dashboard`}
  218. className="px-3 py-2 rounded-lg text-sm font-semibold transition-colors"
  219. style={{
  220. background: "#14532D",
  221. color: "#fff",
  222. fontFamily: "'Source Sans 3', sans-serif",
  223. borderRadius: "8px",
  224. padding: "6px 16px",
  225. }}
  226. >
  227. Dashboard
  228. </a>
  229. )}
  230. </div>
  231. ) : (
  232. <a
  233. href={`${import.meta.env.BASE_URL}login`}
  234. className="px-3 py-2 rounded-lg text-sm font-semibold transition-colors"
  235. style={{
  236. background: "#14532D",
  237. color: "#fff",
  238. fontFamily: "'Source Sans 3', sans-serif",
  239. borderRadius: "8px",
  240. padding: "6px 16px",
  241. }}
  242. >
  243. Sign In
  244. </a>
  245. )}
  246. </div>
  247. </div>
  248. </nav>
  249. );
  250. }
  251. /* ─── Hero Section ─── */
  252. function HeroSection() {
  253. return (
  254. <section className="relative min-h-[92vh] flex items-center pt-16 overflow-hidden">
  255. {/* Background image */}
  256. <div className="absolute inset-0">
  257. <img
  258. src={HERO_IMG}
  259. alt="Modern furniture showroom"
  260. className="w-full h-full object-cover"
  261. />
  262. <div
  263. className="absolute inset-0"
  264. style={{
  265. background: "linear-gradient(135deg, rgba(20, 83, 45, 0.82) 0%, rgba(20, 83, 45, 0.65) 40%, rgba(194, 65, 12, 0.3) 100%)",
  266. }}
  267. />
  268. </div>
  269. <div className="container relative z-10">
  270. <div className="max-w-2xl">
  271. <motion.div
  272. initial={{ opacity: 0, y: 20 }}
  273. animate={{ opacity: 1, y: 0 }}
  274. transition={{ delay: 0.2 }}
  275. className="inline-flex items-center gap-2 px-4 py-2 rounded-full mb-8"
  276. style={{ background: "rgba(255,255,255,0.15)", backdropFilter: "blur(8px)" }}
  277. >
  278. <Zap className="w-4 h-4 text-amber-300" />
  279. <span className="text-sm text-white/90" style={{ fontFamily: "'Source Sans 3', sans-serif" }}>
  280. AI-Powered Customer Experience
  281. </span>
  282. </motion.div>
  283. <motion.h1
  284. initial={{ opacity: 0, y: 30 }}
  285. animate={{ opacity: 1, y: 0 }}
  286. transition={{ delay: 0.3 }}
  287. className="text-4xl sm:text-5xl lg:text-6xl font-bold leading-tight mb-6"
  288. style={{ fontFamily: "'Playfair Display', serif", color: "#fff" }}
  289. >
  290. Chatbot Workflow
  291. <br />
  292. <span style={{ color: "#fbbf24" }}>& Integration Guide</span>
  293. </motion.h1>
  294. <motion.p
  295. initial={{ opacity: 0, y: 30 }}
  296. animate={{ opacity: 1, y: 0 }}
  297. transition={{ delay: 0.4 }}
  298. className="text-lg mb-10 max-w-xl leading-relaxed"
  299. style={{ color: "rgba(255,255,255,0.85)", fontFamily: "'Source Sans 3', sans-serif" }}
  300. >
  301. A comprehensive guide to designing, building, and integrating an
  302. AI-powered chatbot for homelegance.com — from conversation workflows
  303. to production deployment.
  304. </motion.p>
  305. <motion.div
  306. initial={{ opacity: 0, y: 30 }}
  307. animate={{ opacity: 1, y: 0 }}
  308. transition={{ delay: 0.5 }}
  309. className="flex flex-wrap gap-4"
  310. >
  311. <a
  312. href="#workflow"
  313. className="inline-flex items-center gap-2 px-6 py-3.5 rounded-xl text-sm font-semibold transition-all hover:shadow-lg"
  314. style={{
  315. background: "#fff",
  316. color: "#14532D",
  317. fontFamily: "'Source Sans 3', sans-serif",
  318. boxShadow: "0 4px 16px rgba(0,0,0,0.1)",
  319. }}
  320. >
  321. <Workflow className="w-4 h-4" />
  322. Explore Workflow
  323. </a>
  324. <a
  325. href="#integration"
  326. className="inline-flex items-center gap-2 px-6 py-3.5 rounded-xl text-sm font-semibold transition-all hover:bg-white/20"
  327. style={{
  328. background: "rgba(255,255,255,0.12)",
  329. color: "#fff",
  330. border: "1px solid rgba(255,255,255,0.25)",
  331. fontFamily: "'Source Sans 3', sans-serif",
  332. }}
  333. >
  334. <Code2 className="w-4 h-4" />
  335. Integration Code
  336. </a>
  337. </motion.div>
  338. </div>
  339. </div>
  340. {/* Scroll indicator */}
  341. <motion.div
  342. animate={{ y: [0, 8, 0] }}
  343. transition={{ repeat: Infinity, duration: 2 }}
  344. className="absolute bottom-8 left-1/2 -translate-x-1/2"
  345. >
  346. <ArrowDown className="w-5 h-5 text-white/50" />
  347. </motion.div>
  348. </section>
  349. );
  350. }
  351. /* ─── Stats Bar ─── */
  352. function StatsBar() {
  353. const stats = [
  354. { value: "73%", label: "Queries Resolved by Bot", icon: <CheckCircle2 className="w-5 h-5" /> },
  355. { value: "< 2s", label: "Average Response Time", icon: <Clock className="w-5 h-5" /> },
  356. { value: "24/7", label: "Availability", icon: <Shield className="w-5 h-5" /> },
  357. { value: "40%", label: "Support Cost Reduction", icon: <TrendingUp className="w-5 h-5" /> },
  358. ];
  359. return (
  360. <div style={{ background: "#14532D" }}>
  361. <div className="container py-10">
  362. <div className="grid grid-cols-2 lg:grid-cols-4 gap-6">
  363. {stats.map((stat, i) => (
  364. <motion.div
  365. key={stat.label}
  366. initial={{ opacity: 0, y: 20 }}
  367. whileInView={{ opacity: 1, y: 0 }}
  368. viewport={{ once: true }}
  369. transition={{ delay: i * 0.1 }}
  370. className="text-center"
  371. >
  372. <div className="flex justify-center mb-2">
  373. <div className="w-10 h-10 rounded-lg flex items-center justify-center" style={{ background: "rgba(255,255,255,0.12)", color: "#fbbf24" }}>
  374. {stat.icon}
  375. </div>
  376. </div>
  377. <div className="text-2xl sm:text-3xl font-bold text-white mb-1" style={{ fontFamily: "'Playfair Display', serif" }}>
  378. {stat.value}
  379. </div>
  380. <div className="text-xs text-green-200/70" style={{ fontFamily: "'Source Sans 3', sans-serif" }}>
  381. {stat.label}
  382. </div>
  383. </motion.div>
  384. ))}
  385. </div>
  386. </div>
  387. </div>
  388. );
  389. }
  390. /* ─── Workflow Section ─── */
  391. function WorkflowSection() {
  392. return (
  393. <AnimatedSection
  394. id="workflow"
  395. className="py-20 lg:py-28 relative"
  396. >
  397. <div
  398. className="absolute inset-0 opacity-30"
  399. style={{
  400. backgroundImage: `url(${WORKFLOW_BG})`,
  401. backgroundSize: "cover",
  402. backgroundPosition: "center",
  403. }}
  404. />
  405. <div className="container relative z-10">
  406. <div className="max-w-2xl mx-auto text-center mb-14">
  407. <div
  408. className="inline-flex items-center gap-2 px-4 py-1.5 rounded-full mb-5"
  409. style={{ background: "#14532D12", color: "#14532D" }}
  410. >
  411. <GitBranch className="w-4 h-4" />
  412. <span className="text-xs font-semibold uppercase tracking-wider" style={{ fontFamily: "'Source Sans 3', sans-serif" }}>
  413. Conversation Flow
  414. </span>
  415. </div>
  416. <h2
  417. className="text-3xl sm:text-4xl font-bold mb-4"
  418. style={{ fontFamily: "'Playfair Display', serif", color: "#292524" }}
  419. >
  420. Chatbot Workflow Design
  421. </h2>
  422. <p className="text-base leading-relaxed" style={{ color: "#78716C", fontFamily: "'Source Sans 3', sans-serif" }}>
  423. The chatbot follows a structured conversation flow that routes users to the right
  424. information based on their intent. Click on any node below to see how each branch works.
  425. </p>
  426. </div>
  427. <WorkflowDiagram />
  428. </div>
  429. </AnimatedSection>
  430. );
  431. }
  432. /* ─── Architecture Section ─── */
  433. function ArchitectureSection() {
  434. return (
  435. <AnimatedSection
  436. id="architecture"
  437. className="py-20 lg:py-28"
  438. style={{ background: "#f5f0e8" }}
  439. >
  440. <div className="container">
  441. <div className="grid lg:grid-cols-2 gap-12 items-start">
  442. {/* Left: text */}
  443. <div>
  444. <div
  445. className="inline-flex items-center gap-2 px-4 py-1.5 rounded-full mb-5"
  446. style={{ background: "#C2410C12", color: "#C2410C" }}
  447. >
  448. <Server className="w-4 h-4" />
  449. <span className="text-xs font-semibold uppercase tracking-wider" style={{ fontFamily: "'Source Sans 3', sans-serif" }}>
  450. System Architecture
  451. </span>
  452. </div>
  453. <h2
  454. className="text-3xl sm:text-4xl font-bold mb-4"
  455. style={{ fontFamily: "'Playfair Display', serif", color: "#292524" }}
  456. >
  457. How It All Connects
  458. </h2>
  459. <p className="text-base leading-relaxed mb-8" style={{ color: "#78716C", fontFamily: "'Source Sans 3', sans-serif" }}>
  460. The chatbot architecture is designed as a layered system. The frontend widget communicates
  461. through a secure API gateway to the AI processing layer, which connects to Homelegance's
  462. existing CRM and fulfillment systems.
  463. </p>
  464. <div className="space-y-4">
  465. {[
  466. {
  467. title: "Client Layer",
  468. desc: "The chat widget is embedded via a lightweight JavaScript SDK that loads asynchronously. It handles the UI, message rendering, and WebSocket connection for real-time communication.",
  469. },
  470. {
  471. title: "Middleware",
  472. desc: "An API gateway handles authentication, rate limiting, and request routing. Webhooks process events like new messages, escalation requests, and session endings.",
  473. },
  474. {
  475. title: "AI & Logic",
  476. desc: "The NLP engine uses a fine-tuned language model to detect user intent and extract entities (product names, order numbers, locations). The dialog manager maintains conversation state.",
  477. },
  478. {
  479. title: "Integrations",
  480. desc: "The chatbot connects to Homelegance's CRM for order data, the product catalog API for search, and the dealer database for location queries. Live agent handoff uses the existing support queue.",
  481. },
  482. ].map((item, i) => (
  483. <motion.div
  484. key={item.title}
  485. initial={{ opacity: 0, x: -20 }}
  486. whileInView={{ opacity: 1, x: 0 }}
  487. viewport={{ once: true }}
  488. transition={{ delay: i * 0.1 }}
  489. className="p-4 rounded-xl"
  490. style={{ background: "#fff", border: "1px solid #e7e0d5" }}
  491. >
  492. <h4 className="text-sm font-bold mb-1" style={{ color: "#14532D", fontFamily: "'Source Sans 3', sans-serif" }}>
  493. {item.title}
  494. </h4>
  495. <p className="text-sm leading-relaxed" style={{ color: "#78716C", fontFamily: "'Source Sans 3', sans-serif" }}>
  496. {item.desc}
  497. </p>
  498. </motion.div>
  499. ))}
  500. </div>
  501. </div>
  502. {/* Right: diagram */}
  503. <div className="lg:sticky lg:top-24">
  504. <div className="p-6 rounded-2xl" style={{ background: "#FFFBEB", border: "1px solid #e7e0d5" }}>
  505. <ArchitectureDiagram />
  506. </div>
  507. </div>
  508. </div>
  509. </div>
  510. </AnimatedSection>
  511. );
  512. }
  513. /* ─── Integration Guide Section ─── */
  514. function IntegrationSection() {
  515. const steps = [
  516. {
  517. step: "01",
  518. title: "Embed the Widget",
  519. description: "Add a single script tag to your website's HTML. The widget loads asynchronously and won't affect page performance. Configure it with your site ID and preferred settings.",
  520. code: EMBED_CODE,
  521. language: "html",
  522. filename: "index.html",
  523. },
  524. {
  525. step: "02",
  526. title: "Configure Behavior",
  527. description: "Customize the chatbot's appearance, AI model, escalation rules, and integration endpoints through a configuration file. This controls everything from colors to conversation flow.",
  528. code: CONFIG_CODE,
  529. language: "javascript",
  530. filename: "chatbot-config.js",
  531. },
  532. {
  533. step: "03",
  534. title: "Set Up Webhooks",
  535. description: "Create server-side webhook handlers to process chatbot events. This is where you connect to your CRM, order management system, and live agent queue.",
  536. code: WEBHOOK_CODE,
  537. language: "javascript",
  538. filename: "server/chatbot-webhook.js",
  539. },
  540. {
  541. step: "04",
  542. title: "Connect Product APIs",
  543. description: "Integrate the chatbot with Homelegance's product catalog API to enable real-time product search, availability checking, and personalized recommendations within conversations.",
  544. code: API_CODE,
  545. language: "javascript",
  546. filename: "api/product-search.js",
  547. },
  548. ];
  549. return (
  550. <AnimatedSection id="integration" className="py-20 lg:py-28">
  551. <div className="container">
  552. <div className="max-w-2xl mx-auto text-center mb-14">
  553. <div
  554. className="inline-flex items-center gap-2 px-4 py-1.5 rounded-full mb-5"
  555. style={{ background: "#14532D12", color: "#14532D" }}
  556. >
  557. <Code2 className="w-4 h-4" />
  558. <span className="text-xs font-semibold uppercase tracking-wider" style={{ fontFamily: "'Source Sans 3', sans-serif" }}>
  559. Step-by-Step Guide
  560. </span>
  561. </div>
  562. <h2
  563. className="text-3xl sm:text-4xl font-bold mb-4"
  564. style={{ fontFamily: "'Playfair Display', serif", color: "#292524" }}
  565. >
  566. Integration Guide
  567. </h2>
  568. <p className="text-base leading-relaxed" style={{ color: "#78716C", fontFamily: "'Source Sans 3', sans-serif" }}>
  569. Follow these four steps to integrate the chatbot into homelegance.com.
  570. Each step includes production-ready code that you can customize to your needs.
  571. </p>
  572. </div>
  573. {/* Steps */}
  574. <div className="max-w-4xl mx-auto space-y-16">
  575. {steps.map((step, i) => (
  576. <motion.div
  577. key={step.step}
  578. initial={{ opacity: 0, y: 30 }}
  579. whileInView={{ opacity: 1, y: 0 }}
  580. viewport={{ once: true }}
  581. transition={{ delay: 0.1 }}
  582. className="relative"
  583. >
  584. {/* Step number + connector */}
  585. <div className="flex items-start gap-6">
  586. <div className="shrink-0 hidden sm:flex flex-col items-center">
  587. <div
  588. className="w-14 h-14 rounded-2xl flex items-center justify-center text-lg font-bold"
  589. style={{
  590. background: "#14532D",
  591. color: "#fff",
  592. fontFamily: "'Playfair Display', serif",
  593. boxShadow: "0 4px 16px rgba(20, 83, 45, 0.25)",
  594. }}
  595. >
  596. {step.step}
  597. </div>
  598. {i < steps.length - 1 && (
  599. <div className="w-0.5 h-16 mt-3" style={{ background: "#e7e0d5" }} />
  600. )}
  601. </div>
  602. <div className="flex-1">
  603. <h3
  604. className="text-xl sm:text-2xl font-bold mb-3"
  605. style={{ fontFamily: "'Playfair Display', serif", color: "#292524" }}
  606. >
  607. <span className="sm:hidden mr-2" style={{ color: "#C2410C" }}>{step.step}.</span>
  608. {step.title}
  609. </h3>
  610. <p className="text-sm leading-relaxed mb-5" style={{ color: "#78716C", fontFamily: "'Source Sans 3', sans-serif" }}>
  611. {step.description}
  612. </p>
  613. <CodeSnippet
  614. code={step.code}
  615. language={step.language}
  616. filename={step.filename}
  617. />
  618. </div>
  619. </div>
  620. </motion.div>
  621. ))}
  622. </div>
  623. </div>
  624. </AnimatedSection>
  625. );
  626. }
  627. /* ─── Benefits Section ─── */
  628. function BenefitsSection() {
  629. const benefits = [
  630. {
  631. icon: <Clock className="w-6 h-6" />,
  632. title: "24/7 Availability",
  633. description: "The chatbot never sleeps. Dealers and retailers across time zones can get instant answers to product questions, check order status, and find information at any hour.",
  634. },
  635. {
  636. icon: <TrendingUp className="w-6 h-6" />,
  637. title: "Increased Engagement",
  638. description: "Interactive conversation drives deeper product exploration. Dealers discover collections they might have missed, leading to larger and more diverse orders.",
  639. },
  640. {
  641. icon: <Zap className="w-6 h-6" />,
  642. title: "Faster Resolution",
  643. description: "Common queries like order status, dealer location, and product specs are answered instantly. This frees up sales reps to focus on complex, high-value conversations.",
  644. },
  645. {
  646. icon: <Shield className="w-6 h-6" />,
  647. title: "Consistent Experience",
  648. description: "Every interaction follows the same quality standards. The chatbot delivers accurate product information, current pricing, and up-to-date availability data every time.",
  649. },
  650. {
  651. icon: <Layers className="w-6 h-6" />,
  652. title: "Scalable Support",
  653. description: "Handle hundreds of simultaneous conversations without adding headcount. The chatbot scales with your business during peak seasons like market weeks and promotions.",
  654. },
  655. {
  656. icon: <Puzzle className="w-6 h-6" />,
  657. title: "Seamless Integration",
  658. description: "Connects with existing CRM, ERP, and order management systems. No need to replace current tools — the chatbot enhances what you already have.",
  659. },
  660. ];
  661. return (
  662. <AnimatedSection
  663. id="benefits"
  664. className="py-20 lg:py-28"
  665. >
  666. <div
  667. className="absolute inset-0 opacity-5"
  668. style={{
  669. backgroundImage: `url(${ARCH_BG})`,
  670. backgroundSize: "cover",
  671. }}
  672. />
  673. <div className="container relative z-10">
  674. <div className="max-w-2xl mx-auto text-center mb-14">
  675. <div
  676. className="inline-flex items-center gap-2 px-4 py-1.5 rounded-full mb-5"
  677. style={{ background: "#C2410C12", color: "#C2410C" }}
  678. >
  679. <Zap className="w-4 h-4" />
  680. <span className="text-xs font-semibold uppercase tracking-wider" style={{ fontFamily: "'Source Sans 3', sans-serif" }}>
  681. Why a Chatbot
  682. </span>
  683. </div>
  684. <h2
  685. className="text-3xl sm:text-4xl font-bold mb-4"
  686. style={{ fontFamily: "'Playfair Display', serif", color: "#292524" }}
  687. >
  688. Business Benefits
  689. </h2>
  690. <p className="text-base leading-relaxed" style={{ color: "#78716C", fontFamily: "'Source Sans 3', sans-serif" }}>
  691. An AI chatbot transforms how Homelegance connects with its dealer network,
  692. delivering measurable improvements across customer experience and operational efficiency.
  693. </p>
  694. </div>
  695. <div className="grid sm:grid-cols-2 lg:grid-cols-3 gap-5">
  696. {benefits.map((benefit, i) => (
  697. <motion.div
  698. key={benefit.title}
  699. initial={{ opacity: 0, y: 20 }}
  700. whileInView={{ opacity: 1, y: 0 }}
  701. viewport={{ once: true }}
  702. transition={{ delay: i * 0.08 }}
  703. whileHover={{ y: -4, boxShadow: "0 12px 32px rgba(120, 113, 108, 0.12)" }}
  704. className="p-6 rounded-xl transition-all"
  705. style={{
  706. background: "#fff",
  707. border: "1px solid #e7e0d5",
  708. boxShadow: "0 2px 8px rgba(120, 113, 108, 0.06)",
  709. }}
  710. >
  711. <div
  712. className="w-12 h-12 rounded-xl flex items-center justify-center mb-4"
  713. style={{ background: "#14532D12", color: "#14532D" }}
  714. >
  715. {benefit.icon}
  716. </div>
  717. <h3
  718. className="text-lg font-bold mb-2"
  719. style={{ fontFamily: "'Playfair Display', serif", color: "#292524" }}
  720. >
  721. {benefit.title}
  722. </h3>
  723. <p className="text-sm leading-relaxed" style={{ color: "#78716C", fontFamily: "'Source Sans 3', sans-serif" }}>
  724. {benefit.description}
  725. </p>
  726. </motion.div>
  727. ))}
  728. </div>
  729. </div>
  730. </AnimatedSection>
  731. );
  732. }
  733. /* ─── CTA Section ─── */
  734. function CTASection() {
  735. return (
  736. <section className="relative py-20 overflow-hidden">
  737. <div className="absolute inset-0">
  738. <img
  739. src={INTEGRATION_IMG}
  740. alt="Developer workspace"
  741. className="w-full h-full object-cover"
  742. />
  743. <div
  744. className="absolute inset-0"
  745. style={{
  746. background: "linear-gradient(135deg, rgba(20, 83, 45, 0.88) 0%, rgba(20, 83, 45, 0.75) 100%)",
  747. }}
  748. />
  749. </div>
  750. <div className="container relative z-10 text-center">
  751. <motion.div
  752. initial={{ opacity: 0, y: 20 }}
  753. whileInView={{ opacity: 1, y: 0 }}
  754. viewport={{ once: true }}
  755. >
  756. <h2
  757. className="text-3xl sm:text-4xl font-bold mb-4 text-white"
  758. style={{ fontFamily: "'Playfair Display', serif" }}
  759. >
  760. Ready to Get Started?
  761. </h2>
  762. <p
  763. className="text-base mb-8 max-w-lg mx-auto"
  764. style={{ color: "rgba(255,255,255,0.8)", fontFamily: "'Source Sans 3', sans-serif" }}
  765. >
  766. Try the live chatbot demo by clicking the green chat icon in the bottom-right corner.
  767. Experience the conversation flow firsthand.
  768. </p>
  769. <div className="flex flex-wrap justify-center gap-4">
  770. <a
  771. href="#workflow"
  772. className="inline-flex items-center gap-2 px-6 py-3.5 rounded-xl text-sm font-semibold transition-all"
  773. style={{
  774. background: "#fff",
  775. color: "#14532D",
  776. fontFamily: "'Source Sans 3', sans-serif",
  777. boxShadow: "0 4px 16px rgba(0,0,0,0.15)",
  778. }}
  779. >
  780. Review Workflow
  781. <ChevronRight className="w-4 h-4" />
  782. </a>
  783. <a
  784. href="#integration"
  785. className="inline-flex items-center gap-2 px-6 py-3.5 rounded-xl text-sm font-semibold transition-all"
  786. style={{
  787. background: "rgba(255,255,255,0.12)",
  788. color: "#fff",
  789. border: "1px solid rgba(255,255,255,0.25)",
  790. fontFamily: "'Source Sans 3', sans-serif",
  791. }}
  792. >
  793. View Integration Code
  794. <ExternalLink className="w-4 h-4" />
  795. </a>
  796. </div>
  797. </motion.div>
  798. </div>
  799. </section>
  800. );
  801. }
  802. /* ─── Footer ─── */
  803. function Footer() {
  804. return (
  805. <footer className="py-8 border-t" style={{ borderColor: "#e7e0d5", background: "#FFFBEB" }}>
  806. <div className="container">
  807. <div className="flex flex-col sm:flex-row items-center justify-between gap-4">
  808. <div className="flex items-center gap-2">
  809. <div className="w-7 h-7 rounded-md flex items-center justify-center" style={{ background: "#14532D" }}>
  810. <Bot className="w-4 h-4 text-white" />
  811. </div>
  812. <span className="text-sm font-semibold" style={{ color: "#14532D", fontFamily: "'Playfair Display', serif" }}>
  813. Homelegance Chatbot Demo
  814. </span>
  815. </div>
  816. <p className="text-xs" style={{ color: "#a8a29e", fontFamily: "'Source Sans 3', sans-serif" }}>
  817. Chatbot integration concept for homelegance.com
  818. </p>
  819. </div>
  820. </div>
  821. </footer>
  822. );
  823. }
  824. /* ─── Main Page ─── */
  825. export default function Home() {
  826. return (
  827. <div className="min-h-screen" style={{ background: "#FFFBEB" }}>
  828. <Nav />
  829. <HeroSection />
  830. <StatsBar />
  831. <WorkflowSection />
  832. <ArchitectureSection />
  833. <IntegrationSection />
  834. <BenefitsSection />
  835. <CTASection />
  836. <Footer />
  837. <ChatbotWidgetLive />
  838. </div>
  839. );
  840. }