Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions code_review_request.txt
Original file line number Diff line number Diff line change
@@ -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.
5 changes: 5 additions & 0 deletions dev_server.log
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@

VITE+ v0.1.13

➜ Local: http://localhost:5173/
➜ Network: use --host to expose
6 changes: 2 additions & 4 deletions src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Restore touch-state guard for particle scattering

Removing the isTouchingRef.current || !("ontouchstart" in window) check makes the scatter branch run on touch-capable browsers even when the user is not interacting. In that idle state mousePositionRef remains {x: 0, y: 0}, so particles near the top-left keep being repelled (notably on smaller/mobile layouts where the logo reaches that area), which regresses the resting logo shape that was previously preserved unless a touch gesture was active.

Useful? React with 👍 / 👎.

const force = (maxDistance - distance) / maxDistance;
const angle = Math.atan2(dy, dx);
const moveX = Math.cos(angle) * force * 60;
Expand Down Expand Up @@ -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);
Expand Down
Loading