-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathdummy1.html
84 lines (79 loc) · 2.04 KB
/
dummy1.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
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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
<style>
.cartpopup1 {
position: absolute;
transform: translate(-25%, -25%);
top: -50%;
left: -20%;
opacity: 0;
transform: translate(-50%, -50%) scale(1.25);
width: 20%;
height: auto;
padding: 20px 30px;
background-color: white;
box-shadow: 2px 2px 5px 5px rgba(0, 0, 0, 0.15);
border-radius: 10px;
text-align: center;
transition: top 0ms ease-in-out 200ms,
opacity 200ms ease-in-out 0ms,
transform 200ms ease-in-out 0ms;
}
.cartpopup1.active {
top: 20%;
opacity: 1;
transform: translate(250%, -25%) scale(1);
transition: top 0ms ease-in-out 200ms,
opacity 200ms ease-in-out 0ms,
transform 200ms ease-in-out 0ms;
}
.close_button1 {
position: absolute;
top: 20px;
right: 20px;
width: 20px;
height: 20px;
background: grey;
color: white;
text-align: center;
line-height: 15px;
cursor: pointer;
border-radius: 50%;
}
#button>a>button {
border-radius: 200px;
background-color: white;
padding: 11px 40px;
font-weight: bold;
cursor: pointer;
}
</style>
</head>
<body>
<div id="mycart">HI</div>
<div class="cartpopup1">
<h1>MY BAG</h1>
<div class="close_button1">×</div>
<hr>
<div>
<p>You don't have any items in your cart</p>
</div>
<div id="button">
<a href="index.html"><button>CONTINUE SHOPPING</button></a>
</div>
</div>
</body>
</html>
<script>
let mycart=document.querySelector("#mycart");
mycart.addEventListener("click", function(){
document.querySelector(".cartpopup1").classList.add("active");
})
document.querySelector(".close_button1").addEventListener("click", function () {
document.querySelector(".cartpopup1").classList.remove("active");
});
</script>