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; color: green;
} }
.status {
color: white;
}
.self { .self {
color: gray; color: gray;
} }
@ -56,7 +60,7 @@ button {
font-family: 'system-ui'; font-family: 'system-ui';
} }
.post,.self { .post,.self,.status {
width: 50%; width: 50%;
margin-left: 25%; margin-left: 25%;
margin-right: 25%; margin-right: 25%;

View File

@ -82,6 +82,9 @@ async function main(){
username = user.username username = user.username
if(!username){ if(!username){
document.getElementById("noaccount").style="" document.getElementById("noaccount").style=""
document.getElementById("loading").style="display:none;"
console.log("no account");
return;
} }
document.getElementById("username-self").innerText = username document.getElementById("username-self").innerText = username
} }
@ -120,7 +123,7 @@ async function main(){
} }
document.getElementById("loading").style="display:none;" document.getElementById("loading").style="display:none;"
document.getElementById("scriptonly").style = ""
} }
function reply(username) { function reply(username) {
@ -170,6 +173,3 @@ if(window.location.href.includes("mention=")) {
if(window.location.href.includes("message=")) { if(window.location.href.includes("message=")) {
document.getElementById("post-text").innerText = `${decodeURIComponent(window.location.href.split("message=")[1])} ` 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> <script type="text/javascript" src="/js/markdown.js"></script>
</head> </head>
<body> <body>
<div id="loading"> <div id="loading" class="status">
<h1>Loading...</h1> <h1>Loading...</h1>
Please allow us up to 5 seconds to load in your requested content. <br> 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> If this takes longer than usual, please refresh the page or contact support. <br>
</div> </div>
<div id="noaccount" style="display:none;"> <div id="noaccount" style="display:none;" class="status">
<h1>Error</h1> <h1>Error</h1>
<h2>You have to be logged in to view this content</h2> <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> To log in, please visit <a href="/login">The login page</a> <br>