-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
161 lines (131 loc) · 7.54 KB
/
index.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
<!doctype html>
<html lang="en">
<head>
<!-- Required meta tags -->
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<!-- Bootstrap CSS -->
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css" integrity="sha384-ggOyR0iXCbMQv3Xipma34MD+dH/1fQ784/j6cY/iJTQUOhcWr7x9JvoRxT2MZw1T" crossorigin="anonymous">
<title>Sandbox</title>
</head>
<body>
<h1>This is a sandbox</h1>
<div>
<div class="btn-group" role="group" aria-label="day filter" data-filter-type="exclusive">
<button class="btn btn-outline-primary filter-btn" data-filter="day" data-value="1">day 1</button>
<button class="btn btn-outline-primary filter-btn" data-filter="day" data-value="2">day 2</button>
<button class="btn btn-outline-primary filter-btn" data-filter="day" data-value="3">day 3</button>
<button class="btn btn-outline-primary filter-btn" data-reset='all'>reset all</button>
</div>
<div class="btn-group" role="group" aria-label="topic filter">
<button class="btn btn-outline-primary filter-btn" data-filter="topic" data-value="1">topic 1</button>
<button class="btn btn-outline-primary filter-btn" data-filter="topic" data-value="2">topic 2</button>
<button class="btn btn-outline-primary filter-btn" data-filter="topic" data-value="3">topic 3</button>
<button class="btn btn-outline-primary filter-btn active" data-filter="topic" data-reset="filter">reset</button>
</div>
<div class="btn-group" role="group" aria-label="category">
<button class="btn btn-outline-primary filter-btn" data-filter="category" data-value="1">category 1</button>
<button class="btn btn-outline-primary filter-btn" data-filter="category" data-value="2">category 2</button>
<button class="btn btn-outline-primary filter-btn" data-filter="category" data-value="3">category 3</button>
<button class="btn btn-outline-primary filter-btn active" data-filter="category" data-reset="filter">reset</button>
</div>
<button class="btn btn-outline-primary filter-btn" data-reset="all">reset all</button>
<button class="btn btn-outline-primary filter-btn active" data-filter="day" data-reset="filter">reset day</button>
<div class="row">
<div class="col filter-item" data-day="1" data-topic="1" data-category="2">
day 1 topic 1 category 2 item 1
</div>
<div class="col filter-item" data-day="1" data-topic="1" data-category="1">
day 1 topic 1 category 1 item 2
</div>
<div class="col filter-item" data-day="1" data-topic="2" data-category="3">
day 1 topic 2 category 3 item 3
</div>
<div class="col filter-item" data-day="2" data-topic="2" data-category="1">
day 2 topic 2 item 4
</div>
<div class="col filter-item" data-day="2" data-topic="1" data-category="2">
day 2 topic 1 item 5
</div>
<div class="col filter-item" data-day="2" data-topic="3" data-category="3">
day 2 topic 3 item 6
</div>
<div class="col filter-item" data-day="1" data-topic="3" data-category="2">
day 1 topic 3 item 7
</div>
<div class="col filter-item" data-day="3" data-topic="2" data-category="3">
day 3 topic 2 item 8
</div>
<div class="col filter-item" data-day="3" data-topic="1" data-category="1">
day 3 topic 1 item 9
</div>
</div>
</div>
<div>
<div class="btn-group" role="group" aria-label="day filter" data-filter-type="exclusive">
<button class="btn btn-outline-primary sec-filter-btn" data-filter="day" data-value="1">day 1</button>
<button class="btn btn-outline-primary sec-filter-btn" data-filter="day" data-value="2">day 2</button>
<button class="btn btn-outline-primary sec-filter-btn" data-filter="day" data-value="3">day 3</button>
<button class="btn btn-outline-primary sec-filter-btn" data-reset='all'>reset all</button>
</div>
<div class="btn-group" role="group" aria-label="topic filter">
<button class="btn btn-outline-primary sec-filter-btn" data-filter="topic" data-value="1">topic 1</button>
<button class="btn btn-outline-primary sec-filter-btn" data-filter="topic" data-value="2">topic 2</button>
<button class="btn btn-outline-primary sec-filter-btn" data-filter="topic" data-value="3">topic 3</button>
<button class="btn btn-outline-primary sec-filter-btn active" data-filter="topic" data-reset="filter">reset</button>
</div>
<div class="btn-group" role="group" aria-label="category">
<button class="btn btn-outline-primary sec-filter-btn" data-filter="category" data-value="1">category 1</button>
<button class="btn btn-outline-primary sec-filter-btn" data-filter="category" data-value="2">category 2</button>
<button class="btn btn-outline-primary sec-filter-btn" data-filter="category" data-value="3">category 3</button>
<button class="btn btn-outline-primary sec-filter-btn active" data-filter="category" data-reset="filter">reset</button>
</div>
<button class="btn btn-outline-primary sec-filter-btn" data-reset="all">reset all</button>
<button class="btn btn-outline-primary sec-filter-btn active" data-filter="day" data-reset="filter">reset day</button>
<div class="row">
<div class="col sec-filter-item" data-day="1" data-topic="1" data-category="2">
day 1 topic 1 category 2 item 1
</div>
<div class="col sec-filter-item" data-day="1" data-topic="1" data-category="1">
day 1 topic 1 category 1 item 2
</div>
<div class="col sec-filter-item" data-day="1" data-topic="2" data-category="3">
day 1 topic 2 category 3 item 3
</div>
<div class="col sec-filter-item" data-day="2" data-topic="2" data-category="1">
day 2 topic 2 item 4
</div>
<div class="col sec-filter-item" data-day="2" data-topic="1" data-category="2">
day 2 topic 1 item 5
</div>
<div class="col sec-filter-item" data-day="2" data-topic="3" data-category="3">
day 2 topic 3 item 6
</div>
<div class="col sec-filter-item" data-day="1" data-topic="3" data-category="2">
day 1 topic 3 item 7
</div>
<div class="col sec-filter-item" data-day="3" data-topic="2" data-category="3">
day 3 topic 2 item 8
</div>
<div class="col sec-filter-item" data-day="3" data-topic="1" data-category="1">
day 3 topic 1 item 9
</div>
</div>
</div>
<!-- Optional JavaScript -->
<!-- jQuery first, then Popper.js, then Bootstrap JS -->
<!-- <script src="https://cdn.jsdelivr.net/gh/RasyadiAbdoellah/filterPackage/index.js"></script> -->
<script src='index.js'></script>
<script>
const itemFilter = new Filter({ day: {}, topic: {}, category: {} })
itemFilter.init()
const secFilter = new Filter({ day: {}, topic: {}, category: {} })
secFilter.setItemClass('sec-filter-item')
secFilter.setSelector('sec-filter-btn')
secFilter.init()
</script>
<script src="https://code.jquery.com/jquery-3.3.1.slim.min.js" integrity="sha384-q8i/X+965DzO0rT7abK41JStQIAqVgRVzpbzo5smXKp4YfRvH+8abtTE1Pi6jizo" crossorigin="anonymous"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.7/umd/popper.min.js" integrity="sha384-UO2eT0CpHqdSJQ6hJty5KVphtPhzWj9WO1clHTMGa3JDZwrnQq4sF86dIHNDz0W1" crossorigin="anonymous"></script>
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.min.js" integrity="sha384-JjSmVgyd0p3pXB1rRibZUAYoIIy6OrQ6VrjIEaFf/nJGzIxFDsf4x0xIM+B07jRM" crossorigin="anonymous"></script>
</body>
</html>