div+css实现漩涡开关切换效果代码
代码语言:html
所属分类:其他
代码描述:div+css实现漩涡开关切换效果代码
下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开
<!DOCTYPE html>
<html lang="en" >
<head>
<meta charset="UTF-8">
<style>
body {
margin: 0
}
* {
box-sizing: border-box;
}
input {
display: none;
opacity: 0;
pointer-events: none;
visibility: hidden;
height: 0;
width: 0;
}
.container {
background-color: #333333;
background-image: radial-gradient(transparent, rgb(0 0 0 / 45%));
display: flex;
align-items: center;
justify-content: center;
height: 100vh;
width: 100vw;
}
.switch {
border: 3px solid #252525;
box-shadow: 0 0 35px 5px inset, 0 0 3px 1px;
border-radius: 100px;
height: 120px;
width: 250px;
position: relative;
padding: 10px;
transition: background-color 0.63s 0.06s;
}
.overlay:before {
top: -40px;
}
.overlay:after {
bottom: -40px;
}
label {
position: absolute;
top: -3px;
height: calc(100% + 6px);
width: calc(50% + 3px);
cursor: pointer;
z-index: 1;
}
label[for="switch-on"] {
left: -3px;
}
label[for="switch-off"] {
right: -3px;
}
.pin-wrapper {
position: relative;
height: 100%;
width: 100%;
}
.pin {
position: absolute;
t.........完整代码请登录后点击上方下载按钮下载查看
















网友评论0