leafer-ui icon indicating copy to clipboard operation
leafer-ui copied to clipboard

在设置了动画延迟的情况下 能否让元素在等待延迟过程中处于动画的第一帧的状态

Open kekesita opened this issue 4 months ago • 1 comments

示例代码

import {  Leafer, Text } from 'leafer-ui'
import '@leafer-in/animate' // 导入动画插件  

const leafer = new Leafer({ view: window })

const t = new Text({
    x: 300,
    y: 100,
    width: 150,
    height: 100,
    color: '#FEB027',
    text:'测试',
    fontSize:60,
  
    animation: { // 入场动画  
        keyframes: [{ opacity: 0 }, { opacity: 1}],
        duration: 2,
        delay:1,
       join:false,
    },
  
})
leafer.add(t)


理想状态: 创建后就处于第一帧的透明状态 持续1s透明后 开始执行渐显动画 (在css 如果设置了 running的状态 就是这样的表现)

css的配置如下

animation: 1s linear 2s 1 normal both running fade


kekesita avatar Aug 29 '25 10:08 kekesita

收到,谢谢反馈

leaferjs avatar Aug 30 '25 02:08 leaferjs