Skip to content

Commit

Permalink
💄 UI fix for pancake menu on smaller devices.
Browse files Browse the repository at this point in the history
- Fix UI for content inside pancake menu for devices with screens that are under 1024px in width.
- Add 'alt' attribute for 'saved-icon' and 'unsaved-icon' SVGs in order to display descriptive text of the image in case resource doesn't load.
  • Loading branch information
cadagong committed Jun 21, 2023
1 parent 63b6aad commit 100851e
Show file tree
Hide file tree
Showing 4 changed files with 60 additions and 12 deletions.
66 changes: 55 additions & 11 deletions assets/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ body {
margin: 0px;
display: flex;
flex-direction: column;
overflow: scroll;
}

a {
Expand Down Expand Up @@ -209,43 +210,86 @@ a:hover {
display: block;
}

/* Tablet and mobile styles for navbar */
/* Neon document-editor-navbar styles for smaller devices */
@media screen and (max-width: 1023px) {
.navbar-menu.is-active {
display: flex;
flex-direction: column;
background-color: #e2e2e2;
min-height: 91vh;
justify-content: space-between;
overflow: scroll;
gap: 30px;
padding: 0;
}
.navbar-start {
gap: 20px;
}
.navbar-main-content-container {
display: flex;
flex-direction: column;
height: 50%;
flex-direction: row;
height: fit-content;
flex-wrap: wrap;
justify-content: space-evenly;
align-content: space-between;
gap: 40px 0px;
}
#unsaved-changes-container {
transform: scale(0.5);
}
.navbar-item.has-dropdown.is-hoverable {
color: #68A7AD;
margin-top: 3vh;
/* margin-top: 3vh; */
flex-grow: 1;
width: 100%;
display: flex;
flex-direction: column;
gap: 5px;
/* font-size: 40px; */
align-items: flex-start;
}
.navbar-item.has-dropdown.is-hoverable:hover {
background-color: #e2e2e2 !important;
color: #68A7AD !important;
border-radius: 0px;
}
.navbar-element.navbar-btn {
cursor: pointer;
/* border-radius: 2px; */
overflow: hidden;
border-bottom: 1px solid #7cb1b7;
font-size: 1.2rem;
width: 100%;
}
.navbar-btn-text {
font-weight: bold;
}
.navbar-dropdown {
border-top: 1px solid #7cb1b7;
border-top: none;
box-shadow: none;
min-width: 13vw;
gap: 5px;
display: flex;
flex-direction: column;
width: 100%;
padding: 0;
}
.navbar-element.navbar-btn:hover {
background-color: #e2e2e2;
color: #7cb1b7 !important;
cursor: auto;
.navbar-dropdown-item {
font-size: 1rem;
}
#feedback-form-btn-container {
margin: 0;
border: none;
border-radius: 0;
/* font-weight: bold; */
/* padding: 0; */
}
}
@media only screen and (max-width: 900px) {
/* @media only screen and (max-width: 900px) {
#navMenu {
height: 100%;
}
}
} */

/* Section: Editor Main Body */

Expand Down
2 changes: 1 addition & 1 deletion assets/template.html
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
<div class="navbar-main-content-container" id="navbar-main-content-container-top">
<div class="navbar-element" id="filename"></div>
<div id="unsaved-changes-container">
<img class="navbar-element" id="file-saved" src="/Neon/assets/img/saved-icon.svg">
<img class="navbar-element" id="file-saved" src="/Neon/assets/img/saved-icon.svg" alt="Your work is saved">
</div>
<div class="navbar-element" id="file-status"></div>
</div>
Expand Down
3 changes: 3 additions & 0 deletions src/utils/Unsaved.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@ function updateIndicator (): void {
const indicator = document.querySelector<HTMLDivElement>('#file-saved');
const path = saved? `${__ASSET_PREFIX__}assets/img/saved-icon.svg` : `${__ASSET_PREFIX__}assets/img/unsaved-icon.svg`;
indicator.setAttribute('src', path);
// set the alt attribute message depending on whether latest changes are save or not
const altMessage = saved? "Your work is saved" : "You have unsaved work";
indicator.setAttribute('alt', altMessage);
}


Expand Down
1 change: 1 addition & 0 deletions src/utils/template/Template.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ async function setBody (neonView: NeonView): Promise<void> {
// set initial saved status
const indicator = document.querySelector<HTMLDivElement>('#file-saved');
indicator.setAttribute('src', `${__ASSET_PREFIX__}assets/img/saved-icon.svg`);
indicator.setAttribute('alt', "Your work is saved");
}

export { setBody as default };

0 comments on commit 100851e

Please sign in to comment.