Skip to content

Commit 1fd88fa

Browse files
committed
首页页面开发
1 parent 39ffefe commit 1fd88fa

File tree

3 files changed

+62
-28
lines changed

3 files changed

+62
-28
lines changed

src/main.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ import * as components from 'vuetify/components'
1111
import * as directives from 'vuetify/directives'
1212
import '@mdi/font/css/materialdesignicons.css'
1313
import { aliases, mdi } from 'vuetify/iconsets/mdi'
14+
1415
const vuetify = createVuetify({
1516
components,
1617
directives,

src/views/intro/index.vue

Lines changed: 59 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ const handleScroll = (event: WheelEvent) => {
1515
isAnimating = true
1616
1717
const scrollDirection = event.deltaY > 0 ? 1 : -1
18-
let steps = 4 // 每次滚动切换六张图片
18+
let steps = 5 // 每次滚动切换六张图片
1919
2020
const switchImages = () => {
2121
const newIndex = currentImageIndex.value + scrollDirection
@@ -32,7 +32,7 @@ const handleScroll = (event: WheelEvent) => {
3232
} else {
3333
isAnimating = false
3434
}
35-
}, 5) // 每次切换间隔10毫秒
35+
}, 1) // 每次切换间隔10毫秒
3636
}
3737
3838
switchImages()
@@ -57,7 +57,6 @@ const handleVideoEnded = () => {
5757
onMounted(() => {
5858
preloadImages()
5959
window.addEventListener('wheel', handleScroll, { passive: false })
60-
6160
const videoElement = document.querySelector('.intro-video') as HTMLVideoElement
6261
if (videoElement) {
6362
setTimeout(() => {
@@ -76,38 +75,57 @@ onUnmounted(() => {
7675
})
7776
const titleSlidUpClass = ref("")
7877
const titleSlidUp = (isIntersecting: boolean, entries: IntersectionObserverEntry[], observer: IntersectionObserver) => {
79-
if (isIntersecting) {
80-
titleSlidUpClass.value = "slid-up"
81-
}
82-
else {
83-
titleSlidUpClass.value = ""
84-
}
78+
entries.forEach(entry => {
79+
const element = entry.target as HTMLElement
80+
if (isIntersecting) {
81+
element.classList.add("slid-up")
82+
element.classList.remove("unvisibility")
83+
}
84+
else {
85+
element.classList.add("unvisibility")
86+
element.classList.remove("slid-up")
87+
}
88+
})
8589
}
8690
87-
const feature = {
88-
91+
interface feature{
92+
name: string
93+
desc: string
94+
img: string
8995
}
9096
97+
const features = reactive<feature[]>([
98+
{name: "牛逼", desc: "除了牛逼还是牛逼", img: "/src/assets/img/intro/feature1.jpg"},
99+
{name: "牛逼啊", desc: "除了牛逼啊还是牛逼啊", img: "/src/assets/img/intro/feature2.jpg"},
100+
{name: "真的牛逼啊", desc: "除了真的的牛逼啊还是真的牛逼啊", img: "/src/assets/img/intro/feature3.jpg"}
101+
])
102+
91103
</script>
92104

93105
<template>
94-
<div class="image-container">
106+
<div class="image-container" >
95107
<video src="/src/assets/img/intro/intro.mp4" class="intro-video" :style="fadeOutVideo" muted></video>
96-
<img v-for="(image, index) in images" :src="image" :key="index" class="image-slide" :class="{ active: index === currentImageIndex && !isVideoPlaying }" alt="Slideshow Image" />
108+
<img v-for="(image, index) in images" :src="image" :key="index" class="image-slide" :style=" index === currentImageIndex && !isVideoPlaying ? {visibility: 'visible',opacity : 1} : ''" alt="Slideshow Image" />
97109
</div>
98110

99-
<div class="project-slogan" v-intersect="titleSlidUp" >
100-
<p style="font-size: 50px; margin-bottom: 20px" :class="titleSlidUpClass">ONE TOUCHE ONE WORLD</p>
101-
<p style="width: 40%; margin: 0 auto; font-weight: lighter; animation-duration: 2s; " :class="titleSlidUpClass"> $1.0 billion in capital raised by some of the most prominent investors, Clear Street services hundreds of institutional clients and supports ~$60 billion in customer balances.</p>
102-
</div>
111+
<div class="blue-section">
112+
<div class="project-slogan unvisibility" v-intersect="titleSlidUp" >
113+
<p style="font-size: 50px; margin-bottom: 20px" :class="titleSlidUpClass">ONE TOUCHE ONE WORLD</p>
114+
<p style="width: 40%; margin: 0 auto; font-weight: lighter; animation-duration: 2s; " :class="titleSlidUpClass"> $1.0 billion in capital raised by some of the most prominent investors, Clear Street services hundreds of institutional clients and supports ~$60 billion in customer balances.</p>
115+
</div>
103116

104-
<div class="diver"></div>
105-
106-
<div class="features-container">
107-
<div class="features-box" v-for="index of 3">
117+
<div class="diver"></div>
108118

119+
<div class="features-container" v-intersect="titleSlidUp" >
120+
<div class="features-box" :class="titleSlidUpClass" v-for="(feature, index) in features ">
121+
<p style="font-size: 25px">{{feature.name}}</p>
122+
<div class="feature-img" :style="{ backgroundImage: `url(${feature.img})` }"> </div>
123+
<p>{{feature.desc}}</p>
109124
</div>
125+
</div>
110126
</div>
127+
128+
111129
</template>
112130

113131
<style scoped>
@@ -122,6 +140,10 @@ p, span {
122140
overflow: hidden;
123141
}
124142
143+
.unvisibility{
144+
visibility: hidden;
145+
}
146+
125147
.image-slide {
126148
width: 100%;
127149
height: 100%;
@@ -131,13 +153,12 @@ p, span {
131153
object-fit: cover;
132154
visibility: hidden;
133155
opacity: 0;
134-
transition: opacity 0.2s ease-in-out, visibility 0s 0s;
156+
transition: opacity 0s , visibility 0s 0s;
135157
}
136158
137159
.image-slide.active {
138160
visibility: visible;
139161
opacity: 1;
140-
transition: opacity 0s ease-in-out, visibility 0s 0s;
141162
}
142163
143164
.intro-video {
@@ -153,11 +174,15 @@ p, span {
153174
display: none; /* 隐藏视频 */
154175
}
155176
177+
.blue-section{
178+
background-color: #2e21de;
179+
}
180+
156181
.project-slogan {
157182
height: 20vh;
158183
width: 100%;
159184
text-align: center;
160-
background-color: #2e21de;
185+
161186
transition: opacity 0.5s ease-in-out;
162187
}
163188
.project-slogan p {
@@ -174,8 +199,8 @@ p, span {
174199
.features-container{
175200
background-color: #2e21de;
176201
width: 100%;
177-
height: 40vh;
178-
padding: 0 10vw;
202+
height: 70vh;
203+
padding: 10vh 10vw;
179204
display: flex;
180205
align-items: center;
181206
justify-content: space-between;
@@ -185,6 +210,14 @@ p, span {
185210
height: 100%;
186211
}
187212
213+
.features-container .feature-img{
214+
margin: 10px 0;
215+
background-size: cover;
216+
background-position: 50% 50%;
217+
height: 80%;
218+
width: 100%;
219+
border-radius: 20px;
220+
}
188221
189222
190223
@keyframes slideUp {

src/views/market/list.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<script setup lang="ts">
2-
import marketCard from '@/components/market/MarketCard.vue'
3-
import type {projectData} from "@/type/market/Market.ts";
2+
import marketCard from '../../components/market/MarketCard.vue'
3+
import type {projectData} from "../../type/market/Market.ts";
44
import {reactive, ref, computed, watch} from "vue";
55
import project from "./project.vue";
66
// import {tr} from "vuetify/locale";

0 commit comments

Comments
 (0)