پیشنمایش زنده
کد HTML
<div class="fingerprint-container">
<div class="fingerprint-button">
<svg
class="fingerprint-svg"
xmlns="http://www.w3.org/2000/svg"
width="24"
height="24"
viewBox="0 0 24 24"
>
<g
fill="none"
stroke-linecap="round"
stroke-linejoin="round"
stroke-width="1.5"
>
<path
d="M7 3.516A9.004 9.004 0 0 1 20.648 8.5M21 22v-8M3 22V11c0-1.052.18-2.062.512-3"
></path>
<path
d="M18 22V11.3C18 7.82 15.314 5 12 5s-6 2.82-6 6.3V14m0 8v-4"
></path>
<path
d="M9 22V11.15C9 9.41 10.343 8 12 8c.865 0 1.645.385 2.193 1M15 22v-8m-3 8v-3.5m0-7.5v3"
></path>
</g>
</svg>
<div class="scan-line"></div>
<div class="glitch-overlay-h"></div>
<div class="glitch-overlay-v"></div>
<div class="glitch-distort"></div>
<div class="ripple-effect"></div>
<div class="binary-particles">
<span class="particle" style="left: 10%; animation-delay: 0s;">1</span>
<span class="particle" style="left: 30%; animation-delay: -0.2s;">0</span>
<span class="particle" style="left: 50%; animation-delay: -0.4s;">1</span>
<span class="particle" style="left: 70%; animation-delay: -0.6s;">0</span>
<span class="particle" style="left: 90%; animation-delay: -0.8s;">1</span>
</div>
</div>
</div>
کد CSS
.fingerprint-container {
position: relative;
width: 120px;
height: 120px;
display: flex;
justify-content: center;
align-items: center;
}
.fingerprint-button {
position: relative;
width: 100px;
height: 100px;
background: #1a1a1a;
border: 2px solid #00ff00;
border-radius: 50%;
box-shadow: 0 0 15px #00ff00;
cursor: pointer;
overflow: hidden;
transition: all 0.3s ease;
z-index: 1;
display: flex;
justify-content: center;
align-items: center;
}
/* SVG Fingerprint */
.fingerprint-svg {
width: 70px;
height: 70px;
stroke: #00ff00;
fill: none;
z-index: 2;
transition: stroke 0.3s ease;
}
.fingerprint-svg path {
stroke-dasharray: 50;
stroke-dashoffset: 0;
transition: stroke-dashoffset 0.5s ease;
}
/* Scan line */
.scan-line {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 4px;
background: rgba(0, 255, 0, 0.6);
box-shadow: 0 0 10px #00ff00;
opacity: 0;
transition: opacity 0.3s ease;
z-index: 3;
}
/* Horizontal glitch overlay */
.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;
}
/* Vertical glitch overlay */
.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;
}
/* Distorted glitch layer */
.glitch-distort {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
background: rgba(0, 255, 0, 0.1);
opacity: 0;
transition: opacity 0.3s ease;
z-index: 1;
}
/* Ripple effect for click */
.ripple-effect {
position: absolute;
width: 0;
height: 0;
background: rgba(0, 255, 0, 0.3);
border-radius: 50%;
opacity: 0;
z-index: 2;
pointer-events: none;
}
/* Binary particles */
.binary-particles {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
pointer-events: none;
z-index: 4;
}
.particle {
position: absolute;
color: #00ff00;
font-size: 10px;
opacity: 0;
animation: particle-rise 1.2s linear infinite;
}
/* Hover state */
.fingerprint-button:hover {
background: rgba(0, 255, 0, 0.1);
box-shadow: 0 0 25px #00ff00;
transform: scale(1.05);
}
.fingerprint-button:hover .fingerprint-svg {
stroke: #00cc00;
}
.fingerprint-button:hover .fingerprint-svg path:nth-child(1) {
animation: scan-path-1 1.5s infinite linear;
}
.fingerprint-button:hover .fingerprint-svg path:nth-child(2) {
animation: scan-path-2 1.5s infinite linear;
}
.fingerprint-button:hover .fingerprint-svg path:nth-child(3) {
animation: scan-path-3 1.5s infinite linear;
}
.fingerprint-button:hover .scan-line {
opacity: 1;
animation: scan-move 1.5s infinite linear;
}
.fingerprint-button:hover .glitch-overlay-h {
opacity: 1;
animation: glitch-h 1s infinite;
}
.fingerprint-button:hover .glitch-overlay-v {
opacity: 1;
animation: glitch-v 0.8s infinite;
}
.fingerprint-button:hover .glitch-distort {
opacity: 0.8;
animation: glitch-distort 0.5s infinite;
}
/* Clicked state */
.fingerprint-button:active {
background: #00ff00;
box-shadow:
0 0 30px #00ff00,
0 0 50px #00ff00;
transition: all 0.1s ease;
}
.fingerprint-button:active .fingerprint-svg {
stroke: #0a0a0a;
}
.fingerprint-button:active .fingerprint-svg path {
animation: scanned-path 0.5s ease-in-out forwards;
}
.fingerprint-button:active .scan-line,
.fingerprint-button:active .glitch-overlay-h,
.fingerprint-button:active .glitch-overlay-v,
.fingerprint-button:active .glitch-distort {
opacity: 0;
}
.fingerprint-button:active .ripple-effect {
width: 120px;
height: 120px;
opacity: 1;
animation: ripple 0.6s ease-out forwards;
transform: translate(-50%, -50%);
top: 50%;
left: 50%;
}
/* Animations */
@keyframes scan-path-1 {
0% {
stroke-dashoffset: 50;
}
50% {
stroke-dashoffset: 0;
}
100% {
stroke-dashoffset: 50;
}
}
@keyframes scan-path-2 {
0% {
stroke-dashoffset: 0;
}
50% {
stroke-dashoffset: 50;
}
100% {
stroke-dashoffset: 0;
}
}
@keyframes scan-path-3 {
0% {
stroke-dashoffset: 25;
}
50% {
stroke-dashoffset: 75;
}
100% {
stroke-dashoffset: 25;
}
}
@keyframes scan-move {
0% {
top: 0;
}
100% {
top: 100%;
}
}
@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 glitch-distort {
0% {
transform: translate(0, 0);
}
20% {
transform: translate(-2px, 2px);
}
40% {
transform: translate(2px, -2px);
}
60% {
transform: translate(-1px, 1px);
}
80% {
transform: translate(1px, -1px);
}
100% {
transform: translate(0, 0);
}
}
@keyframes scanned-path {
0% {
stroke-dashoffset: 0;
opacity: 1;
}
50% {
stroke-dashoffset: 50;
opacity: 0.8;
}
100% {
stroke-dashoffset: 0;
opacity: 1;
}
}
@keyframes ripple {
0% {
width: 0;
height: 0;
opacity: 1;
}
100% {
width: 120px;
height: 120px;
opacity: 0;
}
}
@keyframes particle-rise {
0% {
opacity: 0;
transform: translateY(100%) translateX(0);
}
20% {
opacity: 0.7;
}
100% {
opacity: 0;
transform: translateY(-100%) translateX(10px);
}
}