-
-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
Default background image and selector and slideshow for default background images #788
Conversation
public/javascripts/big.js
Outdated
"http:https://wallpapers.wallhaven.cc/wallpapers/full/wallhaven-146575.jpg" | ||
]; | ||
$defaultBg.prepend(defaultBgs.map(function(v) { | ||
return '<a style="background-image:url(' + v + ')" img="' + v + '"></a>'; |
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.
img attribute is not valid on a-tags which makes this invalid html, use data-img instead
http:https://api.jquery.com/data/
http:https://ejohn.org/blog/html-5-data-attributes/
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.
Ok, thanks for the hint!
Is this branch compiling? Also I remember why there's bgImg on server side, now. It's the only way to serve the page with the background image set directly in the HTML (https://github.com/Unihedro/lila/blob/default-bg/app/views/base/layout.scala.html#L41-L43). |
I also can't tell if it compiles since I had to go just when I was going to test compiling, but f7e1613 was pretty dubious. You're right about the FOUC - since the background image is set on the first time the theme picker is loaded (the same time the selector initializes), the background isn't effectively loaded until everything else is, at least. Still, it's disappointing if we'd had to store every picture the user has, it makes me wonder if there's a solution to the design requirement at all. |
it should be possible to keep using bgImg to solve the FOUC issue, while keeping all the rest client side. |
Right, I'll revert f7e1613 and give that a try. |
Turns out I forgot to commit the rest of the common.css changes. |
Although, it's stupidly annoying and kinda makes me feel like removing it.
Done. Compiles fine and works mostly. Let me know if there's any room for improvements! |
Oh, I forgot about it. I'll look into that now. |
looks like code has diverged so far that you would probably have to start over |
fixes #774