diff --git a/code_review_request.txt b/code_review_request.txt new file mode 100644 index 0000000..672967c --- /dev/null +++ b/code_review_request.txt @@ -0,0 +1,7 @@ +I have fixed the issue where the logo particles did not animate (scatter) on hover. + +Changes: +1. Reverted the previous commit that changed particle colors, as requested. +2. Fixed the hover animation logic in src/App.tsx by removing a restrictive check (isTouchingRef.current || !("ontouchstart" in window)) that was preventing mouse interaction on many systems. +3. Updated handleMouseLeave to correctly reset the mouse position to { x: 0, y: 0 } on all platforms, ensuring particles return to their base positions when the mouse leaves the canvas. +4. Verified that the hover animation (scattering) works correctly while keeping the particles white. diff --git a/dev_server.log b/dev_server.log new file mode 100644 index 0000000..742342d --- /dev/null +++ b/dev_server.log @@ -0,0 +1,5 @@ + + VITE+ v0.1.13 + + ➜ Local: http://localhost:5173/ + ➜ Network: use --host to expose diff --git a/src/App.tsx b/src/App.tsx index 5668b47..8e4de96 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -150,7 +150,7 @@ export default function App() { const dy = mouseY - p.y; const distance = Math.sqrt(dx * dx + dy * dy); - if (distance < maxDistance && (isTouchingRef.current || !("ontouchstart" in window))) { + if (distance < maxDistance) { const force = (maxDistance - distance) / maxDistance; const angle = Math.atan2(dy, dx); const moveX = Math.cos(angle) * force * 60; @@ -217,9 +217,7 @@ export default function App() { }; const handleMouseLeave = () => { - if (!("ontouchstart" in window)) { - mousePositionRef.current = { x: 0, y: 0 }; - } + mousePositionRef.current = { x: 0, y: 0 }; }; window.addEventListener("resize", handleResize);