zoukankan      html  css  js  c++  java
  • css3 贝塞尔曲线理解

    <!DOCTYPE html>
    <html lang="en">
    <head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
    * {
    margin: 0;
    padding: 0;
    }
    body {
    100vw;
    height: 100vh;
    }
    ul {
    display: grid;
    list-style: none;
    grid-template: 1fr/ repeat(5, 1fr);
    gap: 5px;
    }
    li {
    height: 50px;
    background-color:orange;
    animation-name: down;
    animation-duration: 2s;
    animation-iteration-count: infinite;
    display: flex;
    justify-content: center;
    align-items: center;
    }
    li:nth-child(1) {
    /* 慢》快》慢》非常慢 */
    animation-timing-function: ease;
    }
    li:nth-child(2) {
    /* 从慢到快 */
    animation-timing-function: ease-in;
    }
    li:nth-child(3) {
    /* 从快到慢 */
    animation-timing-function: ease-out;
    }
    li:nth-child(4) {
    /* 两头慢中间快 */
    animation-timing-function: ease-in-out;
    }
    li:nth-child(5) {
    /* 匀速 */
    animation-timing-function: linear;
    }
    li:nth-child(5) {
    /* 自定义 最直接的理解是,将以一条直线放在范围只有 1 的坐标轴中,并从中间拿出两个点来拉扯(X 轴的取值区间是 [0, 1],Y 轴任意),最后形成的曲线就是动画的速度曲线 */
    animation-timing-function: cubic-bezier(.26, .53, 1, .3);
    }
    @keyframes down {
    to {
    transform: translateY(90vh);
    }
    }
    </style>
    </head>
    <body>
    <ul>
    <li>ease</li>
    <li>ease-in</li>
    <li>ease-out</li>
    <li>ease-in-out</li>
    <li>linear</li>
    <li>cubic-bezier</li>
    </ul>
    </body>
    </html>

  • 相关阅读:
    随机生成4位验证码(包含数字, 字母)
    eval注册和登录
    51单片机中断机制(定时器/计数器)
    CS106B
    机器学习算法之旅(转载)
    Ubuntu系统使用记录
    2. 自然语言处理预备知识
    1. 自然语言处理描述
    前端学习网站
    2016年总结,2017年计划
  • 原文地址:https://www.cnblogs.com/victory820/p/13818460.html
Copyright © 2011-2022 走看看