質問編集履歴

3

pugからHTMLに変換

2021/05/01 04:09

投稿

atk_3
atk_3

スコア43

test CHANGED
File without changes
test CHANGED
@@ -246,13 +246,17 @@
246
246
 
247
247
  なので下記のようにすることができませんでした。
248
248
 
249
- ```pug
249
+ ```html
250
-
250
+
251
+
252
+
251
- .mv-slide.swiper-slide(data-slide="001")
253
+ <div class="mv-slide swiper-slide" data-slide="001">
252
-
254
+
253
-   img(src=`${sectionImgPath}mv/mv-01.jpg`, alt="")
255
+   <img src="/program/meiji/assets/img/mv/mv-01.jpg" alt="">
254
-
256
+
255
-   span TEXT-1
257
+   <span>TEXT-1</span
258
+
259
+  </div>
256
260
 
257
261
  ```
258
262
 

2

pugからHTMLに変換

2021/05/01 04:09

投稿

atk_3
atk_3

スコア43

test CHANGED
File without changes
test CHANGED
@@ -34,232 +34,228 @@
34
34
 
35
35
 
36
36
 
37
+ ```html
38
+
39
+ <div class="mv-content">
40
+
41
+ <div class="mv-hero swiper-container">
42
+
43
+ <div class="slide-group swiper-wrapper" id="mv-images">
44
+
45
+ <div class="mv-slide swiper-slide" data-slide="001"><img src="/program/meiji/assets/img/mv/mv-01.jpg" alt=""></div>
46
+
47
+ <div class="mv-slide swiper-slide" data-slide="002"><img src="/program/meiji/assets/img/mv/mv-02.jpg" alt=""></div>
48
+
49
+ <div class="mv-slide swiper-slide" data-slide="003"><img src="/program/meiji/assets/img/mv/mv-03.jpg" alt=""></div>
50
+
51
+ <div class="mv-slide swiper-slide" data-slide="004"><img src="/program/meiji/assets/img/mv/mv-04.jpg" alt=""></div>
52
+
53
+ </div>
54
+
55
+ <!-- Add Pagination -->
56
+
57
+ <div class="swiper-pagination__mv"></div>
58
+
59
+ </div>
60
+
61
+ <div class="slide-group__text">
62
+
63
+ <ul class="text-lists" id="text-lists">
64
+
65
+ <li class="active" data-slide="001">TEXT-1</li>
66
+
67
+ <li data-slide="002">TEXT-2</li>
68
+
69
+ <li data-slide="003">TEXT-3</li>
70
+
71
+ <li data-slide="004">TEXT-4</li>
72
+
73
+ </ul>
74
+
75
+ </div>
76
+
77
+ </div>
78
+
79
+ ```
80
+
81
+ ```javascript
82
+
83
+ import $ from 'jquery';
84
+
85
+ import Swiper from 'swiper';
86
+
87
+
88
+
89
+ /**
90
+
91
+ * @constructor
92
+
93
+ */
94
+
95
+
96
+
97
+ let swiper = undefined;
98
+
99
+ export default class MvSwiper {
100
+
101
+ constructor() {
102
+
103
+ this.mvSwiperAction();
104
+
105
+ }
106
+
107
+ mvSwiperAction() {
108
+
109
+ swiper = new Swiper('.mv-hero.swiper-container', {
110
+
111
+ autoplay: {
112
+
113
+ delay: 5000,
114
+
115
+ },
116
+
117
+ speed: 800,
118
+
119
+ spaceBetween: 0,
120
+
121
+ initialSlide: 0,
122
+
123
+ slidesPerView: 'auto',
124
+
125
+ centeredSlides: true,
126
+
127
+ loop: true,
128
+
129
+ effect: 'fade',
130
+
131
+ pagination: {
132
+
133
+ el: '.swiper-pagination__mv',
134
+
135
+ type: 'bullets',
136
+
137
+ clickable: false,
138
+
139
+ },
140
+
141
+ });
142
+
143
+ this.mvTextList();
144
+
145
+ }
146
+
147
+ mvTextList() {
148
+
149
+ const target = document.getElementById('mv-images');
150
+
151
+
152
+
153
+ const options = {
154
+
155
+ attributes: true,
156
+
157
+ attributeFilter: ['class', 'style'],
158
+
159
+ childList: true
160
+
161
+ };
162
+
163
+
164
+
165
+ const observer = new MutationObserver(() => {
166
+
167
+ let imageActiveDate = $('.swiper-slide-active').data('slide');
168
+
169
+ let textList = $('.text-lists li')
170
+
171
+ let textListNum = parseInt(imageActiveDate.slice(-1));
172
+
173
+
174
+
175
+ // console.log('画像のデータ', imageActiveDate)
176
+
177
+ // console.log('テキストのデータ', textList[textListNum - 1])
178
+
179
+
180
+
181
+ switch (imageActiveDate) {
182
+
183
+ case '001':
184
+
185
+ $(textList[textListNum - 1]).addClass('active')
186
+
187
+ $(textList[textListNum + 2]).removeClass('active')
188
+
189
+ $(textList[textListNum]).removeClass('active')
190
+
191
+ break;
192
+
193
+ case '002':
194
+
195
+ $(textList[textListNum - 1]).addClass('active')
196
+
197
+ $(textList[textListNum - 2]).removeClass('active')
198
+
199
+ $(textList[textListNum]).removeClass('active')
200
+
201
+ break;
202
+
203
+ case '003':
204
+
205
+ $(textList[textListNum - 1]).addClass('active')
206
+
207
+ $(textList[textListNum - 2]).removeClass('active')
208
+
209
+ $(textList[textListNum]).removeClass('active')
210
+
211
+ break;
212
+
213
+ case '004':
214
+
215
+ $(textList[textListNum - 1]).addClass('active')
216
+
217
+ $(textList[textListNum - 2]).removeClass('active')
218
+
219
+ $(textList[textListNum - 4]).removeClass('active')
220
+
221
+ $(textList[textListNum]).removeClass('active')
222
+
223
+ break;
224
+
225
+ default:
226
+
227
+ false
228
+
229
+ }
230
+
231
+ });
232
+
233
+
234
+
235
+ observer.observe(target, options)
236
+
237
+ }
238
+
239
+ }
240
+
241
+
242
+
243
+ ```
244
+
245
+ 今回デザイン上スライドさせる対象のdivにまとめることが出来ずにわけております。
246
+
247
+ なので下記のようにすることができませんでした。
248
+
37
249
  ```pug
38
250
 
39
- section.mv
40
-
41
- .mv-content
42
-
43
- .mv-hero.swiper-container
44
-
45
- .slide-group.swiper-wrapper#mv-images
46
-
47
- .mv-slide.swiper-slide(data-slide="001")
251
+ .mv-slide.swiper-slide(data-slide="001")
48
-
252
+
49
- img(src=`${sectionImgPath}mv/mv-01.jpg`, alt="")
253
+   img(src=`${sectionImgPath}mv/mv-01.jpg`, alt="")
50
-
51
- .mv-slide.swiper-slide(data-slide="002")
254
+
52
-
53
- img(src=`${sectionImgPath}mv/mv-02.jpg`, alt="")
54
-
55
- .mv-slide.swiper-slide(data-slide="003")
56
-
57
- img(src=`${sectionImgPath}mv/mv-03.jpg`, alt="")
58
-
59
- .mv-slide.swiper-slide(data-slide="004")
60
-
61
- img(src=`${sectionImgPath}mv/mv-04.jpg`, alt="")
62
-
63
-
64
-
65
- <!-- Add Pagination -->
66
-
67
- .swiper-pagination__mv
255
+   span TEXT-1
68
-
69
-
70
-
71
- .slide-group__text
72
-
73
- ul.text-lists#text-lists
74
-
75
- li.active(data-slide="001") TEXT-1
76
-
77
- li(data-slide="002") TEXT-2
78
-
79
- li(data-slide="003") TEXT-3
80
-
81
- li(data-slide="004") TEXT-4
82
256
 
83
257
  ```
84
258
 
85
- ```javascript
86
-
87
- import $ from 'jquery';
88
-
89
- import Swiper from 'swiper';
90
-
91
-
92
-
93
- /**
94
-
95
- * @constructor
96
-
97
- */
98
-
99
-
100
-
101
- let swiper = undefined;
102
-
103
- export default class MvSwiper {
104
-
105
- constructor() {
106
-
107
- this.mvSwiperAction();
108
-
109
- }
110
-
111
- mvSwiperAction() {
112
-
113
- swiper = new Swiper('.mv-hero.swiper-container', {
114
-
115
- autoplay: {
116
-
117
- delay: 5000,
118
-
119
- },
120
-
121
- speed: 800,
122
-
123
- spaceBetween: 0,
124
-
125
- initialSlide: 0,
126
-
127
- slidesPerView: 'auto',
128
-
129
- centeredSlides: true,
130
-
131
- loop: true,
132
-
133
- effect: 'fade',
134
-
135
- pagination: {
136
-
137
- el: '.swiper-pagination__mv',
138
-
139
- type: 'bullets',
140
-
141
- clickable: false,
142
-
143
- },
144
-
145
- });
146
-
147
- this.mvTextList();
148
-
149
- }
150
-
151
- mvTextList() {
152
-
153
- const target = document.getElementById('mv-images');
154
-
155
-
156
-
157
- const options = {
158
-
159
- attributes: true,
160
-
161
- attributeFilter: ['class', 'style'],
162
-
163
- childList: true
164
-
165
- };
166
-
167
-
168
-
169
- const observer = new MutationObserver(() => {
170
-
171
- let imageActiveDate = $('.swiper-slide-active').data('slide');
172
-
173
- let textList = $('.text-lists li')
174
-
175
- let textListNum = parseInt(imageActiveDate.slice(-1));
176
-
177
-
178
-
179
- // console.log('画像のデータ', imageActiveDate)
180
-
181
- // console.log('テキストのデータ', textList[textListNum - 1])
182
-
183
-
184
-
185
- switch (imageActiveDate) {
186
-
187
- case '001':
188
-
189
- $(textList[textListNum - 1]).addClass('active')
190
-
191
- $(textList[textListNum + 2]).removeClass('active')
192
-
193
- $(textList[textListNum]).removeClass('active')
194
-
195
- break;
196
-
197
- case '002':
198
-
199
- $(textList[textListNum - 1]).addClass('active')
200
-
201
- $(textList[textListNum - 2]).removeClass('active')
202
-
203
- $(textList[textListNum]).removeClass('active')
204
-
205
- break;
206
-
207
- case '003':
208
-
209
- $(textList[textListNum - 1]).addClass('active')
210
-
211
- $(textList[textListNum - 2]).removeClass('active')
212
-
213
- $(textList[textListNum]).removeClass('active')
214
-
215
- break;
216
-
217
- case '004':
218
-
219
- $(textList[textListNum - 1]).addClass('active')
220
-
221
- $(textList[textListNum - 2]).removeClass('active')
222
-
223
- $(textList[textListNum - 4]).removeClass('active')
224
-
225
- $(textList[textListNum]).removeClass('active')
226
-
227
- break;
228
-
229
- default:
230
-
231
- false
232
-
233
- }
234
-
235
- });
236
-
237
-
238
-
239
- observer.observe(target, options)
240
-
241
- }
242
-
243
- }
244
-
245
-
246
-
247
- ```
248
-
249
- 今回デザイン上スライドさせる対象のdivにまとめることが出来ずにわけております。
250
-
251
- なので下記のようにすることができませんでした。
252
-
253
- ```pug
254
-
255
- .mv-slide.swiper-slide(data-slide="001")
256
-
257
-   img(src=`${sectionImgPath}mv/mv-01.jpg`, alt="")
258
-
259
-   span TEXT-1
260
-
261
- ```
262
-
263
259
 
264
260
 
265
261
  言葉足らずで伝わりにくい箇所もあるかとは思いますが、よろしくお願いします。

1

文章の校閲

2021/05/01 04:08

投稿

atk_3
atk_3

スコア43

test CHANGED
File without changes
test CHANGED
@@ -28,8 +28,230 @@
28
28
 
29
29
 
30
30
 
31
+
32
+
33
+ ### 実際のコード
34
+
35
+
36
+
31
37
  ```pug
32
38
 
39
+ section.mv
40
+
41
+ .mv-content
42
+
43
+ .mv-hero.swiper-container
44
+
45
+ .slide-group.swiper-wrapper#mv-images
46
+
47
+ .mv-slide.swiper-slide(data-slide="001")
48
+
49
+ img(src=`${sectionImgPath}mv/mv-01.jpg`, alt="")
50
+
51
+ .mv-slide.swiper-slide(data-slide="002")
52
+
53
+ img(src=`${sectionImgPath}mv/mv-02.jpg`, alt="")
54
+
55
+ .mv-slide.swiper-slide(data-slide="003")
56
+
57
+ img(src=`${sectionImgPath}mv/mv-03.jpg`, alt="")
58
+
59
+ .mv-slide.swiper-slide(data-slide="004")
60
+
61
+ img(src=`${sectionImgPath}mv/mv-04.jpg`, alt="")
62
+
63
+
64
+
65
+ <!-- Add Pagination -->
66
+
67
+ .swiper-pagination__mv
68
+
69
+
70
+
71
+ .slide-group__text
72
+
73
+ ul.text-lists#text-lists
74
+
75
+ li.active(data-slide="001") TEXT-1
76
+
77
+ li(data-slide="002") TEXT-2
78
+
79
+ li(data-slide="003") TEXT-3
80
+
81
+ li(data-slide="004") TEXT-4
82
+
83
+ ```
84
+
85
+ ```javascript
86
+
87
+ import $ from 'jquery';
88
+
89
+ import Swiper from 'swiper';
90
+
91
+
92
+
93
+ /**
94
+
95
+ * @constructor
96
+
97
+ */
98
+
99
+
100
+
101
+ let swiper = undefined;
102
+
103
+ export default class MvSwiper {
104
+
105
+ constructor() {
106
+
107
+ this.mvSwiperAction();
108
+
109
+ }
110
+
111
+ mvSwiperAction() {
112
+
113
+ swiper = new Swiper('.mv-hero.swiper-container', {
114
+
115
+ autoplay: {
116
+
117
+ delay: 5000,
118
+
119
+ },
120
+
121
+ speed: 800,
122
+
123
+ spaceBetween: 0,
124
+
125
+ initialSlide: 0,
126
+
127
+ slidesPerView: 'auto',
128
+
129
+ centeredSlides: true,
130
+
131
+ loop: true,
132
+
133
+ effect: 'fade',
134
+
135
+ pagination: {
136
+
137
+ el: '.swiper-pagination__mv',
138
+
139
+ type: 'bullets',
140
+
141
+ clickable: false,
142
+
143
+ },
144
+
145
+ });
146
+
147
+ this.mvTextList();
148
+
149
+ }
150
+
151
+ mvTextList() {
152
+
153
+ const target = document.getElementById('mv-images');
154
+
155
+
156
+
157
+ const options = {
158
+
159
+ attributes: true,
160
+
161
+ attributeFilter: ['class', 'style'],
162
+
163
+ childList: true
164
+
165
+ };
166
+
167
+
168
+
169
+ const observer = new MutationObserver(() => {
170
+
171
+ let imageActiveDate = $('.swiper-slide-active').data('slide');
172
+
173
+ let textList = $('.text-lists li')
174
+
175
+ let textListNum = parseInt(imageActiveDate.slice(-1));
176
+
177
+
178
+
179
+ // console.log('画像のデータ', imageActiveDate)
180
+
181
+ // console.log('テキストのデータ', textList[textListNum - 1])
182
+
183
+
184
+
185
+ switch (imageActiveDate) {
186
+
187
+ case '001':
188
+
189
+ $(textList[textListNum - 1]).addClass('active')
190
+
191
+ $(textList[textListNum + 2]).removeClass('active')
192
+
193
+ $(textList[textListNum]).removeClass('active')
194
+
195
+ break;
196
+
197
+ case '002':
198
+
199
+ $(textList[textListNum - 1]).addClass('active')
200
+
201
+ $(textList[textListNum - 2]).removeClass('active')
202
+
203
+ $(textList[textListNum]).removeClass('active')
204
+
205
+ break;
206
+
207
+ case '003':
208
+
209
+ $(textList[textListNum - 1]).addClass('active')
210
+
211
+ $(textList[textListNum - 2]).removeClass('active')
212
+
213
+ $(textList[textListNum]).removeClass('active')
214
+
215
+ break;
216
+
217
+ case '004':
218
+
219
+ $(textList[textListNum - 1]).addClass('active')
220
+
221
+ $(textList[textListNum - 2]).removeClass('active')
222
+
223
+ $(textList[textListNum - 4]).removeClass('active')
224
+
225
+ $(textList[textListNum]).removeClass('active')
226
+
227
+ break;
228
+
229
+ default:
230
+
231
+ false
232
+
233
+ }
234
+
235
+ });
236
+
237
+
238
+
239
+ observer.observe(target, options)
240
+
241
+ }
242
+
243
+ }
244
+
245
+
246
+
247
+ ```
248
+
249
+ 今回デザイン上スライドさせる対象のdivにまとめることが出来ずにわけております。
250
+
251
+ なので下記のようにすることができませんでした。
252
+
253
+ ```pug
254
+
33
255
  .mv-slide.swiper-slide(data-slide="001")
34
256
 
35
257
    img(src=`${sectionImgPath}mv/mv-01.jpg`, alt="")
@@ -38,226 +260,6 @@
38
260
 
39
261
  ```
40
262
 
41
- 今回デザイン上スライドさせる対象のdivにまとめることが出来ずにわけております。
42
-
43
-
44
-
45
- ### 実際のコード
46
-
47
-
48
-
49
- ```pug
50
-
51
- section.mv
52
-
53
- .mv-content
54
-
55
- .mv-hero.swiper-container
56
-
57
- .slide-group.swiper-wrapper#mv-images
58
-
59
- .mv-slide.swiper-slide(data-slide="001")
60
-
61
- img(src=`${sectionImgPath}mv/mv-01.jpg`, alt="")
62
-
63
- .mv-slide.swiper-slide(data-slide="002")
64
-
65
- img(src=`${sectionImgPath}mv/mv-02.jpg`, alt="")
66
-
67
- .mv-slide.swiper-slide(data-slide="003")
68
-
69
- img(src=`${sectionImgPath}mv/mv-03.jpg`, alt="")
70
-
71
- .mv-slide.swiper-slide(data-slide="004")
72
-
73
- img(src=`${sectionImgPath}mv/mv-04.jpg`, alt="")
74
-
75
-
76
-
77
- <!-- Add Pagination -->
78
-
79
- .swiper-pagination__mv
80
-
81
-
82
-
83
- .slide-group__text
84
-
85
- ul.text-lists#text-lists
86
-
87
- li.active(data-slide="001") TEXT-1
88
-
89
- li(data-slide="002") TEXT-2
90
-
91
- li(data-slide="003") TEXT-3
92
-
93
- li(data-slide="004") TEXT-4
94
-
95
- ```
96
-
97
- ```javascript
98
-
99
- import $ from 'jquery';
100
-
101
- import Swiper from 'swiper';
102
-
103
-
104
-
105
- /**
106
-
107
- * @constructor
108
-
109
- */
110
-
111
-
112
-
113
- let swiper = undefined;
114
-
115
- export default class MvSwiper {
116
-
117
- constructor() {
118
-
119
- this.mvSwiperAction();
120
-
121
- }
122
-
123
- mvSwiperAction() {
124
-
125
- swiper = new Swiper('.mv-hero.swiper-container', {
126
-
127
- autoplay: {
128
-
129
- delay: 5000,
130
-
131
- },
132
-
133
- speed: 800,
134
-
135
- spaceBetween: 0,
136
-
137
- initialSlide: 0,
138
-
139
- slidesPerView: 'auto',
140
-
141
- centeredSlides: true,
142
-
143
- loop: true,
144
-
145
- effect: 'fade',
146
-
147
- pagination: {
148
-
149
- el: '.swiper-pagination__mv',
150
-
151
- type: 'bullets',
152
-
153
- clickable: false,
154
-
155
- },
156
-
157
- });
158
-
159
- this.mvTextList();
160
-
161
- }
162
-
163
- mvTextList() {
164
-
165
- const target = document.getElementById('mv-images');
166
-
167
-
168
-
169
- const options = {
170
-
171
- attributes: true,
172
-
173
- attributeFilter: ['class', 'style'],
174
-
175
- childList: true
176
-
177
- };
178
-
179
-
180
-
181
- const observer = new MutationObserver(() => {
182
-
183
- let imageActiveDate = $('.swiper-slide-active').data('slide');
184
-
185
- let textList = $('.text-lists li')
186
-
187
- let textListNum = parseInt(imageActiveDate.slice(-1));
188
-
189
-
190
-
191
- // console.log('画像のデータ', imageActiveDate)
192
-
193
- // console.log('テキストのデータ', textList[textListNum - 1])
194
-
195
-
196
-
197
- switch (imageActiveDate) {
198
-
199
- case '001':
200
-
201
- $(textList[textListNum - 1]).addClass('active')
202
-
203
- $(textList[textListNum + 2]).removeClass('active')
204
-
205
- $(textList[textListNum]).removeClass('active')
206
-
207
- break;
208
-
209
- case '002':
210
-
211
- $(textList[textListNum - 1]).addClass('active')
212
-
213
- $(textList[textListNum - 2]).removeClass('active')
214
-
215
- $(textList[textListNum]).removeClass('active')
216
-
217
- break;
218
-
219
- case '003':
220
-
221
- $(textList[textListNum - 1]).addClass('active')
222
-
223
- $(textList[textListNum - 2]).removeClass('active')
224
-
225
- $(textList[textListNum]).removeClass('active')
226
-
227
- break;
228
-
229
- case '004':
230
-
231
- $(textList[textListNum - 1]).addClass('active')
232
-
233
- $(textList[textListNum - 2]).removeClass('active')
234
-
235
- $(textList[textListNum - 4]).removeClass('active')
236
-
237
- $(textList[textListNum]).removeClass('active')
238
-
239
- break;
240
-
241
- default:
242
-
243
- false
244
-
245
- }
246
-
247
- });
248
-
249
-
250
-
251
- observer.observe(target, options)
252
-
253
- }
254
-
255
- }
256
-
257
-
258
-
259
- ```
260
-
261
263
 
262
264
 
263
265
  言葉足らずで伝わりにくい箇所もあるかとは思いますが、よろしくお願いします。