Skip to content

Commit 71b1ec2

Browse files
committed
首页开发
1 parent 9e87836 commit 71b1ec2

File tree

3 files changed

+121
-11
lines changed

3 files changed

+121
-11
lines changed
1.9 MB
Binary file not shown.
437 KB
Binary file not shown.

src/views/intro/index.vue

Lines changed: 121 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,6 @@ const switchPicture = function (event: WheelEvent) {
3737
isAnimating = false
3838
return
3939
}else{
40-
console.log('阻止滚动')
4140
event.preventDefault()
4241
}
4342
currentImageIndex.value = newIndex
@@ -70,6 +69,7 @@ const section2VideoStyle = reactive({
7069
})
7170
const visibilitySection2Video = ref(false)
7271
const videoTitleIntersect = (isIntersecting: boolean, entries: IntersectionObserverEntry[], observer: IntersectionObserver) => {
72+
videoTitleDisplay.value = isIntersecting
7373
entries.forEach(entry => {
7474
const element = entry.target as HTMLElement
7575
if (isIntersecting) {
@@ -107,10 +107,9 @@ const videoTitleScroll = function (event: WheelEvent){
107107
return
108108
}
109109
// 当视频文字从下向上滑动到中间时,蓝色遮罩逐渐消失
110-
111110
const rect = videoTitle.value.getBoundingClientRect();
112111
if(scrollDirection === 1 && rect.top < twentyVhInPixels * 0.3){
113-
whiteMaskStyle.opacity = Math.min(whiteMaskStyle.opacity + 0.3, 1)
112+
whiteMaskStyle.opacity = Math.min(whiteMaskStyle.opacity + 0.1, 1)
114113
// 兜底,当视频标题完全消失时,白色遮罩完全出现
115114
if(rect.top < twentyVhInPixels){
116115
whiteMaskStyle.opacity = 1
@@ -119,24 +118,42 @@ const videoTitleScroll = function (event: WheelEvent){
119118
section3Style.zIndex = 1
120119
}
121120
}
121+
122122
if(scrollDirection === -1 && rect.top > twentyVhInPixels * 0.1){
123-
whiteMaskStyle.opacity = Math.max(whiteMaskStyle.opacity - 0.3, 0)
123+
whiteMaskStyle.opacity = Math.max(whiteMaskStyle.opacity - 0.1, 0)
124124
}
125125
126-
127126
if(scrollDirection === 1){
128127
blueMaskStyle.opacity = Math.max(blueMaskStyle.opacity - 0.2, 0)
129128
}
130-
131-
if(scrollDirection === -1 && whiteMaskStyle.opacity <= 0){
129+
if(scrollDirection === -1 && rect.top > twentyVhInPixels * 0.5){
132130
blueMaskStyle.opacity = Math.min(blueMaskStyle.opacity + 0.2, 1)
133131
if(blueMaskStyle.opacity === 1){
134132
section3Style.zIndex = 0
135133
}
136134
}
137135
}
138136
137+
const section3VideoBox1Style = reactive({
138+
transform: 'scale(1)',
139+
opacity: 1
140+
});
141+
142+
const section3VideoBox2Style = reactive({
143+
transform: 'scale(1)',
144+
opacity: 1
145+
});
146+
147+
148+
const section3BoxFadeout = function (event: WheelEvent){
149+
const videoElement1 = document.querySelector('.section3-video1') as HTMLVideoElement
150+
const videoElement2 = document.querySelector('.section3-video2') as HTMLVideoElement;
151+
const rect1 = videoElement1.getBoundingClientRect()
152+
const rect2 = videoElement2.getBoundingClientRect()
153+
if(rect1.top < twentyVhInPixels){
139154
155+
}
156+
}
140157
141158
const preloadImages = () => {
142159
images.value.forEach((src) => {
@@ -152,6 +169,18 @@ const fadeOutVideo = reactive({
152169
const handleVideoEnded = () => {
153170
isVideoPlaying.value = false
154171
fadeOutVideo.opacity = 0
172+
}
173+
174+
const section3AutoPlay = (isIntersecting: boolean, entries: IntersectionObserverEntry[], observer: IntersectionObserver) => {
175+
const videoElement1 = document.querySelector('.section3-video1') as HTMLVideoElement
176+
videoElement1.play()
177+
const videoElement2 = document.querySelector('.section3-video2') as HTMLVideoElement
178+
videoElement2.play()
179+
180+
181+
182+
183+
155184
}
156185
157186
onMounted(() => {
@@ -234,13 +263,44 @@ const features = reactive<feature[]>([
234263
<div class="video-title" ref="videoTitle" v-intersect="videoTitleIntersect">
235264
<p>这是一个非常牛逼的项目</p>
236265
</div>
266+
237267
</div>
238268
</div>
239269

240270
<div class="section3" :style="whiteMaskStyle" >
241-
<p style="font-size: 50px; letter-spacing: 10px">
242-
Designed for today’s complex, <br/>global market.
243-
</p>
271+
<h1 style="font-size: 70px; font-weight: bolder; letter-spacing: 10px;text-align: center; margin-bottom: 10vh; color: #5549ed" v-intersect="titleSlidUp">
272+
Designed for <br/> today’s complex, <br/>global market.
273+
</h1>
274+
275+
<div class="section3-box" v-intersect="section3AutoPlay" >
276+
<video class="section3-video1" src="/img/intro/section3video1.mp4" muted loop></video>
277+
<div class="section3-box-title">
278+
<p>Built for <br/> Multi-Asset Clearing</p>
279+
<div class="section3-box-bottom">
280+
<span>One platform for all asset classes</span>
281+
<span>Data available in real-time</span>
282+
<span>Information held in a single system</span>
283+
</div>
284+
</div>
285+
</div>
286+
287+
<div class="section3-box" v-intersect="section3AutoPlay" >
288+
<video class="section3-video2" src="/img/intro/section3video2.mp4" muted loop></video>
289+
<div class="section3-box-title">
290+
<p>Built for <br/> Multi-Asset Clearing</p>
291+
<div class="section3-box-bottom">
292+
<span>One platform for all asset classes</span>
293+
<span>Data available in real-time</span>
294+
<span>Information held in a single system</span>
295+
</div>
296+
</div>
297+
</div>
298+
</div>
299+
300+
<div class="section4">
301+
<div>
302+
303+
</div>
244304
</div>
245305
</template>
246306

@@ -400,10 +460,60 @@ p, span {
400460
.section3{
401461
position: relative;
402462
z-index: 1;
403-
height: 100vh;
404463
width: 100vw;
464+
padding: 0 10vw;
465+
}
466+
467+
.section3-box{
468+
position: relative;
469+
margin: 0 auto;
470+
margin-bottom: 15vh;
471+
width: 55vw;
472+
height: 48vh;
473+
background-color: white;
474+
border-radius: 60px;
475+
overflow: hidden;
476+
}
477+
478+
.section3-box video{
479+
width: 100%;
480+
height: 100%;
481+
object-fit: cover;
405482
}
406483
484+
.section3-box .section3-box-title{
485+
z-index: 2;
486+
position: absolute;
487+
left: 20px;
488+
bottom: 50px;
489+
width: 60%;
490+
491+
}
492+
.section3-box .section3-box-title p{
493+
color: #2e21de;
494+
font-size: 40px;
495+
font-weight: bolder;
496+
}
497+
498+
.section3-box .section3-box-bottom{
499+
display: flex;
500+
align-items: center;
501+
502+
}
503+
.section3-box .section3-box-bottom span{
504+
padding: 0 5px;
505+
width: 180px;
506+
font-size: 14px;
507+
border-left: 1px solid rgba(0,0,0,0.4);
508+
color: #2e21de;
509+
font-weight: bolder;
510+
511+
}
512+
513+
.section4{
514+
height: 100vh;
515+
width: 100vw;
516+
}
407517
@keyframes slideUp {
408518
0% { opacity: 0; transform: translateY(5vh); }
409519
100% { opacity: 1; transform: translateY(0); }

0 commit comments

Comments
 (0)