css实现抖动转换的checkbox开关动画效果代码

代码语言:html

所属分类:布局界面

代码描述:css实现抖动转换的checkbox开关动画效果代码

代码标签: css 抖动 转换 checkbox 开关 动画

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

<!DOCTYPE html>
<html lang="zh">
    <head>
        <meta charset="UTF-8">
        <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
        <meta name="viewport" content="width=device-width, initial-scale=1.0">
<style>

.container {
    margin: 0;
    min-height: 60vh;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    background: #234;
    gap: 1rem
}

@property --color {
    syntax: '<color>';
    initial-value: #789;
    inherits: true
}

@keyframes slideRight {
    0% {
        background-position: 0 0,0% 11%,0% 22%,0% 33%,0% 44%,0% 55%,0% 66%,0% 77%,0% 86%,0% 100%
    }

    10% {
        background-position: 100% 0,0% 11%,0% 22%,0% 33%,0% 44%,0% 55%,0% 66%,0% 77%,0% 86%,0% 100%
    }

    20% {
        background-position: 100% 0,100% 11%,0% 22%,0% 33%,0% 44%,0% 55%,0% 66%,0% 77%,0% 86%,0% 100%
    }

    30% {
        background-position: 100% 0,100% 11%,100% 22%,0% 33%,0% 44%,0% 55%,0% 66%,0% 77%,0% 86%,0% 100%
    }

    40% {
        background-position: 100% 0,100% 11%,100% 22%,100% 33%,0% 44%,0% 55%,0% 66%,0% 77%,0% 86%,0% 100%
    }

    50% {
        background-position: 100% 0,100% 11%,100% 22%,100% 33%,100% 44%,0% 55%,0% 66%,0% 77%,0% 86%,0% 100%
    }

    60% {
        background-position: 100% 0,100% 11%,100% 22%,100% 33%,100% 44%,100% 55%,0% 66%,0% 77%,0% 86%,0% 100%
    }

    70% {
        background-position: 100% 0,100% 11%,100% 22%,100% 33%,100% 44%,100% 55%,100% 66%,0% 77%,0% 86%,0% 100%
    }

    80% {
        background-position: 100% 0,100% 11%,100% 22%,100% 33%,100% 44%,100% 55%,100% 66%,100% 77%,0% 86%,0% 100%
    }

    90% {
        background-position: 100% 0,100% 11%,100% 22%,100% 33%,100% 44%,100% 55%,100% 66%,100% 77%,100% 86%,0% 100%
    }

    100% {
        background-position: 100% 0,100% 11%,100% 22%,100% 33%,100% 44%,100% 55%,100% 66%,100% 77%,100% 86%,100% 100%
    }
}

@keyframes slideLeft {
    0% {
        background-position: 0 0,0% 11%,0% 22%,0% 33%,0% 44%,0% 55%,0% 66%,0% 77%,0% 86%,0% 100%
    }

    10% {
        background-position: 100% 0,0% 11%,0% 22%,0% 33%,0% 44%,0% 55%,0% 66%,0% 77%,0% 86%,0% 100%
    }

    20% {
        background-position: 100% 0,100% 11%,0% 22%,0% 33%,0% 44%,0% 55%,0% 66%,0% 77%,0% 86%,0% 100%
    }

    30% {
        background-position: 100% 0,100% 11%,100% 22%,0% 33%,0% 44%,0% 55%,0% 66%,0% 77%,0% 86%,0% 100%
    }

    40% {
        background-position: 100% 0,100% 11%,100% 22%,100% 33%,0% 44%,0% 55%,0% 66%,0% 77%,0% 86%,0% 100%
    }

    50% {
        background-position: 100% 0,100% 11%,100% 22%,100% 33%,100% 44%,0% 55%,0% 66%,0% 77%,0% 86%,0% 100%
    }

    60% {
        background-position: 100% 0,100% 11%,100% 22%,100% 33%,100% 44%,100% 55%,0% 66%,0% 77%,0% 86%,0% 100%
    }

    70% {
        background-position: 100% 0,100% 11%,100% 22%,100% 33%,100% 44%,100% 55%,100% 66%,0% 77%,0% 86%,0% 100%
    }

    80% {
        background-position: 100% 0,100% 11%,100% 22%,100% 33%,100% 44%,100% 55%,100% 66%,100% 77%,0% 86%,0% 100%
    }

    90% {
        background-position: 100% 0,100% 11%,100% 22%,100% 33%,100% 44%,100% 55%,100% 66%,100% 77%,100% 86%,0% 100%
    }

  .........完整代码请登录后点击上方下载按钮下载查看

网友评论0