Hailey Park
#000033) with bright yellow text (#f5ffa8). Each line begins at a random location on the canvas and continuously converges toward the user's mouse cursor, maintaining neat vertical spacing to symbolize love and coming together.My Thoughts:
In this sketch, I explored the premise "Everything is related to everything else" by linking textual coordinates (x1~x5, y1~y5) directly to the mouse cursor position (mouseX, mouseY). Using nested conditional logic, each line speeds toward the mouse when far away, then slows down to a gentle crawl once within a 50-pixel radius. This two-stage attraction paired with flickering background stars creates a poetic metaphor: scattered fragments of light dynamically drawn together through human interaction, gradually aligning into a structured poem around the user.
Line Number(s):
if(x1 < mouseX) { if (x1 < mouseX - 50) x1 += 6; else x1++; }
if(y2 < mouseY + 30) { if (y2 < mouseY + 30 - 50) y2 += 4; else y2++; }
Why it's interesting:
I found it fascinating how simple conditional logic can simulate physics without complex libraries. By checking if the text is further than 50 pixels from the target (mouseX - 50), the text shifts into a "fast-approach" mode (+= 6, += 4), and seamlessly drops down to precise step increments (x1++) near the cursor. Combining this logic with Y-axis offsets (mouseY + 30, + 60, etc.) allows each line to move at its own speed while maintaining structured line breaks.
Question:
Currently, the text stops moving when the mouse leaves the screen. What is the simplest way to make all the text lines scatter back to new random positions whenever the mouse exits the canvas?