made the index webpage into two parts
added register/login links when not logged in when logged in, chat and profile links are shown
This commit is contained in:
parent
eee57759f9
commit
69790c32d5
8
js/index.js
Normal file
8
js/index.js
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
window.addEventListener("load",async function(){
|
||||||
|
let data = await(await fetch("/api/getuser")).json()
|
||||||
|
if(data["username"] != undefined) {
|
||||||
|
document.getElementById("HasAccount").style=""
|
||||||
|
} else {
|
||||||
|
document.getElementById("NoAccount").style=""
|
||||||
|
}
|
||||||
|
})
|
@ -1,27 +1,39 @@
|
|||||||
<head>
|
<head>
|
||||||
<style media="screen">
|
|
||||||
a {
|
|
||||||
color: red;
|
|
||||||
text-decoration: none;
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
<link rel="stylesheet" href="/css/logon.css">
|
<link rel="stylesheet" href="/css/logon.css">
|
||||||
|
<script src="/js/index.js" charset="utf-8"></script>
|
||||||
</head>
|
</head>
|
||||||
|
|
||||||
<body>
|
<body>
|
||||||
<header>
|
<header>
|
||||||
<h1>Auth website</h1>
|
<h1>IPost</h1>
|
||||||
</header>
|
</header>
|
||||||
<main>
|
<main>
|
||||||
<form id="login_form" class="form_class" action="login" method="post">
|
<form id="login_form" class="form_class" action="login" method="post">
|
||||||
<div class="info_div">
|
<div class="info_div">
|
||||||
<span>Do you not have an account? <a href="register">Register now!</a></span>
|
|
||||||
|
IPost is a revolutionary chatting website <br>
|
||||||
|
featuring an innovative design <br>
|
||||||
<br>
|
<br>
|
||||||
<br>
|
<br>
|
||||||
<span>Do you already have an account? <a href="login">Login now!</a></span>
|
|
||||||
<br>
|
<div id="NoAccount" style="display:none;">
|
||||||
<br>
|
<span>Do you not have an account? <a href="register">Register now!</a></span>
|
||||||
<span>This is open source, find more about this project <a href="https://github.com/Mystikfluu/authwebsite">on github</a></span>
|
<br>
|
||||||
|
<br>
|
||||||
|
<span>Do you already have an account? <a href="login">Login now!</a></span>
|
||||||
|
<br>
|
||||||
|
<br>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div id="HasAccount" style="display:none;">
|
||||||
|
<span>Here to chat? <a href="posts">Chat now!</a></span>
|
||||||
|
<br>
|
||||||
|
<br>
|
||||||
|
<span>Just want a quick look at your profile? <a href="user">your profile</a></span>
|
||||||
|
<br>
|
||||||
|
<br>
|
||||||
|
</div>
|
||||||
|
<span>This is open source, find more about this project <a href="https://github.com/002Hub/IPost">on github</a></span>
|
||||||
<br>
|
<br>
|
||||||
<br>
|
<br>
|
||||||
</div>
|
</div>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user