led开关按钮点击效果

代码语言:html

所属分类:表单美化

代码描述:led开关按钮点击效果

代码标签: 点击 效果

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

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

<head>

    <meta charset="UTF-8">



    <style>
        * {
            border: 0;
            box-sizing: border-box;
            margin: 0;
            padding: 0;
        }
:root {
            --transDur: 0.2s;
            --shadowA:
            -1.5em 0 1.5em #8d273100,
            1.5em 0 1.5em #8d273100,
            0 0 3em #8d273144,
            0 6.5em 3em #0002;
            --shadowB:
            -1.5em 0 1.5em #8d273100,
            1.5em 0 1.5em #8d273100,
            0 3.25em 3em #8d273144,
            0 6.5em 3em #0002;
            --shadowC:
            -1.5em 0 1.5em #8d273177,
            1.5em 0 1.5em #8d273177,
            0 3.25em 3em #8d273144,
            0 6.5em 3em #0002;
            --shadowD:
            -1.5em 0 1.5em #8d273177,
            1.5em 0 1.5em #8d273177,
            0 6.5em 3em #8d273144,
            0 6.5em 3em #0002;
            --switchOnA:
            linear-gradient(90deg,#ecc0,#ecc 0.05rem 0.45rem,#ecc0) 50% 50% / 0.5rem 4rem no-repeat,
            linear-gradient(90deg,#0000,#0002 0.25rem 0.75rem,#0000) 50% 50% / 1rem 4rem no-repeat,
            linear-gradient(#0000,#0003 0.25rem 4.25rem,#0000) 50% 50% / 0.5rem 4.5rem no-repeat,
            radial-gradient(12rem 6rem at 0 0,#95001100 25%,#95001100 50%),
            radial-gradient(12rem 6rem at 100% 0,#95001100 25%,#95001100 50%),
            radial-gradient(100% 75% at center,#ff002c,#ff002c00 50%) 0 0 / 0.6rem 0.6rem,
            radial-gradient(6rem 9rem at 50% 10%,#ff002c00,#ff002c00 50%),
            radial-gradient(12rem 6rem at 0 90%,#ff002c00,#ff002c00 50%),
            radial-gradient(12rem 6rem at 100% 90%,#ff002c00,#ff002c00 50%),
            radial-gradient(9rem 9rem at 53% 87.5%,#ffc56400 5%,#ff002c00 20%,#ff002c00 50%),
            linear-gradient(#a90020 87.5%,#d4001d);
            --switchOnB:
            linear-gradient(90deg,#ecc0,#ecc 0.05rem 0.45rem,#ecc0) 50% 50% / 0.5rem 4rem no-repeat,
            linear-gradient(90deg,#0000,#0002 0.25rem 0.75rem,#0000) 50% 50% / 1rem 4rem no-repeat,
            linear-gradient(#0000,#0003 0.25rem 4.25rem,#0000) 50% 50% / 0.5rem 4.5rem no-repeat,
            radial-gradient(12rem 6rem at 0 0,#950011 25%,#95001100 50%),
            radial-gradient(12rem 6rem at 100% 0,#950011 25%,#95001100 50%),
            radial-gradient(100% 75% at center,#ff002c,#ff002c00 50%) 0 0 / 0.6rem 0.6rem,
            radial-gradient(6rem 9rem at 50% 10%,#ff002c,#ff002c00 50%),
            radial-gradient(12rem 6rem at 0 90%,#ff002c,#ff002c00 50%),
            radial-gradient(12rem 6rem at 100% 90%,#ff002c,#ff002c00 50%),
            radial-gradient(9rem 9rem at 53% 87.5%,#ffc564 5%,#ff002c 20%,#ff002c00 50%),
            linear-gradient(#950011 87.5%,#c10017);
            --switchOffA:
            radial-gradient(4rem 4rem at center,#ecc0 1.45rem,#ecc 1.5rem 1.95rem,#ecc0 2rem),
            radial-gradient(5rem 5rem at center,#0000 1rem,#0002 1.5rem 2rem,#0000 2.5rem),
            radial-gradient(100% 75% at center,#ff002c 25%,#ff002c00 50%) 0 0 / 0.6rem 0.6rem,
            radial-gradient(4rem 12rem at 50% 100%,#ff002c00,#ff002c00 50%),
            radial-gradient(12rem 6rem at 0 10%,#ff002c00,#ff002c00 50%),
            radial-gradient(12rem 6rem at 100% 10%,#ff002c00,#ff002c00 50%),
            radial-gradient(9rem 9rem at 50% 12.5%,#ffc56400 5%,#ff002c00 20%,#ff002c00 50%),
            linear-gradient(#c10017,#c10017);
            --switchOffB:
            radial-gradient(4rem 4rem at center,#ecc0 1.45rem,#ecc 1.5rem 1.95rem,#ecc0 2rem),
            radial-gradient(5rem 5rem at center,#0000 1rem,#0002 1.5rem 2rem,#0000 2.5rem),
            radial-gradient(100% 75% at center,#ff002c 25%,#ff002c00 50%) 0 0 / 0.6rem 0.6rem,
            radial-gradient(4rem 12rem at 50% 100%,#ff002c,#ff002c00 50%),
            radial-gradient(12rem 6rem at 0 10%,#ff002c,#ff002c00 50%),
            radial-gradient(12rem 6rem at 100% 10%,#ff002c,#ff002c00 50%),
            radial-gradient(9rem 9rem at 50% 12.5%,#ffc564 5%,#ff002c 20%,#ff002c00 50%),
            linear-gradient(#c10017,#c10017);
            font-size: calc(12px + 6 * (100vw - 320px) / (1280 - 320));
        }
        body, input {
            font: 1em/1.5 sans-serif;
        }
        body {
            background: linear-gradient(#fff,#c7cad1);
            display: flex;
            height: 100vh;
        }
        form {
            background: linear-gradient(#454954,#2a272d);
            border-radius: 0.25em;
            box-shadow:
            0 0 0 0.2em #000 inset,
            0 0.3em 0 0 #737a8c inset;
            margin: auto;
            width: 16em;
            height: 20em;
        }
        label, input[type=checkbox]:before, input[type=checkbox]:after {
            display: block;
        }
        label {
            border-radius: 0.5em;
            box-shadow:
            0 0.1em 0 #565057,
            0 0 0 0.1em #2e3138,
            0 0 0.2em 0.3em #000 inset,
            0 1em 0.2em 0 #000 inset,
            0 -1em 0.2em 0 #000 inset,
            0.5em 0 0.1em #e7454e inset,
            0.6em 0 0.1em #8d2731 inset,
            -0.5em 0 0.1em #e7454e inset,
            -0.6em 0 0.1em #8d2731 inset,
            0 1.5em 0.2em 0 #800007 inset,
            0 2em 0.2em 0 #8d2731 inset,
            0 3em 0.2em 0 #ff8a90 inset,
            0 4em 0.2em 0 #f8f4f6 inset,
            0 -1.5em 0.3em 0 #a0001c inset,
            0 -2em 0.2em 0 #9f0020 inset,
            0 -3em 0.2em 0.........完整代码请登录后点击上方下载按钮下载查看

网友评论0