質問編集履歴

2

コードを追加しました。

2020/08/21 02:49

投稿

TITO_T
TITO_T

スコア2

test CHANGED
File without changes
test CHANGED
@@ -19,3 +19,501 @@
19
19
 
20
20
 
21
21
  原因として考えられるものを教えていただけますと幸いです。
22
+
23
+
24
+
25
+ ```HTML
26
+
27
+ <header class="head-hero" id="top">
28
+
29
+ <span id="trigger"></span>
30
+
31
+ <div class="container">
32
+
33
+ <!-- SVG -->
34
+
35
+ <div class="svg-container" >
36
+
37
+ <svg id="svgVideo" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1440 1080" width="1440px" height="1080px" preserveAspectRatio="xMidYMid slice">
38
+
39
+ <defs>
40
+
41
+ <!-- Mask -->
42
+
43
+ <mask id="mask" x="0" y="0" width="1480" height="1080" >
44
+
45
+ <rect x="0" y="0" width="1480" height="1080" class="svgVideo_rect"/>
46
+
47
+ <text x="37.5%" y="6.1em" class="pc-only">X</text>
48
+
49
+
50
+
51
+ </mask>
52
+
53
+ </defs>
54
+
55
+ <rect x="0" y="0" width="1480" height="1080" class="upper_rect"/>
56
+
57
+ </svg>
58
+
59
+ </div>
60
+
61
+ <div class="video-container">
62
+
63
+ <video id="video" muted="muted" source="mp4" preload="auto" loop="loop"muted playsinline>
64
+
65
+ <source src="./video/r2_sample.mp4" type="video/mp4">
66
+
67
+ </video>
68
+
69
+ </div>
70
+
71
+ </div>
72
+
73
+ </header>
74
+
75
+ ```
76
+
77
+ ```CSS
78
+
79
+ .container {
80
+
81
+ height: 100vh;
82
+
83
+ width: 100%;
84
+
85
+ position: relative;
86
+
87
+ overflow: hidden;
88
+
89
+ }
90
+
91
+
92
+
93
+ .video-container {
94
+
95
+ position: absolute;
96
+
97
+ width: 1480px;
98
+
99
+ height: 810px;
100
+
101
+ }
102
+
103
+
104
+
105
+ .svg-container {
106
+
107
+ font-family: "Hiragino Kaku Gothic ProN","Helvetica Neue", "Helvetica", "Hiragino Sans","Arial", "Yu Gothic", "Meiryo", sans-serif;
108
+
109
+ font-size: 6.1em;
110
+
111
+ letter-spacing: -4px;
112
+
113
+ z-index:1;
114
+
115
+ width: 100%;
116
+
117
+ height: 100%;
118
+
119
+ position: relative;
120
+
121
+ font-weight: bold;
122
+
123
+ top: 0;
124
+
125
+ transition-property:z-index;
126
+
127
+ -webkit-transition-property:z-index;
128
+
129
+ -moz-transition-property:z-index;
130
+
131
+ -o-transition-property:z-index;
132
+
133
+ -ms-transition-property:z-index;
134
+
135
+ opacity:1;
136
+
137
+ }
138
+
139
+ .cover{
140
+
141
+ overflow: hidden;
142
+
143
+ }
144
+
145
+ #svgVideo {
146
+
147
+ width: 100%;
148
+
149
+ height: 100%;
150
+
151
+ overflow: visible;
152
+
153
+ display: block;
154
+
155
+ }
156
+
157
+ #svgVideo text {
158
+
159
+ text-anchor: middle;
160
+
161
+ }
162
+
163
+ #svgVideo mask rect {
164
+
165
+ fill: rgba(255, 255, 255, 0.8);
166
+
167
+ fill: white;
168
+
169
+ -webkit-fill:white;
170
+
171
+ }
172
+
173
+ .upper_rect {
174
+
175
+ fill: white;
176
+
177
+ background-clip: text;
178
+
179
+ -webkit-fill:white;
180
+
181
+ -webkit-mask: url(#mask);
182
+
183
+ -moz-mask: url(#mask);
184
+
185
+ -o-mask: url(#mask);
186
+
187
+ -ms-mask: url(#mask);
188
+
189
+ mask: url(#mask);
190
+
191
+ -webkit-mask-image: url(#mask);
192
+
193
+ -moz-mask-image: url(#mask);
194
+
195
+ -o-mask-image: url(#mask);
196
+
197
+ -ms-mask-image: url(#mask);
198
+
199
+ mask-image: url(#mask);
200
+
201
+ }
202
+
203
+
204
+
205
+ .video-container {
206
+
207
+ position: absolute;
208
+
209
+ top: 0%;
210
+
211
+ left: 0%;
212
+
213
+ z-index: -1;
214
+
215
+ min-height: 100%;
216
+
217
+ min-width: 100%;
218
+
219
+ width: 100vh;
220
+
221
+ height: 230px;
222
+
223
+ /* width: 100%;
224
+
225
+ height: 100vh; */
226
+
227
+ -webkit-transform: matrix(1.2, 0, 0, 1.2, 0, 0);
228
+
229
+ -moz-transform: matrix(1.2, 0, 0, 1.2, 0, 0);
230
+
231
+ -o-transform: matrix(1.2, 0, 0, 1.2, 0, 0);
232
+
233
+ -ms-transform: matrix(1.2, 0, 0, 1.2, 0, 0);
234
+
235
+ transform: matrix(1.2, 0, 0, 1.2, 0, 0);
236
+
237
+
238
+
239
+ }
240
+
241
+
242
+
243
+ video{
244
+
245
+ height: 100vh;
246
+
247
+ min-height: 100vh;
248
+
249
+ min-width: 100vw;
250
+
251
+ width: 130vw;
252
+
253
+ /* position: fixed; */
254
+
255
+ top: 0;
256
+
257
+ left: 0;
258
+
259
+ overflow: hidden;
260
+
261
+ -webkit-transform: matrix(2, 0, 0, 2, 0, 0);
262
+
263
+ -moz-transform: matrix(2, 0, 0, 2, 0, 0);
264
+
265
+ -o-transform: matrix(2, 0, 0, 2, 0, 0);
266
+
267
+ -ms-transform: matrix(2, 0, 0, 2, 0, 0);
268
+
269
+ transform: matrix(2, 0, 0, 2, 0, 0);
270
+
271
+
272
+
273
+ }
274
+
275
+ .pc-only{
276
+
277
+ display: none;
278
+
279
+ }
280
+
281
+ .sp-only{
282
+
283
+ display: inline-block;
284
+
285
+ }
286
+
287
+ .middle-only{
288
+
289
+ display: none;
290
+
291
+ }
292
+
293
+ @media(min-width:550px){
294
+
295
+ .svg-container{
296
+
297
+ font-size: 8.5em;
298
+
299
+ }
300
+
301
+ .video-container{
302
+
303
+ width: 1024px;
304
+
305
+ height: 590px;
306
+
307
+ }
308
+
309
+ video{
310
+
311
+ height: 100vh;
312
+
313
+ width: 110vw;
314
+
315
+ min-height: 100vh;
316
+
317
+ -webkit-transform: matrix(1.3, 0, 0, 1.3, 0, 0)!important;
318
+
319
+ -moz-transform: matrix(1.3, 0, 0, 1.3, 0, 0)!important;
320
+
321
+ -o-transform: matrix(1.3, 0, 0, 1.3, 0, 0)!important;
322
+
323
+ -ms-transform: matrix(1.3, 0, 0, 1.3, 0, 0)!important;
324
+
325
+ transform: matrix(1.3, 0, 0, 1.3, 0, 0)!important;
326
+
327
+ /* transform: translate(0%,15%); */
328
+
329
+ }
330
+
331
+ .pc-only{
332
+
333
+ display: none;
334
+
335
+ }
336
+
337
+ .sp-only{
338
+
339
+ display: none;
340
+
341
+ }
342
+
343
+ .middle-only{
344
+
345
+ display: inline-block;
346
+
347
+ }
348
+
349
+ }
350
+
351
+ @media(min-width:1025px){
352
+
353
+ .svg-container{
354
+
355
+ font-size: 9.2em!important;
356
+
357
+ }
358
+
359
+ .video-container{
360
+
361
+ width: 1440px!important;
362
+
363
+ height: 810px!important;
364
+
365
+ -webkit-transform: matrix(1, 0, 0, 1, 0, 0)!important;
366
+
367
+ -moz-transform: matrix(1, 0, 0, 1, 0, 0)!important;
368
+
369
+ -o-transform: matrix(1, 0, 0, 1, 0, 0)!important;
370
+
371
+ -ms-transform: matrix(1, 0, 0, 1, 0, 0)!important;
372
+
373
+ transform: matrix(1, 0, 0, 1, 0, 0)!important;
374
+
375
+
376
+
377
+ }
378
+
379
+ video{
380
+
381
+ height: 100vh!important;
382
+
383
+ width: 100vw!important;
384
+
385
+ min-height: 100%!important;
386
+
387
+ min-width: 100vw!important;
388
+
389
+ transform: matrix(1.4, 0, 0, 1.4, 0, 0)!important;
390
+
391
+ -webkit-transform: matrix(1.4, 0, 0, 1.4, 0, 0)!important;
392
+
393
+ -moz-transform: matrix(1.4, 0, 0, 1.4, 0, 0)!important;
394
+
395
+ -o-transform: matrix(1.4, 0, 0, 1.4, 0, 0)!important;
396
+
397
+ -ms-transform: matrix(1.4, 0, 0, 1.4, 0, 0)!important;
398
+
399
+
400
+
401
+ /* transform: translate(0%,15%); */
402
+
403
+ }
404
+
405
+ .pc-only{
406
+
407
+ display: block!important;
408
+
409
+ }
410
+
411
+ .middle-only{
412
+
413
+ display: none!important;
414
+
415
+ }
416
+
417
+ }
418
+
419
+
420
+
421
+ ```
422
+
423
+ ```JS
424
+
425
+ // Greensock
426
+
427
+ var tl = new TimelineMax();
428
+
429
+
430
+
431
+ tl.add(
432
+
433
+ TweenMax.to('.video-container', 1, { scale: 1.5,opacity:1, transformOrigin: "50%, 50%", ease: Power2.easeInOut }),
434
+
435
+
436
+
437
+ )
438
+
439
+
440
+
441
+
442
+
443
+ tl.add(
444
+
445
+ TweenMax.to(".svg-container", 1, {scale: 40,zIndex:-1, ease:Power2.easeIn}),
446
+
447
+ "-=1"
448
+
449
+ )
450
+
451
+
452
+
453
+ // ScrollMagic
454
+
455
+ var controller = new ScrollMagic.Controller();
456
+
457
+
458
+
459
+ // container pin
460
+
461
+ var startpin = new ScrollMagic.Scene({
462
+
463
+ duration: 800
464
+
465
+ })
466
+
467
+ .setPin("#top")
468
+
469
+ .addTo(controller);
470
+
471
+
472
+
473
+ // tween
474
+
475
+ new ScrollMagic.Scene({
476
+
477
+ duration: 550
478
+
479
+ })
480
+
481
+ .setTween(tl)
482
+
483
+ .addTo(controller);
484
+
485
+
486
+
487
+
488
+
489
+ window.addEventListener('load', function(){
490
+
491
+
492
+
493
+ //1000ミリ秒(1秒)毎に関数「showNowDate()」を呼び出す
494
+
495
+ setInterval("clientWidth()", 1000);
496
+
497
+ });
498
+
499
+ function clientWidth(){
500
+
501
+ let client_w = window.pageYOffset;
502
+
503
+ if(client_w > 400){
504
+
505
+ $('video').get(0).play();
506
+
507
+ }
508
+
509
+ else {
510
+
511
+ $('video').get(0).pause();
512
+
513
+ }
514
+
515
+ }
516
+
517
+
518
+
519
+ ```

1

一部ついき

2020/08/21 02:49

投稿

TITO_T
TITO_T

スコア2

test CHANGED
File without changes
test CHANGED
File without changes