动画以及2D与3D变形

Animation(动画)

思维导图

在这里插入图片描述
区分关键帧周期以及动画周期、动画内属性以及动画外属性

代码例子

在这里插入图片描述

代码
<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=deice-width, initial-scale=1.0">
    <title>animation</title>
    <style>
        * {
            margin: 0;
            padding: 0;
        }

        #wrap {
            position: absolute;
            left: 0;
            right: 0;
            top: 0;
            bottom: 0;
            margin: auto;
            width: 400px;
            height: 400px;
            background: wheat;
            border: 1px solid black;
        }

        .inner {
            margin: 0 auto;
            width: 100px;
            height: 100px;
            background: ghostwhite;
            border-radius: 50%;
            text-align: center;
            line-height: 100px;
            /* 关键帧的名字 */
            animation-name: move;
            /* 一个动画周期的时长 */
            animation-duration: 3s;
            animation-timing-function: ease-in;
            /* 反方向运动 */
            animation-direction: reverse;
            /* 延迟两秒 */
            animation-delay: 2s;
            /* 重复两次 */
            animation-iteration-count: 2;
            /* 元素在动画外的状态 */
            animation-fill-mode: both;
        }

        @keyframes move {
            from {
                transform: translateY(0px);
            }

            to {
                transform: translateY(300px);
            }
        }

        /* 鼠标滑过停止运动 */

        #wrap:hover .inner {
            animation-play-state: paused;
        }
    </style>
</head>

<body>
    <div id="wrap">
        <div class="inner">ball</div>
    </div>
</body>

</html>

2D与3D变形

在这里插入图片描述

  • 1
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值