import { useEffect, useRef } from "react"; import "styles/echoes.css"; export const Echoes: React.FC = () => { const svgRef = useRef(null); useEffect(() => { // 优化动画性能 if (svgRef.current) { svgRef.current.style.willChange = "transform"; // 使用 requestAnimationFrame 来优化动画 const paths = svgRef.current.querySelectorAll("path"); paths.forEach((path) => { path.style.willChange = "transform"; }); } return () => { if (svgRef.current) { svgRef.current.style.willChange = "auto"; } }; }, []); return ( ); };