-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathfilter option.html
116 lines (107 loc) · 2.63 KB
/
filter option.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
<!DOCTYPE html>
<html lang="en">
<head>
<title>Filter option</title>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
<style>
*{
margin:0;
padding:0;
box-sizing:border-box;
}
body{
min-height:100vh;
position:relative;
background-color:#2F474D;
}
.container{
position:absolute;
top:50%;
left:50%;
transform:translate(-50%, -50%);
width:300px;
height:50px;
display:flex;
align-items:center;
justify-content:space-around;
}
h2{
font-family:sans-serif;
font-size:33px;
text-transform:uppercase;
color:#FFFFFF;
position:absolute;
top:30%;
left:50%;
transform:translate(-50%, -50%);
transition:0.5s;
width:300px;
height:50px;
text-align:center;
}
h2:hover{
transform:translate(-50%, -50%) scale(1.5);
text-align:center;
text-decoration:underline;
}
.option{
width:90px;
height:30px;
display:flex;
align-items:center;
justify-content:center;
border-radius:10px;
padding:5px;
transition:0.5s;
background:#7BA897;
}
.option:hover{
margin-top:-10px;
background:#0002FF;
box-shadow:0 10px 15px #333333;
}
.option.active i{
display:block;
}
.option i{
display:none;
font-size:17px;
color:#FFFFFF;
}
.option h4{
color:#FFFFFF;
margin-left:5px;
font-family:sans-serif;
font-size:17px;
text-transform:uppercase;
}
</style>
</head>
<body>
<h2>Filter options</h2>
<div class="container">
<div class="option">
<i class="fa fa-check-circle"></i>
<h4>HTML</h4>
</div>
<div class="option">
<i class="fa fa-check-circle"></i>
<h4>CSS</h4>
</div>
<div class="option">
<i class="fa fa-check-circle"></i>
<h4>js</h4>
</div>
</div>
<script>
let opt = document.querySelectorAll(".option");
//opt.style.backgroundColor = "red";
for(var i = 0; i < 3; i++){
//opt[i].style.backgroundColor = "red";
opt[i].addEventListener("click", function(){
this.classList.toggle("active");
});
}
</script>
</body>
</html>