div+css实现牙齿咬合左右滑动checkbox开关效果代码
代码语言:html
所属分类:其他
代码描述:div+css实现牙齿咬合左右滑动checkbox开关效果代码
代码标签: div css 牙齿 咬合 左右 滑动 checkbox 开关
下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开
<!DOCTYPE html>
<html lang="en" >
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<style>
@import url('https://fonts.googleapis.com/css2?family=Roboto:wght@500&display=swap');
:root {
--sz: 9vmin;
--on: #4CAF50;
--of: #f50000;
--gr: #666666;
--tr: all 0.5s ease 0s;
--lg: var(--of);
}
* {
box-sizing: border-box;
transition: var(--tr);
}
body {
margin: 0;
padding: 0;
width: 100vw;
height: 100vh;
overflow: hidden;
display: flex;
align-items: center;
justify-content: center;
background: linear-gradient(45deg, #1c2123, #1f2425);
font-family: 'Roboto', Arial, Helvetica, serif;
}
body:before, body:after {
content: "";
position: absolute;
width: 100%;
height: 100%;
background:
repeating-conic-gradient(#0002 0.00005%, #fff0 .0005%, #fff0 .005%, #fff0 .0005%),
repeating-conic-gradient(#0002 0.00001%, #fff0 .00009%, #fff0 .00075%, #fff0 .000025%);
opacity: 0.75;
filter: blur(0.75px);
}
.content {
position: relative;
width: calc(var(--sz) * 6);
height: calc(var(--sz) * 2);
display: flex;
align-items: center;
justify-content: center;
}
input {
display: none;
}
label[for=btn] {
position: absolute;
width: calc(var(--sz) * 6);
height: calc(var(--sz) * 2);
background: #616774;
border-radius: var(--sz);
box-shadow:
0 0 calc(var(--sz) / 50) calc(var(--sz) / 50) #0006,
0 -4px calc(var(--sz) / 10) calc(var(--sz) / 500) #000d,
0 0px calc(var(--sz) / 10) calc(var(--sz) / 50) #fff8,
0 -4px calc(var(--sz) / 5) calc(var(--sz) / 50) #000c;
}
.track {
position: absolute;
width: 100%;
height: 100%;
border-radius: var(--sz);
overflow: hidden;
.........完整代码请登录后点击上方下载按钮下载查看
















网友评论0