-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathhome.js
67 lines (51 loc) · 1.37 KB
/
home.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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
import home from "./homeport.js"
document.getElementById("container").innerHTML=home()
document.getElementById("dill").addEventListener("click",myFunction)
let cart=JSON.parse(localStorage.getItem("basket"))
let h4=document.createElement("h4")
h4.innerText=`Cart Items ${cart.length}`
h4.style.cursor="pointer"
let base=document.getElementById("ket")
base.append(h4)
let consume=JSON.parse(localStorage.getItem("Data"))
console.log(consume.name)
let naaav=document.getElementById("update")
naaav.innerText=consume.name
naaav.style.fontWeight="bold"
let count=0
function myFunction(){
count++
console.log("triggers")
if(count===1){
document.getElementById("down").style.display="flex"
}
else if(count===2){
document.getElementById("down").style.display="none"
count=0
}
}
let tab=0
naaav.addEventListener("click",off)
function off(){
tab++
let process=document.getElementById("upper")
if(tab===1){
process.innerHTML=null
let div=document.createElement("div")
div.setAttribute("class","make")
let p=document.createElement("p")
p.innerText="Log Out"
p.style.cursor="pointer"
p.addEventListener("click",logOff)
div.append(p)
process.append(div)
}
else if(tab===2){
process.innerHTML=null
tab=0
}
}
function logOff(){
console.log("trigete")
window.location.href="navbar.html"
}