css美化checkbox实现火柴点燃开关效果代码

代码语言:html

所属分类:布局界面

代码描述:css美化checkbox实现火柴点燃开关效果代码

代码标签: css 美化 checkbox 实现 火柴 点燃 开关

下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开

<!DOCTYPE html>
<html lang="en" >

<head>
  <meta charset="UTF-8">
  

  
  
  
<style>
body {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  margin: 0;
  min-height: 100vh;
  font-size: 6rem;
  background: #352c37;
}

@keyframes burn {
  0%, 100% { border-radius: 5% 87% 45% 85%; width: 30em; }
  10% { border-radius: 5% 85% 49% 82%; }
  20% { border-radius: 0% 85% 45% 87%; width: 31em; }
  30%, 90% { border-radius: 5% 85% 49% 82%; }
  40% { border-radius: 0% 85% 45% 87%; width: 32em; }
  50% { border-radius: 2% 87% 42% 90%; }
  60% { border-radius: 5% 97% 45% 88%; }
  70% { border-radius: 2% 87% 42% 90%; width: 31em}
  80% { border-radius: 5% 97% 45% 88%; }
}

.toggle {
  appearance: none;
  position: relative;
  font-size: 1em;
  width: 3em;
  aspect-ratio: 2.5;
  border: max(1px, 0.05em) solid #000;
  border-radius: 100vmax;
  background: #0002;

  &::before {
    content: "";
    position: absolute;
    box-sizing: border-box;
    width: 0.25em;
    height: 0.925em;
    -webkit-mask:
      radial-gradient(40% 18% at 50% 14.5%, #000 80%, #0000 0),
      conic-gradient(at 50% -50%, #0000 179deg, #000 0 181deg, #0000 0);
    top: 50%;
    left: 23%;
    transform: translate(-50%, -50%) translate(0em) rotate(0deg).........完整代码请登录后点击上方下载按钮下载查看

网友评论0