better loading and error screen

This commit is contained in:
Mystikfluu 2022-06-09 16:36:43 +02:00
parent 5ad3b322b9
commit a01db193dc
3 changed files with 12 additions and 8 deletions

View File

@ -2,6 +2,10 @@
color: green;
}
.status {
color: white;
}
.self {
color: gray;
}
@ -56,7 +60,7 @@ button {
font-family: 'system-ui';
}
.post,.self {
.post,.self,.status {
width: 50%;
margin-left: 25%;
margin-right: 25%;

View File

@ -82,6 +82,9 @@ async function main(){
username = user.username
if(!username){
document.getElementById("noaccount").style=""
document.getElementById("loading").style="display:none;"
console.log("no account");
return;
}
document.getElementById("username-self").innerText = username
}
@ -120,7 +123,7 @@ async function main(){
}
document.getElementById("loading").style="display:none;"
document.getElementById("scriptonly").style = ""
}
function reply(username) {
@ -170,6 +173,3 @@ if(window.location.href.includes("mention=")) {
if(window.location.href.includes("message=")) {
document.getElementById("post-text").innerText = `${decodeURIComponent(window.location.href.split("message=")[1])} `
}
document.getElementById("scriptonly").style = ""

View File

@ -11,12 +11,12 @@
<script type="text/javascript" src="/js/markdown.js"></script>
</head>
<body>
<div id="loading">
<div id="loading" class="status">
<h1>Loading...</h1>
Please allow us up to 5 seconds to load in your requested content. <br>
If this takes longer than usual, please refresh the page or contact support. <br>
</div>
<div id="noaccount" style="display:none;">
<div id="noaccount" style="display:none;" class="status">
<h1>Error</h1>
<h2>You have to be logged in to view this content</h2>
To log in, please visit <a href="/login">The login page</a> <br>