質問編集履歴
3
コード修正
test
CHANGED
File without changes
|
test
CHANGED
@@ -82,15 +82,15 @@
|
|
82
82
|
|
83
83
|
<ul>
|
84
84
|
|
85
|
-
<li><a href="https://
|
85
|
+
<li><a href="https://" class="insta_btn" target="_blank"><span class="insta"><i
|
86
86
|
|
87
87
|
class="fab fa-instagram"></i></span>instagram</a></li>
|
88
88
|
|
89
|
-
<li><a href="https://
|
89
|
+
<li><a href="https://" class="twitter_btn" target="_blank"><span class="twitter"><i
|
90
90
|
|
91
91
|
class="fab fa-twitter"></i></span>twitter</a></li>
|
92
92
|
|
93
|
-
<li><i class="fa fa-envelope fa-1x"><span class="e-mail"><a href="mailto:
|
93
|
+
<li><i class="fa fa-envelope fa-1x"><span class="e-mail"><a href="mailto:"
|
94
94
|
|
95
95
|
class="mail_btn" title="Send me an email">e-mail</a></span></i></li>
|
96
96
|
|
2
コードの修正
test
CHANGED
File without changes
|
test
CHANGED
@@ -18,7 +18,7 @@
|
|
18
18
|
|
19
19
|
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
|
20
20
|
|
21
|
-
<title>
|
21
|
+
<title></title>
|
22
22
|
|
23
23
|
<link rel="stylesheet" href="css/style.css">
|
24
24
|
|
@@ -72,7 +72,7 @@
|
|
72
72
|
|
73
73
|
<img class="topicon" src="img/topicon.jpg" alt="topicon">
|
74
74
|
|
75
|
-
<h1 class="logo">
|
75
|
+
<h1 class="logo"></h1>
|
76
76
|
|
77
77
|
</div>
|
78
78
|
|
1
HTML.CSS.jQueryのコードを追加しました。
test
CHANGED
File without changes
|
test
CHANGED
@@ -1,6 +1,558 @@
|
|
1
|
+
```html
|
2
|
+
|
3
|
+
|
4
|
+
|
5
|
+
<!DOCTYPE html>
|
6
|
+
|
7
|
+
<html lang="ja">
|
8
|
+
|
9
|
+
|
10
|
+
|
11
|
+
<head>
|
12
|
+
|
13
|
+
<meta charset="UTF-8">
|
14
|
+
|
15
|
+
<meta name="viewport"
|
16
|
+
|
17
|
+
content="width=device-width, initial-scale=1.0, user-scalable=no, minimum-scale=1.0, maximum-scale=1.0">
|
18
|
+
|
19
|
+
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
|
20
|
+
|
21
|
+
<title>古塔つみ</title>
|
22
|
+
|
23
|
+
<link rel="stylesheet" href="css/style.css">
|
24
|
+
|
25
|
+
<link href="https://use.fontawesome.com/releases/v5.6.1/css/all.css" rel="stylesheet"> <!-- フォントオーサム -->
|
26
|
+
|
27
|
+
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script> <!-- ハンバーガークリックアニメ -->
|
28
|
+
|
29
|
+
<link rel="stylesheet"
|
30
|
+
|
31
|
+
href="https://fonts.googleapis.com/css2?family=M+PLUS+Rounded+1c:wght@800&family=Noto+Serif+JP:wght@700&display=swap">
|
32
|
+
|
33
|
+
<!-- googleフォント -->
|
34
|
+
|
35
|
+
<link rel="icon" href="img/favicon.png"> <!-- ファビコン -->
|
36
|
+
|
37
|
+
|
38
|
+
|
39
|
+
<!-- fancybox -->
|
40
|
+
|
41
|
+
<!-- Add mousewheel plugin (オプションのマウスホイールプラグイン) -->
|
42
|
+
|
43
|
+
<script type="text/javascript" src="js/jquery.mousewheel.pack.js"></script>
|
44
|
+
|
45
|
+
<!-- fancyBox の読み込み(必須)-->
|
46
|
+
|
47
|
+
<link rel="stylesheet" href="css/jquery.fancybox.css" type="text/css" media="screen" />
|
48
|
+
|
49
|
+
<script type="text/javascript" src="js/jquery.fancybox.pack.js"></script>
|
50
|
+
|
51
|
+
<!-- lazyload -->
|
52
|
+
|
53
|
+
<script src="js/lazysizes.min.js"></script>
|
54
|
+
|
55
|
+
<!-- javascript -->
|
56
|
+
|
57
|
+
<script src="js/script.js"></script>
|
58
|
+
|
59
|
+
</head>
|
60
|
+
|
61
|
+
|
62
|
+
|
63
|
+
<body ontouchstart="">
|
64
|
+
|
65
|
+
|
66
|
+
|
67
|
+
<header id="top-head">
|
68
|
+
|
69
|
+
<div class="inner">
|
70
|
+
|
71
|
+
<div id="mobile-head">
|
72
|
+
|
73
|
+
<img class="topicon" src="img/topicon.jpg" alt="topicon">
|
74
|
+
|
75
|
+
<h1 class="logo">古塔つみ</h1>
|
76
|
+
|
77
|
+
</div>
|
78
|
+
|
79
|
+
|
80
|
+
|
81
|
+
<nav id="global-nav">
|
82
|
+
|
83
|
+
<ul>
|
84
|
+
|
85
|
+
<li><a href="https://instagram.com/cotoh_tsumi" class="insta_btn" target="_blank"><span class="insta"><i
|
86
|
+
|
87
|
+
class="fab fa-instagram"></i></span>instagram</a></li>
|
88
|
+
|
89
|
+
<li><a href="https://twitter.com/cotoh_tsumi" class="twitter_btn" target="_blank"><span class="twitter"><i
|
90
|
+
|
91
|
+
class="fab fa-twitter"></i></span>twitter</a></li>
|
92
|
+
|
93
|
+
<li><i class="fa fa-envelope fa-1x"><span class="e-mail"><a href="mailto:cotohtsumi@gmail.com"
|
94
|
+
|
95
|
+
class="mail_btn" title="Send me an email">e-mail</a></span></i></li>
|
96
|
+
|
97
|
+
</ul>
|
98
|
+
|
99
|
+
</nav>
|
100
|
+
|
101
|
+
</div>
|
102
|
+
|
103
|
+
</header>
|
104
|
+
|
105
|
+
|
106
|
+
|
107
|
+
<main>
|
108
|
+
|
109
|
+
<div id="loader-bg">
|
110
|
+
|
111
|
+
<div id="loader">
|
112
|
+
|
113
|
+
|
114
|
+
|
115
|
+
</div>
|
116
|
+
|
117
|
+
</div>
|
118
|
+
|
119
|
+
<div id="wrap">
|
120
|
+
|
121
|
+
<div id="container">
|
122
|
+
|
123
|
+
<div class="wrapper">
|
124
|
+
|
125
|
+
<figure class="hover-parent">
|
126
|
+
|
127
|
+
<a href="img/2020-8-19-4.jpg" class="item x3" data-fancybox-group="cotoh"><img class="lazyload" data-src="img/2020-8-19-4.jpg">
|
128
|
+
|
129
|
+
<span class="hover-mask">2020-8-19</span></a>
|
130
|
+
|
131
|
+
</figure>
|
132
|
+
|
133
|
+
<figure class="hover-parent">
|
134
|
+
|
135
|
+
<a href="img/2020-8-19-3.jpg" class="item x3" data-fancybox-group="cotoh"><img class="lazyload" data-src="img/2020-8-19-3.jpg">
|
136
|
+
|
137
|
+
<span class="hover-mask">2020-8-19</span></a>
|
138
|
+
|
139
|
+
</figure>
|
140
|
+
|
141
|
+
<figure class="hover-parent">
|
142
|
+
|
143
|
+
<a href="img/2020-8-19-2.jpg" class="item x3" data-fancybox-group="cotoh"><img class="lazyload" data-src="img/2020-8-19-2.jpg">
|
144
|
+
|
145
|
+
<span class="hover-mask">2020-8-19</span></a>
|
146
|
+
|
147
|
+
</figure>
|
148
|
+
|
149
|
+
|
150
|
+
|
151
|
+
</div>
|
152
|
+
|
153
|
+
|
154
|
+
|
155
|
+
|
156
|
+
|
157
|
+
</main>
|
158
|
+
|
159
|
+
|
160
|
+
|
161
|
+
<footer class="footer">
|
162
|
+
|
163
|
+
</footer>
|
164
|
+
|
165
|
+
|
166
|
+
|
167
|
+
<!-- masonry -->
|
168
|
+
|
169
|
+
<script src="js/masonry.pkgd.min.js"></script>
|
170
|
+
|
171
|
+
<script src="js/imagesloaded.pkgd.min.js"></script>
|
172
|
+
|
173
|
+
|
174
|
+
|
1
|
-
|
175
|
+
<script>
|
176
|
+
|
2
|
-
|
177
|
+
$("img.lazyload").lazyload();
|
178
|
+
|
3
|
-
|
179
|
+
</script>
|
180
|
+
|
181
|
+
|
182
|
+
|
183
|
+
</body>
|
184
|
+
|
185
|
+
|
186
|
+
|
187
|
+
</html>
|
188
|
+
|
189
|
+
```
|
190
|
+
|
191
|
+
|
192
|
+
|
193
|
+
```css
|
194
|
+
|
195
|
+
|
196
|
+
|
197
|
+
@charset "UTF-8";
|
198
|
+
|
199
|
+
|
200
|
+
|
201
|
+
html {
|
202
|
+
|
203
|
+
margin: 0;
|
204
|
+
|
205
|
+
padding:0;
|
206
|
+
|
207
|
+
}
|
208
|
+
|
209
|
+
img {
|
210
|
+
|
211
|
+
width: 100%;
|
212
|
+
|
213
|
+
vertical-align: middle;
|
214
|
+
|
215
|
+
}
|
216
|
+
|
217
|
+
figure {
|
218
|
+
|
219
|
+
margin: 0;
|
220
|
+
|
221
|
+
}
|
222
|
+
|
223
|
+
table {
|
224
|
+
|
225
|
+
border-collapse: collapse;
|
226
|
+
|
227
|
+
border-spacing: 0;
|
228
|
+
|
229
|
+
}
|
230
|
+
|
231
|
+
a {
|
232
|
+
|
233
|
+
text-decoration: none;
|
234
|
+
|
235
|
+
/* transition: all 0.5s ease; 全てのプロパティ・変化までの時間・開始と終了時緩やかに */
|
236
|
+
|
237
|
+
}
|
238
|
+
|
239
|
+
a:hover {
|
240
|
+
|
241
|
+
transition:all .5s ease;
|
242
|
+
|
243
|
+
}
|
244
|
+
|
245
|
+
section {
|
246
|
+
|
247
|
+
margin-bottom: 120px;
|
248
|
+
|
249
|
+
}
|
250
|
+
|
251
|
+
.content-wrapper {
|
252
|
+
|
253
|
+
width: 100%; /*修正前95*/
|
254
|
+
|
255
|
+
margin: 0 auto;
|
256
|
+
|
257
|
+
max-width: 1400px; /*これ以上大きくならない*/
|
258
|
+
|
259
|
+
}
|
260
|
+
|
261
|
+
section h2 {
|
262
|
+
|
263
|
+
font-size: 2rem;
|
264
|
+
|
265
|
+
}
|
266
|
+
|
267
|
+
/* figcaption */
|
268
|
+
|
269
|
+
.hover-parent {
|
270
|
+
|
271
|
+
position: relative;
|
272
|
+
|
273
|
+
line-height: 30px;
|
274
|
+
|
275
|
+
}
|
276
|
+
|
277
|
+
.hover-parent:hover .hover-mask {
|
278
|
+
|
279
|
+
display: inline; /* インライン要素として表示 */
|
280
|
+
|
281
|
+
}
|
282
|
+
|
283
|
+
|
284
|
+
|
285
|
+
|
286
|
+
|
287
|
+
/* masonry */
|
288
|
+
|
289
|
+
#container {
|
290
|
+
|
291
|
+
width: 100%;
|
292
|
+
|
293
|
+
margin: 0 auto; /*中央寄せ */
|
294
|
+
|
295
|
+
position: relative;
|
296
|
+
|
297
|
+
}
|
298
|
+
|
299
|
+
.wrapper {
|
300
|
+
|
301
|
+
position: absolute;
|
302
|
+
|
303
|
+
top: 15px;
|
304
|
+
|
305
|
+
left: 60px;
|
306
|
+
|
307
|
+
}
|
308
|
+
|
309
|
+
.item {
|
310
|
+
|
311
|
+
margin-top:15px;
|
312
|
+
|
313
|
+
margin-bottom: 15px;
|
314
|
+
|
315
|
+
width: 100%;
|
316
|
+
|
317
|
+
padding: 8px;
|
318
|
+
|
319
|
+
box-shadow: 8px 8px 10px #555555;
|
320
|
+
|
321
|
+
/* float: left; */
|
322
|
+
|
323
|
+
}
|
324
|
+
|
325
|
+
.item.x3 {
|
326
|
+
|
327
|
+
width: 400px;
|
328
|
+
|
329
|
+
opacity : 0;
|
330
|
+
|
331
|
+
transform: translate(0,50px);
|
332
|
+
|
333
|
+
transition: all 1s 1s ease-out;
|
334
|
+
|
335
|
+
}
|
336
|
+
|
337
|
+
.item img {
|
338
|
+
|
339
|
+
width: 100%;
|
340
|
+
|
341
|
+
}
|
342
|
+
|
343
|
+
|
344
|
+
|
345
|
+
```
|
346
|
+
|
347
|
+
```jQuery
|
348
|
+
|
349
|
+
|
350
|
+
|
351
|
+
jQuery(function ($) { //ロード時の崩れ対策
|
352
|
+
|
353
|
+
$('body').fadeIn(500)
|
354
|
+
|
355
|
+
|
356
|
+
|
357
|
+
|
358
|
+
|
359
|
+
// var min_width = 100;
|
360
|
+
|
361
|
+
|
362
|
+
|
363
|
+
//画面幅による分岐と imagesLoaded, Masonry のイニシャライズを関数化
|
364
|
+
|
365
|
+
function masonry_update() {
|
366
|
+
|
367
|
+
ww = $(window).width();
|
368
|
+
|
369
|
+
var cw = 90;
|
370
|
+
|
371
|
+
if (ww < 1025) { cw = 59; } //幅により columnWidth を変更
|
372
|
+
|
373
|
+
if (ww < 897) { cw = 53; }
|
374
|
+
|
375
|
+
if (ww < 835) { cw = 50; }
|
376
|
+
|
377
|
+
if (ww < 769) { cw = 36; }
|
378
|
+
|
379
|
+
if (ww < 737) { cw = 33; }
|
380
|
+
|
381
|
+
if (ww < 668) { cw = 31; }
|
382
|
+
|
383
|
+
if (ww < 415) { cw = 33; }
|
384
|
+
|
385
|
+
if (ww < 376) { cw = 30; }
|
386
|
+
|
387
|
+
var $works_list = $('#container');
|
388
|
+
|
389
|
+
$works_list.imagesLoaded(function () {
|
390
|
+
|
391
|
+
$works_list.masonry({
|
392
|
+
|
393
|
+
itemSelector: '.item',
|
394
|
+
|
395
|
+
isFitWidth: true,//親要素の幅に合わせてカラム数を自動調整
|
396
|
+
|
397
|
+
columnWidth: cw //写真のサイズ
|
398
|
+
|
399
|
+
});
|
400
|
+
|
401
|
+
});
|
402
|
+
|
403
|
+
}
|
404
|
+
|
405
|
+
|
406
|
+
|
407
|
+
masonry_update();
|
408
|
+
|
409
|
+
|
410
|
+
|
411
|
+
//リサイズ時の処理
|
412
|
+
|
413
|
+
var timer = false;
|
414
|
+
|
415
|
+
$(window).resize(function () {
|
416
|
+
|
417
|
+
if (timer !== false) {
|
418
|
+
|
419
|
+
clearTimeout(timer);
|
420
|
+
|
421
|
+
}
|
422
|
+
|
423
|
+
timer = setTimeout(function () {
|
424
|
+
|
425
|
+
masonry_update();
|
426
|
+
|
427
|
+
}, 200);
|
428
|
+
|
429
|
+
});
|
430
|
+
|
431
|
+
});
|
432
|
+
|
433
|
+
|
434
|
+
|
435
|
+
|
436
|
+
|
437
|
+
|
438
|
+
|
439
|
+
$(function(){
|
440
|
+
|
441
|
+
$(window).on('load scroll', function() {
|
442
|
+
|
443
|
+
var winScroll = $(window).scrollTop();
|
444
|
+
|
445
|
+
var winHeight = $(window).height();
|
446
|
+
|
447
|
+
var scrollPos = winScroll + (winHeight * 0.8);
|
448
|
+
|
449
|
+
|
450
|
+
|
451
|
+
$(".item.x3").each(function() {
|
452
|
+
|
453
|
+
if($(this).offset().top < scrollPos + 1000 ) {
|
454
|
+
|
455
|
+
$(this).css({opacity: 1, transform: 'translate(0, 0)'});
|
456
|
+
|
457
|
+
}
|
458
|
+
|
459
|
+
});
|
460
|
+
|
461
|
+
});
|
462
|
+
|
463
|
+
});
|
464
|
+
|
465
|
+
|
466
|
+
|
467
|
+
|
468
|
+
|
469
|
+
// fancybox
|
470
|
+
|
471
|
+
//消すと連続で移動できない
|
472
|
+
|
473
|
+
(function ($, F) {
|
474
|
+
|
475
|
+
F.transitions.resizeIn = function () {
|
476
|
+
|
477
|
+
var previous = F.previous,
|
478
|
+
|
479
|
+
current = F.current,
|
480
|
+
|
481
|
+
startPos = previous.wrap.stop(true).position(),
|
482
|
+
|
483
|
+
endPos = $.extend({ opacity: 1 }, current.pos);
|
484
|
+
|
485
|
+
startPos.width = previous.wrap.width();
|
486
|
+
|
487
|
+
startPos.height = previous.wrap.height();
|
488
|
+
|
489
|
+
previous.wrap.stop(true).trigger('onReset').remove();
|
490
|
+
|
491
|
+
delete endPos.position;
|
492
|
+
|
493
|
+
current.inner.hide();
|
494
|
+
|
495
|
+
current.wrap.css(startPos).animate(endPos, {
|
496
|
+
|
497
|
+
duration: current.nextSpeed,
|
498
|
+
|
499
|
+
easing: current.nextEasing,
|
500
|
+
|
501
|
+
step: F.transitions.step,
|
502
|
+
|
503
|
+
complete: function () {
|
504
|
+
|
505
|
+
F._afterZoomIn();
|
506
|
+
|
507
|
+
current.inner.fadeIn("fast");
|
508
|
+
|
509
|
+
}
|
510
|
+
|
511
|
+
});
|
512
|
+
|
513
|
+
};
|
514
|
+
|
515
|
+
}(jQuery, jQuery.fancybox));
|
516
|
+
|
517
|
+
// 消すと拡大後の移動できない
|
518
|
+
|
519
|
+
jQuery(function ($) {
|
520
|
+
|
521
|
+
$(".item.x3").fancybox({
|
522
|
+
|
523
|
+
nextMethod: 'resizeIn',
|
524
|
+
|
525
|
+
nextSpeed: 250,
|
526
|
+
|
527
|
+
prevMethod: false
|
528
|
+
|
529
|
+
});
|
530
|
+
|
531
|
+
});
|
532
|
+
|
533
|
+
|
534
|
+
|
535
|
+
$('#container').imagesLoaded(function(){
|
536
|
+
|
537
|
+
/*実行させたい処理*/
|
538
|
+
|
539
|
+
});
|
540
|
+
|
541
|
+
|
542
|
+
|
543
|
+
$("img.item.x3").lazyload({
|
544
|
+
|
545
|
+
effect: 'fadeIn',
|
546
|
+
|
547
|
+
effectspeed: 1000,
|
548
|
+
|
549
|
+
threshold: 10
|
550
|
+
|
551
|
+
});
|
552
|
+
|
553
|
+
![イメージ説明](f785f988fc2da84cc587626849a44d9b.png)
|
554
|
+
|
555
|
+
```
|
4
556
|
|
5
557
|
サイズの違う写真を縦横比率を変えずに、横並び折返してレイアウトし、遅延読み込みを使用し、サクサク見れるギャラリーサイトを作りたいです。
|
6
558
|
|