captbaritone / webamp

Winamp 2 reimplemented for the browser
https://webamp.org
MIT License
10.1k stars 672 forks source link

How to programmatically move Webamp? (through CSS styling?) #1245

Open that-ben opened 9 months ago

that-ben commented 9 months ago

So, I've seen this question pop up on various forums over the last 3 years up to just a few weeks ago, but couldn't find any answer: Is it possible to programmatically override Webamp's position variables? They don't seem to be publicly exposed.

I've hacked the initial position to my liking (couldn't use options.__initialWindowLayout because I wanted a relative viewport percentage rather than absolute values) and it works fine, except that when we click for the first time on any of Webamp's components, it instantly reverts back to the center of the viewport. Subsequent clicks and drags are OK. I found that the absolute positioning of Webamp relies on private coordinate variables that don't seem to be exposed at all:

Screenshot 2023-12-17 at 11 05 21 AM