-
Notifications
You must be signed in to change notification settings - Fork 0
/
index-bootstrap.html
231 lines (230 loc) · 12.9 KB
/
index-bootstrap.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
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Cardfilter with Bootstrap</title>
<!-- Bootstrap -->
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.5.2/css/bootstrap.min.css" integrity="sha384-JcKb8q3iqJ61gNV9KGb8thSsNjpSL0n8PARn9HuZOnIxN0hoP+VmmDGMN5t9UJ0Z" crossorigin="anonymous">
<!-- Custom CSS -->
<style>
.container {
max-width: 1250px;
}
button.active .btn {
color: #fff!important;
background-color: #00b74a!important;
}
.filter {
margin: 0 15px 0 0;
}
a.change {
position: absolute;
top: 10px;
right: 10px;
}
</style>
<!-- jQuery -->
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
<!-- Custom JS -->
<script>
$(document).ready(function() {
$(".btn-filter").click(function() {
var value = $(this).attr('data-filter');
if(value == "all") {
$('.filter').show('1000');
} else {
$(".filter").not('.'+value).hide('3000');
$('.filter').filter('.'+value).show('3000');
}
$(".btn-filter").removeClass('active');
$(this).addClass('active');
});
});
</script>
</head>
<body>
<div class="container">
<h1>Filter Cards</h1>
<h2>With Bootstrap</h2>
<a href="./index.html" class="change">With CSS</a>
<button class="btn-filter btn btn-primary active" data-filter="all">All Cards</button>
<button class="btn-filter btn btn-danger" data-filter="red">Red Cards</button>
<button class="btn-filter btn btn-warning" data-filter="yellow">Yellow Cards</button>
<button class="btn-filter btn btn-success" data-filter="green">Green Cards</button>
<div class="container mt-5">
<div class="row row-cols-1 row-cols-sm-2 row row-cols-lg-3">
<div class="filter red card text-white bg-danger mb-3" style="max-width: 18rem;">
<div class="card-header"> </div>
<div class="card-body">
<h5 class="card-title">Red Card</h5>
<p class="card-text">Some quick example text to build on the card title and make up the bulk of the card's content.</p>
</div>
</div>
<div class="filter yellow card text-white bg-warning mb-3" style="max-width: 18rem;">
<div class="card-header"> </div>
<div class="card-body">
<h5 class="card-title">Yellow Card</h5>
<p class="card-text">Some quick example text to build on the card title and make up the bulk of the card's content.</p>
</div>
</div>
<div class="filter green card text-white bg-success mb-3" style="max-width: 18rem;">
<div class="card-header"> </div>
<div class="card-body">
<h5 class="card-title">Green Card</h5>
<p class="card-text">Some quick example text to build on the card title and make up the bulk of the card's content.</p>
</div>
</div>
<div class="filter red card text-white bg-danger mb-3" style="max-width: 18rem;">
<div class="card-header"> </div>
<div class="card-body">
<h5 class="card-title">Red Card</h5>
<p class="card-text">Some quick example text to build on the card title and make up the bulk of the card's content.</p>
</div>
</div>
<div class="filter yellow card text-white bg-warning mb-3" style="max-width: 18rem;">
<div class="card-header"> </div>
<div class="card-body">
<h5 class="card-title">Yellow Card</h5>
<p class="card-text">Some quick example text to build on the card title and make up the bulk of the card's content.</p>
</div>
</div>
<div class="filter green card text-white bg-success mb-3" style="max-width: 18rem;">
<div class="card-header"> </div>
<div class="card-body">
<h5 class="card-title">Green Card</h5>
<p class="card-text">Some quick example text to build on the card title and make up the bulk of the card's content.</p>
</div>
</div>
<div class="filter red card text-white bg-danger mb-3" style="max-width: 18rem;">
<div class="card-header"> </div>
<div class="card-body">
<h5 class="card-title">Red Card</h5>
<p class="card-text">Some quick example text to build on the card title and make up the bulk of the card's content.</p>
</div>
</div>
<div class="filter yellow card text-white bg-warning mb-3" style="max-width: 18rem;">
<div class="card-header"> </div>
<div class="card-body">
<h5 class="card-title">Yellow Card</h5>
<p class="card-text">Some quick example text to build on the card title and make up the bulk of the card's content.</p>
</div>
</div>
<div class="filter green card text-white bg-success mb-3" style="max-width: 18rem;">
<div class="card-header"> </div>
<div class="card-body">
<h5 class="card-title">Green Card</h5>
<p class="card-text">Some quick example text to build on the card title and make up the bulk of the card's content.</p>
</div>
</div>
<div class="filter red card text-white bg-danger mb-3" style="max-width: 18rem;">
<div class="card-header"> </div>
<div class="card-body">
<h5 class="card-title">Red Card</h5>
<p class="card-text">Some quick example text to build on the card title and make up the bulk of the card's content.</p>
</div>
</div>
<div class="filter yellow card text-white bg-warning mb-3" style="max-width: 18rem;">
<div class="card-header"> </div>
<div class="card-body">
<h5 class="card-title">Yellow Card</h5>
<p class="card-text">Some quick example text to build on the card title and make up the bulk of the card's content.</p>
</div>
</div>
<div class="filter green card text-white bg-success mb-3" style="max-width: 18rem;">
<div class="card-header"> </div>
<div class="card-body">
<h5 class="card-title">Green Card</h5>
<p class="card-text">Some quick example text to build on the card title and make up the bulk of the card's content.</p>
</div>
</div>
<div class="filter red card text-white bg-danger mb-3" style="max-width: 18rem;">
<div class="card-header"> </div>
<div class="card-body">
<h5 class="card-title">Red Card</h5>
<p class="card-text">Some quick example text to build on the card title and make up the bulk of the card's content.</p>
</div>
</div>
<div class="filter yellow card text-white bg-warning mb-3" style="max-width: 18rem;">
<div class="card-header"> </div>
<div class="card-body">
<h5 class="card-title">Yellow Card</h5>
<p class="card-text">Some quick example text to build on the card title and make up the bulk of the card's content.</p>
</div>
</div>
<div class="filter green card text-white bg-success mb-3" style="max-width: 18rem;">
<div class="card-header"> </div>
<div class="card-body">
<h5 class="card-title">Green Card</h5>
<p class="card-text">Some quick example text to build on the card title and make up the bulk of the card's content.</p>
</div>
</div>
<div class="filter red card text-white bg-danger mb-3" style="max-width: 18rem;">
<div class="card-header"> </div>
<div class="card-body">
<h5 class="card-title">Red Card</h5>
<p class="card-text">Some quick example text to build on the card title and make up the bulk of the card's content.</p>
</div>
</div>
<div class="filter yellow card text-white bg-warning mb-3" style="max-width: 18rem;">
<div class="card-header"> </div>
<div class="card-body">
<h5 class="card-title">Yellow Card</h5>
<p class="card-text">Some quick example text to build on the card title and make up the bulk of the card's content.</p>
</div>
</div>
<div class="filter green card text-white bg-success mb-3" style="max-width: 18rem;">
<div class="card-header"> </div>
<div class="card-body">
<h5 class="card-title">Green Card</h5>
<p class="card-text">Some quick example text to build on the card title and make up the bulk of the card's content.</p>
</div>
</div>
<div class="filter red card text-white bg-danger mb-3" style="max-width: 18rem;">
<div class="card-header"> </div>
<div class="card-body">
<h5 class="card-title">Red Card</h5>
<p class="card-text">Some quick example text to build on the card title and make up the bulk of the card's content.</p>
</div>
</div>
<div class="filter yellow card text-white bg-warning mb-3" style="max-width: 18rem;">
<div class="card-header"> </div>
<div class="card-body">
<h5 class="card-title">Yellow Card</h5>
<p class="card-text">Some quick example text to build on the card title and make up the bulk of the card's content.</p>
</div>
</div>
<div class="filter green card text-white bg-success mb-3" style="max-width: 18rem;">
<div class="card-header"> </div>
<div class="card-body">
<h5 class="card-title">Green Card</h5>
<p class="card-text">Some quick example text to build on the card title and make up the bulk of the card's content.</p>
</div>
</div>
<div class="filter red card text-white bg-danger mb-3" style="max-width: 18rem;">
<div class="card-header"> </div>
<div class="card-body">
<h5 class="card-title">Red Card</h5>
<p class="card-text">Some quick example text to build on the card title and make up the bulk of the card's content.</p>
</div>
</div>
<div class="filter yellow card text-white bg-warning mb-3" style="max-width: 18rem;">
<div class="card-header"> </div>
<div class="card-body">
<h5 class="card-title">Yellow Card</h5>
<p class="card-text">Some quick example text to build on the card title and make up the bulk of the card's content.</p>
</div>
</div>
<div class="filter green card text-white bg-success mb-3" style="max-width: 18rem;">
<div class="card-header"> </div>
<div class="card-body">
<h5 class="card-title">Green Card</h5>
<p class="card-text">Some quick example text to build on the card title and make up the bulk of the card's content.</p>
</div>
</div>
</div>
</div>
</div>
</body>
</html>