爱心悬停跳动动画效果代码

代码语言:html

所属分类:悬停

代码描述:爱心悬停跳动动画效果代码

代码标签: 动画 效果

下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开

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

<head>

    <meta charset="UTF-8">






    <style>
        body {
            display: flex;
            align-items: center;
            justify-content: center;
            min-height: 100vh;
            margin: 0;
            background-color: #222222;
            /*LETTERS*/
            font-family: sans-serif;
            font-size: 5.5em;
            letter-spacing: 25px;
            color: #E1E1E1;
            text-shadow: 3px 2px #696969;
        }

        /*LETTER DIVS*/
        #letter-1 {
            margin-right: 10px;
        }

        .letter-2 {
            margin-left: 30px;
        }

        /*HEART*/
        .heart {
            background-color: #656565;
            position: relative;
            height: 45px;
            width: 45px;
            transform: rotate(-45deg);
            display: inline-block;
        }

        .heart:hover {
            animation: heartbeat 1500ms linear infinite;
            background-color: #DE3163;
        }

        .heart::after {
            background-color: inherit;
            position: absolute;
            height: inherit;
            width: inherit;
            top: -50%;
            left: 0;
            border-radius: 50%;
            content: "";
        }

        .heart::before {
            background-color: inherit;
            position: absolute;
            height: inherit;
            width: inherit;
            top: 0;
            right: -50%;
            border-radius: 50%;
            content: "";
        }

        /*ANIMATION*/
@keyframes heartbeat {
            0% {
                transform: rotate(-45deg) scale(1);
                background-color: #DE3163;

            }

            5% {
                transform: rotate(-45deg) scale(1.1);
          .........完整代码请登录后点击上方下载按钮下载查看

网友评论0