Skip to content

Commit c092dd8

Browse files
committed
add file picker in debug mode to change wallpaper
1 parent 6ef2b94 commit c092dd8

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

static/debug.js

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,20 @@ for (let i = 0; i < 5; i++) {
7676
document.getElementById('intra-calendar').appendChild(calendarEvent);
7777
}
7878

79+
// Add file picker for wallpaper
80+
const wallpaperPicker = document.createElement('input');
81+
wallpaperPicker.type = 'file';
82+
wallpaperPicker.accept = 'image/*';
83+
optionsContainer.appendChild(wallpaperPicker);
84+
wallpaperPicker.addEventListener('change', () => {
85+
const file = wallpaperPicker.files[0];
86+
const reader = new FileReader();
87+
reader.onload = () => {
88+
document.body.style.backgroundImage = `url(${reader.result})`;
89+
};
90+
reader.readAsDataURL(file);
91+
});
92+
7993
// Add slider to change the background brightness
8094
const brightnessFilter = document.createElement('div');
8195
brightnessFilter.style.position = 'fixed';

0 commit comments

Comments
 (0)