diff --git a/src/app/page.tsx b/src/app/page.tsx index fedc108..25a16ce 100644 --- a/src/app/page.tsx +++ b/src/app/page.tsx @@ -9,8 +9,8 @@ import FeatureCardOne from "@/components/sections/feature/FeatureCardOne"; import TestimonialCardSix from "@/components/sections/testimonial/TestimonialCardSix"; import ContactSplit from "@/components/sections/contact/ContactSplit"; import FooterBase from "@/components/sections/footer/FooterBase"; -import { Star, Sparkles, Award, Heart, Mail, Calendar, X, Clock, Users, CheckCircle } from "lucide-react"; -import { useState, useEffect } from "react"; +import { Star, Sparkles, Award, Heart, Mail, CheckCircle } from "lucide-react"; +import { useState } from "react"; import React from "react"; interface TimeSlot { @@ -50,31 +50,38 @@ const TIME_SLOTS: TimeSlot[] = [ { time: '04:00 PM', available: true }, ]; +// Pre-generate random values outside of render to avoid impure function violations +const generateRandomValues = () => { + return Array.from({ length: 30 }).map(() => ({ + delay: Math.random() * 2, + duration: 3 + Math.random() * 2, + x: Math.random() * 100, + y: Math.random() * 100, + size: 2 + Math.random() * 4, + offsetX: Math.random() * 100 - 50, + offsetY: Math.random() * 100 - 50, + })); +}; + +const RANDOM_VALUES = generateRandomValues(); + function FloatingDotsAnimation() { return (
- {Array.from({ length: 30 }).map((_, i) => { - const randomDelay = Math.random() * 2; - const randomDuration = 3 + Math.random() * 2; - const randomX = Math.random() * 100; - const randomY = Math.random() * 100; - const randomSize = 2 + Math.random() * 4; - - return ( -
- ); - })} + {RANDOM_VALUES.map((values, i) => ( +
+ ))}