-
Notifications
You must be signed in to change notification settings - Fork 43
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
add a screensaver overlay to ui for use with connected displays #140
add a screensaver overlay to ui for use with connected displays #140
Conversation
} | ||
let timer = null; | ||
//current localbrowser user agent is 'Mozilla/5.0 (X11; Linux armv7l) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/13.0 Safari/605.1.15' | ||
let screensaverEnabled = navigator.userAgent.indexOf('(X11; Linux armv7l)') >= 0 && navigator.userAgent.indexOf(' (KHTML, like Gecko) Version/13.0 Safari') >= 0; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The userAgent could be customized to something very specific on hifiberry-os e.g. "hifiberry-localbrowser", but I'm not sure if there is any other current use of userAgent that would break.
|
||
</div> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is the HTML overlay that shows when the timeout fires. It is a parallax black and white starfield animated from the css in Beocreate2/beo-extensions/ui-settings/ui-settings.css. I will clean up the id/class names to be more pertinent.
Cool stuff, I'll try this out before merging. The important thing is to not have this when the UI is running in any other context, which is something you've also given some thought. I also think there might be opportunities to bring in an "ambient display" aspect, such as track info at song change. |
<div class="screensaver-timeout-slider black show-value"></div> | ||
<div class="symbol" style="-webkit-mask-image: url(extensions/ui-settings/symbols-black/clock.svg); mask-image: url(extensions/ui-settings/symbols-black/clock.svg);"></div> | ||
</div> | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure this slider should be hidden when the "Use Connected Display" is hidden, but for now it is.
I've reviewed the changes the best I could and got a few suggestions on improvements:
Overall I'm grateful that you took the initiative with this idea and I'm certain we can fit it in just nicely with some tweaks 😊 Best, |
Cheers. Let me know if you require assistance with it.
This is kind of what I was referring to with "ambient display", maybe we bring this information directly into the screen saver such that it fades in for a brief period of time. We could also bring colours from the album cover into the screen saver in some fashion. Now Playing is implemented using Vue and it's trivial to add another instance that hooks this data up with the screen saver. I can give this a shot once we get the basics up and running.
Yup that's exactly it. I think customisable options could be something to think about in the future but for now we should aim for one simple solution and see how people are finding it.
Cheers, take all the time you need. |
Very nice work with the improvements. Currently the mini-now-playing within the screensaver does not function, from what I can see, but that's because there is no "global" Vue instance. Right now we're just "flirting" with Vue in a bunch of places (Now Playing and Music are written with it) so the whole UI is not yet contained in it. Moving the whole UI onto Vue is something I would like to do at some point, but that time is not now. For now we could just add a Vue instance in the UI settings client code, outside the self-invoking function, and connect it to the Now Playing data:
This is a quick-and-dirty way to do it, there's a lot of extra markup in the component so for the long term there are better ways to go about it, I can also pitch in on that later. |
Ah right, sorry I had added this to the |
After replacing the starfield with the animated dots, it works fine, except that on my DSI display, the svg animations stop after some time. I don't think this is critical, but would be interested to know if the same happens to others. Here is a video of my laptop browser next to my pi display after running for some time - the css transitions/javascript is still working on both, but the animations in the svg only play on my laptop: Restarting cog service the animations in svg come back for a while, not sure exactly how long - maybe 10-15 minutes. I don't see anything fishy in top:
|
Cool to see the dots make an appearance. I implemented some tweaks based on these latest changes:
I don't have suggestions on the DSI display issue, unfortunately. The SVG animations seem to have a mind of their own even on my Mac, not always triggering, but this might be some WebKit power saving feature. Unless I'm mistaken (which could be, Git is like black magic to me at times...), I can't add to this PR because you own the fork this comes from, so I could merge now and add my changes afterwards – better ideas? |
Thanks for the help @tuomashamalainen. This all sounds good. To test out changes on desktop (mac if it matters), is there a simple way to run the beocreate2 nodejs app on desktop, without moving around directories like |
Thanks, must be a user error then. I'll try again. Currently the system has not been designed to run outside Raspberry Pi / HiFiBerryOS environment so it's very angry about a lot of stuff if it's not where expected. I did test this a while back and these instructions might still work: #66 (comment) It's not very simple but if you really want it, it can be done. The GUI itself, as you probably know, doesn't really care where it's displayed – the server is the culprit here. Personally when I work, I have set up my editor to automatically mirror saved files to the Raspberry Pi so that it doesn't matter much where the actual server runs when testing. |
I haven't seen the issue with allowing edits by maintainers - but I can't remember the last time I used it. I added you as a collaborator on my fork, or if you prefer I can manually shuttle changes from your branch, etc. Whatever is easier for you. |
- Fade in and out - Rotate dots on the screen one by one - Better now playing data - Default delay is 5 minutes - Show currently selected option in the menu
Thanks, after accepting your invitation I managed to push my changes just fine. Give them a go when you've got time, and after that I'll fold this in if you don't have more things to add/change for now. |
Looks good to me - thanks for your help! |
No worries, thanks for taking the lead on this. It's a cool initiative that has future potential. I'll merge this in now. |
On connected display, displays an animated html overlay after a configurable timeout.