diff options
| author | Priyansh <[email protected]> | 2020-11-13 22:29:39 +0530 |
|---|---|---|
| committer | Priyansh <[email protected]> | 2020-11-13 22:29:39 +0530 |
| commit | c62911c83e7849cc8cc0e358c3187659123a4a32 (patch) | |
| tree | 1a38da52460c2ec1d816476c12104c74c14d374a /js | |
| parent | cb0a123664554a3735f464efb5d30930c6dd90c0 (diff) | |
| download | nineties-computing-c62911c83e7849cc8cc0e358c3187659123a4a32.tar.xz nineties-computing-c62911c83e7849cc8cc0e358c3187659123a4a32.zip | |
Desktop View
Diffstat (limited to 'js')
| -rw-r--r-- | js/acountLogin.js | 18 | ||||
| -rw-r--r-- | js/desktop.js | 19 |
2 files changed, 28 insertions, 9 deletions
diff --git a/js/acountLogin.js b/js/acountLogin.js index 53cb4b8..3b50e2f 100644 --- a/js/acountLogin.js +++ b/js/acountLogin.js @@ -62,17 +62,17 @@ function DELoader() { let width = 0; function loadMeter() { - if (width < 100) { - if (100 - width < 10) { - width = 100; - } else { - width += Math.round(Math.random() * 10); - } - meterLoaderElement.style.width = width + "%"; - } else { + // if (width < 100) { + // if (100 - width < 10) { + // width = 100; + // } else { + // width += Math.round(Math.random() * 10); + // } + // meterLoaderElement.style.width = width + "%"; + // } else { loadingDesktopExperienceElement.style.display = "none"; document.getElementById('desktop').style.display = "block"; - } + // } } (function loop() { diff --git a/js/desktop.js b/js/desktop.js new file mode 100644 index 0000000..cef0d7b --- /dev/null +++ b/js/desktop.js @@ -0,0 +1,19 @@ +const parsedAccounts = JSON.parse(localAccounts); +const currentAccount = parsedAccounts.find( + (account) => account.fullName === currentLoggedInUser +); +const currentIndex = parsedAccounts.findIndex( + (account) => account.fullName === currentLoggedInUser +); +const desktop = document.getElementById("desktop"); +const wallpaperRoute = "./images/wallpapers"; +const wallpaperExtension = ".jpeg"; + +if(!currentAccount.wallpaper) { + currentAccount['wallpaper'] = 'Wallpaper1'; + parsedAccounts[currentIndex] = currentAccount; + localStorage.setItem('accounts', JSON.stringify(parsedAccounts)); + desktop.style.backgroundImage = `url("${wallpaperRoute}/${currentAccount.wallpaper}${wallpaperExtension}")`; +} else { + desktop.style.backgroundImage = `url("${wallpaperRoute}/${currentAccount.wallpaper}${wallpaperExtension}")`; +} |
