aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPriyansh <[email protected]>2020-11-13 22:29:39 +0530
committerPriyansh <[email protected]>2020-11-13 22:29:39 +0530
commitc62911c83e7849cc8cc0e358c3187659123a4a32 (patch)
tree1a38da52460c2ec1d816476c12104c74c14d374a
parentcb0a123664554a3735f464efb5d30930c6dd90c0 (diff)
downloadnineties-computing-c62911c83e7849cc8cc0e358c3187659123a4a32.tar.xz
nineties-computing-c62911c83e7849cc8cc0e358c3187659123a4a32.zip
Desktop View
-rw-r--r--css/layouts.css6
-rw-r--r--index.html3
-rw-r--r--js/acountLogin.js18
-rw-r--r--js/desktop.js19
4 files changed, 36 insertions, 10 deletions
diff --git a/css/layouts.css b/css/layouts.css
index cb96025..50a78ae 100644
--- a/css/layouts.css
+++ b/css/layouts.css
@@ -133,3 +133,9 @@
.animate > span > span {
animation: move 2s linear infinite;
}
+
+.wallpaper {
+ background-size: cover;
+ background-position: center;
+ background-repeat: no-repeat;
+}
diff --git a/index.html b/index.html
index e0af89b..6eedf37 100644
--- a/index.html
+++ b/index.html
@@ -113,9 +113,10 @@
</div>
</div>
</section>
- <section id="desktop" class="fullscreen bg-skyblue"></section>
+ <section id="desktop" class="fullscreen bg-skyblue wallpaper"></section>
<!-- Scripts -->
<script src="js/createAccount.js"></script>
<script src="js/acountLogin.js"></script>
+ <script src="js/desktop.js"></script>
</body>
</html>
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}")`;
+}