-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdraw.php
490 lines (401 loc) · 19.9 KB
/
draw.php
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
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
<!doctype html>
<html lang="zh-Hant-TW">
<head>
<title>2020中部漫聯同樂會~靈魂繪手/寫手之章~</title>
<meta property="og:title" content="2020中部漫聯同樂會~靈魂繪手/寫手之章~"/>
<?php include("includes/g-meta.php") ?>
<script src="js/photoswipe.min.js"></script>
<script src="js/photoswipe-ui-default.min.js"></script>
<link href="../css/photoswipe.css" rel="stylesheet" />
<link href="../css/default-skin.css?<?php echo date('Ymdis'); ?>" rel="stylesheet" />
<link href="../css/photoswipe.default.css?<?php echo date('Ymdis'); ?>" rel="stylesheet" />
<!--[if lt IE 9]>
<script>
alert("建議使用IE10以上版本");
</script>
<![endif]-->
<script>
$(window).load(function(){
$('.demo-gallery a').each(function(){
var $img = $(this).find('img'),
$picW = $img[0].naturalWidth,
$picH = $img[0].naturalHeight/*抓取真實的原始寬高*/
$(this).attr('data-size',$picW+'x'+$picH);
})
});
</script>
</head>
<body>
<?php include("includes/g-header.php") ?>
<div class="g-wrapper animate-quiz">
<h1>
2020中部漫聯同樂會<br>
~靈魂繪手/寫手之章~
</h1>
<div class="draw-wrap">
<div class="demo-gallery album-box">
<!-- <a href="img/draw/a01.jpg" data-size="1200x900" data-med="img/draw/a01.jpg" data-med-size="1200x900" data-author="111" class="demo-gallery__img--main" style="width:94.5%">
<img src="img/draw/a01.jpg" alt="" />
<p></p>
</a> -->
<a href="img/draw/a02.jpg" data-size="900x1200" data-med="img/draw/a02.jpg" data-med-size="900x1200" data-author="" class="demo-gallery__img--main">
<img src="img/draw/a02.jpg" alt="" />
<p>「偵探の呼吸第一型『我就殺』」(漩子)</p>
</a>
<a href="img/draw/a04.jpg" data-size="900x1200" data-med="img/draw/a04.jpg" data-med-size="900x1200" data-author="111" class="demo-gallery__img--main">
<img src="img/draw/a04.jpg" alt="" />
<p>「我就殺☺」(歐小)</p>
</a>
<a href="img/draw/a03.jpg" data-size="900x1200" data-med="img/draw/a03.jpg" data-med-size="900x1200" data-author="111" class="demo-gallery__img--main">
<img src="img/draw/a03.jpg" alt="" />
<p>「沒有目擊證人,就沒有兇殺案✧」(喬洛)</p>
</a>
<a href="img/draw/a05.jpg" data-size="900x1200" data-med="img/draw/a05.jpg" data-med-size="900x1200" data-author="111" class="demo-gallery__img--main">
<img src="img/draw/a05.jpg" alt="" />
<p>「謹此紀念被殺爆的20子」❀(阿清)</p>
</a>
<a href="img/draw/a06.jpg" data-size="900x1200" data-med="img/draw/a06.jpg" data-med-size="900x1200" data-author="111" class="demo-gallery__img--main">
<img src="img/draw/a06.jpg" alt="" />
<p>偵探20君的默默不語(海參捲)</p>
</a>
<a href="img/draw/a07.jpg" data-size="900x1200" data-med="img/draw/a07.jpg" data-med-size="900x1200" data-author="111" class="demo-gallery__img--main">
<img src="img/draw/a07.jpg" alt="" />
<p>「謝謝大家來!每個都好優秀!」來自主辦溫馨ㄉ喊話(帷辰)</p>
</a>
<a href="img/draw/a08.jpg" data-size="1200x900" data-med="img/draw/a08.jpg" data-med-size="1200x900" data-author="111" class="demo-gallery__img--main">
<img src="img/draw/a08.jpg" alt="" />
<p>「20君今天根本不是偵探,是吸血鬼吧!(來自怪盜組的哀嚎)」(NO醬)<br>
哭啊:怪盜組似乎真的受到很大的心靈創傷呢。</p>
</a>
<a href="img/draw/a09.jpg" data-size="1200x900" data-med="img/draw/a09.jpg" data-med-size="1200x900" data-author="111" class="demo-gallery__img--main">
<img src="img/draw/a09.jpg" alt="" />
<p>豐中漫研20屆社郎社娘客串!可愛!(魚ㄍ)</p>
</a>
<a href="img/draw/a10.jpg" data-size="1200x900" data-med="img/draw/a10.jpg" data-med-size="1200x900" data-author="111" class="demo-gallery__img--main">
<img src="img/draw/a10.jpg" alt="" />
<p>魚ㄍ樂園開催(鈴雪&???) <br>
哭啊:等等,什麼時候開起魚ㄍ趴了!然後左邊那隻魚ㄍ到底要不要轉正!(內心糾結)
</p>
</a>
<a href="img/draw/a11.jpg" data-size="1200x900" data-med="img/draw/a11.jpg" data-med-size="1200x900" data-author="111" class="demo-gallery__img--main">
<img src="img/draw/a11.jpg" alt="" />
<p>好中漫研20屆社寵啾啾特輯(可愛!)</p>
</a>
<a href="img/draw/a12.jpg" data-size="1200x900" data-med="img/draw/a12.jpg" data-med-size="1200x900" data-author="111" class="demo-gallery__img--main">
<img src="img/draw/a12.jpg" alt="" />
<p>好中漫研21屆社寵毛毛特輯(可愛!)<br>
哭啊:看來是很有防疫觀念的毛毛呢,智商好像比啾啾高。
</p>
</a>
<a href="img/draw/a13.jpg" data-size="1200x900" data-med="img/draw/a13.jpg" data-med-size="1200x900" data-author="111" class="demo-gallery__img--main">
<img src="img/draw/a13.jpg" alt="" />
<p>來自文華漫研的糾咪!<br>
哭啊:言和20君拜託快結婚!</p>
</a>
<a href="img/draw/a14.jpg" data-size="1200x900" data-med="img/draw/a14.jpg" data-med-size="1200x900" data-author="111" class="demo-gallery__img--main">
<img src="img/draw/a14.jpg" alt="" />
<p>咖哩飯(???)好ㄘ!</p>
</a>
<a href="img/draw/a15.jpg" data-size="1200x900" data-med="img/draw/a15.jpg" data-med-size="1200x900" data-author="111" class="demo-gallery__img--main">
<img src="img/draw/a15.jpg" alt="" />
<p>帷辰的 我只有撕破到這邊 聲明<br>
(帷辰:你怎麼知道是我!!)</p>
</a>
<!-- <a href="img/draw/a16.jpg" data-size="1200x900" data-med="img/draw/a16.jpg" data-med-size="1200x900" data-author="111" class="demo-gallery__img--main">
<img src="img/draw/a16.jpg" alt="" />
<p></p>
</a> -->
<a href="img/draw/stickers.jpg" data-size="1200x900" data-med="img/draw/stickers.jpg" data-med-size="1200x900" data-author="111" class="demo-gallery__img--main">
<img src="img/draw/stickers.jpg" alt="" />
<p>帷辰畫的小圖公開!<br>
作為活動手冊點綴插圖和獎品貼紙大活躍!</p>
</a>
<a href="img/draw/p01.jpg" data-size="1200x900" data-med="img/draw/p01.jpg" data-med-size="1200x900" data-author="111" class="demo-gallery__img--main">
<img src="img/draw/p01.jpg" alt="" />
<p>大嘴鳥怎麼畫聽歌就知道</p>
</a>
<a href="img/draw/p02.jpg" data-size="1200x900" data-med="img/draw/p02.jpg" data-med-size="1200x900" data-author="111" class="demo-gallery__img--main">
<img src="img/draw/p02.jpg" alt="" />
<p>看來是題目太簡單大家還有時間畫呢</p>
</a>
<a href="img/draw/p03.jpg" data-size="1200x900" data-med="img/draw/p03.jpg" data-med-size="1200x900" data-author="111" class="demo-gallery__img--main">
<img src="img/draw/p03.jpg" alt="" />
<p>到底是多好畫啊大嘴鳥</p>
</a>
<a href="img/draw/p05.jpg" data-size="1200x900" data-med="img/draw/p05.jpg" data-med-size="1200x900" data-author="111" class="demo-gallery__img--main">
<img src="img/draw/p05.jpg" alt="" />
<p>硬要畫個大傑意圖太過明顯,這是沒有加分ㄉ</p>
</a>
<a href="img/draw/p04.jpg" data-size="1200x900" data-med="img/draw/p04.jpg" data-med-size="1200x900" data-author="111" class="demo-gallery__img--main">
<img src="img/draw/p04.jpg" alt="" />
<p>黎曄:雖然怪盜基德的完成度很高,但偵真的有這麼難寫嗎?</p>
</a>
</div>
<!-- photo swipe -->
<div class="cata_photo">
<div id="gallery" class="pswp" tabindex="-1" role="dialog" aria-hidden="true">
<div class="pswp__bg"></div>
<div class="pswp__scroll-wrap">
<div class="pswp__container">
<div class="pswp__item"></div>
<div class="pswp__item"></div>
<div class="pswp__item"></div>
</div>
<div class="pswp__ui pswp__ui--hidden">
<div class="pswp__top-bar">
<div class="pswp__counter"></div>
<button class="pswp__button pswp__button--close" title="Close (Esc)"></button>
<button class="pswp__button pswp__button--zoom" title="Zoom in/out"></button>
<div class="pswp__preloader">
<div class="pswp__preloader__icn">
<div class="pswp__preloader__cut">
<div class="pswp__preloader__donut"></div>
</div>
</div>
</div>
</div>
<button class="pswp__button pswp__button--arrow--left" title="Previous (arrow left)"></button>
<button class="pswp__button pswp__button--arrow--right" title="Next (arrow right)"></button>
<div class="pswp__caption">
<div class="pswp__caption__center"></div>
</div>
</div>
</div>
</div>
<script type="text/javascript">
(function() {
var initPhotoSwipeFromDOM = function(gallerySelector) {
var parseThumbnailElements = function(el) {
var thumbElements = el.childNodes,
numNodes = thumbElements.length,
items = [],
el,
childElements,
thumbnailEl,
size,
item;
for(var i = 0; i < numNodes; i++) {
el = thumbElements[i];
// include only element nodes
if(el.nodeType !== 1) {
continue;
}
childElements = el.children;
size = el.getAttribute('data-size').split('x');
// create slide object
item = {
src: el.getAttribute('href'),
w: parseInt(size[0], 10),
h: parseInt(size[1], 10),
author: el.getAttribute('data-author')
};
item.el = el; // save link to element for getThumbBoundsFn
if(childElements.length > 0) {
item.msrc = childElements[0].getAttribute('src'); // thumbnail url
if(childElements.length > 1) {
item.title = childElements[1].innerHTML; // caption (contents of figure)
}
}
var mediumSrc = el.getAttribute('data-med');
if(mediumSrc) {
size = el.getAttribute('data-med-size').split('x');
// "medium-sized" image
item.m = {
src: mediumSrc,
w: parseInt(size[0], 10),
h: parseInt(size[1], 10)
};
}
// original image
item.o = {
src: item.src,
w: item.w,
h: item.h
};
items.push(item);
}
return items;
};
// find nearest parent element
var closest = function closest(el, fn) {
return el && ( fn(el) ? el : closest(el.parentNode, fn) );
};
var onThumbnailsClick = function(e) {
e = e || window.event;
e.preventDefault ? e.preventDefault() : e.returnValue = false;
var eTarget = e.target || e.srcElement;
var clickedListItem = closest(eTarget, function(el) {
return el.tagName === 'A';
});
if(!clickedListItem) {
return;
}
var clickedGallery = clickedListItem.parentNode;
var childNodes = clickedListItem.parentNode.childNodes,
numChildNodes = childNodes.length,
nodeIndex = 0,
index;
for (var i = 0; i < numChildNodes; i++) {
if(childNodes[i].nodeType !== 1) {
continue;
}
if(childNodes[i] === clickedListItem) {
index = nodeIndex;
break;
}
nodeIndex++;
}
if(index >= 0) {
openPhotoSwipe( index, clickedGallery );
}
return false;
};
var photoswipeParseHash = function() {
var hash = window.location.hash.substring(1),
params = {};
if(hash.length < 5) { // pid=1
return params;
}
var vars = hash.split('&');
for (var i = 0; i < vars.length; i++) {
if(!vars[i]) {
continue;
}
var pair = vars[i].split('=');
if(pair.length < 2) {
continue;
}
params[pair[0]] = pair[1];
}
if(params.gid) {
params.gid = parseInt(params.gid, 10);
}
return params;
};
var openPhotoSwipe = function(index, galleryElement, disableAnimation, fromURL) {
var pswpElement = document.querySelectorAll('.pswp')[0],
gallery,
options,
items;
items = parseThumbnailElements(galleryElement);
// define options (if needed)
options = {
galleryUID: galleryElement.getAttribute('data-pswp-uid'),
getThumbBoundsFn: function(index) {
// See Options->getThumbBoundsFn section of docs for more info
var thumbnail = items[index].el.children[0],
pageYScroll = window.pageYOffset || document.documentElement.scrollTop,
rect = thumbnail.getBoundingClientRect();
return {x:rect.left, y:rect.top + pageYScroll, w:rect.width};
},
addCaptionHTMLFn: function(item, captionEl, isFake) {
if(!item.title) {
captionEl.children[0].innerText = '';
return false;
}
captionEl.children[0].innerHTML = item.title + '<br/><small>Photo: ' + item.author + '</small>';
return true;
}
};
if(fromURL) {
if(options.galleryPIDs) {
// parse real index when custom PIDs are used
// http://photoswipe.com/documentation/faq.html#custom-pid-in-url
for(var j = 0; j < items.length; j++) {
if(items[j].pid == index) {
options.index = j;
break;
}
}
} else {
options.index = parseInt(index, 10) - 1;
}
} else {
options.index = parseInt(index, 10);
}
// exit if index not found
if( isNaN(options.index) ) {
return;
}
var radios = document.getElementsByName('gallery-style');
for (var i = 0, length = radios.length; i < length; i++) {
if (radios[i].checked) {
if(radios[i].id == 'radio-all-controls') {
} else if(radios[i].id == 'radio-minimal-black') {
options.mainClass = 'pswp--minimal--dark';
options.barsSize = {top:0,bottom:0};
options.captionEl = false;
options.fullscreenEl = false;
options.shareEl = false;
options.bgOpacity = 0.85;
options.tapToClose = true;
options.tapToToggleControls = false;
}
break;
}
}
if(disableAnimation) {
options.showAnimationDuration = 0;
}
// Pass data to PhotoSwipe and initialize it
gallery = new PhotoSwipe( pswpElement, PhotoSwipeUI_Default, items, options);
// see: http://photoswipe.com/documentation/responsive-images.html
var realViewportWidth,
useLargeImages = false,
firstResize = true,
imageSrcWillChange;
gallery.listen('beforeResize', function() {
var dpiRatio = window.devicePixelRatio ? window.devicePixelRatio : 1;
dpiRatio = Math.min(dpiRatio, 2.5);
realViewportWidth = gallery.viewportSize.x * dpiRatio;
if(realViewportWidth >= 1200 || (!gallery.likelyTouchDevice && realViewportWidth > 800) || screen.width > 1200 ) {
if(!useLargeImages) {
useLargeImages = true;
imageSrcWillChange = true;
}
} else {
if(useLargeImages) {
useLargeImages = false;
imageSrcWillChange = true;
}
}
if(imageSrcWillChange && !firstResize) {
gallery.invalidateCurrItems();
}
if(firstResize) {
firstResize = false;
}
imageSrcWillChange = false;
});
gallery.listen('gettingData', function(index, item) {
if( useLargeImages ) {
item.src = item.o.src;
item.w = item.o.w;
item.h = item.o.h;
} else {
item.src = item.m.src;
item.w = item.m.w;
item.h = item.m.h;
}
});
gallery.init();
};
// select all gallery elements
var galleryElements = document.querySelectorAll( gallerySelector );
for(var i = 0, l = galleryElements.length; i < l; i++) {
galleryElements[i].setAttribute('data-pswp-uid', i+1);
galleryElements[i].onclick = onThumbnailsClick;
}
// Parse URL and open gallery if it contains #&pid=3&gid=1
var hashData = photoswipeParseHash();
if(hashData.pid && hashData.gid) {
openPhotoSwipe( hashData.pid, galleryElements[ hashData.gid - 1 ], true, true );
}
};
initPhotoSwipeFromDOM('.demo-gallery');
})();
</script>
</div>
<?php include("includes/g-footer.php") ?>
</body>
</html>