forked from palabhi017/DeskTime-Clome
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathnavbar.js
50 lines (29 loc) · 1008 Bytes
/
navbar.js
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
40
41
42
43
44
45
46
47
48
49
50
window.onload=()=>{
isUserAvailable()
// do your all navbar functionalities here
document.querySelector("#logo").onclick=()=>{
window.location.href="../index.html"
}
//for login btn
document.querySelector("#login_btn").onclick=()=>{
window.location.href="../login.html"
}
//for register btn
document.querySelector("#signup_btn").onclick=()=>{
if(document.querySelector("#signup_btn").innerText=="SIGN UP"){
window.location.href="../register.html"
}else{
window.location.href="../danshboard.html"
// setUserArrivalTime()
}
}
function isUserAvailable(){
let presence = JSON.parse(localStorage.getItem("user-data"))||0
if(presence==0){
return
}else{
document.querySelector("#signup_btn").innerText= "DASHBOARD"
document.querySelector("#login_btn").style.display="none"
}
}
}