質問編集履歴
3
書式の改善
test
CHANGED
File without changes
|
test
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
|
1
|
+
ハンバーガーメニューを作っています。
|
2
2
|
|
3
3
|
クラスの追加削除に伴うフェードインフェードアウトを機能させたいと思っています。
|
4
4
|
|
@@ -12,7 +12,7 @@
|
|
12
12
|
|
13
13
|
|
14
14
|
|
15
|
-
```
|
15
|
+
```Javascript
|
16
16
|
|
17
17
|
<script type="text/javascript">
|
18
18
|
|
2
書式の改善
test
CHANGED
File without changes
|
test
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
ハンバーガーメニューを作っています。
|
1
|
+
```ハンバーガーメニューを作っています。
|
2
2
|
|
3
3
|
クラスの追加削除に伴うフェードインフェードアウトを機能させたいと思っています。
|
4
4
|
|
@@ -12,6 +12,8 @@
|
|
12
12
|
|
13
13
|
|
14
14
|
|
15
|
+
```ここに言語を入力
|
16
|
+
|
15
17
|
<script type="text/javascript">
|
16
18
|
|
17
19
|
$(function() {
|
@@ -52,13 +54,17 @@
|
|
52
54
|
|
53
55
|
</script>
|
54
56
|
|
57
|
+
```
|
58
|
+
|
55
59
|
|
56
60
|
|
57
61
|
<追加でHTMLとCSSのコードです。>
|
58
62
|
|
59
63
|
|
60
64
|
|
65
|
+
|
66
|
+
|
61
|
-
|
67
|
+
```HTML
|
62
68
|
|
63
69
|
<!doctype html>
|
64
70
|
|
@@ -154,11 +160,13 @@
|
|
154
160
|
|
155
161
|
|
156
162
|
|
157
|
-
|
163
|
+
```
|
158
|
-
|
159
|
-
|
160
|
-
|
164
|
+
|
165
|
+
|
166
|
+
|
167
|
+
|
168
|
+
|
161
|
-
|
169
|
+
```CSS
|
162
170
|
|
163
171
|
@charset "UTF-8";
|
164
172
|
|
@@ -503,3 +511,5 @@
|
|
503
511
|
}
|
504
512
|
|
505
513
|
}
|
514
|
+
|
515
|
+
```
|
1
HTML/CSSコードの追加
test
CHANGED
File without changes
|
test
CHANGED
@@ -51,3 +51,455 @@
|
|
51
51
|
});
|
52
52
|
|
53
53
|
</script>
|
54
|
+
|
55
|
+
|
56
|
+
|
57
|
+
<追加でHTMLとCSSのコードです。>
|
58
|
+
|
59
|
+
|
60
|
+
|
61
|
+
<HTML/Java Script>
|
62
|
+
|
63
|
+
<!doctype html>
|
64
|
+
|
65
|
+
<html>
|
66
|
+
|
67
|
+
<head>
|
68
|
+
|
69
|
+
<meta charset="UTF-8">
|
70
|
+
|
71
|
+
<title>Kyoka Hatano</title>
|
72
|
+
|
73
|
+
<meta name="viewport" content="width=device-width,initial-scale=1">
|
74
|
+
|
75
|
+
<link rel="stylesheet" type="text/css" href="index.css">
|
76
|
+
|
77
|
+
<script src="js/jquery.min.js" type="text/javascript"></script>
|
78
|
+
|
79
|
+
<script type="text/javascript">
|
80
|
+
|
81
|
+
$(function() {
|
82
|
+
|
83
|
+
$(".nav-button").on("click", function() {
|
84
|
+
|
85
|
+
if ($(this).hasClass("active")) {
|
86
|
+
|
87
|
+
$(this).removeClass("active");
|
88
|
+
|
89
|
+
$(".list")
|
90
|
+
|
91
|
+
.addClass("close")
|
92
|
+
|
93
|
+
.removeClass("open");
|
94
|
+
|
95
|
+
} else {
|
96
|
+
|
97
|
+
$(this).addClass("active");
|
98
|
+
|
99
|
+
$(".list")
|
100
|
+
|
101
|
+
.hide()
|
102
|
+
|
103
|
+
.addClass("open")
|
104
|
+
|
105
|
+
.removeClass("close")
|
106
|
+
|
107
|
+
.fadeIn( 200 );
|
108
|
+
|
109
|
+
}
|
110
|
+
|
111
|
+
});
|
112
|
+
|
113
|
+
});
|
114
|
+
|
115
|
+
</script>
|
116
|
+
|
117
|
+
</head>
|
118
|
+
|
119
|
+
|
120
|
+
|
121
|
+
<body>
|
122
|
+
|
123
|
+
<div class="menu"><a class="nav-button" href="#"> <span></span> <span></span> <span></span> </a>
|
124
|
+
|
125
|
+
<div class="list">
|
126
|
+
|
127
|
+
<ul>
|
128
|
+
|
129
|
+
<li><a href="portraits.html">portraits</a></li>
|
130
|
+
|
131
|
+
<li><a href="snaps.html">snaps</a></li>
|
132
|
+
|
133
|
+
<li><a href="works.html">works</a></li>
|
134
|
+
|
135
|
+
<li><a href="contact.html">contact</a></li>
|
136
|
+
|
137
|
+
</ul>
|
138
|
+
|
139
|
+
</div>
|
140
|
+
|
141
|
+
<h1 id="name">Kyoka Hatano</h1>
|
142
|
+
|
143
|
+
</div>
|
144
|
+
|
145
|
+
<footer>
|
146
|
+
|
147
|
+
<p>© 2020 Kyoka Hatano</p>
|
148
|
+
|
149
|
+
</footer>
|
150
|
+
|
151
|
+
</body>
|
152
|
+
|
153
|
+
</html>
|
154
|
+
|
155
|
+
|
156
|
+
|
157
|
+
|
158
|
+
|
159
|
+
|
160
|
+
|
161
|
+
<CSS>
|
162
|
+
|
163
|
+
@charset "UTF-8";
|
164
|
+
|
165
|
+
/* CSS Document */
|
166
|
+
|
167
|
+
|
168
|
+
|
169
|
+
|
170
|
+
|
171
|
+
/*******共通*******/
|
172
|
+
|
173
|
+
|
174
|
+
|
175
|
+
@font-face {
|
176
|
+
|
177
|
+
font-family: 'OptimaLTPro-Roman';
|
178
|
+
|
179
|
+
src: url('webFonts/OptimaLTPro-Roman/font.woff2') format('woff2'), url('webFonts/OptimaLTPro-Roman/font.woff') format('woff');
|
180
|
+
|
181
|
+
}
|
182
|
+
|
183
|
+
|
184
|
+
|
185
|
+
html{
|
186
|
+
|
187
|
+
font-size: 62.5%;
|
188
|
+
|
189
|
+
}
|
190
|
+
|
191
|
+
|
192
|
+
|
193
|
+
body{
|
194
|
+
|
195
|
+
background-color: #fcfcfc;
|
196
|
+
|
197
|
+
font-family: OptimaLTPro-Roman, san-serif;
|
198
|
+
|
199
|
+
color:#444;
|
200
|
+
|
201
|
+
margin: 0;
|
202
|
+
|
203
|
+
}
|
204
|
+
|
205
|
+
|
206
|
+
|
207
|
+
.menu{
|
208
|
+
|
209
|
+
margin-top: 5rem;
|
210
|
+
|
211
|
+
margin-left: 4.2rem;
|
212
|
+
|
213
|
+
position: fixed;
|
214
|
+
|
215
|
+
}
|
216
|
+
|
217
|
+
|
218
|
+
|
219
|
+
.nav-button {
|
220
|
+
|
221
|
+
display: none;
|
222
|
+
|
223
|
+
}
|
224
|
+
|
225
|
+
|
226
|
+
|
227
|
+
ul{
|
228
|
+
|
229
|
+
font-size: 1rem;
|
230
|
+
|
231
|
+
letter-spacing: 0.01em;
|
232
|
+
|
233
|
+
margin: 0;
|
234
|
+
|
235
|
+
padding: 0;
|
236
|
+
|
237
|
+
}
|
238
|
+
|
239
|
+
|
240
|
+
|
241
|
+
ul li{
|
242
|
+
|
243
|
+
list-style-type: none;
|
244
|
+
|
245
|
+
padding-bottom: 2.1rem;
|
246
|
+
|
247
|
+
}
|
248
|
+
|
249
|
+
|
250
|
+
|
251
|
+
a:hover {
|
252
|
+
|
253
|
+
color: #999;
|
254
|
+
|
255
|
+
}
|
256
|
+
|
257
|
+
|
258
|
+
|
259
|
+
.now{
|
260
|
+
|
261
|
+
text-decoration: underline;
|
262
|
+
|
263
|
+
}
|
264
|
+
|
265
|
+
|
266
|
+
|
267
|
+
#name{
|
268
|
+
|
269
|
+
writing-mode: vertical-rl;
|
270
|
+
|
271
|
+
font-weight: normal;
|
272
|
+
|
273
|
+
font-size: 1.57rem;
|
274
|
+
|
275
|
+
letter-spacing: 0.11em;
|
276
|
+
|
277
|
+
line-height: 0.9rem;
|
278
|
+
|
279
|
+
margin: 0;
|
280
|
+
|
281
|
+
padding: 0;
|
282
|
+
|
283
|
+
}
|
284
|
+
|
285
|
+
|
286
|
+
|
287
|
+
a{
|
288
|
+
|
289
|
+
color: #444;
|
290
|
+
|
291
|
+
text-decoration: none;
|
292
|
+
|
293
|
+
}
|
294
|
+
|
295
|
+
|
296
|
+
|
297
|
+
footer{
|
298
|
+
|
299
|
+
clear: both;
|
300
|
+
|
301
|
+
margin-left: 4.2rem;
|
302
|
+
|
303
|
+
padding: 0;
|
304
|
+
|
305
|
+
font-size: 1rem;
|
306
|
+
|
307
|
+
letter-spacing: 0.01em;
|
308
|
+
|
309
|
+
position: fixed;
|
310
|
+
|
311
|
+
bottom: 1rem;
|
312
|
+
|
313
|
+
}
|
314
|
+
|
315
|
+
|
316
|
+
|
317
|
+
|
318
|
+
|
319
|
+
/*******レスポンシブ*******/
|
320
|
+
|
321
|
+
|
322
|
+
|
323
|
+
@media screen and (max-width:768px){
|
324
|
+
|
325
|
+
|
326
|
+
|
327
|
+
|
328
|
+
|
329
|
+
.menu{
|
330
|
+
|
331
|
+
margin: auto;
|
332
|
+
|
333
|
+
position: fixed;
|
334
|
+
|
335
|
+
width: 11.7%;
|
336
|
+
|
337
|
+
}
|
338
|
+
|
339
|
+
|
340
|
+
|
341
|
+
.nav-button {
|
342
|
+
|
343
|
+
display: block;
|
344
|
+
|
345
|
+
cursor: pointer;
|
346
|
+
|
347
|
+
}
|
348
|
+
|
349
|
+
|
350
|
+
|
351
|
+
.list.open {
|
352
|
+
|
353
|
+
display: block;
|
354
|
+
|
355
|
+
}
|
356
|
+
|
357
|
+
|
358
|
+
|
359
|
+
.list.close {
|
360
|
+
|
361
|
+
display: none;
|
362
|
+
|
363
|
+
}
|
364
|
+
|
365
|
+
|
366
|
+
|
367
|
+
.list {
|
368
|
+
|
369
|
+
|
370
|
+
|
371
|
+
position: fixed;
|
372
|
+
|
373
|
+
left: 0;
|
374
|
+
|
375
|
+
top: 0;
|
376
|
+
|
377
|
+
display: none;
|
378
|
+
|
379
|
+
z-index: 10;
|
380
|
+
|
381
|
+
background-color: #fcfcfc;
|
382
|
+
|
383
|
+
width: 100%;
|
384
|
+
|
385
|
+
height: 100%;}
|
386
|
+
|
387
|
+
ul {
|
388
|
+
|
389
|
+
height: 100%;
|
390
|
+
|
391
|
+
width:63px;
|
392
|
+
|
393
|
+
margin:163px auto 0 auto;
|
394
|
+
|
395
|
+
position: relative;
|
396
|
+
|
397
|
+
overflow-x: hidden;
|
398
|
+
|
399
|
+
overflow-y: auto;
|
400
|
+
|
401
|
+
font-size: 1.3rem;
|
402
|
+
|
403
|
+
}
|
404
|
+
|
405
|
+
ul li {
|
406
|
+
|
407
|
+
display: block;
|
408
|
+
|
409
|
+
padding-bottom: 3rem;
|
410
|
+
|
411
|
+
}
|
412
|
+
|
413
|
+
|
414
|
+
|
415
|
+
.nav-button,
|
416
|
+
|
417
|
+
.nav-button span {
|
418
|
+
|
419
|
+
transition: all 0.3s;
|
420
|
+
|
421
|
+
box-sizing: border-box;
|
422
|
+
|
423
|
+
}
|
424
|
+
|
425
|
+
.nav-button {
|
426
|
+
|
427
|
+
position: relative;
|
428
|
+
|
429
|
+
margin: 2rem auto 8rem auto;
|
430
|
+
|
431
|
+
z-index: 20;
|
432
|
+
|
433
|
+
width: 24px;
|
434
|
+
|
435
|
+
height: 18px;
|
436
|
+
|
437
|
+
transform: rotate(90deg);
|
438
|
+
|
439
|
+
}
|
440
|
+
|
441
|
+
.nav-button span {
|
442
|
+
|
443
|
+
position: absolute;
|
444
|
+
|
445
|
+
width: 100%;
|
446
|
+
|
447
|
+
height: 0.2rem;
|
448
|
+
|
449
|
+
background-color: #ccc;
|
450
|
+
|
451
|
+
border-radius: 4px;
|
452
|
+
|
453
|
+
}
|
454
|
+
|
455
|
+
.nav-button span:nth-of-type(1) {
|
456
|
+
|
457
|
+
top: 0;
|
458
|
+
|
459
|
+
}
|
460
|
+
|
461
|
+
.nav-button span:nth-of-type(2) {
|
462
|
+
|
463
|
+
top: 8px;
|
464
|
+
|
465
|
+
}
|
466
|
+
|
467
|
+
.nav-button span:nth-of-type(3) {
|
468
|
+
|
469
|
+
bottom: 0;
|
470
|
+
|
471
|
+
}
|
472
|
+
|
473
|
+
.nav-button.active {
|
474
|
+
|
475
|
+
transform: none;
|
476
|
+
|
477
|
+
}
|
478
|
+
|
479
|
+
|
480
|
+
|
481
|
+
|
482
|
+
|
483
|
+
|
484
|
+
|
485
|
+
#name{
|
486
|
+
|
487
|
+
letter-spacing: 0.11em;
|
488
|
+
|
489
|
+
margin: auto;
|
490
|
+
|
491
|
+
padding-right: 0.3rem;
|
492
|
+
|
493
|
+
}
|
494
|
+
|
495
|
+
|
496
|
+
|
497
|
+
footer{
|
498
|
+
|
499
|
+
margin-left: 2.4rem;
|
500
|
+
|
501
|
+
bottom: 0.2rem;
|
502
|
+
|
503
|
+
}
|
504
|
+
|
505
|
+
}
|