css动画、过渡、变形

    科技2022-07-13  145

    动画 animation 1. 动画帧定义 @keyframes 动画名 { from { width:200px; } to { width:0; } } 2. 动画配置

    animation-name:动画名;

    animation-duration:2s; 一次动画持续得时间

    animation-iternation-count动画重复次数 数字 10 infinite 无限次 animation-direction normaml动画从0% 执行到100% reverse 顺序反转 alternate :from->to/to->from/from->to alternate-reverse:to->from/from->to/to->from(后面俩种不会出现跳帧)

    animation-fill-mode

    forwards 动画结束后元素应用动画最后一帧的样式;动画准备阶段元素在正常文档流

    backwards 动画准备阶段元素应用动画第一帧的样式。动画结束后元素在正常文档流

    both 动画准备节点元素应用动画第一帧的样式,动画结束后元素应用动画最后一帧样式。

    animation-timing-function: ease;动画的速度(默认值。先快后慢) ease-in 先慢后快 ease-out 先快后慢 ease-in-out 先慢后快再慢 linear 匀速 steps(4) animation-play-state: running; paused } 速写 animated: 属性值没有顺序要求 必须写name 和时长(只有一个是播放时长 出现两个时间 第一个为播放时长 第二个为延迟时间)transition 过渡

    transition 是 transition-property属性, transition-duration持续时间,transition- timing-function 时间曲线 , transition-delay延迟的速写形式,分别表示过渡属性,持续时间,时间曲线,过渡延迟

    transform变形 animated 和transitions 区别 : animation是动画效果,先指定好动画过程中的关键帧属性,进行动画的属性 transitions是css中检测指定属性变化进行自动补间动画的属性。自然过渡效果
    Processed: 0.012, SQL: 8