Skip to content

Commit

Permalink
Merge pull request #33 from live-codes/ui-enhancements
Browse files Browse the repository at this point in the history
toolbar adjustments
  • Loading branch information
gigamaster authored Nov 4, 2024
2 parents 370f500 + 36b1b88 commit d7780ef
Show file tree
Hide file tree
Showing 4 changed files with 64 additions and 95 deletions.
10 changes: 6 additions & 4 deletions src/livecodes/UI/login.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,9 +61,10 @@ export const displayLoggedIn = (user: User) => {
loginLink.style.display = 'none';
}
const logOutLink = getLogoutLink();
if (logOutLink) {
const logOutText = logOutLink?.querySelector('span');
if (logOutLink && logOutText) {
const displayName = user.displayName || user.username;
logOutLink.innerHTML = window.deps.translateString('login.logout', 'Log out');
logOutText.innerHTML = window.deps.translateString('login.logout', 'Log out');
logOutLink.classList.add('hint--bottom');
logOutLink.dataset.hint = window.deps.translateString(
'login.loginAs',
Expand All @@ -82,8 +83,9 @@ export const displayLoggedOut = () => {
loginLink.style.display = 'flex';
}
const logOutLink = getLogoutLink();
if (logOutLink) {
logOutLink.innerHTML = window.deps.translateString('login.logout', 'Log out');
const logOutText = logOutLink?.querySelector('span');
if (logOutLink && logOutText) {
logOutText.innerHTML = window.deps.translateString('login.logout', 'Log out');
logOutLink.style.display = 'none';
}
};
8 changes: 4 additions & 4 deletions src/livecodes/html/app.html
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@
<a
href="javascript:void(0)"
id="app-menu-button-i18n"
class="button hint--bottom"
class="button hint--right"
data-hint="UI Language"
data-i18n="app.i18nButton.hint"
data-i18n-prop="data-hint"
Expand All @@ -107,7 +107,7 @@
<a
href="javascript:void(0)"
id="light-theme-button"
class="button hint--bottom"
class="button hint--right"
data-hint="Change Theme"
data-i18n="app.changeTheme.hint"
data-i18n-prop="data-hint"
Expand All @@ -117,7 +117,7 @@
<a
href="javascript:void(0)"
id="dark-theme-button"
class="button hint--bottom"
class="button hint--right"
data-hint="Change Theme"
data-i18n="app.changeTheme.hint"
data-i18n-prop="data-hint"
Expand Down Expand Up @@ -188,7 +188,7 @@
<a
href="#"
id="logout-link"
class="menu hint--bottom"
class="menu hint--bottom-left"
aria-label="Logout"
style="display: none"
>
Expand Down
110 changes: 54 additions & 56 deletions src/livecodes/styles/app.scss
Original file line number Diff line number Diff line change
Expand Up @@ -675,6 +675,10 @@ a#result-button {
display: none;
}

#project-title {
display: none;
}

#login-link,
#logout-link {
min-width: var(--s24);
Expand Down Expand Up @@ -738,60 +742,58 @@ a#result-button {

@media only screen and (max-width: 480px) and (orientation: portrait) {
#toolbar {
align-items: flex-start;
display: flex;
flex-direction: unset;
flex-wrap: wrap;
height: calc(var(--toolbar-height) * 2);
width: 100%;

.dropdown-menu.submenu {
left: 44%;
.toolbar-render {
justify-content: space-between;
place-items: center;
}

#light-theme-button,
#dark-theme-button {
display: none;
}
}
#select-editor {
inset-inline-start: 0; /* left */
max-width: unset;
position: absolute;
top: var(--toolbar-height);

#toolbar > .toolbar-app,
#toolbar > .toolbar-render {
display: flex;
flex: 1;
flex-basis: 100%;
flex-direction: row;
flex-grow: 1;
}
.editor-title > span {
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
}

#toolbar > .toolbar-render {
justify-content: space-between;
place-items: center;
}
.menu-scroller-markup,
.menu-scroller-style,
.menu-scroller-script {
max-width: 98vw;
position: fixed;
top: calc(var(--toolbar-height) * 2);
transform: translateX(-1vw);
}

#toolbar #select-editor {
max-width: unset;
.dropdown-menu-script {
column-count: 2;
}

.editor-title > span {
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
.dropdown-menu.submenu {
left: 44%;
}
}

#toolbar #login-link,
#toolbar #logout-link {
height: 100%;
}
#light-theme-button,
#dark-theme-button {
display: none;
}

#select-editor {
ul li.editor-title {
top: 0;
width: 74px;
#login-link,
#logout-link {
height: 100%;
}
}

#toolbar #project-title {
height: var(--s24);
#editor-container {
height: calc(100% - var(--toolbar-height) * 2);
}

#modal {
Expand Down Expand Up @@ -1466,6 +1468,10 @@ li.editor-title {
}
}

#select-editor {
position: unset;
}

.language-menu-button {
display: none !important;
}
Expand Down Expand Up @@ -1510,27 +1516,19 @@ li.editor-title {

@media only screen and (max-width: 480px) and (orientation: portrait) {
#toolbar {
display: flex;
flex-direction: unset;
flex-wrap: nowrap;
height: var(--toolbar-height);
width: 100%;
.toolbar-app,
.toolbar-render {
height: calc(var(--toolbar-height));
}

.editor-title {
width: 73px;
}

#app-menu-button-i18n,
#light-theme-button,
#dark-theme-button {
display: none;
}

#select-editor {
height: var(--toolbar-height);
margin: 0;

li.editor-title {
height: 32px;
top: 0;
width: 74px;
}
display: none !important;
}
}
}
Expand Down
31 changes: 0 additions & 31 deletions src/livecodes/styles/inc-menu.scss
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,6 @@
}

#app-menu-container-i18n {
// left: unset;
// right: 15%;
left: 15rem;
width: 250px;
}
Expand All @@ -38,17 +36,10 @@
}

#app-menu-container-i18n {
// right: 10%;
left: 8em;
}
}

@media only screen and (max-width: 768px) {
#app-menu-container-i18n {
// right: 5%;
}
}

[id^='app-menu-button-'] {
&:focus + .menu-scroller,
&:active + .menu-scroller,
Expand Down Expand Up @@ -389,28 +380,6 @@ i.arrow {
}
}

@media only screen and (max-width: 480px) and (orientation: portrait) {
#toolbar {
.menu-scroller-markup,
.menu-scroller-style,
.menu-scroller-script {
max-width: 98vw;
position: fixed;
transform: translateX(-1vw);
}

.dropdown-menu-script {
column-count: 2;
}

#app-menu-button-i18n,
#light-theme-button,
#dark-theme-button {
display: none !important;
}
}
}

.switch {
cursor: pointer;
display: inherit;
Expand Down

0 comments on commit d7780ef

Please sign in to comment.