puzzle/views/header.ejs
2023-06-27 20:29:42 +05:00

40 lines
1.1 KiB
Plaintext

<style>
header{
display: flex;
/* width: 90%; */
justify-content: space-between;
width: 90%;
text-align: center;
margin: auto;
}
#top_panel_right{
float: right;
}
#top_panel_left{
float: left;
}
/* button{
/* margin-inline: 5px; */
/* } */
</style>
<header id="top_panel">
<script>get_from_uuid((res)=>{
let uname = document.getElementById("user_name");
let header = document.getElementById("top_panel");
let right = document.getElementById("top_panel_right");
let left = document.getElementById("top_panel_left");
left.innerHTML += res["login"];
if (res["admin"] == true){
right.innerHTML += "<button>admin panel</button>";
}
right.innerHTML += "<button onclick='logout();'>logout</button>";
});
</script>
<!-- <div id="user_name"></div> -->
<div id="top_panel_left"></div>
<div>puzzle</div>
<div id="top_panel_right"></div>
<!-- <div><button onclick="logout();">logout</button></div> -->
</header>