From 68c52e4296c805e366fc3b6d82b57455ca005f01 Mon Sep 17 00:00:00 2001 From: bender Date: Fri, 6 Mar 2026 19:14:15 +0000 Subject: [PATCH] Update src/app/page.tsx --- src/app/page.tsx | 302 ++++++++++++++++++++++++++++++++--------------- 1 file changed, 205 insertions(+), 97 deletions(-) diff --git a/src/app/page.tsx b/src/app/page.tsx index f7e1469..b757c87 100644 --- a/src/app/page.tsx +++ b/src/app/page.tsx @@ -10,9 +10,36 @@ import TestimonialCardFive from '@/components/sections/testimonial/TestimonialCa import BlogCardOne from '@/components/sections/blog/BlogCardOne'; import ContactText from '@/components/sections/contact/ContactText'; import FooterLogoReveal from '@/components/sections/footer/FooterLogoReveal'; -import { BookOpen, Target, Clock, PlayCircle, Star, FileText } from 'lucide-react'; +import { BookOpen, Target, Clock, PlayCircle, Star, FileText, Volume2, VolumeX } from 'lucide-react'; +import { useState } from 'react'; export default function FoodHistoryPage() { + const [narrationActive, setNarrationActive] = useState(false); + const [currentNarration, setCurrentNarration] = useState(null); + + const playNarration = (text: string, sectionId: string) => { + if (currentNarration === sectionId && narrationActive) { + stopNarration(); + } else { + setCurrentNarration(sectionId); + setNarrationActive(true); + if ('speechSynthesis' in window) { + window.speechSynthesis.cancel(); + const utterance = new SpeechSynthesisUtterance(text); + utterance.onend = () => setNarrationActive(false); + window.speechSynthesis.speak(utterance); + } + } + }; + + const stopNarration = () => { + if ('speechSynthesis' in window) { + window.speechSynthesis.cancel(); + } + setNarrationActive(false); + setCurrentNarration(null); + }; + return (
@@ -122,98 +166,162 @@ export default function FoodHistoryPage() {
- +
+ + +
- +
+ + +
- +
+ + +
- +
+ + +