-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathnavbar.html
39 lines (36 loc) · 1.44 KB
/
navbar.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
<!DOCTYPE html>
<html lang="en-US">
<body>
<header>
<div class="navbar-logo">
<!-- Logo ajustada -->
<img src="../media/logoNoBg.png" onclick="window.location='/';" height='40' width="40" alt="home page">
</div>
<div class="navbar-options">
<ul class="navbar-nav">
<li><a class="nav-link" href="/archive">NEWS</a></li>
<li>|</li>
<li><a class="nav-link" href="/buy">PLAY</a></li>
<li>|</li>
<li><a class="nav-link" href="https://discord.gg/AwZkzHt8he">DISCORD</a></li>
</ul>
<!-- <img src="../media/gifs/Money.gif" onclick="window.location='/buy';" height='54' style="padding-left: 1%;" alt="secrets!"> -->
</div>
<div class="navbar-login">
<a class="nav-link" id="account" href="/dash/">ACCOUNT</a>
</div>
</header>
<script type="module"> //remember to use type="module" when using a module script
import { isSessionValid } from '/dash/sessionApi.js?v=0.1.2';
import { getUserData } from '/dash/userApi.js?v=0.1.0';
const element = document.getElementById("account")
if (await isSessionValid()) {
const sessionToken = sessionStorage.getItem("sessionToken");
const data = await getUserData(["username"], sessionToken);
element.innerText = data.username.toUpperCase();
} else {
element.innerText = "LOGIN";
}
</script>
</body>
</html>