赵走x博客
网站访问量:151424
首页
书籍
软件
工具
古诗词
搜索
登录
类似IOS的切换器
爱情切换器
切换器:锁
黑白切换器
暗/亮切换器
切换器:锁
资源编号:552080
热度:96
切换器:锁
# 源码 ### HTML源码 ```
``` ### CSS源码 ``` .btn-lock { position: absolute; top: calc(50% - 32px); left: calc(50% - 32px); display: inline-block; background: #ff5b5b; width: 64px; height: 64px; box-sizing: border-box; padding: 12px 0 0 18px; border-radius: 50%; cursor: pointer; -webkit-tap-highlight-color: transparent; } .btn-lock svg { fill: none; transform: translate3d(0, 0, 0); } .btn-lock svg .bling { stroke: #fff; stroke-width: 2.5; stroke-linecap: round; stroke-dasharray: 3; stroke-dashoffset: 15; transition: all 0.3s ease; } .btn-lock svg .lock { stroke: #fff; stroke-width: 4; stroke-linejoin: round; stroke-linecap: round; stroke-dasharray: 36; transition: all 0.4s ease; } .btn-lock svg .lockb { fill: #fff; fill-rule: evenodd; clip-rule: evenodd; transform: rotate(8deg); transform-origin: 14px 20px; transition: all 0.2s ease; } #inpLock { display: none; } #inpLock:checked + label { background: #20cca5; } #inpLock:checked + label svg { opacity: 1; } #inpLock:checked + label svg .bling { animation: bling6132 0.3s linear forwards; animation-delay: 0.2s; } #inpLock:checked + label svg .lock { stroke-dasharray: 48; animation: locked 0.3s linear forwards; } #inpLock:checked + label svg .lockb { transform: rotate(0); transform-origin: 14px 22px; } @keyframes bling6132 { 50% { stroke-dasharray: 3; stroke-dashoffset: 12; } 100% { stroke-dasharray: 3; stroke-dashoffset: 9; } } @keyframes locked { 50% { transform: translateY(1px); } } ```
展示效果