feat: 首页动画调整

This commit is contained in:
duanshuwen
2025-11-11 21:40:14 +08:00
parent a3087c09a8
commit 5cb3a903ff
4 changed files with 43 additions and 16 deletions

View File

@@ -5,13 +5,10 @@
<!-- 隐藏 -->
<view class="flex-full h-full flex flex-items-center flex-justify-center">
<!-- ChatTopWelcome不在可视区显示并添加动画在可视区隐藏 -->
<image
<view
v-show="show"
class="w-32 h-32"
:class="{ 'image-animated': show }"
:src="logoImageUrl"
mode="aspectFit"
/>
:class="['ip w-32 h-32', { 'image-animated': show }]"
></view>
<text
v-show="show"
class="font-size-14 font-500 color-171717 ml-10"

View File

@@ -1,6 +1,13 @@
.ip {
background-image: url("https://oss.nianxx.cn/mp/static/version_101/dh/dh_small.png");
background-repeat: no-repeat;
background-size: 32px auto;
background-position: 0 0;
}
// 图片从0%到100%动画
.image-animated {
animation: logo-scale 0.3s ease-in-out;
animation: logo-scale 0.3s ease-in-out, sprite-play 2s steps(117) infinite;
}
@keyframes logo-scale {
@@ -12,6 +19,17 @@
}
}
@keyframes sprite-play {
0% {
background-position: 0 0;
}
100% {
/* 117 帧 × 每帧高度约 32px终点应为 -(117-1)*32 = -5421px */
background-position: 0 -3802px;
}
}
// 文字从0%到100%动画,从左到右
.text-animated {
animation: text-fade-in 0.3s ease-in-out;

View File

@@ -1,14 +1,11 @@
v
<template>
<view class="welcome-content border-box p-12">
<view class="wrap rounded-20">
<view
class="flex flex-items-center flex-justify-between border-box pl-12 pr-12"
>
<image
class="ip relative"
:src="initPageImages?.logoImageUrl"
mode="aspectFit"
/>
<view class="ip"></view>
<view
class="welcome-text font-size-14 font-500 font-family-misans-vf color-171717 line-height-24"
>

View File

@@ -3,8 +3,23 @@
}
.ip {
flex: 0 0 123px;
width: 123px;
height: 166px;
margin-top: -20px;
flex: 0 0 158px;
width: 158px;
height: 134px;
background-image: url("https://oss.nianxx.cn/mp/static/version_101/dh/dh.png");
background-repeat: no-repeat;
background-size: 158px auto;
background-position: 0 0;
animation: sprite-play 2s steps(40) infinite;
}
@keyframes sprite-play {
0% {
background-position: 0 0;
}
100% {
/* 40 帧 × 每帧高度约 139px终点应为 -(40-1)*139 = -5421px */
background-position: 0 -5424px;
}
}