diff --git a/src/App.vue b/src/App.vue index 87cb395..318a5cb 100644 --- a/src/App.vue +++ b/src/App.vue @@ -194,6 +194,9 @@ onUnmounted(() => { animation: floatFlower 25s ease-in-out infinite; animation-delay: var(--delay); opacity: 0.5; + transform-origin: center; + backface-visibility: hidden; + perspective: 1000px; } .flower-center { @@ -205,6 +208,7 @@ onUnmounted(() => { top: 50%; left: 50%; transform: translate(-50%, -50%); + animation: pulse 2s ease-in-out infinite; } .flower-petal { @@ -216,13 +220,65 @@ onUnmounted(() => { top: 50%; left: 50%; transform-origin: 0 0; + animation: petalWave 3s ease-in-out infinite; } -.flower-petal:nth-child(1) { transform: rotate(0deg) translate(10px, 0); } -.flower-petal:nth-child(2) { transform: rotate(72deg) translate(10px, 0); } -.flower-petal:nth-child(3) { transform: rotate(144deg) translate(10px, 0); } -.flower-petal:nth-child(4) { transform: rotate(216deg) translate(10px, 0); } -.flower-petal:nth-child(5) { transform: rotate(288deg) translate(10px, 0); } +.flower-petal:nth-child(1) { + transform: rotate(0deg) translate(10px, 0); + animation-delay: 0s; +} +.flower-petal:nth-child(2) { + transform: rotate(72deg) translate(10px, 0); + animation-delay: 0.2s; +} +.flower-petal:nth-child(3) { + transform: rotate(144deg) translate(10px, 0); + animation-delay: 0.4s; +} +.flower-petal:nth-child(4) { + transform: rotate(216deg) translate(10px, 0); + animation-delay: 0.6s; +} +.flower-petal:nth-child(5) { + transform: rotate(288deg) translate(10px, 0); + animation-delay: 0.8s; +} + +@keyframes floatFlower { + 0% { + transform: translate(0, -50px) rotate(0deg) scale(1); + } + 25% { + transform: translate(calc(100vw * 0.25), calc(100vh * 0.25)) rotate(180deg) scale(1.1); + } + 50% { + transform: translate(calc(100vw * 0.5), calc(100vh * 0.5)) rotate(360deg) scale(1); + } + 75% { + transform: translate(calc(100vw * 0.75), calc(100vh * 0.75)) rotate(540deg) scale(0.9); + } + 100% { + transform: translate(100vw, -50px) rotate(720deg) scale(1); + } +} + +@keyframes petalWave { + 0%, 100% { + transform: rotate(var(--rotation)) translate(10px, 0) scale(1); + } + 50% { + transform: rotate(var(--rotation)) translate(10px, 0) scale(1.1); + } +} + +@keyframes pulse { + 0%, 100% { + transform: translate(-50%, -50%) scale(1); + } + 50% { + transform: translate(-50%, -50%) scale(1.2); + } +} /* 云朵样式 */ .floating-cloud { @@ -281,18 +337,6 @@ onUnmounted(() => { } /* 动画关键帧 */ -@keyframes floatFlower { - 0% { - transform: translate(0, -50px) rotate(0deg); - } - 50% { - transform: translate(calc(100vw * 0.5), calc(100vh + 50px)) rotate(360deg); - } - 100% { - transform: translate(100vw, -50px) rotate(720deg); - } -} - @keyframes floatCloud { 0% { transform: translateX(-150px) translateY(0); @@ -431,6 +475,19 @@ onUnmounted(() => { .rainbow-glow { animation-duration: 20s; } + + .floating-flower { + animation-duration: 20s; + animation-timing-function: linear; + } + + .flower-petal { + animation-duration: 2s; + } + + .flower-center { + animation-duration: 1.5s; + } } .floating-element,