From a01db193dcb22c30b8e75ed20a0367e3b44151df Mon Sep 17 00:00:00 2001 From: Mystikfluu Date: Thu, 9 Jun 2022 16:36:43 +0200 Subject: [PATCH] better loading and error screen --- css/posts.css | 6 +++++- js/posts.js | 10 +++++----- views/posts.html | 4 ++-- 3 files changed, 12 insertions(+), 8 deletions(-) diff --git a/css/posts.css b/css/posts.css index 9795079..b5e2ca6 100644 --- a/css/posts.css +++ b/css/posts.css @@ -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%; diff --git a/js/posts.js b/js/posts.js index 7dd0756..9125185 100644 --- a/js/posts.js +++ b/js/posts.js @@ -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 } @@ -119,8 +122,8 @@ async function main(){ } } - document.getElementById("loading").style="display:none;" - + 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 = "" diff --git a/views/posts.html b/views/posts.html index fa918c1..d8efcb9 100644 --- a/views/posts.html +++ b/views/posts.html @@ -11,12 +11,12 @@ -
+

Loading...

Please allow us up to 5 seconds to load in your requested content.
If this takes longer than usual, please refresh the page or contact support.
-