پیشنمایش زنده
کد HTML
<div class="sketch-background">
<div class="sketch-container">
<div class="sketch-title">To-Do List!</div>
<label class="sketch-label">
<input type="checkbox" class="sketch-input" />
<div class="custom-checkbox-sketch">
<svg class="checkmark-svg-sketch" viewBox="0 0 24 24">
<polyline points="20 6 9 17 4 12"></polyline>
</svg>
</div>
<span class="sketch-text">Water the plants</span>
</label>
<label class="sketch-label">
<input type="checkbox" class="sketch-input" checked="" />
<div class="custom-checkbox-sketch">
<svg class="checkmark-svg-sketch" viewBox="0 0 24 24">
<polyline points="20 6 9 17 4 12"></polyline>
</svg>
</div>
<span class="sketch-text">Sketch a new idea</span>
</label>
<label class="sketch-label">
<input type="checkbox" class="sketch-input" />
<div class="custom-checkbox-sketch">
<svg class="checkmark-svg-sketch" viewBox="0 0 24 24">
<polyline points="20 6 9 17 4 12"></polyline>
</svg>
</div>
<span class="sketch-text">Buy more coffee</span>
</label>
<label class="sketch-label">
<input type="checkbox" class="sketch-input" />
<div class="custom-checkbox-sketch">
<svg class="checkmark-svg-sketch" viewBox="0 0 24 24">
<polyline points="20 6 9 17 4 12"></polyline>
</svg>
</div>
<span class="sketch-text">Read a chapter</span>
</label>
</div>
</div>
کد CSS
.sketch-background {
display: flex;
justify-content: center;
align-items: center;
min-height: 100%;
background-color: #f4f1ea;
}
.sketch-container {
width: 300px;
height: 300px;
background-color: #ffffff;
border: 2px solid #4a4a4a;
border-radius: 8px 6px 10px 7px;
box-shadow: 5px 5px 0px #d1ccc1;
padding: 20px;
display: flex;
flex-direction: column;
gap: 20px;
font-family: "Comic Sans MS", "Chalkduster", "cursive";
}
.sketch-title {
font-size: 24px;
font-weight: bold;
color: #333;
margin-bottom: 10px;
text-align: center;
}
.sketch-label {
display: flex;
align-items: center;
cursor: pointer;
}
.sketch-input {
position: absolute;
opacity: 0;
width: 0;
height: 0;
}
.custom-checkbox-sketch {
width: 24px;
height: 24px;
border: 3px solid #4a4a4a;
border-radius: 5px 4px 6px 3px;
margin-right: 12px;
flex-shrink: 0;
display: flex;
align-items: center;
justify-content: center;
transition: transform 0.2s ease;
}
.sketch-label:hover .custom-checkbox-sketch {
transform: rotate(-5deg) scale(1.1);
}
.checkmark-svg-sketch {
width: 20px;
height: 20px;
stroke: #2980b9;
stroke-width: 4;
stroke-linecap: round;
stroke-linejoin: round;
fill: none;
stroke-dasharray: 30;
stroke-dashoffset: 30;
transition: stroke-dashoffset 0.4s ease-in-out;
}
.sketch-text {
color: #333;
font-size: 18px;
position: relative;
transition: color 0.4s ease;
}
.sketch-text::after {
content: "";
position: absolute;
left: -5%;
top: 50%;
height: 100%;
width: 110%;
background-image: url("data:image/svg+xml,%3Csvg xmlns='://www.w3.org/2000/svg' viewBox='0 0 100 20'%3E%3Cpath d='M0 10 Q 20 5, 40 10 T 80 10 T 100 10' stroke='%23d35400' stroke-width='3' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
background-repeat: no-repeat;
background-size: 100% 100%;
transform: scaleX(0);
transform-origin: left;
transition: transform 0.4s cubic-bezier(0.68, -0.55, 0.27, 1.55);
opacity: 0;
}
.sketch-input:checked + .custom-checkbox-sketch .checkmark-svg-sketch {
stroke-dashoffset: 0;
}
.sketch-input:checked ~ .sketch-text {
color: #999;
}
.sketch-input:checked ~ .sketch-text::after {
transform: scaleX(1);
opacity: 1;
}