質問するログイン新規登録

質問編集履歴

2

コードを追加しました。

2020/08/21 02:49

投稿

TITO_T
TITO_T

スコア2

title CHANGED
File without changes
body CHANGED
@@ -8,4 +8,253 @@
8
8
  ちなみに、検証ツールでみましたところ要素自体は存在しています。
9
9
  ただなぜかopacityを調整してもdisplayをいじってみても画面に表示されません。
10
10
 
11
- 原因として考えられるものを教えていただけますと幸いです。
11
+ 原因として考えられるものを教えていただけますと幸いです。
12
+
13
+ ```HTML
14
+ <header class="head-hero" id="top">
15
+ <span id="trigger"></span>
16
+ <div class="container">
17
+ <!-- SVG -->
18
+ <div class="svg-container" >
19
+ <svg id="svgVideo" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1440 1080" width="1440px" height="1080px" preserveAspectRatio="xMidYMid slice">
20
+ <defs>
21
+ <!-- Mask -->
22
+ <mask id="mask" x="0" y="0" width="1480" height="1080" >
23
+ <rect x="0" y="0" width="1480" height="1080" class="svgVideo_rect"/>
24
+ <text x="37.5%" y="6.1em" class="pc-only">X</text>
25
+
26
+ </mask>
27
+ </defs>
28
+ <rect x="0" y="0" width="1480" height="1080" class="upper_rect"/>
29
+ </svg>
30
+ </div>
31
+ <div class="video-container">
32
+ <video id="video" muted="muted" source="mp4" preload="auto" loop="loop"muted playsinline>
33
+ <source src="./video/r2_sample.mp4" type="video/mp4">
34
+ </video>
35
+ </div>
36
+ </div>
37
+ </header>
38
+ ```
39
+ ```CSS
40
+ .container {
41
+ height: 100vh;
42
+ width: 100%;
43
+ position: relative;
44
+ overflow: hidden;
45
+ }
46
+
47
+ .video-container {
48
+ position: absolute;
49
+ width: 1480px;
50
+ height: 810px;
51
+ }
52
+
53
+ .svg-container {
54
+ font-family: "Hiragino Kaku Gothic ProN","Helvetica Neue", "Helvetica", "Hiragino Sans","Arial", "Yu Gothic", "Meiryo", sans-serif;
55
+ font-size: 6.1em;
56
+ letter-spacing: -4px;
57
+ z-index:1;
58
+ width: 100%;
59
+ height: 100%;
60
+ position: relative;
61
+ font-weight: bold;
62
+ top: 0;
63
+ transition-property:z-index;
64
+ -webkit-transition-property:z-index;
65
+ -moz-transition-property:z-index;
66
+ -o-transition-property:z-index;
67
+ -ms-transition-property:z-index;
68
+ opacity:1;
69
+ }
70
+ .cover{
71
+ overflow: hidden;
72
+ }
73
+ #svgVideo {
74
+ width: 100%;
75
+ height: 100%;
76
+ overflow: visible;
77
+ display: block;
78
+ }
79
+ #svgVideo text {
80
+ text-anchor: middle;
81
+ }
82
+ #svgVideo mask rect {
83
+ fill: rgba(255, 255, 255, 0.8);
84
+ fill: white;
85
+ -webkit-fill:white;
86
+ }
87
+ .upper_rect {
88
+ fill: white;
89
+ background-clip: text;
90
+ -webkit-fill:white;
91
+ -webkit-mask: url(#mask);
92
+ -moz-mask: url(#mask);
93
+ -o-mask: url(#mask);
94
+ -ms-mask: url(#mask);
95
+ mask: url(#mask);
96
+ -webkit-mask-image: url(#mask);
97
+ -moz-mask-image: url(#mask);
98
+ -o-mask-image: url(#mask);
99
+ -ms-mask-image: url(#mask);
100
+ mask-image: url(#mask);
101
+ }
102
+
103
+ .video-container {
104
+ position: absolute;
105
+ top: 0%;
106
+ left: 0%;
107
+ z-index: -1;
108
+ min-height: 100%;
109
+ min-width: 100%;
110
+ width: 100vh;
111
+ height: 230px;
112
+ /* width: 100%;
113
+ height: 100vh; */
114
+ -webkit-transform: matrix(1.2, 0, 0, 1.2, 0, 0);
115
+ -moz-transform: matrix(1.2, 0, 0, 1.2, 0, 0);
116
+ -o-transform: matrix(1.2, 0, 0, 1.2, 0, 0);
117
+ -ms-transform: matrix(1.2, 0, 0, 1.2, 0, 0);
118
+ transform: matrix(1.2, 0, 0, 1.2, 0, 0);
119
+
120
+ }
121
+
122
+ video{
123
+ height: 100vh;
124
+ min-height: 100vh;
125
+ min-width: 100vw;
126
+ width: 130vw;
127
+ /* position: fixed; */
128
+ top: 0;
129
+ left: 0;
130
+ overflow: hidden;
131
+ -webkit-transform: matrix(2, 0, 0, 2, 0, 0);
132
+ -moz-transform: matrix(2, 0, 0, 2, 0, 0);
133
+ -o-transform: matrix(2, 0, 0, 2, 0, 0);
134
+ -ms-transform: matrix(2, 0, 0, 2, 0, 0);
135
+ transform: matrix(2, 0, 0, 2, 0, 0);
136
+
137
+ }
138
+ .pc-only{
139
+ display: none;
140
+ }
141
+ .sp-only{
142
+ display: inline-block;
143
+ }
144
+ .middle-only{
145
+ display: none;
146
+ }
147
+ @media(min-width:550px){
148
+ .svg-container{
149
+ font-size: 8.5em;
150
+ }
151
+ .video-container{
152
+ width: 1024px;
153
+ height: 590px;
154
+ }
155
+ video{
156
+ height: 100vh;
157
+ width: 110vw;
158
+ min-height: 100vh;
159
+ -webkit-transform: matrix(1.3, 0, 0, 1.3, 0, 0)!important;
160
+ -moz-transform: matrix(1.3, 0, 0, 1.3, 0, 0)!important;
161
+ -o-transform: matrix(1.3, 0, 0, 1.3, 0, 0)!important;
162
+ -ms-transform: matrix(1.3, 0, 0, 1.3, 0, 0)!important;
163
+ transform: matrix(1.3, 0, 0, 1.3, 0, 0)!important;
164
+ /* transform: translate(0%,15%); */
165
+ }
166
+ .pc-only{
167
+ display: none;
168
+ }
169
+ .sp-only{
170
+ display: none;
171
+ }
172
+ .middle-only{
173
+ display: inline-block;
174
+ }
175
+ }
176
+ @media(min-width:1025px){
177
+ .svg-container{
178
+ font-size: 9.2em!important;
179
+ }
180
+ .video-container{
181
+ width: 1440px!important;
182
+ height: 810px!important;
183
+ -webkit-transform: matrix(1, 0, 0, 1, 0, 0)!important;
184
+ -moz-transform: matrix(1, 0, 0, 1, 0, 0)!important;
185
+ -o-transform: matrix(1, 0, 0, 1, 0, 0)!important;
186
+ -ms-transform: matrix(1, 0, 0, 1, 0, 0)!important;
187
+ transform: matrix(1, 0, 0, 1, 0, 0)!important;
188
+
189
+ }
190
+ video{
191
+ height: 100vh!important;
192
+ width: 100vw!important;
193
+ min-height: 100%!important;
194
+ min-width: 100vw!important;
195
+ transform: matrix(1.4, 0, 0, 1.4, 0, 0)!important;
196
+ -webkit-transform: matrix(1.4, 0, 0, 1.4, 0, 0)!important;
197
+ -moz-transform: matrix(1.4, 0, 0, 1.4, 0, 0)!important;
198
+ -o-transform: matrix(1.4, 0, 0, 1.4, 0, 0)!important;
199
+ -ms-transform: matrix(1.4, 0, 0, 1.4, 0, 0)!important;
200
+
201
+ /* transform: translate(0%,15%); */
202
+ }
203
+ .pc-only{
204
+ display: block!important;
205
+ }
206
+ .middle-only{
207
+ display: none!important;
208
+ }
209
+ }
210
+
211
+ ```
212
+ ```JS
213
+ // Greensock
214
+ var tl = new TimelineMax();
215
+
216
+ tl.add(
217
+ TweenMax.to('.video-container', 1, { scale: 1.5,opacity:1, transformOrigin: "50%, 50%", ease: Power2.easeInOut }),
218
+
219
+ )
220
+
221
+
222
+ tl.add(
223
+ TweenMax.to(".svg-container", 1, {scale: 40,zIndex:-1, ease:Power2.easeIn}),
224
+ "-=1"
225
+ )
226
+
227
+ // ScrollMagic
228
+ var controller = new ScrollMagic.Controller();
229
+
230
+ // container pin
231
+ var startpin = new ScrollMagic.Scene({
232
+ duration: 800
233
+ })
234
+ .setPin("#top")
235
+ .addTo(controller);
236
+
237
+ // tween
238
+ new ScrollMagic.Scene({
239
+ duration: 550
240
+ })
241
+ .setTween(tl)
242
+ .addTo(controller);
243
+
244
+
245
+ window.addEventListener('load', function(){
246
+
247
+ //1000ミリ秒(1秒)毎に関数「showNowDate()」を呼び出す
248
+ setInterval("clientWidth()", 1000);
249
+ });
250
+ function clientWidth(){
251
+ let client_w = window.pageYOffset;
252
+ if(client_w > 400){
253
+ $('video').get(0).play();
254
+ }
255
+ else {
256
+ $('video').get(0).pause();
257
+ }
258
+ }
259
+
260
+ ```

1

一部ついき

2020/08/21 02:49

投稿

TITO_T
TITO_T

スコア2

title CHANGED
File without changes
body CHANGED
File without changes