首页 > 其他 > 详细

心跳动画

时间:2017-02-15 13:51:34      阅读:241      评论:0      收藏:0      [点我收藏+]
这个心制作稍微有点难度,关键旋转后的对照
<style type="text/css">
        .heart{
            width: 200px;
            height: 180px;
            position: relative;
            animation: heartAnimation 2s infinite;
        }
        .heart::before,.heart::after{
            position: absolute;
            left: 100px;
            top: 0;
           
            width: 100px;
            height: 160px;
            content: ‘‘;
            border-radius: 50px 50px 0 0;
            transform-origin: 0 100%;
            transform: rotate(-45deg);
        }
        .heart::after{
            transform: rotate(45deg);
            transform-origin: 100% 100%;
            left: 0;
        }
        @keyframes heartAnimation{
            0%{
                transform: scale(.3);
            }
            20%{
                transform: scale(.7);
            }
            40%{
                transform: scale(.9);
            }
            50%{
                transform: scale(1);
            }
            60%{
                transform: scale(.9);
            }
            80%{
                transform: scale(.7);
            }
            100%{
                transform: scale(.3);
            }
        }
    </style>
</head>
<body>
    <div class="heart"></div>
</body>

心跳动画

原文:http://www.cnblogs.com/adialike/p/6401033.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!