Update changes
This commit is contained in:
parent
5ba0d053f2
commit
49a1892678
6 changed files with 123 additions and 29 deletions
48
functions/wallpaper.js
Normal file
48
functions/wallpaper.js
Normal file
|
@ -0,0 +1,48 @@
|
|||
// Set Default
|
||||
if (localStorage.getItem('wallpaper') === null) {Wallpaper27588471()}
|
||||
|
||||
// Apply
|
||||
function ApplyWallpaper() {
|
||||
document.querySelector('.tab-background img').setAttribute('src', localStorage.getItem('wallpaper'))
|
||||
document.querySelector('#wallpaper-credit-link').innerHTML = localStorage.getItem('wallpaper-credit-author')
|
||||
document.querySelector('#wallpaper-credit-link').setAttribute('href', localStorage.getItem('wallpaper-credit-link'))
|
||||
}
|
||||
|
||||
// Deselect All
|
||||
function WallpaperDeselectAll() {
|
||||
document.querySelector('#wallpaper-selection-19906181').style.borderColor = 'transparent'
|
||||
document.querySelector('#wallpaper-selection-27588471').style.borderColor = 'transparent'
|
||||
document.querySelector('#wallpaper-selection-27960528').style.borderColor = 'transparent'
|
||||
}
|
||||
|
||||
// Change Wallpaper
|
||||
function Wallpaper19906181() {
|
||||
localStorage.setItem('wallpaper', './backgrounds/19906181/background.jpg')
|
||||
localStorage.setItem('wallpaper-selection', 'wallpaper-selection-19906181')
|
||||
|
||||
localStorage.setItem('wallpaper-credit-author', 'Susanne Jutzeler')
|
||||
localStorage.setItem('wallpaper-credit-link', 'https://www.pexels.com/photo/swiss-alps-in-winter-19906181/')
|
||||
ApplyWallpaper()
|
||||
WallpaperDeselectAll()
|
||||
document.querySelector('#wallpaper-selection-19906181').style.borderColor = 'white'
|
||||
}
|
||||
function Wallpaper27588471() {
|
||||
localStorage.setItem('wallpaper', './backgrounds/27588471/background.jpg')
|
||||
localStorage.setItem('wallpaper-selection', 'wallpaper-selection-27588471')
|
||||
|
||||
localStorage.setItem('wallpaper-credit-author', 'Wolfgang Weiser')
|
||||
localStorage.setItem('wallpaper-credit-link', 'https://www.pexels.com/photo/elbsandsteingebirge-27588471/')
|
||||
ApplyWallpaper()
|
||||
WallpaperDeselectAll()
|
||||
document.querySelector('#wallpaper-selection-27588471').style.borderColor = 'white'
|
||||
}
|
||||
function Wallpaper27960528() {
|
||||
localStorage.setItem('wallpaper', './backgrounds/27960528/background.jpg')
|
||||
localStorage.setItem('wallpaper-selection', 'wallpaper-selection-27960528')
|
||||
|
||||
localStorage.setItem('wallpaper-credit-author', 'Artem Stoliar')
|
||||
localStorage.setItem('wallpaper-credit-link', 'https://www.pexels.com/photo/sea-landscape-beach-water-27960528/')
|
||||
ApplyWallpaper()
|
||||
WallpaperDeselectAll()
|
||||
document.querySelector('#wallpaper-selection-27960528').style.borderColor = 'white'
|
||||
}
|
Reference in a new issue