Android builds fixed
- new icon - fixed android icons - fixed android status & navigation bar - added "Splash" page
This commit is contained in:
parent
8fe2b5cf28
commit
6ff37cb3be
85 changed files with 415 additions and 161 deletions
29
webroot/favicon.svg
Normal file
29
webroot/favicon.svg
Normal file
|
|
@ -0,0 +1,29 @@
|
|||
<svg width="1024" height="1024" viewBox="0 0 1024 1024" xmlns="http://www.w3.org/2000/svg">
|
||||
<defs>
|
||||
<linearGradient id="grad" x1="0%" y1="0%" x2="100%" y2="100%">
|
||||
<stop offset="0%" style="stop-color:#b870ff;stop-opacity:1" />
|
||||
<stop offset="100%" style="stop-color:#a64aff;stop-opacity:1" />
|
||||
</linearGradient>
|
||||
<linearGradient id="bg_grad" x1="0%" y1="0%" x2="100%" y2="100%">
|
||||
<stop offset="0%" stop-color="#b870ff" />
|
||||
<stop offset="100%" stop-color="#a64aff" />
|
||||
</linearGradient>
|
||||
</defs>
|
||||
<rect width="1024" height="1024" fill="url(#bg_grad)" rx="190" />
|
||||
<g transform="translate(112, 112) scale(1.55)">
|
||||
|
||||
<text x="256" y="305"
|
||||
fill="#F0F0F5"
|
||||
font-family="Nunito"
|
||||
font-size="280"
|
||||
font-weight="900"
|
||||
text-anchor="middle"
|
||||
letter-spacing="-5">MN</text>
|
||||
|
||||
<g opacity="0.6">
|
||||
<circle cx="190" cy="400" r="15" fill="#F0F0F5" />
|
||||
<circle cx="256" cy="400" r="15" fill="white" />
|
||||
<circle cx="322" cy="400" r="15" fill="#F0F0F5" />
|
||||
</g>
|
||||
</g>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 1.1 KiB |
|
|
@ -1,109 +1,139 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="pl">
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0, viewport-fit=cover">
|
||||
<title>Larpix Client</title>
|
||||
<link rel="stylesheet" href="style.css">
|
||||
<link rel="icon" type="image/svg+xml" href="favicon.svg">
|
||||
</head>
|
||||
<body>
|
||||
<sidebar>
|
||||
<sidebarelement id="sidebar-home">
|
||||
<indicator class="active">
|
||||
</indicator>
|
||||
<button class="icon-button" aria-label="Homepage">
|
||||
<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)"
|
||||
/>
|
||||
</svg>
|
||||
</button>
|
||||
</sidebarelement>
|
||||
<hr>
|
||||
<sidebarelement id="sidebar-add">
|
||||
<indicator>
|
||||
</indicator>
|
||||
<button class="icon-button" aria-label="Add space">
|
||||
<svg 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">
|
||||
<line x1="12" y1="5" x2="12" y2="19"></line>
|
||||
<line x1="5" y1="12" x2="19" y2="12"></line>
|
||||
</svg>
|
||||
</button>
|
||||
</sidebarelement>
|
||||
<hr>
|
||||
</sidebar>
|
||||
|
||||
<sidebar class="second" id="roomsbar">
|
||||
<div class="sidebar-section-header">
|
||||
<button class="collapse-text-button" id="collapse-dms">
|
||||
<span>Direct messages</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">
|
||||
<polyline points="6 9 12 15 18 9"></polyline>
|
||||
</svg>
|
||||
</button>
|
||||
<button class="add-action-button" aria-label="New Direct Message" id="add-dm-btn">
|
||||
<svg 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">
|
||||
<line x1="12" y1="5" x2="12" y2="19"></line>
|
||||
<line x1="5" y1="12" x2="19" y2="12"></line>
|
||||
</svg>
|
||||
</button>
|
||||
</div>
|
||||
<sidebar>
|
||||
<sidebarelement id="sidebar-home">
|
||||
<indicator class="active">
|
||||
</indicator>
|
||||
<button class="icon-button" aria-label="Homepage">
|
||||
<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)"
|
||||
/>
|
||||
</svg>
|
||||
</button>
|
||||
</sidebarelement>
|
||||
<hr>
|
||||
<sidebarelement id="sidebar-add">
|
||||
<indicator>
|
||||
</indicator>
|
||||
<button class="icon-button" aria-label="Add space">
|
||||
<svg 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">
|
||||
<line x1="12" y1="5" x2="12" y2="19"></line>
|
||||
<line x1="5" y1="12" x2="19" y2="12"></line>
|
||||
</svg>
|
||||
</button>
|
||||
</sidebarelement>
|
||||
<hr>
|
||||
</sidebar>
|
||||
|
||||
<div class="sidebar-section-header">
|
||||
<button class="collapse-text-button" id="collapse-groups">
|
||||
<span>Groups</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">
|
||||
<polyline points="6 9 12 15 18 9"></polyline>
|
||||
</svg>
|
||||
</button>
|
||||
<button class="add-action-button" aria-label="New Group" id="add-group-btn">
|
||||
<svg 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">
|
||||
<line x1="12" y1="5" x2="12" y2="19"></line>
|
||||
<line x1="5" y1="12" x2="19" y2="12"></line>
|
||||
</svg>
|
||||
</button>
|
||||
</div>
|
||||
</sidebar>
|
||||
<sidebar class="second" id="roomsbar">
|
||||
<roomtopbar>
|
||||
Home
|
||||
</roomtopbar>
|
||||
<div class="sidebar-section-header">
|
||||
<button class="collapse-text-button" id="collapse-dms">
|
||||
<span>Direct messages</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">
|
||||
<polyline points="6 9 12 15 18 9"></polyline>
|
||||
</svg>
|
||||
</button>
|
||||
<button class="add-action-button" aria-label="Add Direct Message" id="add-dm-btn">
|
||||
<svg 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">
|
||||
<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>Groups</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">
|
||||
<polyline points="6 9 12 15 18 9"></polyline>
|
||||
</svg>
|
||||
</button>
|
||||
<button class="add-action-button" aria-label="Add Group" id="add-group-btn">
|
||||
<svg 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">
|
||||
<line x1="12" y1="5" x2="12" y2="19"></line>
|
||||
<line x1="5" y1="12" x2="19" y2="12"></line>
|
||||
</svg>
|
||||
</button>
|
||||
</div>
|
||||
</sidebar>
|
||||
|
||||
<roomcontent>
|
||||
<roomtopbar>
|
||||
Splash
|
||||
</roomtopbar>
|
||||
<roomcontent2>
|
||||
<div style="display: flex;justify-content: center;align-items: center;height:100%;flex-direction: column;">
|
||||
<img src="favicon.svg" style="width: 6rem">
|
||||
<herotitle>Welcome to Miarven</herotitle>
|
||||
<p>First Larpix client. <span class="aqua">v<span class="clientver aqua">1.0</span></span></p>
|
||||
</div>
|
||||
</roomcontent2>
|
||||
</roomcontent>
|
||||
<sidebar class="second hidden" id="roomdetailsbar" style="display: none;">
|
||||
</sidebar>
|
||||
|
||||
<roomcontent>
|
||||
|
||||
</roomcontent>
|
||||
<sidebar class="second" id="roomdetailsbar">
|
||||
</sidebar>
|
||||
</body>
|
||||
</html>
|
||||
<script src="main.js"></script>
|
||||
<script>
|
||||
async function start()
|
||||
{
|
||||
showAction("Authenticating...", "startauth");
|
||||
let res = await Auth(username, password);
|
||||
clearAction("startauth");
|
||||
if (res == "Login successful")
|
||||
{
|
||||
await refreshDms();
|
||||
}
|
||||
else
|
||||
{
|
||||
async function start() {
|
||||
try {
|
||||
|
||||
|
||||
showAction("Authenticating...", "startauth");
|
||||
let res = await Auth(username, password);
|
||||
clearAction("startauth");
|
||||
if (res == "Login successful") {
|
||||
await refreshDms();
|
||||
} else {
|
||||
showNotification("Failed to auth. Redirecting to login...", "error", 3500);
|
||||
await delay(2000);
|
||||
window.location.href = "login/";
|
||||
}
|
||||
} catch (e) {
|
||||
clearAction("startauth");
|
||||
showNotification("Failed to auth. Redirecting to login...", "error", 3500);
|
||||
await delay(2000);
|
||||
window.location.href = "login/";
|
||||
}
|
||||
}
|
||||
|
||||
async function refreshDms()
|
||||
{
|
||||
|
||||
async function refreshDms() {
|
||||
try {
|
||||
|
||||
|
||||
showAction("Refreshing dms...", "dmrefresh");
|
||||
let res = await fetchEncrypted("user/dm/list", "");
|
||||
console.log(res);
|
||||
clearAction("dmrefresh");
|
||||
}
|
||||
catch (e) {
|
||||
clearAction("dmrefresh");
|
||||
showNotification("Failed to refresh dms", "error", 3500);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
start();
|
||||
</script>
|
||||
|
|
@ -2,7 +2,7 @@
|
|||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0, viewport-fit=cover">
|
||||
<title>Larpix - Authentication</title>
|
||||
<link rel="stylesheet" href="../style.css">
|
||||
<link rel="icon" type="image/svg+xml" href="../favicon.svg">
|
||||
|
|
@ -249,7 +249,7 @@
|
|||
<p>Prove you are a human.</p>
|
||||
</div>
|
||||
<div class="captcha-img">
|
||||
<img src="https://miro.medium.com/0*obnHri9w__4Cmhbj.jpg" alt="Captcha" id="captcha-image">
|
||||
<img src="" alt="Captcha" id="captcha-image">
|
||||
</div>
|
||||
<form id="form-captcha">
|
||||
<div class="input-group">
|
||||
|
|
@ -342,7 +342,7 @@
|
|||
|
||||
} catch (error) {
|
||||
console.log(error);
|
||||
showNotification("Something went wrong...", "error", 3500);
|
||||
showNotification("Something went wrong... (probably wrong password)", "error", 3500);
|
||||
container.className = 'auth-container';
|
||||
}
|
||||
});
|
||||
|
|
|
|||
|
|
@ -6,6 +6,9 @@ var params = new URLSearchParams(window.location.search);
|
|||
const collapseDmsBtn = document.getElementById("collapse-dms");
|
||||
const collapseGroupsBtn = document.getElementById("collapse-groups");
|
||||
|
||||
const addDmBtn = document.getElementById("add-dm-btn");
|
||||
const addGroupBtn = document.getElementById("add-group-btn");
|
||||
|
||||
const sidebarHome = document.getElementById("sidebar-home");
|
||||
const sidebarHomeButton = sidebarHome.children.item(1);
|
||||
const sidebarHomeIndicator = sidebarHome.children.item(0);
|
||||
|
|
@ -14,6 +17,15 @@ const sidebarAdd = document.getElementById("sidebar-add");
|
|||
const sidebarAddButton = sidebarAdd.children.item(1);
|
||||
const sidebarAddIndicator = sidebarAdd.children.item(0);
|
||||
|
||||
const roomDetailsBar = document.getElementById("roomdetailsbar");
|
||||
const roomContent = document.getElementsByTagName("roomcontent")[0];
|
||||
const roomsBar = document.getElementById("roomsbar");
|
||||
const sideBar = document.getElementsByTagName("sidebar")[0];
|
||||
|
||||
const roomContentMain = document.getElementsByTagName("roomcontent2")[0];
|
||||
|
||||
const roomContentBar = roomContent.children[0];
|
||||
|
||||
|
||||
|
||||
function delay(time) {
|
||||
|
|
@ -256,6 +268,7 @@ async function getServerInfo(host){
|
|||
}
|
||||
|
||||
async function Auth(username, password) {
|
||||
|
||||
|
||||
let passwordHash = await hashSHA3_512(password);
|
||||
let response = await fetch(`${url}/auth?u=${username}`, {
|
||||
|
|
@ -268,11 +281,13 @@ async function Auth(username, password) {
|
|||
|
||||
let data = await response.text();
|
||||
return data;
|
||||
|
||||
}
|
||||
|
||||
|
||||
async function fetchEncrypted(request, body)
|
||||
{
|
||||
|
||||
let nonce = await getNonce(username, passwordHash);
|
||||
|
||||
let response = await fetch(`${url}/encryptedrequest?u=${username}`, {
|
||||
|
|
@ -413,6 +428,22 @@ collapseGroupsBtn.addEventListener("click", () => {
|
|||
collapseGroupsBtn.classList.toggle("collapsed");
|
||||
});
|
||||
|
||||
addDmBtn.addEventListener("click", () => {
|
||||
roomContentMain.innerHTML =
|
||||
`
|
||||
<div style="display: flex;justify-content: center;align-items: center;height:100%;flex-direction: column;">
|
||||
<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>
|
||||
<herotitle>Add Chat</herotitle>
|
||||
<p>Add a private, encrypted chat by entering a username</p>
|
||||
</div>
|
||||
`
|
||||
});
|
||||
addGroupBtn.addEventListener("click", () => {
|
||||
|
||||
});
|
||||
|
||||
|
||||
|
||||
sidebarHomeButton.addEventListener("mouseenter", () => {
|
||||
sidebarHomeIndicator.classList.add("hover");
|
||||
});
|
||||
|
|
|
|||
|
|
@ -27,10 +27,14 @@
|
|||
font-size: 80%;
|
||||
padding: 0 0.5rem;
|
||||
}
|
||||
.aqua {
|
||||
color: rgb(0 139 200);
|
||||
}
|
||||
html {
|
||||
font-size: max(16px, calc(100vw / 120));
|
||||
}
|
||||
body {
|
||||
padding-top: env(safe-area-inset-top);
|
||||
background-color: var(--main-bg-color);
|
||||
display: flex;
|
||||
height: 100dvh;
|
||||
|
|
@ -128,9 +132,18 @@ roomcontent {
|
|||
flex-direction: column;
|
||||
|
||||
height: 100dvh;
|
||||
width: calc(100vw - (var(--icon-button-height) + (var(--button-margin) * 2) + var(--border-width)) - 22rem);
|
||||
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);
|
||||
}
|
||||
roomcontent2 {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
|
||||
height: calc(100dvh - (var(--button-height) * 1.5));
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
|
||||
sidebar {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
|
|
@ -140,7 +153,9 @@ sidebar {
|
|||
border-right: var(--border-width) solid var(--light-border-color);
|
||||
}
|
||||
sidebar.second {
|
||||
width: 20rem;
|
||||
width: 17rem;
|
||||
min-width: 17rem;
|
||||
max-width: 17rem;
|
||||
}
|
||||
.sidebar-section-header {
|
||||
display: flex;
|
||||
|
|
@ -199,6 +214,7 @@ hr {
|
|||
|
||||
|
||||
#notification-container {
|
||||
padding-top: env(safe-area-inset-top);
|
||||
position: fixed;
|
||||
top: 1.5rem;
|
||||
left: 50%;
|
||||
|
|
@ -250,4 +266,35 @@ hr {
|
|||
|
||||
.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);
|
||||
font-size: 1.5rem;
|
||||
}
|
||||
sidebar.second#roomdetailsbar {
|
||||
height: calc(var(--button-height) * 1.5);
|
||||
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
|
||||
border-bottom: var(--border-width) solid var(--light-border-color);
|
||||
}
|
||||
fullcontainer {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
herotitle {
|
||||
font-weight: bold;
|
||||
font-size: 1.6rem;
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue