From a1916ed9fd8879c7c96f915717c044027862395b Mon Sep 17 00:00:00 2001 From: Gerome Matilla Date: Wed, 9 Sep 2020 16:52:36 +0800 Subject: [PATCH] V2.0.1 (#22) * accounts: improve logic * css: fixes --- css/body-background.css | 3 +++ css/screens.css | 8 +++++++- css/sidebar.css | 13 +++++++------ js/accounts.js | 18 +++++++++--------- 4 files changed, 26 insertions(+), 16 deletions(-) diff --git a/css/body-background.css b/css/body-background.css index e30263a..191d76c 100644 --- a/css/body-background.css +++ b/css/body-background.css @@ -14,4 +14,7 @@ background-repeat: no-repeat; background-position: center; background-attachment: fixed; + -webkit-touch-callout: none; + -webkit-user-select: none; + user-select: none; } diff --git a/css/screens.css b/css/screens.css index 4f9b1bf..95799d1 100644 --- a/css/screens.css +++ b/css/screens.css @@ -107,12 +107,18 @@ display: inline-block; } +.greeter-content { + cursor: default; + -webkit-touch-callout: none; + -webkit-user-select: none; + user-select: none; +} + #greeter-message.greeter-content { font-size: 32pt; font-weight: 400; text-align: center; color: var(--global-fg); - cursor: pointer; } #greeter-clock.greeter-content { diff --git a/css/sidebar.css b/css/sidebar.css index 7310676..80d858b 100644 --- a/css/sidebar.css +++ b/css/sidebar.css @@ -24,16 +24,11 @@ top: 0; right: -411px; box-sizing: border-box; + box-shadow: none; padding: 10px 10px; overflow: hidden; scrollbar-width: none; z-index: 5; - box-shadow: - 0 1px 1px rgba(0,0,0,0.12), - 0 2px 2px rgba(0,0,0,0.12), - 0 4px 4px rgba(0,0,0,0.12), - 0 8px 8px rgba(0,0,0,0.12), - 0 16px 16px rgba(0,0,0,0.12); -webkit-touch-callout: none; -webkit-user-select: none; user-select: none; @@ -46,6 +41,12 @@ #sidebar.sidebar-show { right: 0; + box-shadow: + 0 1px 1px rgba(0,0,0,0.12), + 0 2px 2px rgba(0,0,0,0.12), + 0 4px 4px rgba(0,0,0,0.12), + 0 8px 8px rgba(0,0,0,0.12), + 0 16px 16px rgba(0,0,0,0.12); } .sidebar-group { diff --git a/js/accounts.js b/js/accounts.js index 461275c..8a9d874 100644 --- a/js/accounts.js +++ b/js/accounts.js @@ -68,6 +68,13 @@ class Accounts { ); } + _setAccountDefaultOnStartUp() { + this._setUserImageProfile(this._defaultUserProfileImage, this._defaultUserProfileImageFallback); + this._setUserNameLabel(this._defaultUserDisplayName); + const defaultAccountItem = document.querySelector(`#button-accounts-item-${this._defaultUser}`); + this._updateAccountDefault(defaultAccountItem); + } + _updateProfileVariablesOnStartUp() { this._defaultUser = this._localStorage.getItem('defaultUser') || this._usersObject[0].username; @@ -77,14 +84,7 @@ class Accounts { this._usersObject[0].image; this._defaultUserProfileImageFallback = this._localStorage.getItem('defaultUserProfileImageFallback') || 'assets/profiles/user.svg'; - } - - _setAccountDefaultOnStartUp() { - this._updateProfileVariablesOnStartUp(); - this._setUserImageProfile(this._defaultUserProfileImage, this._defaultUserProfileImageFallback); - this._setUserNameLabel(this._defaultUserDisplayName); - const defaultAccountItem = document.querySelector(`#button-accounts-item-${this._defaultUser}`); - this._updateAccountDefault(defaultAccountItem); + this._setAccountDefaultOnStartUp(); } _populateAccountsList() { @@ -119,7 +119,7 @@ class Accounts { listItem.appendChild(userItemButton); this._accountsList.appendChild(listItem); } - this._setAccountDefaultOnStartUp(); + this._updateProfileVariablesOnStartUp(); } _init() {