div+css实现弹性checkbox立体质感开关效果代码
代码语言:html
所属分类:布局界面
代码描述:div+css实现弹性checkbox立体质感开关效果代码
代码标签: div css 弹性 checkbox 立体 质感 开关
下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开
<!DOCTYPE html> <html lang="en" > <head> <meta charset="UTF-8"> <style> body { background: #1f1f23; margin: 0; min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; font-size: 5em; gap: 0.5em; } @property --color { syntax: '<color>'; inherits: true; initial-value: red; } @property --light-on { syntax: '<color>'; inherits: true; initial-value: #0001; } @property --light-off { syntax: '<color>'; inherits: true; initial-value: #000d; } @keyframes squeeze { 0%, 100% { width: 0.95em; aspect-ratio: 1; } 50% { width: 1.35em; aspect-ratio: 1.75; } } @keyframes squeeze2 { 0%, 100% { width: 0.95em; aspect-ratio: 1; } 50% { width: 1.35em; aspect-ratio: 1.75; } } .ellastic { --on: #af5; --off: #d55; --duration: 0.75s; --color: var(--off); --color-semi: color-mix(in srgb, va.........完整代码请登录后点击上方下载按钮下载查看
网友评论0