پیش‌نمایش زنده
کد HTML
<label class="scratch-check">
  <input type="checkbox" class="scratch-check__input" />
  <span class="scratch-check__box">
    <span class="scratch-check__scratch"></span>
    <svg class="scratch-check__tick" viewBox="0 0 24 24" fill="none">
      <polyline
        points="4,13 9,18 20,7"
        stroke="#fff"
        stroke-width="2.5"
        stroke-linecap="round"
        stroke-linejoin="round"
      ></polyline>
    </svg>
  </span>
  <span class="scratch-check__label">Mark as done</span>
</label>
کد CSS
@import url("s://fonts.googleapis.com/css2?family=DM+Mono:wght@400;500&display=swap");

.scratch-check {
  font-family: "DM Mono", monospace;
  display: inline-flex;
  align-items: center;
  gap: 14px;
  cursor: pointer;
  user-select: none;
}

.scratch-check__input {
  display: none;
}

.scratch-check__box {
  position: relative;
  width: 28px;
  height: 28px;
  border-radius: 6px;
  background: #1a1a2e;
  border: 2px solid #e94560;
  flex-shrink: 0;
  overflow: hidden;
  transition:
    border-color 0.3s ease,
    background 0.3s ease;
}

.scratch-check__scratch {
  position: absolute;
  inset: -2px;
  background: repeating-linear-gradient(
    -45deg,
    #e94560 0px,
    #e94560 3px,
    transparent 3px,
    transparent 8px
  );
  opacity: 1;
  transform-origin: center;
  transition:
    transform 0.5s cubic-bezier(0.68, -0.55, 0.27, 1.55),
    opacity 0.4s ease;
}

.scratch-check__tick {
  position: absolute;
  inset: 2px;
  opacity: 0;
  transform: scale(0) rotate(-30deg);
  transition:
    transform 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) 0.15s,
    opacity 0.3s ease 0.15s;
}

/* Checked state */
.scratch-check__input:checked ~ .scratch-check__box {
  background: #e94560;
  border-color: #e94560;
}

.scratch-check__input:checked ~ .scratch-check__box .scratch-check__scratch {
  transform: scale(0) rotate(45deg);
  opacity: 0;
}

.scratch-check__input:checked ~ .scratch-check__box .scratch-check__tick {
  opacity: 1;
  transform: scale(1) rotate(0deg);
}

.scratch-check__label {
  font-size: 14px;
  font-weight: 500;
  color: #c9d1d9;
  letter-spacing: 0.03em;
  transition:
    color 0.3s ease,
    text-decoration 0.3s ease;
  text-decoration-color: transparent;
  text-decoration-line: line-through;
}

.scratch-check__input:checked ~ .scratch-check__label {
  color: #8b949e;
  text-decoration-color: #8b949e;
}

/* Hover */
.scratch-check:hover .scratch-check__box {
  box-shadow: 0 0 0 3px rgba(233, 69, 96, 0.2);
}
نوع: checkbox
تاریخ ایجاد: 2026/06/05
آخرین بروزرسانی: 2026/06/05