Compare commits

...

2 commits

Author SHA1 Message Date
34ddd1d507 Add test mobile ui
All checks were successful
Android Build / publish (push) Successful in 27s
Linux Build / publish (push) Successful in 51s
2026-05-14 23:05:54 +02:00
d29c5eea74 More animations 2026-05-14 22:35:22 +02:00
12 changed files with 726 additions and 250 deletions

View file

@ -61,7 +61,11 @@
"placeholder.create.group.input": "My group",
"placeholder.create.space.input": "My space",
"title.name": "Name",
"desc.create.space": "Create, a space for your community",
"desc.create.space": "Create a space for your community",
"desc.join.space": "Join a community that fits you",
"title.join.space": "Join space",
"title.space.id": "Space id",
"title.sign.up": "Sign Up",
"title.sign.in": "Sign In",

View file

@ -21,22 +21,15 @@
</indicator>
<button class="icon-button" onclick="gotoHome()">
<svg viewBox="-1 -1 18 18" fill="none" xmlns="http://www.w3.org/2000/svg">
<path
d="M1 6V15H6V11C6 9.89543 6.89543 9 8 9C9.10457 9 10 9.89543 10 11V15H15V6L8 0L1 6Z"
stroke="currentColor"
stroke-width="1.28"
stroke-linejoin="round"
stroke-linecap="round"
transform="translate(0 0.5)"
/>
<path d="M1 6V15H6V11C6 9.89543 6.89543 9 8 9C9.10457 9 10 9.89543 10 11V15H15V6L8 0L1 6Z" stroke="var(--text-color)" stroke-width="1.28" stroke-linejoin="round" stroke-linecap="round" transform="translate(0 0.5)"/>
</svg>
</button>
</sidebarelement>
<sidebarelement id="sidebar-add">
<indicator>
</indicator>
<button class="icon-button" onclick="gotoCreateSpace()">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor"
<button class="icon-button">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="var(--text-color)"
stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
<line x1="12" y1="5" x2="12" y2="19"></line>
<line x1="5" y1="12" x2="19" y2="12"></line>
@ -49,7 +42,7 @@
<indicator>
</indicator>
<button class="icon-button" onclick="gotoInbox()">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 -960 960 960" fill="currentColor"><path d="M216-144q-29 0-50.5-21.5T144-216v-528q0-29.7 21.5-50.85Q187-816 216-816h528q29.7 0 50.85 21.15Q816-773.7 816-744v528q0 29-21.15 50.5T744-144H216Zm0-72h528v-144H632q-23 43-63.5 69.5T480-264q-49 0-89.5-26T328-360H216v144Zm332-148q28-28 28-68h168v-312H216v312h168q0 40 28 68t68 28q40 0 68-28ZM216-216h528-528Z"/></svg>
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 -960 960 960" fill="var(--text-color)"><path d="M216-144q-29 0-50.5-21.5T144-216v-528q0-29.7 21.5-50.85Q187-816 216-816h528q29.7 0 50.85 21.15Q816-773.7 816-744v528q0 29-21.15 50.5T744-144H216Zm0-72h528v-144H632q-23 43-63.5 69.5T480-264q-49 0-89.5-26T328-360H216v144Zm332-148q28-28 28-68h168v-312H216v312h168q0 40 28 68t68 28q40 0 68-28ZM216-216h528-528Z"/></svg>
</button>
</sidebarelement>
<sidebarelement id="sidebar-profile">
@ -60,7 +53,6 @@
</button>
</sidebarelement>
</sidebar>
<sidebar class="second" id="roomsbar">
<roomtopbar>
<blah>title.home</blah>
@ -69,29 +61,29 @@
<button class="collapse-text-button" id="collapse-dms">
<span><blah>title.dms</blah></span>
<svg class="chevron" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none"
stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
stroke="var(--text-color)" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
<polyline points="6 9 12 15 18 9"></polyline>
</svg>
</button>
<button class="add-action-button" id="add-dm-btn">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor"
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="var(--text-color)"
stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
<line x1="12" y1="5" x2="12" y2="19"></line>
<line x1="5" y1="12" x2="19" y2="12"></line>
</svg>
</button>
</div>
<div class="sidebar-section-header">
<button class="collapse-text-button" id="collapse-groups">
<span><blah>title.groups</blah></span>
<svg class="chevron" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none"
stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
stroke="var(--text-color)" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
<polyline points="6 9 12 15 18 9"></polyline>
</svg>
</button>
<button class="add-action-button" id="add-group-btn">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor"
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="var(--text-color)"
stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
<line x1="12" y1="5" x2="12" y2="19"></line>
<line x1="5" y1="12" x2="19" y2="12"></line>
@ -99,22 +91,19 @@
</button>
</div>
</sidebar>
<roomcontent>
<roomtopbar>
<blah>title.splash</blah>
</roomtopbar>
<roomcontent2>
<div style="display: flex;justify-content: center;align-items: center;height:100%;flex-direction: column;text-align: center;">
<img src="favicon.svg" style="width: 6rem">
<herotitle><blah>title.welcome.splash</blah></herotitle>
<p><blah>desc.welcome.splash</blah>. <span class="aqua">v<span class="clientver aqua">1.0</span></span></p>
</div>
</roomcontent2>
</roomcontent>
<sidebar class="second" id="roomdetailsbar" style="display: none;">
</sidebar>
</main>
<div id="fixed-context-menu" class="context-menu">
</div>
</body>
</html>
<script src="screens.js"></script>
@ -122,6 +111,7 @@
async function start() {
updateLoadingStatus("loading.loading");
try {
switchRoomContent("title.splash", splashScreen, false, "", true);
if (host != null)
{
await updateProtocolAndUrl(host);
@ -130,9 +120,8 @@
{
await updateProtocolAndUrl(window.location.hostname);
}
sidebarPfp.src = await getAvatarUrl(username);
showAction("Authenticating...", "startauth");
let res = await Auth(username, password);
clearAction("startauth");
@ -155,12 +144,12 @@
async function refreshDms() {
try {
showAction("Refreshing dms...", "dmrefresh");
let res = await fetchEncrypted("user/dm/list", "");
console.log(res);
clearAction("dmrefresh");
showAction("Refreshing dms...", "dmrefresh");
let res = await fetchEncrypted("user/dm/list", "");
console.log(res);
clearAction("dmrefresh");
}
catch (e) {
clearAction("dmrefresh");
@ -184,11 +173,10 @@
showBlahNotification("error:chat.add.failed");
}
}
async function createGroup() {
}
async function createGroup() {
}
</script>
<script src="main.js"></script>
<script src="userscript.js"></script>

View file

@ -66,6 +66,7 @@ try {
var sidebarInboxIndicator = sidebarInbox.children.item(0);
var fixedContextMenu = document.getElementById("fixed-context-menu");
} catch (e) {
}
@ -653,28 +654,11 @@ password = localStorage.getItem('password');
host = localStorage.getItem('host');
mainJS();
collapseDmsBtn.addEventListener("click", () => {
collapseDmsBtn.classList.toggle("collapsed");
});
collapseGroupsBtn.addEventListener("click", () => {
collapseGroupsBtn.classList.toggle("collapsed");
});
//Invite to dm, addDmScreen, false
async function switchRoomContent(title, content, showRoomBar)
{
roomContentMain.style.transform = "scale(0.85)";
roomContentMain.style.opacity = "0";
await delay(200);
roomTopBar.innerHTML = processBlah(title);
roomDetailsBar.style.display = showRoomBar ? "flex" : "none";
//content blah parsing
function showFixedContextMenu(rect, html) {
let parser = new DOMParser();
let doc = parser.parseFromString(content, "text/html");
let doc = parser.parseFromString(html, "text/html");
let blahTags = doc.getElementsByTagName("blah");
for (let i = 0; i < blahTags.length; i++) {
blahTags[i].innerHTML = processBlah(blahTags[i].innerHTML);
@ -693,14 +677,63 @@ async function switchRoomContent(title, content, showRoomBar)
}
}
fixedContextMenu.innerHTML = doc.body.innerHTML;
fixedContextMenu.style.left = `${rect.right + 10}px`;
fixedContextMenu.style.top = `${rect.top}px`;
fixedContextMenu.classList.add("show");
}
async function switchRoomContent(title, content, showRoomBar, icon = "", skipMobileSlide = false)
{
roomContentMain.style.transform = "scale(0.85)";
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>`;
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>` : '';
roomTopBar.innerHTML = `${backBtnHtml}${icon}<space></space><inherit>${processBlah(title)}</inherit><div class="flex-spacer"></div>${detailsBtnHtml}`;
roomDetailsBar.style.display = showRoomBar ? "flex" : "none";
let parser = new DOMParser();
let doc = parser.parseFromString(content, "text/html");
let blahTags = doc.getElementsByTagName("blah");
for (let i = 0; i < blahTags.length; i++) {
blahTags[i].innerHTML = processBlah(blahTags[i].innerHTML);
}
blahTags = doc.getElementsByClassName("blah");
for (let i = 0; i < blahTags.length; i++) {
blahTags[i].innerHTML = processBlah(blahTags[i].innerHTML);
}
let placeholders = doc.querySelectorAll("[placeholder]");
for (let i = 0; i < placeholders.length; i++) {
if (placeholders[i].placeholder.startsWith("{blah("))
{
let value = placeholders[i].placeholder.split("{blah(")[1].split(")}")[0];
placeholders[i].placeholder = processBlah(value);
}
}
roomContentMain.innerHTML = doc.body.innerHTML;
roomContentMain.style.transform = "";
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.classList.toggle("collapsed");
});
collapseGroupsBtn.addEventListener("click", () => {
collapseGroupsBtn.classList.toggle("collapsed");
});
addDmBtn.addEventListener("click", async () => {
switchRoomContent("title.create.dm", addDmScreen, false);
});
@ -708,47 +741,107 @@ addGroupBtn.addEventListener("click", async () => {
switchRoomContent("title.create.group", createGroupScreen, false);
});
var indicatorBeforeFixedMenu;
sidebarAddButton.addEventListener("click", (e) => {
e.stopPropagation();
if (fixedContextMenu.classList.contains("show")) {
fixedContextMenu.classList.remove("show");
setActiveSidebarIndicator(indicatorBeforeFixedMenu);
} else {
setActiveSidebarIndicator(sidebarAddIndicator, true);
const rect = sidebarAddButton.getBoundingClientRect();
showFixedContextMenu(rect, addSpaceMenu);
}
});
document.addEventListener("click", (e) => {
if (fixedContextMenu.classList.contains("show")) {
if (!fixedContextMenu.contains(e.target)) {
fixedContextMenu.classList.remove("show");
setActiveSidebarIndicator(indicatorBeforeFixedMenu);
}
}
});
function gotoSideProfilePopup() {
}
function gotoInbox() {
setActiveSidebarIndicator(sidebarInboxIndicator);
}
async function gotoCreateSpace() {
function gotoCreateSpace() {
fixedContextMenu.classList.remove("show");
setActiveSidebarIndicator(sidebarAddIndicator);
switchRoomContent("title.create.space", createSpaceScreen, false);
}
function gotoJoinSpace() {
fixedContextMenu.classList.remove("show");
setActiveSidebarIndicator(sidebarAddIndicator);
switchRoomContent("title.join.space", joinSpaceScreen, false);
}
function gotoHome() {
setActiveSidebarIndicator(sidebarHomeIndicator);
switchRoomContent("title.splash", splashScreen, false);
}
function setActiveSidebarIndicator(element, skipDisabling = false)
{
let indicators = document.getElementsByTagName("indicator");
for (let i = 0; i < indicators.length; i++) {
if (indicators[i].classList.contains("active"))
{
indicatorBeforeFixedMenu = indicators[i];
if (!skipDisabling)
{
indicators[i].classList.remove("active");
}
}
}
element.classList.add("active");
}
function mobileNavBack() {
if(mainScreen.classList.contains('mobile-details')) {
mainScreen.classList.remove('mobile-details');
mainScreen.classList.add('mobile-content');
} else {
mainScreen.classList.remove('mobile-content');
}
}
function mobileNavDetails() {
mainScreen.classList.add('mobile-details');
}
let touchStartX = 0;
let touchEndX = 0;
let touchStartY = 0;
let touchEndY = 0;
document.addEventListener('touchstart', e => {
touchStartX = e.changedTouches[0].screenX;
touchStartY = e.changedTouches[0].screenY;
});
document.addEventListener('touchend', e => {
touchEndX = e.changedTouches[0].screenX;
touchEndY = e.changedTouches[0].screenY;
handleMobileSwipe();
});
function handleMobileSwipe() {
const rem = parseFloat(getComputedStyle(document.documentElement).fontSize);
if (window.innerWidth > 52 * rem) return;
/* replaced with css
sidebarHomeButton.addEventListener("mouseenter", () => {
sidebarHomeIndicator.classList.add("hover");
});
sidebarHomeButton.addEventListener("mouseleave", () => {
sidebarHomeIndicator.classList.remove("hover");
});
let diffX = touchEndX - touchStartX;
let diffY = touchEndY - touchStartY;
sidebarAddButton.addEventListener("mouseenter", () => {
sidebarAddIndicator.classList.add("hover");
});
sidebarAddButton.addEventListener("mouseleave", () => {
sidebarAddIndicator.classList.remove("hover");
});
sidebarProfileButton.addEventListener("mouseenter", () => {
sidebarProfileIndicator.classList.add("hover");
});
sidebarProfileButton.addEventListener("mouseleave", () => {
sidebarProfileIndicator.classList.remove("hover");
});
sidebarInboxButton.addEventListener("mouseenter", () => {
sidebarInboxIndicator.classList.add("hover");
});
sidebarInboxButton.addEventListener("mouseleave", () => {
sidebarInboxIndicator.classList.remove("hover");
});
*/
if (Math.abs(diffX) > Math.abs(diffY) && Math.abs(diffX) > 60) {
if (diffX > 0) {
mobileNavBack();
} else {
if (mainScreen.classList.contains('mobile-content') && roomDetailsBar.style.display !== 'none') {
mobileNavDetails();
}
}
}
}

View file

@ -1,3 +1,11 @@
//room screens
var splashScreen = `
<div style="display: flex;justify-content: center;align-items: center;height:100%;flex-direction: column;text-align: center;">
<img src="favicon.svg" style="width: 6rem">
<herotitle><blah>title.welcome.splash</blah></herotitle>
<p><blah>desc.welcome.splash</blah>. <span class="aqua">v<span class="clientver aqua">1.0</span></span></p>
</div>
`;
var addDmScreen = `
<div style="display: flex;justify-content: center;align-items: center;height:100%;flex-direction: column;text-align: center;">
<svg xmlns="http://www.w3.org/2000/svg" width="3rem" viewBox="0 -960 960 960" fill="var(--text-color)"><path d="M120-160v-600q0-33 23.5-56.5T200-840h480q33 0 56.5 23.5T760-760v203q-10-2-20-2.5t-20-.5q-10 0-20 .5t-20 2.5v-203H200v400h283q-2 10-2.5 20t-.5 20q0 10 .5 20t2.5 20H240L120-160Zm160-440h320v-80H280v80Zm0 160h200v-80H280v80Zm400 280v-120H560v-80h120v-120h80v120h120v80H760v120h-80ZM200-360v-400 400Z"/></svg>
@ -6,7 +14,7 @@ var addDmScreen = `
<br>
<div class="input-group">
<label for="addchat-username"><blah>title.username</blah></label>
<input type="text" id="addchat-username" placeholder="name@example.com" class="forminput">
<input type="text" id="addchat-username" placeholder="name:example.com" class="forminput">
</div>
<div class="input-group">
<button class="submit-button blah" onclick="addDm()">title.add.chat</button>
@ -37,11 +45,43 @@ var createSpaceScreen = `
<p><blah>desc.create.space</blah></p>
<br>
<div class="input-group">
<label for="addgroup-name"><blah>title.name</blah></label>
<label for="createspace-name"><blah>title.name</blah></label>
<input type="text" id="createspace-name" placeholder="{blah(placeholder.create.space.input)}" class="forminput">
</div>
<div class="input-group">
<button class="submit-button blah" onclick="createGroup()">title.create.space</button>
</div>
</div>
`;
var joinSpaceScreen = `
<div style="display: flex;justify-content: center;align-items: center;height:100%;flex-direction: column;text-align: center;">
<svg xmlns="http://www.w3.org/2000/svg" width="3rem" viewBox="0 -960 960 960" fill="var(--text-color)"><path d="M440-280H280q-83 0-141.5-58.5T80-480q0-83 58.5-141.5T280-680h160v80H280q-50 0-85 35t-35 85q0 50 35 85t85 35h160v80ZM320-440v-80h320v80H320Zm200 160v-80h160q50 0 85-35t35-85q0-50-35-85t-85-35H520v-80h160q83 0 141.5 58.5T880-480q0 83-58.5 141.5T680-280H520Z"/></svg>
<herotitle><blah>title.join.space</blah></herotitle>
<p><blah>desc.join.space</blah></p>
<br>
<div class="input-group">
<label for="joinspace-id"><blah>title.space.id</blah></label>
<input type="text" id="joinspace-id" placeholder="id:example.com" class="forminput">
</div>
<div class="input-group">
<label for="joinspace-code"><blah>title.invitation.code</blah></label>
<input type="text" id="joinspace-code" placeholder="{blah(placeholder.invitation.code)}" class="forminput">
</div>
<div class="input-group">
<button class="submit-button blah" onclick="createGroup()">title.join.space</button>
</div>
</div>
`;
//context menus
var addSpaceMenu = `
<button onclick="gotoJoinSpace()">
<svg xmlns="http://www.w3.org/2000/svg" width="1.4rem" viewBox="0 -960 960 960" fill="var(--text-color)"><path d="M440-280H280q-83 0-141.5-58.5T80-480q0-83 58.5-141.5T280-680h160v80H280q-50 0-85 35t-35 85q0 50 35 85t85 35h160v80ZM320-440v-80h320v80H320Zm200 160v-80h160q50 0 85-35t35-85q0-50-35-85t-85-35H520v-80h160q83 0 141.5 58.5T880-480q0 83-58.5 141.5T680-280H520Z"/></svg>
<span class="blah">title.join.space</span>
</button>
<button onclick="gotoCreateSpace()">
<svg xmlns="http://www.w3.org/2000/svg" width="1.4rem" viewBox="0 -960 960 960" fill="var(--text-color)"><path d="M80-120v-720h400v160h400v320h-80v-240H480v80h80v80h-80v80h80v80h-80v80h160v80H80Zm80-80h80v-80h-80v80Zm0-160h80v-80h-80v80Zm0-160h80v-80h-80v80Zm0-160h80v-80h-80v80Zm160 480h80v-80h-80v80Zm0-160h80v-80h-80v80Zm0-160h80v-80h-80v80Zm0-160h80v-80h-80v80ZM800-40v-80h-80v-80h80v-80h80v80h80v80h-80v80h-80ZM640-440v-80h80v80h-80Zm0 160v-80h80v80h-80Z"/></svg>
<span class="blah">title.create.space</span>
</button>
`;

View file

@ -5,6 +5,7 @@
:root {
--main-bg-color: rgb(20, 20, 20);
--text-color: rgb(240, 240, 245);
--darker-text-color: rgb(210, 210, 215);
--icon-button-size: 2rem;
--press-scale: scale(0.92);
--light-border-color: rgba(255, 255, 255, 0.08);
@ -12,7 +13,7 @@
--icon-button-height: 3.4rem;
--button-height: 2.4rem;
--border-width: 0.09rem;
--big-default: rgb(207 207 207);
--big-red: rgb(202 0 0);
--big-green: rgb(25 189 0);
@ -52,7 +53,7 @@ main, loading {
overflow: hidden;
}
loading {
justify-content: center;
justify-content: center;
align-items: center;
width: 100%;
}
@ -69,7 +70,6 @@ loading {
user-select: none !important;
-webkit-user-drag: none !important;
}
button, input {
border-radius: 0.8rem;
background-color: rgba(255, 255, 255, 0.05);
@ -84,8 +84,8 @@ button, input {
border: var(--border-width) solid var(--light-border-color);
backface-visibility: hidden;
transform: translateZ(0);
will-change: transform;
transform: translateZ(0);
will-change: transform;
transform-origin: center center;
}
input {
@ -149,7 +149,7 @@ button:active, input:active {
roomcontent {
display: flex;
flex-direction: column;
height: 100%;
width: calc(100vw - (var(--icon-button-height) + (var(--button-margin) * 2) + var(--border-width)) - 17rem);
border-right: var(--border-width) solid var(--light-border-color);
@ -157,7 +157,7 @@ roomcontent {
roomcontent2 {
display: flex;
flex-direction: column;
height: calc(100% - (var(--button-height) * 1.5));
width: 100%;
}
@ -180,27 +180,23 @@ sidebar.second {
align-items: center;
justify-content: space-between;
}
.collapse-text-button {
padding-left: calc(var(--button-margin) + 0.2rem);
flex-shrink: 0;
flex-grow: 1;
flex-grow: 1;
border: none;
background-color: transparent;
height: 2rem;
font-weight: 600;
gap: 0.3rem;
gap: 0.3rem;
}
.collapse-text-button .chevron {
width: 1.25rem;
height: 1.25rem;
}
.collapse-text-button.collapsed .chevron {
transform: rotate(-90deg);
}
.add-action-button {
border: none;
background-color: transparent;
@ -211,7 +207,6 @@ sidebar.second {
justify-content: center;
color: rgba(255, 255, 255, 0.5);
}
.add-action-button svg {
width: 1.25rem;
height: 1.25rem;
@ -224,8 +219,6 @@ hr {
width: 60%;
margin-left: 20%;
}
#notification-container {
padding-top: env(safe-area-inset-top);
position: fixed;
@ -239,12 +232,10 @@ hr {
pointer-events: none;
align-items: center;
}
.notification {
background: rgba(255, 255, 255, 0.015);
backdrop-filter: blur(1.2rem);
-webkit-backdrop-filter: blur(1.2rem);
border: var(--border-width) solid var(--light-border-color);
border-radius: 0.9rem;
@ -261,43 +252,37 @@ hr {
transition:
opacity 0.3s ease,
transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275),
background-color 0.2s ease;
background-color 0.2s ease;
}
.notification.show {
opacity: 1;
transform: translateY(0);
}
.notification.info {
border-color: var(--big-default);
}
.notification.error {
border-color: var(--big-red);
}
.notification.success {
border-color: var(--big-green);
}
roomtopbar {
height: calc(var(--button-height) * 1.5);
display: flex;
flex-direction: row;
width: 100%;
border-bottom: var(--border-width) solid var(--light-border-color);
line-height: calc(var(--button-height) * 1.5);
font-weight: bold;
padding-left: calc(var(--button-margin) * 3);
padding-right: calc(var(--button-margin) * 3);
font-size: 1.5rem;
}
sidebar.second#roomdetailsbar {
height: calc(var(--button-height) * 1.5);
display: flex;
flex-direction: row;
@ -311,32 +296,24 @@ herotitle {
font-weight: bold;
font-size: 1.6rem;
}
.input-group {
text-align: left;
display: flex;
flex-direction: column;
gap: 0.2rem;
width: 90%;
max-width: 30rem;
}
.input-group label {
font-size: 0.75rem;
font-weight: 800;
margin-left: 0.6rem;
margin-bottom: -0.2rem;
opacity: 0.4;
letter-spacing: 0.05rem;
position: relative;
z-index: 1;
}
.submit-button {
justify-content: center;
background-color: var(--text-color);
@ -345,11 +322,9 @@ herotitle {
border: none;
font-size: 1.05rem;
}
.bottom-element {
margin-top: auto;
}
@media (hover: hover) {
sidebarelement:hover indicator:not(.active) {
content: "";
@ -392,11 +367,149 @@ sidebarelement:has(.icon-button:active) indicator:not(.active) {
border-radius: 0.8rem;
transform: translateY(calc( ( var(--icon-button-height) + (var(--button-margin) * 2) ) / 2 - 0.6rem));
}
blah {
blah, inherit, .inherit {
all: inherit;
padding: 0;
margin: 0;
display: inline;
opacity: 1;
}
space{
margin-left: 0.4rem;
}
.context-menu {
position: fixed;
background: var(--main-bg-color);
border: var(--border-width) solid var(--light-border-color);
border-radius: 0.8rem;
padding: 0.4rem;
display: flex;
flex-direction: column;
gap: 0.2rem;
z-index: 2000;
box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.4);
opacity: 0;
transform: scale(0.95);
transform-origin: center left;
pointer-events: none;
}
.context-menu.show {
opacity: 1;
transform: scale(1);
pointer-events: auto;
}
.context-menu button {
margin: 0;
padding: 0.5rem 1rem;
border: none;
background: transparent;
width: 100%;
min-width: 10rem;
justify-content: flex-start;
gap: 0.5rem;
font-weight: 600;
}
.context-menu button:hover {
background-color: rgba(255, 255, 255, 0.08);
}
.mobile-nav-btn {
display: none;
background: transparent;
border: none;
height: 2.4rem;
width: 2.4rem;
padding: 0;
margin: 0;
margin-right: 0.8rem;
align-items: center;
justify-content: center;
flex-shrink: 0;
color: var(--text-color);
cursor: pointer;
}
.mobile-nav-btn:active {
background-color: rgba(255, 255, 255, 0.1);
border-radius: 0.8rem;
}
.mobile-nav-btn.right {
margin-right: 0;
margin-left: 0.8rem;
}
.mobile-nav-btn svg {
width: 1.5rem;
height: 1.5rem;
}
.flex-spacer {
flex-grow: 1;
}
@media (max-width: 52rem) {
.mobile-nav-btn {
display: flex;
}
main {
position: relative;
width: 100vw;
overflow: hidden;
}
sidebar, sidebar.second, roomcontent {
position: absolute !important;
height: 100%;
transition: transform 0.35s cubic-bezier(0.25, 1, 0.5, 1);
}
sidebar {
left: 0;
z-index: 1;
}
#roomsbar {
left: calc(var(--icon-button-height) + (var(--button-margin) * 2) + var(--border-width));
width: calc(100vw - (var(--icon-button-height) + (var(--button-margin) * 2) + var(--border-width))) !important;
min-width: unset !important;
max-width: none !important;
z-index: 1;
}
roomcontent {
left: 0;
width: 100vw !important;
transform: translateX(100vw);
border-right: none !important;
z-index: 2;
background-color: var(--main-bg-color);
}
#roomdetailsbar {
left: 0;
width: 100vw !important;
min-width: unset !important;
max-width: none !important;
transform: translateX(100vw);
z-index: 3;
background-color: var(--main-bg-color);
}
main.mobile-content sidebar,
main.mobile-content #roomsbar {
transform: translateX(-30vw);
}
main.mobile-content roomcontent {
transform: translateX(0);
}
main.mobile-details sidebar,
main.mobile-details #roomsbar {
transform: translateX(-60vw);
}
main.mobile-details roomcontent {
transform: translateX(-30vw);
}
main.mobile-details #roomdetailsbar {
transform: translateX(0);
}
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 14 KiB

After

Width:  |  Height:  |  Size: 14 KiB

Before After
Before After

Binary file not shown.

Before

Width:  |  Height:  |  Size: 14 KiB

After

Width:  |  Height:  |  Size: 14 KiB

Before After
Before After

View file

@ -61,7 +61,11 @@
"placeholder.create.group.input": "My group",
"placeholder.create.space.input": "My space",
"title.name": "Name",
"desc.create.space": "Create, a space for your community",
"desc.create.space": "Create a space for your community",
"desc.join.space": "Join a community that fits you",
"title.join.space": "Join space",
"title.space.id": "Space id",
"title.sign.up": "Sign Up",
"title.sign.in": "Sign In",

View file

@ -21,22 +21,15 @@
</indicator>
<button class="icon-button" onclick="gotoHome()">
<svg viewBox="-1 -1 18 18" fill="none" xmlns="http://www.w3.org/2000/svg">
<path
d="M1 6V15H6V11C6 9.89543 6.89543 9 8 9C9.10457 9 10 9.89543 10 11V15H15V6L8 0L1 6Z"
stroke="currentColor"
stroke-width="1.28"
stroke-linejoin="round"
stroke-linecap="round"
transform="translate(0 0.5)"
/>
<path d="M1 6V15H6V11C6 9.89543 6.89543 9 8 9C9.10457 9 10 9.89543 10 11V15H15V6L8 0L1 6Z" stroke="var(--text-color)" stroke-width="1.28" stroke-linejoin="round" stroke-linecap="round" transform="translate(0 0.5)"/>
</svg>
</button>
</sidebarelement>
<sidebarelement id="sidebar-add">
<indicator>
</indicator>
<button class="icon-button" onclick="gotoCreateSpace()">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor"
<button class="icon-button">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="var(--text-color)"
stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
<line x1="12" y1="5" x2="12" y2="19"></line>
<line x1="5" y1="12" x2="19" y2="12"></line>
@ -49,7 +42,7 @@
<indicator>
</indicator>
<button class="icon-button" onclick="gotoInbox()">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 -960 960 960" fill="currentColor"><path d="M216-144q-29 0-50.5-21.5T144-216v-528q0-29.7 21.5-50.85Q187-816 216-816h528q29.7 0 50.85 21.15Q816-773.7 816-744v528q0 29-21.15 50.5T744-144H216Zm0-72h528v-144H632q-23 43-63.5 69.5T480-264q-49 0-89.5-26T328-360H216v144Zm332-148q28-28 28-68h168v-312H216v312h168q0 40 28 68t68 28q40 0 68-28ZM216-216h528-528Z"/></svg>
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 -960 960 960" fill="var(--text-color)"><path d="M216-144q-29 0-50.5-21.5T144-216v-528q0-29.7 21.5-50.85Q187-816 216-816h528q29.7 0 50.85 21.15Q816-773.7 816-744v528q0 29-21.15 50.5T744-144H216Zm0-72h528v-144H632q-23 43-63.5 69.5T480-264q-49 0-89.5-26T328-360H216v144Zm332-148q28-28 28-68h168v-312H216v312h168q0 40 28 68t68 28q40 0 68-28ZM216-216h528-528Z"/></svg>
</button>
</sidebarelement>
<sidebarelement id="sidebar-profile">
@ -60,7 +53,6 @@
</button>
</sidebarelement>
</sidebar>
<sidebar class="second" id="roomsbar">
<roomtopbar>
<blah>title.home</blah>
@ -69,29 +61,29 @@
<button class="collapse-text-button" id="collapse-dms">
<span><blah>title.dms</blah></span>
<svg class="chevron" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none"
stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
stroke="var(--text-color)" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
<polyline points="6 9 12 15 18 9"></polyline>
</svg>
</button>
<button class="add-action-button" id="add-dm-btn">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor"
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="var(--text-color)"
stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
<line x1="12" y1="5" x2="12" y2="19"></line>
<line x1="5" y1="12" x2="19" y2="12"></line>
</svg>
</button>
</div>
<div class="sidebar-section-header">
<button class="collapse-text-button" id="collapse-groups">
<span><blah>title.groups</blah></span>
<svg class="chevron" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none"
stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
stroke="var(--text-color)" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
<polyline points="6 9 12 15 18 9"></polyline>
</svg>
</button>
<button class="add-action-button" id="add-group-btn">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor"
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="var(--text-color)"
stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
<line x1="12" y1="5" x2="12" y2="19"></line>
<line x1="5" y1="12" x2="19" y2="12"></line>
@ -99,22 +91,19 @@
</button>
</div>
</sidebar>
<roomcontent>
<roomtopbar>
<blah>title.splash</blah>
</roomtopbar>
<roomcontent2>
<div style="display: flex;justify-content: center;align-items: center;height:100%;flex-direction: column;text-align: center;">
<img src="favicon.svg" style="width: 6rem">
<herotitle><blah>title.welcome.splash</blah></herotitle>
<p><blah>desc.welcome.splash</blah>. <span class="aqua">v<span class="clientver aqua">1.0</span></span></p>
</div>
</roomcontent2>
</roomcontent>
<sidebar class="second" id="roomdetailsbar" style="display: none;">
</sidebar>
</main>
<div id="fixed-context-menu" class="context-menu">
</div>
</body>
</html>
<script src="screens.js"></script>
@ -122,6 +111,7 @@
async function start() {
updateLoadingStatus("loading.loading");
try {
switchRoomContent("title.splash", splashScreen, false, "", true);
if (host != null)
{
await updateProtocolAndUrl(host);
@ -130,9 +120,8 @@
{
await updateProtocolAndUrl(window.location.hostname);
}
sidebarPfp.src = await getAvatarUrl(username);
showAction("Authenticating...", "startauth");
let res = await Auth(username, password);
clearAction("startauth");
@ -155,12 +144,12 @@
async function refreshDms() {
try {
showAction("Refreshing dms...", "dmrefresh");
let res = await fetchEncrypted("user/dm/list", "");
console.log(res);
clearAction("dmrefresh");
showAction("Refreshing dms...", "dmrefresh");
let res = await fetchEncrypted("user/dm/list", "");
console.log(res);
clearAction("dmrefresh");
}
catch (e) {
clearAction("dmrefresh");
@ -184,11 +173,10 @@
showBlahNotification("error:chat.add.failed");
}
}
async function createGroup() {
}
async function createGroup() {
}
</script>
<script src="main.js"></script>
<script src="userscript.js"></script>

View file

@ -66,6 +66,7 @@ try {
var sidebarInboxIndicator = sidebarInbox.children.item(0);
var fixedContextMenu = document.getElementById("fixed-context-menu");
} catch (e) {
}
@ -653,28 +654,11 @@ password = localStorage.getItem('password');
host = localStorage.getItem('host');
mainJS();
collapseDmsBtn.addEventListener("click", () => {
collapseDmsBtn.classList.toggle("collapsed");
});
collapseGroupsBtn.addEventListener("click", () => {
collapseGroupsBtn.classList.toggle("collapsed");
});
//Invite to dm, addDmScreen, false
async function switchRoomContent(title, content, showRoomBar)
{
roomContentMain.style.transform = "scale(0.85)";
roomContentMain.style.opacity = "0";
await delay(200);
roomTopBar.innerHTML = processBlah(title);
roomDetailsBar.style.display = showRoomBar ? "flex" : "none";
//content blah parsing
function showFixedContextMenu(rect, html) {
let parser = new DOMParser();
let doc = parser.parseFromString(content, "text/html");
let doc = parser.parseFromString(html, "text/html");
let blahTags = doc.getElementsByTagName("blah");
for (let i = 0; i < blahTags.length; i++) {
blahTags[i].innerHTML = processBlah(blahTags[i].innerHTML);
@ -693,14 +677,63 @@ async function switchRoomContent(title, content, showRoomBar)
}
}
fixedContextMenu.innerHTML = doc.body.innerHTML;
fixedContextMenu.style.left = `${rect.right + 10}px`;
fixedContextMenu.style.top = `${rect.top}px`;
fixedContextMenu.classList.add("show");
}
async function switchRoomContent(title, content, showRoomBar, icon = "", skipMobileSlide = false)
{
roomContentMain.style.transform = "scale(0.85)";
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>`;
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>` : '';
roomTopBar.innerHTML = `${backBtnHtml}${icon}<space></space><inherit>${processBlah(title)}</inherit><div class="flex-spacer"></div>${detailsBtnHtml}`;
roomDetailsBar.style.display = showRoomBar ? "flex" : "none";
let parser = new DOMParser();
let doc = parser.parseFromString(content, "text/html");
let blahTags = doc.getElementsByTagName("blah");
for (let i = 0; i < blahTags.length; i++) {
blahTags[i].innerHTML = processBlah(blahTags[i].innerHTML);
}
blahTags = doc.getElementsByClassName("blah");
for (let i = 0; i < blahTags.length; i++) {
blahTags[i].innerHTML = processBlah(blahTags[i].innerHTML);
}
let placeholders = doc.querySelectorAll("[placeholder]");
for (let i = 0; i < placeholders.length; i++) {
if (placeholders[i].placeholder.startsWith("{blah("))
{
let value = placeholders[i].placeholder.split("{blah(")[1].split(")}")[0];
placeholders[i].placeholder = processBlah(value);
}
}
roomContentMain.innerHTML = doc.body.innerHTML;
roomContentMain.style.transform = "";
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.classList.toggle("collapsed");
});
collapseGroupsBtn.addEventListener("click", () => {
collapseGroupsBtn.classList.toggle("collapsed");
});
addDmBtn.addEventListener("click", async () => {
switchRoomContent("title.create.dm", addDmScreen, false);
});
@ -708,47 +741,107 @@ addGroupBtn.addEventListener("click", async () => {
switchRoomContent("title.create.group", createGroupScreen, false);
});
var indicatorBeforeFixedMenu;
sidebarAddButton.addEventListener("click", (e) => {
e.stopPropagation();
if (fixedContextMenu.classList.contains("show")) {
fixedContextMenu.classList.remove("show");
setActiveSidebarIndicator(indicatorBeforeFixedMenu);
} else {
setActiveSidebarIndicator(sidebarAddIndicator, true);
const rect = sidebarAddButton.getBoundingClientRect();
showFixedContextMenu(rect, addSpaceMenu);
}
});
document.addEventListener("click", (e) => {
if (fixedContextMenu.classList.contains("show")) {
if (!fixedContextMenu.contains(e.target)) {
fixedContextMenu.classList.remove("show");
setActiveSidebarIndicator(indicatorBeforeFixedMenu);
}
}
});
function gotoSideProfilePopup() {
}
function gotoInbox() {
setActiveSidebarIndicator(sidebarInboxIndicator);
}
async function gotoCreateSpace() {
function gotoCreateSpace() {
fixedContextMenu.classList.remove("show");
setActiveSidebarIndicator(sidebarAddIndicator);
switchRoomContent("title.create.space", createSpaceScreen, false);
}
function gotoJoinSpace() {
fixedContextMenu.classList.remove("show");
setActiveSidebarIndicator(sidebarAddIndicator);
switchRoomContent("title.join.space", joinSpaceScreen, false);
}
function gotoHome() {
setActiveSidebarIndicator(sidebarHomeIndicator);
switchRoomContent("title.splash", splashScreen, false);
}
function setActiveSidebarIndicator(element, skipDisabling = false)
{
let indicators = document.getElementsByTagName("indicator");
for (let i = 0; i < indicators.length; i++) {
if (indicators[i].classList.contains("active"))
{
indicatorBeforeFixedMenu = indicators[i];
if (!skipDisabling)
{
indicators[i].classList.remove("active");
}
}
}
element.classList.add("active");
}
function mobileNavBack() {
if(mainScreen.classList.contains('mobile-details')) {
mainScreen.classList.remove('mobile-details');
mainScreen.classList.add('mobile-content');
} else {
mainScreen.classList.remove('mobile-content');
}
}
function mobileNavDetails() {
mainScreen.classList.add('mobile-details');
}
let touchStartX = 0;
let touchEndX = 0;
let touchStartY = 0;
let touchEndY = 0;
document.addEventListener('touchstart', e => {
touchStartX = e.changedTouches[0].screenX;
touchStartY = e.changedTouches[0].screenY;
});
document.addEventListener('touchend', e => {
touchEndX = e.changedTouches[0].screenX;
touchEndY = e.changedTouches[0].screenY;
handleMobileSwipe();
});
function handleMobileSwipe() {
const rem = parseFloat(getComputedStyle(document.documentElement).fontSize);
if (window.innerWidth > 52 * rem) return;
/* replaced with css
sidebarHomeButton.addEventListener("mouseenter", () => {
sidebarHomeIndicator.classList.add("hover");
});
sidebarHomeButton.addEventListener("mouseleave", () => {
sidebarHomeIndicator.classList.remove("hover");
});
let diffX = touchEndX - touchStartX;
let diffY = touchEndY - touchStartY;
sidebarAddButton.addEventListener("mouseenter", () => {
sidebarAddIndicator.classList.add("hover");
});
sidebarAddButton.addEventListener("mouseleave", () => {
sidebarAddIndicator.classList.remove("hover");
});
sidebarProfileButton.addEventListener("mouseenter", () => {
sidebarProfileIndicator.classList.add("hover");
});
sidebarProfileButton.addEventListener("mouseleave", () => {
sidebarProfileIndicator.classList.remove("hover");
});
sidebarInboxButton.addEventListener("mouseenter", () => {
sidebarInboxIndicator.classList.add("hover");
});
sidebarInboxButton.addEventListener("mouseleave", () => {
sidebarInboxIndicator.classList.remove("hover");
});
*/
if (Math.abs(diffX) > Math.abs(diffY) && Math.abs(diffX) > 60) {
if (diffX > 0) {
mobileNavBack();
} else {
if (mainScreen.classList.contains('mobile-content') && roomDetailsBar.style.display !== 'none') {
mobileNavDetails();
}
}
}
}

View file

@ -1,3 +1,11 @@
//room screens
var splashScreen = `
<div style="display: flex;justify-content: center;align-items: center;height:100%;flex-direction: column;text-align: center;">
<img src="favicon.svg" style="width: 6rem">
<herotitle><blah>title.welcome.splash</blah></herotitle>
<p><blah>desc.welcome.splash</blah>. <span class="aqua">v<span class="clientver aqua">1.0</span></span></p>
</div>
`;
var addDmScreen = `
<div style="display: flex;justify-content: center;align-items: center;height:100%;flex-direction: column;text-align: center;">
<svg xmlns="http://www.w3.org/2000/svg" width="3rem" viewBox="0 -960 960 960" fill="var(--text-color)"><path d="M120-160v-600q0-33 23.5-56.5T200-840h480q33 0 56.5 23.5T760-760v203q-10-2-20-2.5t-20-.5q-10 0-20 .5t-20 2.5v-203H200v400h283q-2 10-2.5 20t-.5 20q0 10 .5 20t2.5 20H240L120-160Zm160-440h320v-80H280v80Zm0 160h200v-80H280v80Zm400 280v-120H560v-80h120v-120h80v120h120v80H760v120h-80ZM200-360v-400 400Z"/></svg>
@ -6,7 +14,7 @@ var addDmScreen = `
<br>
<div class="input-group">
<label for="addchat-username"><blah>title.username</blah></label>
<input type="text" id="addchat-username" placeholder="name@example.com" class="forminput">
<input type="text" id="addchat-username" placeholder="name:example.com" class="forminput">
</div>
<div class="input-group">
<button class="submit-button blah" onclick="addDm()">title.add.chat</button>
@ -37,11 +45,43 @@ var createSpaceScreen = `
<p><blah>desc.create.space</blah></p>
<br>
<div class="input-group">
<label for="addgroup-name"><blah>title.name</blah></label>
<label for="createspace-name"><blah>title.name</blah></label>
<input type="text" id="createspace-name" placeholder="{blah(placeholder.create.space.input)}" class="forminput">
</div>
<div class="input-group">
<button class="submit-button blah" onclick="createGroup()">title.create.space</button>
</div>
</div>
`;
var joinSpaceScreen = `
<div style="display: flex;justify-content: center;align-items: center;height:100%;flex-direction: column;text-align: center;">
<svg xmlns="http://www.w3.org/2000/svg" width="3rem" viewBox="0 -960 960 960" fill="var(--text-color)"><path d="M440-280H280q-83 0-141.5-58.5T80-480q0-83 58.5-141.5T280-680h160v80H280q-50 0-85 35t-35 85q0 50 35 85t85 35h160v80ZM320-440v-80h320v80H320Zm200 160v-80h160q50 0 85-35t35-85q0-50-35-85t-85-35H520v-80h160q83 0 141.5 58.5T880-480q0 83-58.5 141.5T680-280H520Z"/></svg>
<herotitle><blah>title.join.space</blah></herotitle>
<p><blah>desc.join.space</blah></p>
<br>
<div class="input-group">
<label for="joinspace-id"><blah>title.space.id</blah></label>
<input type="text" id="joinspace-id" placeholder="id:example.com" class="forminput">
</div>
<div class="input-group">
<label for="joinspace-code"><blah>title.invitation.code</blah></label>
<input type="text" id="joinspace-code" placeholder="{blah(placeholder.invitation.code)}" class="forminput">
</div>
<div class="input-group">
<button class="submit-button blah" onclick="createGroup()">title.join.space</button>
</div>
</div>
`;
//context menus
var addSpaceMenu = `
<button onclick="gotoJoinSpace()">
<svg xmlns="http://www.w3.org/2000/svg" width="1.4rem" viewBox="0 -960 960 960" fill="var(--text-color)"><path d="M440-280H280q-83 0-141.5-58.5T80-480q0-83 58.5-141.5T280-680h160v80H280q-50 0-85 35t-35 85q0 50 35 85t85 35h160v80ZM320-440v-80h320v80H320Zm200 160v-80h160q50 0 85-35t35-85q0-50-35-85t-85-35H520v-80h160q83 0 141.5 58.5T880-480q0 83-58.5 141.5T680-280H520Z"/></svg>
<span class="blah">title.join.space</span>
</button>
<button onclick="gotoCreateSpace()">
<svg xmlns="http://www.w3.org/2000/svg" width="1.4rem" viewBox="0 -960 960 960" fill="var(--text-color)"><path d="M80-120v-720h400v160h400v320h-80v-240H480v80h80v80h-80v80h80v80h-80v80h160v80H80Zm80-80h80v-80h-80v80Zm0-160h80v-80h-80v80Zm0-160h80v-80h-80v80Zm0-160h80v-80h-80v80Zm160 480h80v-80h-80v80Zm0-160h80v-80h-80v80Zm0-160h80v-80h-80v80Zm0-160h80v-80h-80v80ZM800-40v-80h-80v-80h80v-80h80v80h80v80h-80v80h-80ZM640-440v-80h80v80h-80Zm0 160v-80h80v80h-80Z"/></svg>
<span class="blah">title.create.space</span>
</button>
`;

View file

@ -5,6 +5,7 @@
:root {
--main-bg-color: rgb(20, 20, 20);
--text-color: rgb(240, 240, 245);
--darker-text-color: rgb(210, 210, 215);
--icon-button-size: 2rem;
--press-scale: scale(0.92);
--light-border-color: rgba(255, 255, 255, 0.08);
@ -12,7 +13,7 @@
--icon-button-height: 3.4rem;
--button-height: 2.4rem;
--border-width: 0.09rem;
--big-default: rgb(207 207 207);
--big-red: rgb(202 0 0);
--big-green: rgb(25 189 0);
@ -52,7 +53,7 @@ main, loading {
overflow: hidden;
}
loading {
justify-content: center;
justify-content: center;
align-items: center;
width: 100%;
}
@ -69,7 +70,6 @@ loading {
user-select: none !important;
-webkit-user-drag: none !important;
}
button, input {
border-radius: 0.8rem;
background-color: rgba(255, 255, 255, 0.05);
@ -84,8 +84,8 @@ button, input {
border: var(--border-width) solid var(--light-border-color);
backface-visibility: hidden;
transform: translateZ(0);
will-change: transform;
transform: translateZ(0);
will-change: transform;
transform-origin: center center;
}
input {
@ -149,7 +149,7 @@ button:active, input:active {
roomcontent {
display: flex;
flex-direction: column;
height: 100%;
width: calc(100vw - (var(--icon-button-height) + (var(--button-margin) * 2) + var(--border-width)) - 17rem);
border-right: var(--border-width) solid var(--light-border-color);
@ -157,7 +157,7 @@ roomcontent {
roomcontent2 {
display: flex;
flex-direction: column;
height: calc(100% - (var(--button-height) * 1.5));
width: 100%;
}
@ -180,27 +180,23 @@ sidebar.second {
align-items: center;
justify-content: space-between;
}
.collapse-text-button {
padding-left: calc(var(--button-margin) + 0.2rem);
flex-shrink: 0;
flex-grow: 1;
flex-grow: 1;
border: none;
background-color: transparent;
height: 2rem;
font-weight: 600;
gap: 0.3rem;
gap: 0.3rem;
}
.collapse-text-button .chevron {
width: 1.25rem;
height: 1.25rem;
}
.collapse-text-button.collapsed .chevron {
transform: rotate(-90deg);
}
.add-action-button {
border: none;
background-color: transparent;
@ -211,7 +207,6 @@ sidebar.second {
justify-content: center;
color: rgba(255, 255, 255, 0.5);
}
.add-action-button svg {
width: 1.25rem;
height: 1.25rem;
@ -224,8 +219,6 @@ hr {
width: 60%;
margin-left: 20%;
}
#notification-container {
padding-top: env(safe-area-inset-top);
position: fixed;
@ -239,12 +232,10 @@ hr {
pointer-events: none;
align-items: center;
}
.notification {
background: rgba(255, 255, 255, 0.015);
backdrop-filter: blur(1.2rem);
-webkit-backdrop-filter: blur(1.2rem);
border: var(--border-width) solid var(--light-border-color);
border-radius: 0.9rem;
@ -261,43 +252,37 @@ hr {
transition:
opacity 0.3s ease,
transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275),
background-color 0.2s ease;
background-color 0.2s ease;
}
.notification.show {
opacity: 1;
transform: translateY(0);
}
.notification.info {
border-color: var(--big-default);
}
.notification.error {
border-color: var(--big-red);
}
.notification.success {
border-color: var(--big-green);
}
roomtopbar {
height: calc(var(--button-height) * 1.5);
display: flex;
flex-direction: row;
width: 100%;
border-bottom: var(--border-width) solid var(--light-border-color);
line-height: calc(var(--button-height) * 1.5);
font-weight: bold;
padding-left: calc(var(--button-margin) * 3);
padding-right: calc(var(--button-margin) * 3);
font-size: 1.5rem;
}
sidebar.second#roomdetailsbar {
height: calc(var(--button-height) * 1.5);
display: flex;
flex-direction: row;
@ -311,32 +296,24 @@ herotitle {
font-weight: bold;
font-size: 1.6rem;
}
.input-group {
text-align: left;
display: flex;
flex-direction: column;
gap: 0.2rem;
width: 90%;
max-width: 30rem;
}
.input-group label {
font-size: 0.75rem;
font-weight: 800;
margin-left: 0.6rem;
margin-bottom: -0.2rem;
opacity: 0.4;
letter-spacing: 0.05rem;
position: relative;
z-index: 1;
}
.submit-button {
justify-content: center;
background-color: var(--text-color);
@ -345,11 +322,9 @@ herotitle {
border: none;
font-size: 1.05rem;
}
.bottom-element {
margin-top: auto;
}
@media (hover: hover) {
sidebarelement:hover indicator:not(.active) {
content: "";
@ -392,11 +367,149 @@ sidebarelement:has(.icon-button:active) indicator:not(.active) {
border-radius: 0.8rem;
transform: translateY(calc( ( var(--icon-button-height) + (var(--button-margin) * 2) ) / 2 - 0.6rem));
}
blah {
blah, inherit, .inherit {
all: inherit;
padding: 0;
margin: 0;
display: inline;
opacity: 1;
}
space{
margin-left: 0.4rem;
}
.context-menu {
position: fixed;
background: var(--main-bg-color);
border: var(--border-width) solid var(--light-border-color);
border-radius: 0.8rem;
padding: 0.4rem;
display: flex;
flex-direction: column;
gap: 0.2rem;
z-index: 2000;
box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.4);
opacity: 0;
transform: scale(0.95);
transform-origin: center left;
pointer-events: none;
}
.context-menu.show {
opacity: 1;
transform: scale(1);
pointer-events: auto;
}
.context-menu button {
margin: 0;
padding: 0.5rem 1rem;
border: none;
background: transparent;
width: 100%;
min-width: 10rem;
justify-content: flex-start;
gap: 0.5rem;
font-weight: 600;
}
.context-menu button:hover {
background-color: rgba(255, 255, 255, 0.08);
}
.mobile-nav-btn {
display: none;
background: transparent;
border: none;
height: 2.4rem;
width: 2.4rem;
padding: 0;
margin: 0;
margin-right: 0.8rem;
align-items: center;
justify-content: center;
flex-shrink: 0;
color: var(--text-color);
cursor: pointer;
}
.mobile-nav-btn:active {
background-color: rgba(255, 255, 255, 0.1);
border-radius: 0.8rem;
}
.mobile-nav-btn.right {
margin-right: 0;
margin-left: 0.8rem;
}
.mobile-nav-btn svg {
width: 1.5rem;
height: 1.5rem;
}
.flex-spacer {
flex-grow: 1;
}
@media (max-width: 52rem) {
.mobile-nav-btn {
display: flex;
}
main {
position: relative;
width: 100vw;
overflow: hidden;
}
sidebar, sidebar.second, roomcontent {
position: absolute !important;
height: 100%;
transition: transform 0.35s cubic-bezier(0.25, 1, 0.5, 1);
}
sidebar {
left: 0;
z-index: 1;
}
#roomsbar {
left: calc(var(--icon-button-height) + (var(--button-margin) * 2) + var(--border-width));
width: calc(100vw - (var(--icon-button-height) + (var(--button-margin) * 2) + var(--border-width))) !important;
min-width: unset !important;
max-width: none !important;
z-index: 1;
}
roomcontent {
left: 0;
width: 100vw !important;
transform: translateX(100vw);
border-right: none !important;
z-index: 2;
background-color: var(--main-bg-color);
}
#roomdetailsbar {
left: 0;
width: 100vw !important;
min-width: unset !important;
max-width: none !important;
transform: translateX(100vw);
z-index: 3;
background-color: var(--main-bg-color);
}
main.mobile-content sidebar,
main.mobile-content #roomsbar {
transform: translateX(-30vw);
}
main.mobile-content roomcontent {
transform: translateX(0);
}
main.mobile-details sidebar,
main.mobile-details #roomsbar {
transform: translateX(-60vw);
}
main.mobile-details roomcontent {
transform: translateX(-30vw);
}
main.mobile-details #roomdetailsbar {
transform: translateX(0);
}
}