纯css3绘制华硕平板p00i开机动画

前两天收了个洋垃圾华硕平板p00i,今天开机的时候觉得这个平板的开机动画挺好看的,于是用css将它写了出来。

下面是手机拍摄的开机动画视频:

css写的动画:

p00i开机动画

动画的开始是一个圆形div弹跳,然后进行div大小的改变,最后显示加载动画。

附上源码:

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
    <style>
        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
        }
        .container {
            width: 100vw;
            height: 100vh;
            display: flex;
            justify-content: center;
            align-items: center;
            position: relative;
        }
        .drop {
            width: 100px;
            height: 100px;
            border-radius: 50%;
            background-color: #f00;
            
            animation: bounce 1s, biggerSmaller 4s 1s;
            animation-fill-mode: both;
            
        }
        @keyframes bounce {
            0%, 15%, 47%, 73%,89%,100% {
                animation-timing-function: ease-out;
                transform: translate3d(0,0,0);
            }

            30%, 32% {
                animation-timing-function: ease-in;
                transform: translate3d(0, -42px, 0);
            }

            60% {
                animation-timing-function: ease-in;
                transform: translate3d(0, -24px, 0);
            }

            82% {
                animation-timing-function: ease-in;
                transform: translate3d(0, -12px, 0);
            }

            94% {
                animation-timing-function: ease-in;
                transform: translate3d(0,-3px,0);
            }

        }
        @keyframes biggerSmaller {
            0% {

            }
            15% {
                width: 500px;
                height: 500px;
                box-shadow: 0 0 100px 10px rgba(255,255,255,1) inset;
            }
            30% {
                width: 300px;
                height: 300px;
                box-shadow: 0 0 0px 0px rgba(255,255,255,0.7) inset;
            }
            80% {
                width: 300px;
                height: 300px;
                box-shadow: 0 0 0px 0px rgba(255,255,255,0.7) inset;
            }
            100% {
                width: 0;
                height: 0;
                box-shadow: 0 0 10px 10px rgba(255,255,255,0.7) inset;
            }
        }
        span {
            position: absolute;
            color: #fff;
            font-size: 60px;
            animation: textShow 1s 1s backwards;
        }
        @keyframes textShow {
            0% {
                visibility: hidden;
            }   
            100% {
                visibility: visible;
            }
        }
        .loading {
            position: absolute;
        }
        ul {
            list-style: none;
            
        }
        li {
            display: inline-block;
            width: 20px;
            height: 20px;
            border-radius: 50%;
            margin-left: 10px;
            background-color: #000;
            opacity: 0;
            animation: loading 1.2s infinite ease-in-out;
        }
        li:nth-child(1) {
            background-color: green;
            visibility: visible;
            animation-delay: 5s;
        }
        li:nth-child(2) {
            background-color: skyblue;
            visibility: visible;
            animation-delay: 5.3s;
        }
        li:nth-child(3) {
            background-color: yellow;
            visibility: visible;
            animation-delay: 5.6s;
        }
        li:nth-child(4) {
            background-color: red;
            visibility: visible;
            animation-delay: 5.9s;
        }
        @keyframes loading {
            0% {
                opacity: 1;
            }
            100% {
                opacity: 0;
            }
        }
    </style>
</head>
<body>
    <div class="container">
        <div class="drop">
        </div>
        <span>Hello</span>
        <div class="loading">
            <ul>
                <li></li>
                <li></li>
                <li></li>
                <li></li>
            </ul>
        </div>
    </div>
</body>
</html>
最后修改:2019 年 08 月 30 日 10 : 26 PM
如果觉得我的文章对你有用,请随意赞赏

2 条评论

  1. Mark

    有点意思

  2. 搬瓦工vps

    学习了

发表评论