Closed vingkan closed 6 years ago
Any update on this? This pull request seems reasonable, but then I don't really know SimPixel nearly as well...
@rec I have a backlog I'm working through. Hopefully will evaluate this in the next couple of days
On Mon, Oct 15, 2018, 7:37 AM Tom Swirly notifications@github.com wrote:
Any update on this? This pull request seems reasonable, but then I don't really know SimPixel nearly as well...
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/ManiacalLabs/SimPixel/pull/32#issuecomment-429817204, or mute the thread https://github.com/notifications/unsubscribe-auth/AA6a6gHlBzXKjNvkTYMJwvy3XjZXejV-ks5ulHNvgaJpZM4XW47N .
¡No es una problema! Just keeping you honest. ;-)
@vingkan See here -> http://beta.simpixel.io/ Looks good to me, but would appreciate you checking it out as well. Then I can promote it to simpixel.io
It's working like a charm for me! Thanks @adammhaile
Builds on #28 by checking URL parameters to customize point size and dark LED visibility.
Set view to URL parameters
I followed @adammhaile 's suggestion to modify
bpHost()
into a new functionbpParams()
that returns a dict of three settings: websocket host, point size, and dark LED visibility. I added two methods to the View class (updateSizeDefault(val)
andupdateDarkVisible(val)
) to set point size and dark LED visibility from main.js and update the display. Those methods also take care of updating the GUI panel controllers, as recommended in the data-gui documentation.The URL parameters are:
size
: integerdark
:on
oroff
An example URL would be: https://simpixel.io/?host=wss://dreamy-elli_80.ide.mimir.io&size=7&dark=on
Remember parameters in localStorage
I also incorporated @mwcz 's suggestion to save the parameters in localStorage, if possible. I tried the data-gui
remember()
first, but it added extra selectors and buttons to the top of the panel, which seemed like too much. Instead, I added a method to the View class calledrememberParams()
to save point size and dark LED visibility to localStorage when they are updated.