anime实现4种自适应checkbox开关选择动画代码
代码语言:html
所属分类:布局界面
代码描述:anime实现4种自适应checkbox开关选择动画代码
代码标签: anime 自适应 checkbox 开关 选择 动画 代码
下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开
<!DOCTYPE html>
<html lang="en" >
<head>
<meta charset="UTF-8">
<style>
:root {
--bg: #0f1724;
--muted: #9aa4b2;
--accent: #38bdf8; /* cyan */
--success: #34d399; /* green */
--size: 22px;
font-family: "Inter", system-ui, -apple-system, "Segoe UI", Roboto,
"Helvetica Neue", Arial;
}
html,
body {
height: 100%;
}
body {
margin: 0;
background: linear-gradient(180deg, #071026 0%, #0b1220 100%);
display: flex;
align-items: center;
justify-content: center;
color: #e6eef6;
padding: 32px;
box-sizing: border-box;
}
.wrap {
width: min(980px, 96%);
background: linear-gradient(
180deg,
rgba(255, 255, 255, 0.02),
rgba(255, 255, 255, 0.01)
);
border-radius: 14px;
padding: 28px;
box-shadow: 0 8px 30px rgba(2, 6, 23, 0.6);
}
h1 {
margin: 0 0 18px;
font-size: 20px;
}
p {
margin: 0 0 18px;
color: var(--muted);
}
.grid {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
gap: 18px;
align-items: start;
}
.card {
background: rgba(255, 255, 255, 0.02);
border-radius: 12px;
padding: 16px;
min-height: 120px;
display: flex;
flex-direction: column;
gap: 10px;
align-items: flex-start;
position: relative;
overflow: hidden;
}
.label {
display: flex;
gap: 12px;
align-items: center;
user-select: none;
position: relative;
overflow: hidden;
}
.label small {
display: block;
color: var(--muted);
font-size: 13px;
}
/* Ripple effect */
.ripple {
position: absolute;
border-radius: 50%;
background: rgba(255, 255, 255, 0.3);
transform: scale(0);
animation: ripple 600ms linear;
pointer-events: none;
z-index: 0;
}
@keyframes ripple {
to {
transform: scale(4);
opacity: 0;
}
}
.svg-box {
cursor: pointer;
}
/* --------------------------
STYLE 1 - SVG stroke draw
-------------------------- */
.chk-svg {
--s: var(--size);
width: calc(var(--s) * 1.4);
height: calc(var(--s) * 1.4);
display: .........完整代码请登录后点击上方下载按钮下载查看
















网友评论0