颜色闪动动画过渡效果

代码语言:html

所属分类:动画

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

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">

    <style>
:root
        {
            --color-background: blue;
            --color-button: green;
            --duration: 0;
        }

        body, html
        {
            margin: 0;
            padding: 0;
            width: 100%;
            height: 100%;
            overflow: hidden;
        }

        body
        {
            display: -webkit-box;
            display: flex;
            -webkit-box-align: center;
            align-items: center;
            -webkit-box-pack: center;
            justify-content: center;
            background-color: #EDF2F7;
        }

        .container
        {
            width: 200px;
            height: 200px;
            background-color: var(--color-background);

            overflow: hidden;
            border-radius: 10%;
            position: relative;
            box-shadow:
            0 2.8px 2.2px rgba(0, 0, 0, 0.02),
            0 6.7px 5.3px rgba(0, 0, 0, 0.028),
            0 12.5px 10px rgba(0, 0, 0, 0.035),
            0 22.3px 17.9px rgba(0, 0, 0, 0.042),
            0 41.8px 33.4px rgba(0, 0, 0, 0.05),
            0 100px 80px rgba(0, 0, 0, 0.07);


        }

        .circle
        {
            width: 50px;
            height: 50px;
            -webkit-transition-duration: calc(var(--duration) *3s);
            transition-duration: calc(var(--duration) *3s);
            -webkit-transition-delay: calc(var(--duration) *0.5s);
            transition-delay: calc(var(--duration) *0.5s);
            -webkit-transition-property: background-color;
            transition-property: background-color;
            background-color: var(--color-button);
            border-radius: 50%;
            /* 	margin-bottom: 10vh; */
        }

        .inside
        {
            width: 100%;
            height: 100%;
            position: absolute;
            top: 0;
            left: 0;
            display: -webkit-box;
            display: flex;
            -webkit-box-pack: center;
            justify-content: center;
            -webkit-box-align: center;
            align-items: center;
        }
    </style>

</head>
<body translate="no">
    <div class="container">
        <div class="inside">
            <div class="circle".........完整代码请登录后点击上方下载按钮下载查看

网友评论0