Skip to content

Commit cd88420

Browse files
authored
V2.0.2 (#25)
* lazy load bg * css: fixed black vertical lines
1 parent a1916ed commit cd88420

File tree

3 files changed

+12
-6
lines changed

3 files changed

+12
-6
lines changed

css/body-background.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
height: 100%;
44
top: 0;
55
left: 0;
6-
position: fixed;
6+
position: absolute;
77
margin: 0;
88
padding: 0;
99
z-index: 0;

css/screens.css

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
height: 100%;
44
top: 0;
55
left: 0;
6-
position: fixed;
6+
position: absolute;
77
margin: 0;
88
padding: 0;
99
z-index: 20;
@@ -20,7 +20,7 @@
2020
left: 0;
2121
margin: 0;
2222
padding: 0;
23-
position: fixed;
23+
position: absolute;
2424
background-color: #252525;
2525
background-size: cover;
2626
background-repeat: no-repeat;
@@ -87,8 +87,9 @@
8787
}
8888

8989
/* Greeter Screen */
90-
#screen-greeter {
90+
#screen-greeter.screen {
9191
top: 0;
92+
position: fixed;
9293
pointer-events: unset;
9394
transform: translateZ();
9495
transition:

js/backgrounds.js

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,8 +58,13 @@ class Backgrounds {
5858
}
5959

6060
_updateBackgroundImages() {
61-
for (let background of this._backgrounds) {
62-
background.style.backgroundImage = `url('${this._backgroundCurrentPath}')`;
61+
let dummyImg = document.createElement('img');
62+
dummyImg.src = this._backgroundCurrentPath;
63+
dummyImg.onload = () => {
64+
const src = `url('${dummyImg.src}')`;
65+
for (let background of this._backgrounds) {
66+
background.style.backgroundImage = src;
67+
}
6368
}
6469
}
6570

0 commit comments

Comments
 (0)