css实现代办事项列表勾选划掉打钩横线动画效果代码

代码语言:html

所属分类:表单美化

代码描述:css实现代办事项列表勾选划掉打钩横线动画效果代码

代码标签: css 代办 事项 列表 勾选 划掉 打钩 横线 动画

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

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

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

  
<style>
* {
  margin: 0;
  padding: 0;
  font: inherit;
}

body {
  display: grid;
  place-content: center;
  grid-gap: 0.5em;
  grid-template-columns: max-content 8.75em;
  color: #595959;
  font: clamp(.625em, 8vw, 5em)/2 ubuntu, sans-serif;
}

h3 {
  grid-column: 1/span 2;
  text-align: center;
}

input {
  width: 2em;
  height: 2em;
  opacity: 0;
}
input:checked + label {
  --sel: 1 ;
}

label {
  --i: var(--sel, 0);
  --not-i: calc(1 - var(--i));
  justify-self: start;
  position: relative;
  padding: 0 0.25em;
  color: hsl(0, 0%, calc(35% + var(--i)*55%));
  animation: slide calc(var(--sel)*.5*0.35s) ease-out 2 alternate;
  cursor: pointer;
}
label::before, label::after {
  position: absolute;
  right: calc(100% + 0.5em);
  content: "";
}
label::before {
  box-sizing: border-box;
  border: solid 0.125em currentcolor;
  width: 2em;
  height: 2em;
  border-radius: 50%;
  background: hsl(207, 85%, 97%, var(--i));
  color: hsl(207, calc(var(--i)*85%), calc(97% + var(--not-i)*-15%));
  transition: color 0.35s, background 0.35s;
  animation: spark calc(var(--sel)*0.35s);
}
label::after {
  --mask:
  	linear-gradient(-45deg, transparent 50%, red 0) calc(var(--not-i)*100%) calc(var(--not-i)*100%)/ 200% 200%,
  	conic-gradient(at 0.125em calc(100% - 0.125em), transparent 25%, red 0%),
  	radial-gradient(circle at 50% 100%,
  			transparent calc(0.0625em + -.5px), red calc(0.0625em + .5px))
  		0 0/ 0.125em 0.0625em no-repeat,
  	radial-gradient(circle at 0% 50%,
  			transparent calc(0.0625em + -.5px), red calc(0.0625em + .5px))
  		100% 100%/ 0.0625em 0.125em no-repeat;
  top: 50%;
  width: 1em;
  height: 0.5em;
  transform: translate(calc(50% - .5*2em), -50%) rotate(-45deg);
  background: linear-gradient(to right top, #22a4b0, cyan);
  clip-path: inset(0 round 0.0625em);
  -webkit-mask: var(--mask);
  mask: var(--mask);
  -webkit-mask-composite: source-in, source-out, source-over;
  mask-composite: intersect, subtract, add;
  transition: 0.35s;
}

@keyframes slide {
  to {
    text-indent: 0.25em;
  }
}
@keyframes spark {
  0% {
    box-shadow: 0.9375em 0em 0 -0.9375em rgba(111, 240, 205, 0), 0.811898816em 0.46875em 0 -0.9375em rgba(103, 240, 212, 0), 0.46875em 0.811898816em 0 -0.9375em rgba(70, 236, 197, 0), 0em 0.9375em 0 -0.9375em rgba(88, 190, 161, 0), -0.46875em 0.811898816em 0 -0.9375e.........完整代码请登录后点击上方下载按钮下载查看

网友评论0