zoukankan      html  css  js  c++  java
  • css3实现心脏跳动

    源码如下:

      

    <!DOCTYPE html>
    <html lang="en">
    <head>
        <meta charset="UTF-8">
        <title>Title</title>
        <style>
            *{
                margin: 0;
                padding: 0;
            }
            body{
                 100vw;
                height: 100vh;
                display: flex;
                justify-content: center;
                align-items: center;
                background: #34495e;
            }
            .heart{
                 200px;
                height: 200px;
                background: red;
                transform: rotate(45deg) scale(.5);
                animation-name: hd;
                animation-duration: 2s;
                animation-iteration-count: infinite;
            }
            .heart::before{
                content: "";
                 200px;
                height: 200px;
                border-radius: 50%;
                position: absolute;
                background: red;
                transform: translateX(-100px);
            }
            .heart::after{
                content: "";
                 200px;
                height: 200px;
                border-radius: 50%;
                position: absolute;
                background: red;
                transform: translateY(-100px);
            }
            @keyframes hd {
                25%{
                    transform: rotate(45deg) scale(1);
                }
                50%{
                    transform: rotate(45deg) scale(.5);
                }
                75%{
                    transform: rotate(45deg) scale(1);
                }
                to{
                    transform: rotate(45deg) scale(.5);
                }
            }
        </style>
    </head>
    <body>
        <div class="heart"></div>
    </body>
    </html>
  • 相关阅读:
    家庭作业有益吗?
    视图、触发器、事务、存储过程、函数
    Navicat使用和pymysql
    表查询
    外键
    MySQL表操作
    进程池线程池、协程
    全局解释器锁及其他用法
    线程
    进程
  • 原文地址:https://www.cnblogs.com/y-y-y-y/p/12205445.html
Copyright © 2011-2022 走看看