Skip to content

Commit 4bc18dc

Browse files
committed
prevent displaying default wallpaper during load
1 parent 63d7fe8 commit 4bc18dc

File tree

3 files changed

+7
-5
lines changed

3 files changed

+7
-5
lines changed

client/uis/wallpaper.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,8 @@ export class WallpaperUI {
2828
this._element.style.backgroundImage = 'url("' + wallpaper.path + '")';
2929
}
3030
else {
31-
// Fall back to black color
32-
this._element.style.backgroundColor = 'black';
33-
this._element.style.backgroundImage = 'none';
31+
// Fall back to default image from CSS vars
32+
this._element.style.backgroundImage = window.getComputedStyle(this._element).getPropertyValue('--default-bg-img');
3433
}
3534

3635
return true;

static/css/styles.css

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
/* Colors can be found in css/dark.css and css/light.css */
33

44
/* Generic settings */
5-
--default-bg-img: url('../assets/default-wallpaper.png');
5+
--default-bg-img: url('assets/default-wallpaper.png'); /* relative to html file, set in JS */
66
--blur-bg-filter: blur(5px);
77
--blur-bg-filter-lock-screen: blur(25px);
88
--border-radius: 4px;
@@ -53,7 +53,7 @@ body {
5353
flex-direction: column;
5454
align-items: center;
5555
justify-content: center;
56-
background: var(--default-bg-img);
56+
background-color: #000;
5757
background-position: center center;
5858
background-size: cover;
5959
background-repeat: no-repeat;

static/debug.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,9 @@ examModeProjects.innerText = 'Exam Rank 00, Exam Rank 01, Exam Rank 02, non-exis
1414
const lockedAgo = document.getElementById('active-user-session-locked-ago');
1515
lockedAgo.innerText = 'Automated logout occurs in 42 minutes';
1616

17+
// Load the default wallpaper
18+
document.body.style.backgroundImage = window.getComputedStyle(document.body).getPropertyValue('--default-bg-img');
19+
1720
// Add options container
1821
const optionsContainer = document.createElement('div');
1922
optionsContainer.id = 'screen-switcher';

0 commit comments

Comments
 (0)