質問編集履歴
2
コードの視認性向上
test
CHANGED
File without changes
|
test
CHANGED
@@ -26,7 +26,9 @@
|
|
26
26
|
|
27
27
|
コード
|
28
28
|
|
29
|
+
|
30
|
+
|
29
|
-
|
31
|
+
```html
|
30
32
|
|
31
33
|
<!-- ポップアップ -->
|
32
34
|
|
@@ -112,13 +114,13 @@
|
|
112
114
|
|
113
115
|
|
114
116
|
|
115
|
-
|
116
|
-
|
117
|
-
|
117
|
+
```
|
118
|
-
|
119
|
-
|
120
|
-
|
118
|
+
|
119
|
+
|
120
|
+
|
121
|
+
|
122
|
+
|
121
|
-
|
123
|
+
```css
|
122
124
|
|
123
125
|
.popup {
|
124
126
|
|
@@ -288,11 +290,13 @@
|
|
288
290
|
|
289
291
|
|
290
292
|
|
293
|
+
```
|
294
|
+
|
295
|
+
|
296
|
+
|
297
|
+
|
298
|
+
|
291
|
-
javascript
|
299
|
+
```javascript
|
292
|
-
|
293
|
-
|
294
|
-
|
295
|
-
//モーダル
|
296
300
|
|
297
301
|
function popupImage() {
|
298
302
|
|
@@ -331,3 +335,5 @@
|
|
331
335
|
}
|
332
336
|
|
333
337
|
popupImage();
|
338
|
+
|
339
|
+
```
|
1
コード等を追加しました。
test
CHANGED
File without changes
|
test
CHANGED
@@ -17,3 +17,317 @@
|
|
17
17
|
|
18
18
|
|
19
19
|
もしわかる方がいましたら、ご教授いただけると幸いです。
|
20
|
+
|
21
|
+
|
22
|
+
|
23
|
+
端末はMacbook airです。
|
24
|
+
|
25
|
+
|
26
|
+
|
27
|
+
コード
|
28
|
+
|
29
|
+
html
|
30
|
+
|
31
|
+
<!-- ポップアップ -->
|
32
|
+
|
33
|
+
<div class="popup" id="js-popup">
|
34
|
+
|
35
|
+
<div class="popup-inner">
|
36
|
+
|
37
|
+
<div class="close-btn" id="js-close-btn">
|
38
|
+
|
39
|
+
<!-- <i class="fas fa-times"></i> -->
|
40
|
+
|
41
|
+
<div class="batsu">×</div>
|
42
|
+
|
43
|
+
</div>
|
44
|
+
|
45
|
+
<a href="#">
|
46
|
+
|
47
|
+
<!-- <img src="./img/popup.jpg" alt="ポップアップ画像"> -->
|
48
|
+
|
49
|
+
<div class="contact-form">
|
50
|
+
|
51
|
+
<div class="contact-inner">
|
52
|
+
|
53
|
+
<p class="contact-title">宿泊予約</p><!-- /.contact-title -->
|
54
|
+
|
55
|
+
<form action="https://docs.google.com/forms/u/0/d/e/1FAIpQLSeiu2OXn6fYEOh2-9KW-t0mFtIPBiIbBoSD8RRyaRBxqDNmQQ/formResponse" id="form">
|
56
|
+
|
57
|
+
<div class="box d-flex">
|
58
|
+
|
59
|
+
<label for="name">お名前</label>
|
60
|
+
|
61
|
+
<input type="text" name="entry.396652230" id="name" required>
|
62
|
+
|
63
|
+
</div>
|
64
|
+
|
65
|
+
<div class="box d-flex">
|
66
|
+
|
67
|
+
<label for="mail">メールアドレス</label>
|
68
|
+
|
69
|
+
<input type="mail" name="entry.1934980237" id="mail" required>
|
70
|
+
|
71
|
+
</div>
|
72
|
+
|
73
|
+
<div class="box">
|
74
|
+
|
75
|
+
<p class="box">ご希望プラン(空いているプランのみ表示されます)</p>
|
76
|
+
|
77
|
+
</div>
|
78
|
+
|
79
|
+
<div class="box">
|
80
|
+
|
81
|
+
<select name="plan">
|
82
|
+
|
83
|
+
<option value="" hidden>プランを選択してください</option>
|
84
|
+
|
85
|
+
<option value="1">cat</option>
|
86
|
+
|
87
|
+
<option value="2">dog</option>
|
88
|
+
|
89
|
+
<option value="3">rabbit</option>
|
90
|
+
|
91
|
+
<option value="4">squirrel</option>
|
92
|
+
|
93
|
+
</select>
|
94
|
+
|
95
|
+
</div>
|
96
|
+
|
97
|
+
<input type="submit" class="submit-btn" id="js-submit" value="送信する">
|
98
|
+
|
99
|
+
</form>
|
100
|
+
|
101
|
+
</div><!-- /.contact-inner -->
|
102
|
+
|
103
|
+
</div><!-- /.contact-form -->
|
104
|
+
|
105
|
+
</a>
|
106
|
+
|
107
|
+
</div>
|
108
|
+
|
109
|
+
<div class="black-background" id="js-black-bg"></div>
|
110
|
+
|
111
|
+
</div>
|
112
|
+
|
113
|
+
|
114
|
+
|
115
|
+
|
116
|
+
|
117
|
+
CSS
|
118
|
+
|
119
|
+
|
120
|
+
|
121
|
+
//モーダル
|
122
|
+
|
123
|
+
.popup {
|
124
|
+
|
125
|
+
position: fixed;
|
126
|
+
|
127
|
+
left: 0;
|
128
|
+
|
129
|
+
top: 0;
|
130
|
+
|
131
|
+
width: 100%;
|
132
|
+
|
133
|
+
height: 100%;
|
134
|
+
|
135
|
+
z-index: 9999;
|
136
|
+
|
137
|
+
opacity: 0;
|
138
|
+
|
139
|
+
visibility: hidden;
|
140
|
+
|
141
|
+
transition: .6s;
|
142
|
+
|
143
|
+
}
|
144
|
+
|
145
|
+
.popup.is-show {
|
146
|
+
|
147
|
+
opacity: 1;
|
148
|
+
|
149
|
+
visibility: visible;
|
150
|
+
|
151
|
+
}
|
152
|
+
|
153
|
+
.popup-inner {
|
154
|
+
|
155
|
+
position: absolute;
|
156
|
+
|
157
|
+
left: 50%;
|
158
|
+
|
159
|
+
top: 50%;
|
160
|
+
|
161
|
+
transform: translate(-50%,-50%);
|
162
|
+
|
163
|
+
width: 80%;
|
164
|
+
|
165
|
+
max-width: 500px;
|
166
|
+
|
167
|
+
padding: 50px;
|
168
|
+
|
169
|
+
background-color: #fff;
|
170
|
+
|
171
|
+
z-index: 2;
|
172
|
+
|
173
|
+
}
|
174
|
+
|
175
|
+
.popup-inner img {
|
176
|
+
|
177
|
+
width: 100%;
|
178
|
+
|
179
|
+
}
|
180
|
+
|
181
|
+
.close-btn {
|
182
|
+
|
183
|
+
position: absolute;
|
184
|
+
|
185
|
+
right: 0;
|
186
|
+
|
187
|
+
top: 0;
|
188
|
+
|
189
|
+
width: 50px;
|
190
|
+
|
191
|
+
height: 50px;
|
192
|
+
|
193
|
+
line-height: 50px;
|
194
|
+
|
195
|
+
text-align: center;
|
196
|
+
|
197
|
+
cursor: pointer;
|
198
|
+
|
199
|
+
}
|
200
|
+
|
201
|
+
.close-btn i {
|
202
|
+
|
203
|
+
font-size: 20px;
|
204
|
+
|
205
|
+
color: #333;
|
206
|
+
|
207
|
+
}
|
208
|
+
|
209
|
+
.black-background {
|
210
|
+
|
211
|
+
position: absolute;
|
212
|
+
|
213
|
+
left: 0;
|
214
|
+
|
215
|
+
top: 0;
|
216
|
+
|
217
|
+
width: 100%;
|
218
|
+
|
219
|
+
height: 100%;
|
220
|
+
|
221
|
+
background-color: rgba(0,0,0,.8);
|
222
|
+
|
223
|
+
z-index: 1;
|
224
|
+
|
225
|
+
cursor: pointer;
|
226
|
+
|
227
|
+
}
|
228
|
+
|
229
|
+
.batsu{
|
230
|
+
|
231
|
+
font-size: 300%;
|
232
|
+
|
233
|
+
font-weight: bold;
|
234
|
+
|
235
|
+
}
|
236
|
+
|
237
|
+
|
238
|
+
|
239
|
+
.contact{
|
240
|
+
|
241
|
+
&-form{
|
242
|
+
|
243
|
+
font-size: 1.3rem;
|
244
|
+
|
245
|
+
color: #333;
|
246
|
+
|
247
|
+
form{
|
248
|
+
|
249
|
+
margin-top: 30px;
|
250
|
+
|
251
|
+
}
|
252
|
+
|
253
|
+
}
|
254
|
+
|
255
|
+
&-title{
|
256
|
+
|
257
|
+
text-align: center;
|
258
|
+
|
259
|
+
border-bottom: 1px solid #E7E7E7;
|
260
|
+
|
261
|
+
padding-bottom: 30px;
|
262
|
+
|
263
|
+
}
|
264
|
+
|
265
|
+
|
266
|
+
|
267
|
+
}
|
268
|
+
|
269
|
+
|
270
|
+
|
271
|
+
.box{
|
272
|
+
|
273
|
+
flex-direction: column;
|
274
|
+
|
275
|
+
label,p{
|
276
|
+
|
277
|
+
margin-top: 20px;
|
278
|
+
|
279
|
+
}
|
280
|
+
|
281
|
+
input,textarea{
|
282
|
+
|
283
|
+
margin-top: 20px;
|
284
|
+
|
285
|
+
}
|
286
|
+
|
287
|
+
}
|
288
|
+
|
289
|
+
|
290
|
+
|
291
|
+
javascript
|
292
|
+
|
293
|
+
|
294
|
+
|
295
|
+
//モーダル
|
296
|
+
|
297
|
+
function popupImage() {
|
298
|
+
|
299
|
+
var popup = document.getElementById('js-popup');
|
300
|
+
|
301
|
+
if(!popup) return;
|
302
|
+
|
303
|
+
|
304
|
+
|
305
|
+
var blackBg = document.getElementById('js-black-bg');
|
306
|
+
|
307
|
+
var closeBtn = document.getElementById('js-close-btn');
|
308
|
+
|
309
|
+
var showBtn = document.getElementById('js-show-popup');
|
310
|
+
|
311
|
+
|
312
|
+
|
313
|
+
closePopUp(blackBg);
|
314
|
+
|
315
|
+
closePopUp(closeBtn);
|
316
|
+
|
317
|
+
closePopUp(showBtn);
|
318
|
+
|
319
|
+
function closePopUp(elem) {
|
320
|
+
|
321
|
+
if(!elem) return;
|
322
|
+
|
323
|
+
elem.addEventListener('click', function() {
|
324
|
+
|
325
|
+
popup.classList.toggle('is-show');
|
326
|
+
|
327
|
+
});
|
328
|
+
|
329
|
+
}
|
330
|
+
|
331
|
+
}
|
332
|
+
|
333
|
+
popupImage();
|