Ran the format script

This commit is contained in:
Rezmason
2025-05-05 08:52:35 -07:00
parent 7a10893486
commit 237990b44c
25 changed files with 1474 additions and 1403 deletions

View File

@@ -107,34 +107,32 @@ import makeConfig from "./utils/config";
/** @param {MatrixProps} props */
export const Matrix = memo((props) => {
const { style, className, ...rest } = props;
const elProps = { style, className };
const matrix = useRef(null);
const rainRef = useRef(null);
const canvasRef = useRef(null);
const { style, className, ...rest } = props;
const elProps = { style, className };
const matrix = useRef(null);
const rainRef = useRef(null);
const canvasRef = useRef(null);
useEffect(() => {
const canvas = document.createElement("canvas");
canvas.style.width = "100%";
canvas.style.height = "100%";
canvasRef.current = canvas;
}, []);
useEffect(() => {
const canvas = document.createElement("canvas");
canvas.style.width = "100%";
canvas.style.height = "100%";
canvasRef.current = canvas;
}, []);
useEffect(() => {
matrix.current.appendChild(canvasRef.current);
const gl = canvasRef.current.getContext("webgl");
createRain(canvasRef.current, makeConfig({ ...rest }), gl).then(
(handles) => {
rainRef.current = handles;
}
);
useEffect(() => {
matrix.current.appendChild(canvasRef.current);
const gl = canvasRef.current.getContext("webgl");
createRain(canvasRef.current, makeConfig({ ...rest }), gl).then((handles) => {
rainRef.current = handles;
});
return () => {
if (rainRef.current) {
destroyRain(rainRef.current);
}
};
}, [props]);
return () => {
if (rainRef.current) {
destroyRain(rainRef.current);
}
};
}, [props]);
return <div ref={matrix} {...elProps}></div>;
return <div ref={matrix} {...elProps}></div>;
});