Improve mobile ui
This commit is contained in:
parent
34ddd1d507
commit
b43fa5aa82
10 changed files with 136 additions and 36 deletions
|
|
@ -99,6 +99,10 @@
|
||||||
</roomcontent2>
|
</roomcontent2>
|
||||||
</roomcontent>
|
</roomcontent>
|
||||||
<sidebar class="second" id="roomdetailsbar" style="display: none;">
|
<sidebar class="second" id="roomdetailsbar" style="display: none;">
|
||||||
|
<roomtopbar>
|
||||||
|
</roomtopbar>
|
||||||
|
<roomcontent2>
|
||||||
|
</roomcontent2>
|
||||||
</sidebar>
|
</sidebar>
|
||||||
</main>
|
</main>
|
||||||
<div id="fixed-context-menu" class="context-menu">
|
<div id="fixed-context-menu" class="context-menu">
|
||||||
|
|
|
||||||
|
|
@ -689,9 +689,22 @@ async function switchRoomContent(title, content, showRoomBar, icon = "", skipMob
|
||||||
{
|
{
|
||||||
roomContentMain.style.transform = "scale(0.85)";
|
roomContentMain.style.transform = "scale(0.85)";
|
||||||
roomContentMain.style.opacity = "0";
|
roomContentMain.style.opacity = "0";
|
||||||
await delay(200);
|
|
||||||
let backBtnHtml = `<button class="mobile-nav-btn" onclick="mobileNavBack()"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><line x1="19" y1="12" x2="5" y2="12"></line><polyline points="12 19 5 12 12 5"></polyline></svg></button>`;
|
const rem = parseFloat(getComputedStyle(document.documentElement).fontSize);
|
||||||
let detailsBtnHtml = showRoomBar ? `<button class="mobile-nav-btn right" onclick="mobileNavDetails()"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><line x1="3" y1="12" x2="21" y2="12"></line><line x1="3" y1="6" x2="21" y2="6"></line><line x1="3" y1="18" x2="21" y2="18"></line></svg></button>` : '';
|
if (window.innerWidth <= 52 * rem && !skipMobileSlide) {
|
||||||
|
if (title != "title.splash") //do not show splash on mobile
|
||||||
|
{
|
||||||
|
mainScreen.classList.remove('mobile-details');
|
||||||
|
mainScreen.classList.add('mobile-content');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
await delay(200);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
let detailsBtnHtml = showRoomBar ? detailsBtn : '';
|
||||||
|
|
||||||
roomTopBar.innerHTML = `${backBtnHtml}${icon}<space></space><inherit>${processBlah(title)}</inherit><div class="flex-spacer"></div>${detailsBtnHtml}`;
|
roomTopBar.innerHTML = `${backBtnHtml}${icon}<space></space><inherit>${processBlah(title)}</inherit><div class="flex-spacer"></div>${detailsBtnHtml}`;
|
||||||
roomDetailsBar.style.display = showRoomBar ? "flex" : "none";
|
roomDetailsBar.style.display = showRoomBar ? "flex" : "none";
|
||||||
|
|
@ -722,11 +735,7 @@ async function switchRoomContent(title, content, showRoomBar, icon = "", skipMob
|
||||||
roomContentMain.style.transform = "";
|
roomContentMain.style.transform = "";
|
||||||
roomContentMain.style.opacity = "";
|
roomContentMain.style.opacity = "";
|
||||||
|
|
||||||
const rem = parseFloat(getComputedStyle(document.documentElement).fontSize);
|
|
||||||
if (window.innerWidth <= 52 * rem && !skipMobileSlide) {
|
|
||||||
mainScreen.classList.remove('mobile-details');
|
|
||||||
mainScreen.classList.add('mobile-content');
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
collapseDmsBtn.addEventListener("click", () => {
|
collapseDmsBtn.addEventListener("click", () => {
|
||||||
collapseDmsBtn.classList.toggle("collapsed");
|
collapseDmsBtn.classList.toggle("collapsed");
|
||||||
|
|
@ -762,6 +771,15 @@ document.addEventListener("click", (e) => {
|
||||||
setActiveSidebarIndicator(indicatorBeforeFixedMenu);
|
setActiveSidebarIndicator(indicatorBeforeFixedMenu);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (mainScreen && mainScreen.classList.contains('mobile-details')) {
|
||||||
|
const rem = parseFloat(getComputedStyle(document.documentElement).fontSize);
|
||||||
|
if (window.innerWidth <= 52 * rem) {
|
||||||
|
if (!roomDetailsBar.contains(e.target) && !e.target.closest('.mobile-nav-btn.right')) {
|
||||||
|
mobileNavBack();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -85,3 +85,8 @@ var addSpaceMenu = `
|
||||||
<span class="blah">title.create.space</span>
|
<span class="blah">title.create.space</span>
|
||||||
</button>
|
</button>
|
||||||
`;
|
`;
|
||||||
|
|
||||||
|
|
||||||
|
//elements
|
||||||
|
var detailsBtn = `<button class="mobile-nav-btn right" onclick="mobileNavDetails()"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 -960 960 960" fill="var(--text-color)"><path d="M120-240v-80h720v80H120Zm0-200v-80h720v80H120Zm0-200v-80h720v80H120Z"/></svg></button>`;
|
||||||
|
var backBtnHtml = `<button class="mobile-nav-btn" onclick="mobileNavBack()"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 -960 960 960" fill="var(--text-color)"><path d="m313-440 224 224-57 56-320-320 320-320 57 56-224 224h487v80H313Z"/></svg></button>`;
|
||||||
|
|
@ -272,6 +272,8 @@ roomtopbar {
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: row;
|
flex-direction: row;
|
||||||
|
|
||||||
|
align-items: center;
|
||||||
|
|
||||||
width: 100%;
|
width: 100%;
|
||||||
border-bottom: var(--border-width) solid var(--light-border-color);
|
border-bottom: var(--border-width) solid var(--light-border-color);
|
||||||
|
|
||||||
|
|
@ -282,11 +284,10 @@ roomtopbar {
|
||||||
font-size: 1.5rem;
|
font-size: 1.5rem;
|
||||||
}
|
}
|
||||||
sidebar.second#roomdetailsbar {
|
sidebar.second#roomdetailsbar {
|
||||||
height: calc(var(--button-height) * 1.5);
|
height: 100%;
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: row;
|
flex-direction: column;
|
||||||
|
border-left: var(--border-width) solid var(--light-border-color);
|
||||||
border-bottom: var(--border-width) solid var(--light-border-color);
|
|
||||||
}
|
}
|
||||||
fullcontainer {
|
fullcontainer {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
|
|
@ -456,7 +457,7 @@ space{
|
||||||
sidebar, sidebar.second, roomcontent {
|
sidebar, sidebar.second, roomcontent {
|
||||||
position: absolute !important;
|
position: absolute !important;
|
||||||
height: 100%;
|
height: 100%;
|
||||||
transition: transform 0.35s cubic-bezier(0.25, 1, 0.5, 1);
|
transition: transform 0.3s cubic-bezier(0.25, 1, 0.5, 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
sidebar {
|
sidebar {
|
||||||
|
|
@ -482,12 +483,13 @@ space{
|
||||||
}
|
}
|
||||||
|
|
||||||
#roomdetailsbar {
|
#roomdetailsbar {
|
||||||
left: 0;
|
left: auto !important;
|
||||||
width: 100vw !important;
|
right: 0;
|
||||||
|
width: 90vw !important;
|
||||||
min-width: unset !important;
|
min-width: unset !important;
|
||||||
max-width: none !important;
|
max-width: none !important;
|
||||||
transform: translateX(100vw);
|
transform: translateX(100vw);
|
||||||
z-index: 3;
|
z-index: 10;
|
||||||
background-color: var(--main-bg-color);
|
background-color: var(--main-bg-color);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -512,4 +514,25 @@ space{
|
||||||
main.mobile-details #roomdetailsbar {
|
main.mobile-details #roomdetailsbar {
|
||||||
transform: translateX(0);
|
transform: translateX(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
roomcontent::after {
|
||||||
|
content: "";
|
||||||
|
position: absolute;
|
||||||
|
top: 0;
|
||||||
|
left: 0;
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
background-color: rgba(0, 0, 0, 0.5);
|
||||||
|
z-index: 10;
|
||||||
|
cursor: pointer;
|
||||||
|
opacity: 0;
|
||||||
|
pointer-events: none;
|
||||||
|
|
||||||
|
transition: opacity 0.3s cubic-bezier(0.25, 1, 0.5, 1);
|
||||||
|
}
|
||||||
|
|
||||||
|
main.mobile-details roomcontent::after {
|
||||||
|
opacity: 1;
|
||||||
|
pointer-events: auto;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
Binary file not shown.
|
Before Width: | Height: | Size: 14 KiB After Width: | Height: | Size: 14 KiB |
BIN
icons/icon.png
BIN
icons/icon.png
Binary file not shown.
|
Before Width: | Height: | Size: 14 KiB After Width: | Height: | Size: 14 KiB |
|
|
@ -99,6 +99,10 @@
|
||||||
</roomcontent2>
|
</roomcontent2>
|
||||||
</roomcontent>
|
</roomcontent>
|
||||||
<sidebar class="second" id="roomdetailsbar" style="display: none;">
|
<sidebar class="second" id="roomdetailsbar" style="display: none;">
|
||||||
|
<roomtopbar>
|
||||||
|
</roomtopbar>
|
||||||
|
<roomcontent2>
|
||||||
|
</roomcontent2>
|
||||||
</sidebar>
|
</sidebar>
|
||||||
</main>
|
</main>
|
||||||
<div id="fixed-context-menu" class="context-menu">
|
<div id="fixed-context-menu" class="context-menu">
|
||||||
|
|
|
||||||
|
|
@ -689,9 +689,22 @@ async function switchRoomContent(title, content, showRoomBar, icon = "", skipMob
|
||||||
{
|
{
|
||||||
roomContentMain.style.transform = "scale(0.85)";
|
roomContentMain.style.transform = "scale(0.85)";
|
||||||
roomContentMain.style.opacity = "0";
|
roomContentMain.style.opacity = "0";
|
||||||
await delay(200);
|
|
||||||
let backBtnHtml = `<button class="mobile-nav-btn" onclick="mobileNavBack()"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><line x1="19" y1="12" x2="5" y2="12"></line><polyline points="12 19 5 12 12 5"></polyline></svg></button>`;
|
const rem = parseFloat(getComputedStyle(document.documentElement).fontSize);
|
||||||
let detailsBtnHtml = showRoomBar ? `<button class="mobile-nav-btn right" onclick="mobileNavDetails()"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><line x1="3" y1="12" x2="21" y2="12"></line><line x1="3" y1="6" x2="21" y2="6"></line><line x1="3" y1="18" x2="21" y2="18"></line></svg></button>` : '';
|
if (window.innerWidth <= 52 * rem && !skipMobileSlide) {
|
||||||
|
if (title != "title.splash") //do not show splash on mobile
|
||||||
|
{
|
||||||
|
mainScreen.classList.remove('mobile-details');
|
||||||
|
mainScreen.classList.add('mobile-content');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
await delay(200);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
let detailsBtnHtml = showRoomBar ? detailsBtn : '';
|
||||||
|
|
||||||
roomTopBar.innerHTML = `${backBtnHtml}${icon}<space></space><inherit>${processBlah(title)}</inherit><div class="flex-spacer"></div>${detailsBtnHtml}`;
|
roomTopBar.innerHTML = `${backBtnHtml}${icon}<space></space><inherit>${processBlah(title)}</inherit><div class="flex-spacer"></div>${detailsBtnHtml}`;
|
||||||
roomDetailsBar.style.display = showRoomBar ? "flex" : "none";
|
roomDetailsBar.style.display = showRoomBar ? "flex" : "none";
|
||||||
|
|
@ -722,11 +735,7 @@ async function switchRoomContent(title, content, showRoomBar, icon = "", skipMob
|
||||||
roomContentMain.style.transform = "";
|
roomContentMain.style.transform = "";
|
||||||
roomContentMain.style.opacity = "";
|
roomContentMain.style.opacity = "";
|
||||||
|
|
||||||
const rem = parseFloat(getComputedStyle(document.documentElement).fontSize);
|
|
||||||
if (window.innerWidth <= 52 * rem && !skipMobileSlide) {
|
|
||||||
mainScreen.classList.remove('mobile-details');
|
|
||||||
mainScreen.classList.add('mobile-content');
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
collapseDmsBtn.addEventListener("click", () => {
|
collapseDmsBtn.addEventListener("click", () => {
|
||||||
collapseDmsBtn.classList.toggle("collapsed");
|
collapseDmsBtn.classList.toggle("collapsed");
|
||||||
|
|
@ -762,6 +771,15 @@ document.addEventListener("click", (e) => {
|
||||||
setActiveSidebarIndicator(indicatorBeforeFixedMenu);
|
setActiveSidebarIndicator(indicatorBeforeFixedMenu);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (mainScreen && mainScreen.classList.contains('mobile-details')) {
|
||||||
|
const rem = parseFloat(getComputedStyle(document.documentElement).fontSize);
|
||||||
|
if (window.innerWidth <= 52 * rem) {
|
||||||
|
if (!roomDetailsBar.contains(e.target) && !e.target.closest('.mobile-nav-btn.right')) {
|
||||||
|
mobileNavBack();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -85,3 +85,8 @@ var addSpaceMenu = `
|
||||||
<span class="blah">title.create.space</span>
|
<span class="blah">title.create.space</span>
|
||||||
</button>
|
</button>
|
||||||
`;
|
`;
|
||||||
|
|
||||||
|
|
||||||
|
//elements
|
||||||
|
var detailsBtn = `<button class="mobile-nav-btn right" onclick="mobileNavDetails()"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 -960 960 960" fill="var(--text-color)"><path d="M120-240v-80h720v80H120Zm0-200v-80h720v80H120Zm0-200v-80h720v80H120Z"/></svg></button>`;
|
||||||
|
var backBtnHtml = `<button class="mobile-nav-btn" onclick="mobileNavBack()"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 -960 960 960" fill="var(--text-color)"><path d="m313-440 224 224-57 56-320-320 320-320 57 56-224 224h487v80H313Z"/></svg></button>`;
|
||||||
|
|
@ -272,6 +272,8 @@ roomtopbar {
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: row;
|
flex-direction: row;
|
||||||
|
|
||||||
|
align-items: center;
|
||||||
|
|
||||||
width: 100%;
|
width: 100%;
|
||||||
border-bottom: var(--border-width) solid var(--light-border-color);
|
border-bottom: var(--border-width) solid var(--light-border-color);
|
||||||
|
|
||||||
|
|
@ -282,11 +284,10 @@ roomtopbar {
|
||||||
font-size: 1.5rem;
|
font-size: 1.5rem;
|
||||||
}
|
}
|
||||||
sidebar.second#roomdetailsbar {
|
sidebar.second#roomdetailsbar {
|
||||||
height: calc(var(--button-height) * 1.5);
|
height: 100%;
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: row;
|
flex-direction: column;
|
||||||
|
border-left: var(--border-width) solid var(--light-border-color);
|
||||||
border-bottom: var(--border-width) solid var(--light-border-color);
|
|
||||||
}
|
}
|
||||||
fullcontainer {
|
fullcontainer {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
|
|
@ -456,7 +457,7 @@ space{
|
||||||
sidebar, sidebar.second, roomcontent {
|
sidebar, sidebar.second, roomcontent {
|
||||||
position: absolute !important;
|
position: absolute !important;
|
||||||
height: 100%;
|
height: 100%;
|
||||||
transition: transform 0.35s cubic-bezier(0.25, 1, 0.5, 1);
|
transition: transform 0.3s cubic-bezier(0.25, 1, 0.5, 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
sidebar {
|
sidebar {
|
||||||
|
|
@ -482,12 +483,13 @@ space{
|
||||||
}
|
}
|
||||||
|
|
||||||
#roomdetailsbar {
|
#roomdetailsbar {
|
||||||
left: 0;
|
left: auto !important;
|
||||||
width: 100vw !important;
|
right: 0;
|
||||||
|
width: 90vw !important;
|
||||||
min-width: unset !important;
|
min-width: unset !important;
|
||||||
max-width: none !important;
|
max-width: none !important;
|
||||||
transform: translateX(100vw);
|
transform: translateX(100vw);
|
||||||
z-index: 3;
|
z-index: 10;
|
||||||
background-color: var(--main-bg-color);
|
background-color: var(--main-bg-color);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -512,4 +514,25 @@ space{
|
||||||
main.mobile-details #roomdetailsbar {
|
main.mobile-details #roomdetailsbar {
|
||||||
transform: translateX(0);
|
transform: translateX(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
roomcontent::after {
|
||||||
|
content: "";
|
||||||
|
position: absolute;
|
||||||
|
top: 0;
|
||||||
|
left: 0;
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
background-color: rgba(0, 0, 0, 0.5);
|
||||||
|
z-index: 10;
|
||||||
|
cursor: pointer;
|
||||||
|
opacity: 0;
|
||||||
|
pointer-events: none;
|
||||||
|
|
||||||
|
transition: opacity 0.3s cubic-bezier(0.25, 1, 0.5, 1);
|
||||||
|
}
|
||||||
|
|
||||||
|
main.mobile-details roomcontent::after {
|
||||||
|
opacity: 1;
|
||||||
|
pointer-events: auto;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
Loading…
Add table
Add a link
Reference in a new issue