diff --git a/src/web/src/components/ui/grid.jsx b/src/web/src/components/ui/grid.jsx new file mode 100644 index 0000000..10c2506 --- /dev/null +++ b/src/web/src/components/ui/grid.jsx @@ -0,0 +1,37 @@ +"use client" + +import React, { useState } from 'react'; + +const Grid = () => { + const [squares, setSquares] = useState([]); + + const handleClick = (event) => { + const { clientX, clientY } = event; + const newSquares = []; + + for (let i = 0; i < 25; i++) { + const left = clientX - 50 + Math.random() * 100; + const top = clientY - 50 + Math.random() * 100; + const color = `rgb(${Math.random() * 255}, ${Math.random() * 255}, ${Math.random() * 255})`; + + newSquares.push({ left, top, color }); + } + + setSquares(newSquares); + }; + + return ( +
+ {squares.map((square, index) => ( +
+ ))} +
+ ); +}; + +export default Grid; +