css实现checkbox点击选择三维盒子翻转动画效果代码

代码语言:html

所属分类:表单美化

代码描述:css实现checkbox点击选择三维盒子翻转动画效果代码

代码标签: 点击 选择 三维 盒子 翻转 动画 效果

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

<!DOCTYPE html>

<html lang="en">

<head>

    <meta charset="UTF-8">


    <style>
        *,*::before,*::after{padding:0;margin:0 auto;box-sizing:border-box}body{background-color:#111;color:#fff;min-height:100vh;display:grid;place-items:center}
        @import url("https://fonts.googleapis.com/css2?family=Ubuntu:wght@400;700&display=swap");
        *, *::before, *::after {
          box-sizing: border-box;
        }
        
        body {
          font-family: "Ubuntu", sans-serif;
          background-color: #ddd;
          color: #000;
          min-height: 100vh;
          margin: 0;
          display: grid;
          place-items: center;
          perspective: 750px;
        }
        
        *:not(:empty) {
          transform-style: preserve-3d;
        }
        
        .checkboxes {
          width: 100%;
          max-width: 420px;
        }
        
        .flipBox {
          position: relative;
          display: block;
          text-align: left;
          margin: 1em auto;
          cursor: pointer;
        }
        .flipBox:active > .flipBox_boxOuter {
          height: 25%;
        }
        .flipBox span {
          padding-left: 1.25em;
        }
        .flipBox > input {
          -webkit-appearance: none;
             -moz-appearance: none;
                  appearance: none;
          position: fixed;
          left: -100vmax;
          top: -100vmax;
        }
        .flipBox > input:checked ~ .flipBox_boxOuter {
          -webkit-animation: flipBox1 1s forwards linear;
                  animation: flipBox1 1s forwards linear;
        }
        .flipBox > input:checked ~ .flipBox_boxOuter .flipBox_box {
          -webkit-animation: flipBox2 1s forwards ease-in-out;
                  animation: flipBox2 1s forwards ease-in-out;
        }
        .flipBox > input:checked ~ .flipBox_shadow {
          -webkit-animation: flipBox3 1s forwards ease-in-out;
                  animation: flipBox3 1s forwards ease-in-out;
        }
        .flipBox > input:not(:checked) ~ .flipBox_boxOuter {
          -webkit-animation: flipBox4 1s forwards linear;
                  animation: flipB.........完整代码请登录后点击上方下载按钮下载查看

网友评论0