Skip to content

Commit

Permalink
V2.0.1 (#22)
Browse files Browse the repository at this point in the history
* accounts: improve logic

* css: fixes
  • Loading branch information
eromatiya authored Sep 9, 2020
1 parent 833615c commit a1916ed
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 16 deletions.
3 changes: 3 additions & 0 deletions css/body-background.css
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
8 changes: 7 additions & 1 deletion css/screens.css
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
13 changes: 7 additions & 6 deletions css/sidebar.css
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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 {
Expand Down
18 changes: 9 additions & 9 deletions js/accounts.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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() {
Expand Down Expand Up @@ -119,7 +119,7 @@ class Accounts {
listItem.appendChild(userItemButton);
this._accountsList.appendChild(listItem);
}
this._setAccountDefaultOnStartUp();
this._updateProfileVariablesOnStartUp();
}

_init() {
Expand Down

0 comments on commit a1916ed

Please sign in to comment.