File tree Expand file tree Collapse file tree 1 file changed +14
-0
lines changed
Expand file tree Collapse file tree 1 file changed +14
-0
lines changed Original file line number Diff line number Diff 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
8094const brightnessFilter = document . createElement ( 'div' ) ;
8195brightnessFilter . style . position = 'fixed' ;
You can’t perform that action at this time.
0 commit comments