logoalt Hacker News

seba_dos1yesterday at 11:27 PM3 repliesview on HN

Same. Thank heavens the website doesn't know the position of the browser's window in respect to the screen it's on.


Replies

sheepttoday at 2:31 AM

There's several web APIs for browser window positioning, like screenX/Y[0] (which is what OP uses), which allows for those classic pop-up based browser games from over a decade ago, like Browser Ball.[1]

[0]: demo: https://mdn.github.io/dom-examples/screenleft-screentop/

[1]: https://romanbaiocco.github.io/browser-ball-reloaded/

show 1 reply
krickyesterday at 11:59 PM

Actually, they do, sort of. At least, if you use GLSL shaders. I remember some demo project using it in a way that made it appear that the website "sees" another window with the same website, which blew my mind when I saw it first. Cannot recall the name or anything else to locate it.

fluoridationyesterday at 11:33 PM

Wait until they realize that on mobile they can use accelerometer data to keep the element in the same position in space across translations of the device.

show 1 reply