css实现别针引脚开关切换交互效果代码
代码语言:html
所属分类:表单美化
代码描述:css实现别针引脚开关切换交互效果代码
下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开
<!DOCTYPE html> <html lang="en" > <head> <meta charset="UTF-8"> <style> * { box-sizing: border-box; } body, html { width: 100%; margin: 0; padding: 0; height: 100%; } body { display: flex; justify-content: center; align-items: center; background-color: #3a49fd; } .toggle-wrapper { padding: 16px; position: relative; } .toggle-input { position: absolute; width: 0; height: 0; opacity: 0; outline: none; } .toggle-input:checked + label { background-color: #fff; } .toggle-input:checked + label > .toggle-circle { left: calc(100% - 44px); } .toggle-input:checked + label > .toggle-circle .pin-icon { transform: rotate(0); } .toggle-input:checked + label > .toggle-circle .pin-top { -webkit-animation: pushPinTop 0.4s ease-in-out 0.55s; animation: pushPinTop 0.4s ease-in-out 0.55s; } .toggle-input:checked + label > .toggle-circle .pin-middle, .toggle-input:checked + label > .toggle-circle .pin-bottom:before { -webkit-animation: pushPin 0.4s ease-in-out 0.55s; animation: pushPin 0.4s ease-in-out 0.55s; } .toggle-container { border-radius: 30px; display: block; width: 100px; height: 40px; background-color: #1018a4; position: relative; cursor: pointer; transition: all 0.2s cubic-bezier(0.35, 0.4, 0.45, 0.2); } .toggle-circle { position: absolute; top: 50%; left: -4px; transfo.........完整代码请登录后点击上方下载按钮下载查看
网友评论0