From 1a7a52aaf489d427137a8d27c57663ef1e86198f Mon Sep 17 00:00:00 2001 From: sasha-astiadi Date: Thu, 16 Oct 2025 17:48:58 +0200 Subject: [PATCH] feat: add animated grid background with randomly activating cells in AboutSolutions --- src/components/AboutSolutions.tsx | 42 ++++++++++++++++++++++--------- 1 file changed, 30 insertions(+), 12 deletions(-) diff --git a/src/components/AboutSolutions.tsx b/src/components/AboutSolutions.tsx index f2a83f8..470c749 100644 --- a/src/components/AboutSolutions.tsx +++ b/src/components/AboutSolutions.tsx @@ -1,38 +1,56 @@ "use client"; +import { useEffect, useState } from "react"; + export function AboutSolutions() { + const totalCells = 2000; + const [active, setActive] = useState([]); + + // randomly activate some squares every 0.8 s + useEffect(() => { + const interval = setInterval(() => { + const newActive = Array.from({ length: 20 }, () => + Math.floor(Math.random() * totalCells) + ); + setActive(newActive); + }, 800); + return () => clearInterval(interval); + }, []); + return (
- {/* Square grid background */} + {/* Animated grid background */}