svg+css实现checkbox上锁解锁开关切换效果代码

代码语言:html

所属分类:布局界面

代码描述:svg+css实现checkbox上锁解锁开关切换效果代码

代码标签: svg css checkbox 上锁 解锁 开关 切换

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

<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width,initial-scale=1.0,maximum=1.0,minimum=1.0,user-scalable=0" />
    <title>BFW NEW PAGE</title>

     <style>
    body{
    padding: 200px;
    }
#lock {
  display: none;
}
.lock-label {
  width: 45px;
  height: 45px;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: rgb(80, 80, 80);
  border-radius: 15px;
  cursor: pointer;
  transition: all 0.3s;
}
.lock-wrapper {
  width: fit-content;
  height: fit-content;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  transform: rotate(-10deg);
}
.shackle {
  background-color: transparent;
  height: 9px;
  width: 14px;
  border-top-right-radius: 10px;
  border-top-left-radius: 10px;
  border-top: 3px solid white;
  border-left: 3px solid white;
  border-right: 3px solid white;
  transition: all 0.3s;
}
.lock-body {
  width: 15px;
}
#lock:checked + .lock-label .lock-wrapper .shackle {
  transform: rotateY(150deg) translateX(3px);
  transform-origin: right;
}
#lo.........完整代码请登录后点击上方下载按钮下载查看

网友评论0