Super cool.
These are all localhost.
First, a window knows where it is and about the windowing environment. There is an ancient program called "xeyes" that are a pair of eyes that always look at wherever your mouse cursor is. So this data can inform the animation if the window was moved, so it can react to that movement.
Second, being on a localhost server, the frontend can communicate that information back to the localhost server, and the server can coordinate multiple windows.