Skip to content

Commit

Permalink
V2.0.2 (#25)
Browse files Browse the repository at this point in the history
* lazy load bg

* css: fixed black vertical lines
  • Loading branch information
eromatiya authored Sep 9, 2020
1 parent a1916ed commit cd88420
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 6 deletions.
2 changes: 1 addition & 1 deletion css/body-background.css
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
height: 100%;
top: 0;
left: 0;
position: fixed;
position: absolute;
margin: 0;
padding: 0;
z-index: 0;
Expand Down
7 changes: 4 additions & 3 deletions css/screens.css
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
height: 100%;
top: 0;
left: 0;
position: fixed;
position: absolute;
margin: 0;
padding: 0;
z-index: 20;
Expand All @@ -20,7 +20,7 @@
left: 0;
margin: 0;
padding: 0;
position: fixed;
position: absolute;
background-color: #252525;
background-size: cover;
background-repeat: no-repeat;
Expand Down Expand Up @@ -87,8 +87,9 @@
}

/* Greeter Screen */
#screen-greeter {
#screen-greeter.screen {
top: 0;
position: fixed;
pointer-events: unset;
transform: translateZ();
transition:
Expand Down
9 changes: 7 additions & 2 deletions js/backgrounds.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,13 @@ class Backgrounds {
}

_updateBackgroundImages() {
for (let background of this._backgrounds) {
background.style.backgroundImage = `url('${this._backgroundCurrentPath}')`;
let dummyImg = document.createElement('img');
dummyImg.src = this._backgroundCurrentPath;
dummyImg.onload = () => {
const src = `url('${dummyImg.src}')`;
for (let background of this._backgrounds) {
background.style.backgroundImage = src;
}
}
}

Expand Down

0 comments on commit cd88420

Please sign in to comment.