پیشنمایش زنده
کد HTML
<div class="checkbox-container">
<input class="checkbox-input" id="hacker-checkbox" type="checkbox" />
<label class="checkbox-label" for="hacker-checkbox">
<span class="checkmark"></span>
<div class="grid-bg"></div>
<div class="glitch-overlay-h"></div>
<div class="glitch-overlay-v"></div>
<div class="binary-particles">
<span style="left: 10%; animation-delay: 0s;" class="particle">1</span>
<span style="left: 30%; animation-delay: -0.2s;" class="particle">0</span>
<span style="left: 50%; animation-delay: -0.4s;" class="particle">1</span>
<span style="left: 70%; animation-delay: -0.6s;" class="particle">0</span>
<span style="left: 90%; animation-delay: -0.8s;" class="particle">1</span>
</div>
</label>
</div>
کد CSS
.checkbox-container {
position: relative;
width: 50px;
height: 50px;
display: flex;
justify-content: center;
align-items: center;
}
.checkbox-input {
display: none;
}
.checkbox-label {
position: relative;
width: 100%;
height: 100%;
background: #1a1a1a;
border: 2px solid #00ff00;
border-radius: 50%;
box-shadow: 0 0 12px #00ff00;
cursor: pointer;
transition: all 0.3s ease;
overflow: hidden;
display: flex;
justify-content: center;
align-items: center;
}
/* Grid background */
.grid-bg {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
background: repeating-linear-gradient(
45deg,
rgba(0, 255, 0, 0.1),
rgba(0, 255, 0, 0.1) 2px,
transparent 2px,
transparent 6px
);
opacity: 0.3;
transition: opacity 0.3s ease;
z-index: 0;
animation: grid-shift 1.5s linear infinite paused;
}
/* Checkmark */
.checkmark {
position: absolute;
width: 30px;
height: 30px;
border: 3px solid #00ff00;
border-radius: 50%;
opacity: 0;
transition:
opacity 0.3s ease,
transform 0.3s ease;
z-index: 2;
}
.checkmark::before {
content: "";
position: absolute;
top: 50%;
left: 50%;
width: 12px;
height: 6px;
border-left: 3px solid #00ff00;
border-bottom: 3px solid #00ff00;
transform: translate(-50%, -70%) rotate(-45deg);
opacity: 0;
transition: opacity 0.3s ease;
}
/* Glitch effects */
.glitch-overlay-h {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
background: linear-gradient(
90deg,
transparent,
rgba(0, 255, 0, 0.2),
transparent
);
opacity: 0;
transition: opacity 0.3s ease;
z-index: 1;
}
.glitch-overlay-v {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
background: linear-gradient(
0deg,
transparent,
rgba(0, 255, 0, 0.15),
transparent
);
opacity: 0;
transition: opacity 0.3s ease;
z-index: 1;
}
/* Binary particles */
.binary-particles {
position: absolute;
top: -20px;
left: 0;
width: 100%;
height: 80px;
pointer-events: none;
z-index: 3;
}
.particle {
position: absolute;
color: #00ff00;
font-size: 10px;
opacity: 0;
animation: particle-rise 1.2s linear infinite;
}
/* Hover state */
.checkbox-label:hover {
box-shadow: 0 0 20px #00ff00;
transform: scale(1.05);
}
.checkbox-label:hover .glitch-overlay-h {
opacity: 1;
animation: glitch-h 1s infinite;
}
.checkbox-label:hover .glitch-overlay-v {
opacity: 1;
animation: glitch-v 0.8s infinite;
}
/* Checked state */
.checkbox-input:checked + .checkbox-label {
background: rgba(0, 255, 0, 0.2);
border-color: #00ff00;
box-shadow: 0 0 25px #00ff00;
}
.checkbox-input:checked + .checkbox-label .grid-bg {
opacity: 0.6;
animation-play-state: running;
}
.checkbox-input:checked + .checkbox-label .checkmark {
opacity: 1;
transform: rotate(360deg);
animation: check-rotate 0.5s ease-in-out;
}
.checkbox-input:checked + .checkbox-label .checkmark::before {
opacity: 1;
animation: check-bounce 0.4s ease-in-out 0.1s;
}
.checkbox-input:checked + .checkbox-label .glitch-overlay-h {
opacity: 0.8;
animation: glitch-h 0.6s infinite;
}
.checkbox-input:checked + .checkbox-label .glitch-overlay-v {
opacity: 0.8;
animation: glitch-v 0.5s infinite;
}
/* Animations */
@keyframes grid-shift {
0% {
background-position: 0 0;
}
100% {
background-position: 6px 6px;
}
}
@keyframes glitch-h {
0% {
transform: translateX(-100%);
}
20% {
transform: translateX(100%) skewX(5deg);
}
100% {
transform: translateX(100%);
}
}
@keyframes glitch-v {
0% {
transform: translateY(-100%);
}
30% {
transform: translateY(100%) skewY(3deg);
}
100% {
transform: translateY(100%);
}
}
@keyframes check-rotate {
0% {
transform: scale(0) rotate(0deg);
}
50% {
transform: scale(1.1) rotate(180deg);
}
100% {
transform: scale(1) rotate(360deg);
}
}
@keyframes check-bounce {
0% {
opacity: 0;
transform: translate(-50%, -70%) rotate(-45deg) scale(0);
}
50% {
opacity: 1;
transform: translate(-50%, -70%) rotate(-45deg) scale(1.2);
}
100% {
opacity: 1;
transform: translate(-50%, -70%) rotate(-45deg) scale(1);
}
}
@keyframes particle-rise {
0% {
opacity: 0;
transform: translateY(40px);
}
20% {
opacity: 0.7;
}
100% {
opacity: 0;
transform: translateY(-20px);
}
}