پیشنمایش زنده
کد HTML
<div class="button-group">
<button class="darkmatter-btn">
Engage
<div
class="darkmatter-particle"
style="--tx: -20px; --ty: -15px; left: 25%; top: 25%;"
></div>
<div
class="darkmatter-particle"
style="--tx: 15px; --ty: -20px; left: 75%; top: 25%; animation-delay: 0.2s;"
></div>
<div
class="darkmatter-particle"
style="--tx: -15px; --ty: 15px; left: 25%; top: 75%; animation-delay: 0.4s;"
></div>
<div
class="darkmatter-particle"
style="--tx: 20px; --ty: 15px; left: 75%; top: 75%; animation-delay: 0.6s;"
></div>
</button>
</div>
کد CSS
.darkmatter-btn {
background: #000;
border: 1px solid #333;
color: #b56aff;
padding: 15px 40px;
border-radius: 8px;
font-size: 16px;
cursor: pointer;
position: relative;
overflow: hidden;
transition: all 0.3s ease;
z-index: 1;
}
.darkmatter-btn:hover {
box-shadow: 0 0 15px rgba(181, 106, 255, 0.4);
color: #fff;
}
.darkmatter-btn::before {
content: "";
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
background: radial-gradient(
circle at center,
rgba(181, 106, 255, 0.1) 0%,
transparent 70%
);
transform: scale(0);
transition: transform 0.6s ease;
z-index: -1;
}
.darkmatter-btn:hover::before {
transform: scale(1.5);
}
.darkmatter-particle {
position: absolute;
width: 3px;
height: 3px;
border-radius: 50%;
background: #b56aff;
opacity: 0;
z-index: -1;
}
.darkmatter-btn:hover .darkmatter-particle {
animation: darkmatter-float 2s forwards;
}
@keyframes darkmatter-float {
0% {
transform: translate(0, 0) scale(0);
opacity: 0;
}
20% {
opacity: 0.8;
}
100% {
transform: translate(var(--tx), var(--ty)) scale(1);
opacity: 0;
}
}