diff --git a/src/components/ui/backgrounds/background-boxes.tsx b/src/components/ui/backgrounds/background-boxes.tsx index 0f000dc..766b6fd 100644 --- a/src/components/ui/backgrounds/background-boxes.tsx +++ b/src/components/ui/backgrounds/background-boxes.tsx @@ -18,23 +18,19 @@ const COLORS = [ ]; export default React.memo(function BackgroundBoxes({ settings }: Props) { - const rows = clampNumber(settings.rows, 4, 30, 20); - const cols = clampNumber(settings.cols, 4, 30, 12); + const rows = clampNumber(settings.rows, 4, 30, 15); + const cols = clampNumber(settings.cols, 4, 30, 15); const boxColor = sanitizeColor(settings.boxColor, '#818cf8'); - const grid = useMemo(() => { - const result: { color: string; delay: number; duration: number }[][] = []; - for (let i = 0; i < rows; i++) { - const row: { color: string; delay: number; duration: number }[] = []; - for (let j = 0; j < cols; j++) { - row.push({ - color: - boxColor === '#818cf8' ? COLORS[Math.floor(Math.random() * COLORS.length)] : boxColor, - delay: Math.random() * 8, - duration: 3 + Math.random() * 4, - }); - } - result.push(row); + const cells = useMemo(() => { + const result: { color: string; delay: number; duration: number }[] = []; + for (let i = 0; i < rows * cols; i++) { + result.push({ + color: + boxColor === '#818cf8' ? COLORS[Math.floor(Math.random() * COLORS.length)] : boxColor, + delay: Math.random() * 8, + duration: 3 + Math.random() * 4, + }); } return result; }, [rows, cols, boxColor]); @@ -42,43 +38,33 @@ export default React.memo(function BackgroundBoxes({ settings }: Props) { return (