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
|
<!DOCTYPE html>
<html lang="en-HK" prefix="og: http://ogp.me/ns#">
<head> <title>歷屆花絮</title> <!-- css -->
<?php include 'inc/headlinks.php';?> <link rel="stylesheet" href="/eba/assets/css/gallary.css"> <!-- js -->
<?php include 'inc/link-js.php';?>
</head>
<body>
<!-- header -->
<?php include 'inc/navbar.php';?>
<!-- end of header-->
<!-- breadcrumb -->
<div class="breadcrumb" style="background-color:#b68455; background-image:url(/eba/assets/images/countbg.png);">
<div class="breadcrumbWrapper"> <div class="container"> <div class="breadcrumbLink"> <a href="index.php" class="text-white bigfont"> 首頁</a> </div> <p class="breadcrumbTitle text-center m-3 h3">歷屆花絮</p>
</div> </div>
</div>
<section class="contentWrap"> <div class="contentContainer">
<ul class="nav tabNav">
<li class="nav-item"> <a class="nav-link tabNavItem active " href="#" data-year="2022">2022</a> </li> <li class="nav-item"> <a class="nav-link tabNavItem" href="#" data-year="2021">2021</a> </li> </ul> <div class="d-flex flex-wrap justify-content-between mb-4 align-items-center"> <h1 class="text-pramiry mb-4 awardTitle">2022飛越品牌企業大獎</h1>
<div class="btn-group btn-group-lg mb-4" role="group" aria-label="Basic radio toggle button group"> <input type="radio" class="btn-check" name="btnradio" id="btnradio1" value="photo" checked> <label class="btn btn-outline-primary" for="btnradio1">照片</label>
<input type="radio" class="btn-check" name="btnradio" id="btnradio2" value="video"> <label class="btn btn-outline-primary" for="btnradio2">短片</label>
</div> </div>
<div class="tabcontent tz-gallery"> <div class="row row-cols-1 row-cols-md-2 row-cols-lg-3 g-4 gallery-grid gallaryWrap">
</div>
</div>
</div>
</section>
<!-- end #section -->
<!-- footer -->
<?php include 'inc/footer.php'; ?>
<script type="text/javascript" src="/eba/assets/js/gallery.js"></script>
<script> $(function() {
getYear("2022");
}); $('input[name="btnradio"]').on('change', function() { var selectedType = $(this).val();
console.log(selectedType); var galleryItems = $(".gallaryWrap .gallery-item");
galleryItems.each(function() { var itemType = $(this).hasClass("photo") ? "photo" : "video";
if (itemType === selectedType) { $(this).removeClass("hide"); } else { $(this).addClass("hide"); } }); }); document.querySelectorAll('.lightbox').forEach(el => el.addEventListener('click', Lightbox.initialize));
$('.tabNavItem').on('click', function() { var y = $(this).data('year'); $('.tabNavItem').removeClass('active'); $(this).addClass('active');
$(".gallaryGroup").fadeOut(300, function() { $(this).remove();
}); $('input[name="btnradio"]').prop('checked', false); $('input[name="btnradio"][value="photo"]').prop('checked', true); getYear(y);
});
function getYear(year) {
$.ajax({ url: "/eba/assets/json/event.json", type: "get",
data: {}, contentType: "application/json; charset=utf-8", dataType: "json", cache: false,
success: function(data) {
var list = data[year];
$('.awardTitle').text(`${list[0].title}`);
console.log(list); $.each(list[0].gallary, function(index, item) { var awardHTML = ` <div class="gallaryGroup"> <a class="lightbox gallery-item photo" href="${item.photo}"> <img src="${item.photo}" alt="" class="img-fluid"> </a>
${item.video?` <a class="lightbox gallery-item video hide" target="_blank" href="${item.videourl}"> <img src="${item.video}" alt="" class="img-fluid"> </a>`:"" } </div> `; $(".gallaryWrap").append(awardHTML); }); baguetteBox.run('.tz-gallery');
}, error: function(xhr, status, errorThrown) { console.log(errorThrown + "\n" + status + "\n" + xhr.statusTex); }, });
} </script>
</body>
</html>
|