@@ -4,7 +4,6 @@ import { useRouter } from 'vue-router';
44import { useDark } from ' @vueuse/core' ;
55import { SIcon } from ' @soybeanjs/ui' ;
66import { useI18n } from ' vue-i18n' ;
7- import { Motion } from ' motion-v' ;
87import BackgroundDecoration from ' @/motion/background-decoration.vue' ;
98
109const router = useRouter ();
@@ -37,14 +36,6 @@ const features = computed(() => [
3736 class: ' text-pink-500'
3837 }
3938]);
40-
41- function getDelay(index : number ) {
42- return {
43- delay: index * 0.1 + 0.5 ,
44- duration: 0.5 ,
45- ease: ' easeOut' as const
46- };
47- }
4839 </script >
4940
5041<template >
@@ -55,56 +46,31 @@ function getDelay(index: number) {
5546
5647 <div class =" container mx-auto px-4 relative z-10" >
5748 <div class =" text-center max-w-5xl mx-auto" >
58- <Motion
59- :initial =" { opacity: 0, scale: 0.5 }"
60- :animate =" { opacity: 1, scale: 1 }"
61- :transition =" { duration: 0.8, ease: 'easeOut' }"
62- class =" lg:!mt-4 mt-28 mb-4 inline-block relative z-20"
63- >
64- <Motion :animate =" { y: [0, -20, 0] }" :transition =" { duration: 2, repeat: Infinity, ease: 'easeInOut' }" >
65- <div class =" group relative" >
66- <div
67- class =" absolute inset-0 bg-primary/20 rounded-full blur-3xl opacity-0 group-hover:opacity-100 transition-opacity duration-500"
68- />
69- <img
70- src =" /logo.svg"
71- alt =" Logo"
72- class =" size-28 md:size-36 mx-auto drop-shadow-2xl filter relative z-10 transition-transform duration-300 group-hover:scale-105"
73- />
74- </div >
75- </Motion >
76- </Motion >
49+ <div class =" logo-float group relative z-20 mt-28 mb-4 lg:!mt-4" >
50+ <div
51+ class =" absolute inset-0 bg-primary/20 rounded-full blur-3xl opacity-0 group-hover:opacity-100 transition-opacity duration-500"
52+ />
53+ <img
54+ src =" /logo.svg"
55+ alt =" Logo"
56+ class =" size-28 md:size-36 mx-auto drop-shadow-2xl filter relative z-10 transition-transform duration-300 group-hover:scale-105"
57+ />
58+ </div >
7759
78- <Motion
79- :initial =" { opacity: 0, y: 50 }"
80- :animate =" { opacity: 1, y: 0 }"
81- :transition =" { duration: 0.8, ease: 'easeOut' }"
82- >
60+ <div class =" hero-content" >
8361 <h1
8462 class =" text-4xl md:text-6xl lg:text-7xl font-extrabold tracking-tight mb-8 bg-clip-text text-transparent bg-gradient-to-r from-primary-600 to-primary dark:from-primary dark:to-primary-300"
8563 >
8664 {{ t('components.home.title') }}
8765 </h1 >
88- </Motion >
89-
90- <Motion
91- :initial =" { opacity: 0, y: 30 }"
92- :animate =" { opacity: 1, y: 0 }"
93- :transition =" { duration: 0.8, delay: 0.2, ease: 'easeOut' }"
94- >
9566 <p
9667 class =" text-lg md:text-xl text-gray-600 dark:text-gray-300 mb-12 max-w-3xl mx-auto leading-relaxed font-medium"
9768 >
9869 {{ t('components.home.description') }}
9970 </p >
100- </Motion >
71+ </div >
10172
102- <Motion
103- :initial =" { opacity: 0, scale: 0.9 }"
104- :animate =" { opacity: 1, scale: 1 }"
105- :transition =" { duration: 0.5, delay: 0.4 }"
106- class =" flex flex-wrap gap-6 justify-center mb-24"
107- >
73+ <div class =" flex flex-wrap gap-6 justify-center mb-24" >
10874 <button
10975 class =" group flex-center gap-2 w-45 px-4 py-2 rounded-full text-center bg-primary text-white font-semibold text-lg hover:bg-primary-600 transition-all shadow-lg hover:shadow-primary/30 active:scale-95 flex items-center"
11076 @click =" router.push('/components/button')"
@@ -121,16 +87,14 @@ function getDelay(index: number) {
12187 <SIcon :icon =" isDark ? 'skill-icons:github-light' : 'skill-icons:github-dark'" />
12288 {{ t('components.home.actions.github') }}
12389 </a >
124- </Motion >
90+ </div >
12591
12692 <div class =" grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-6 text-left" >
127- <Motion
93+ <div
12894 v-for =" (feature, index) in features"
12995 :key =" feature.title"
130- :initial =" { opacity: 0, y: 20 }"
131- :animate =" { opacity: 1, y: 0 }"
132- :transition =" getDelay(index)"
133- class =" group bg-white/40 dark:bg-white/5 backdrop-blur-xl p-6 rounded-2xl border border-border shadow-lg shadow-gray-200/20 dark:shadow-none hover:bg-white/60 dark:hover:bg-white/10 hover:border-white/80 dark:hover:border-white/20 hover:-translate-y-1 transition-all duration-300"
96+ :style =" { animationDelay: `${index * 0.1 + 0.5}s` }"
97+ class =" feature-card group bg-white/40 dark:bg-white/5 backdrop-blur-xl p-6 rounded-2xl border border-border shadow-lg shadow-gray-200/20 dark:shadow-none hover:bg-white/60 dark:hover:bg-white/10 hover:border-white/80 dark:hover:border-white/20 hover:-translate-y-1 transition-all duration-300"
13498 >
13599 <div class =" text-3xl mb-4 p-3 rounded-xl bg-gray-50 dark:bg-white/5 w-fit" :class =" feature.class" >
136100 <SIcon :icon =" feature.icon" />
@@ -139,13 +103,63 @@ function getDelay(index: number) {
139103 {{ feature.title }}
140104 </h3 >
141105 <p class =" text-gray-600 dark:text-gray-400 text-sm leading-relaxed" >{{ feature.description }}</p >
142- </Motion >
106+ </div >
143107 </div >
144108 </div >
145109 </div >
146110 </div >
147111</template >
148112
113+ <style scoped>
114+ /* Logo 上下浮动动画 */
115+ @keyframes float {
116+ 0% ,
117+ 100% {
118+ transform : translateY (0 );
119+ }
120+ 50% {
121+ transform : translateY (-20px );
122+ }
123+ }
124+
125+ .logo-float {
126+ animation : float 2s ease-in-out infinite ;
127+ }
128+
129+ /* 标题和描述淡入+向上移动动画 */
130+ @keyframes fadeInUp {
131+ from {
132+ opacity : 0 ;
133+ transform : translateY (50px );
134+ }
135+ to {
136+ opacity : 1 ;
137+ transform : translateY (0 );
138+ }
139+ }
140+
141+ .hero-content {
142+ animation : fadeInUp 0.8s ease-out forwards ;
143+ }
144+
145+ /* 特性卡片淡入+向上移动动画 */
146+ @keyframes fadeInUpCard {
147+ from {
148+ opacity : 0 ;
149+ transform : translateY (20px );
150+ }
151+ to {
152+ opacity : 1 ;
153+ transform : translateY (0 );
154+ }
155+ }
156+
157+ .feature-card {
158+ animation : fadeInUpCard 0.5s ease-out forwards ;
159+ opacity : 0 ;
160+ }
161+ </style >
162+
149163<route lang="yaml">
150164meta :
151165 layout : home
0 commit comments