-
Notifications
You must be signed in to change notification settings - Fork 80
/
Copy pathSimple_Popup_Box.html
130 lines (112 loc) · 2.61 KB
/
Simple_Popup_Box.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
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
<!DOCTYPE html>
<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>Simple Popup Box</title>
</head>
<body>
<div class="container">
<div class="content">
<h2>Heading...</h2>
<p>Lorem ipsum dolor sit amet consectetur adipisicing elit. Sapiente eaque aut eius, fugit et aliquid. Optio
quos dolore, aliquid adipisci ducimus, eos quidem nulla temporibus blanditiis sequi unde provident
pariatur?</p>
</div>
<div class="toggleBtn"></div>
</div>
<script src="script.js"></script>
<script>
let toggleBtn = document.querySelector('.toggleBtn');
let container = document.querySelector('.container');
toggleBtn.onclick = function () {
container.classList.toggle('active');
}
</script>
<style>
@import url('https://fonts.googleapis.com/css?family=Poppins:200,300,400,500,600,700,800,900&display=swap');
* {
margin: 0;
padding: 0;
box-sizing: border-box;
font-family: 'Poppins', sans-serif;
}
body {
display: flex;
justify-content: center;
align-items: center;
min-height: 100vh;
background: #1a242a;
}
.container {
position: relative;
width: 0px;
height: 0px;
background: #37444b;
border-radius: 25px;
transition: 0.5s;
display: flex;
justify-content: center;
align-items: center;
}
.container.active {
width: 400px;
height: 400px;
transition-delay: 0.5s;
}
.container::before {
content: '';
position: absolute;
bottom: -15px;
width: 40px;
height: 40px;
background: #37444b;
border-radius: 5px;
opacity: 0;
transition: 0.5s;
transform: rotate(45deg);
}
.container.active::before {
opacity: 1;
transition-delay: 0.5s;
}
.container .content {
min-width: 400px;
padding: 40px;
color: #fff;
opacity: 0;
transition: 0.5s;
transform: scale(0);
}
.container.active .content {
opacity: 1;
transition-delay: 0.5s;
transform: scale(1);
}
.toggleBtn {
position: absolute;
bottom: -20px;
min-width: 60px;
height: 60px;
background: #0bcf9c;
border-radius: 50%;
cursor: pointer;
display: flex;
justify-content: center;
align-items: center;
transition: 0.5s;
}
.toggleBtn::before {
content: '+';
font-size: 2.5em;
color: #fff;
}
.container.active .toggleBtn {
bottom: -90px;
transform: rotate(135deg);
background: #ff5a57;
}
</style>
</body>
</html>