پیشنمایش زنده
کد HTML
<button class="button">
<div class="button-overlay"></div>
<span
>Button
<svg
xmlns="http://www.w3.org/2000/svg"
fill="none"
viewBox="0 0 53 58"
height="58"
width="53"
>
<path
stroke-width="9"
stroke="currentColor"
d="M44.25 36.3612L17.25 51.9497C11.5833 55.2213 4.5 51.1318 4.50001 44.5885L4.50001 13.4115C4.50001 6.86824 11.5833 2.77868 17.25 6.05033L44.25 21.6388C49.9167 24.9104 49.9167 33.0896 44.25 36.3612Z"
></path></svg
></span>
</button>
کد CSS
/* Base button style */
.button {
font-size: 17px;
border-radius: 12px;
background: linear-gradient(
180deg,
rgb(56, 56, 56) 0%,
rgb(36, 36, 36) 66%,
rgb(41, 41, 41) 100%
);
color: rgb(218, 218, 218);
border: none;
padding: 2px;
font-weight: 700;
cursor: pointer;
position: relative;
overflow: hidden;
transition: all 0.3s ease;
transform-origin: center;
}
/* Content styling */
.button span {
border-radius: 10px;
padding: 0.8em 1.3em;
padding-right: 1.2em;
text-shadow: 0px 0px 20px #4b4b4b;
width: 100%;
display: flex;
align-items: center;
gap: 12px;
color: inherit;
transition: all 0.3s ease;
background-color: rgb(29, 29, 29);
background-image: radial-gradient(
at 95% 89%,
rgb(15, 15, 15) 0px,
transparent 50%
),
radial-gradient(at 0% 100%, rgb(17, 17, 17) 0px, transparent 50%),
radial-gradient(at 0% 0%, rgb(29, 29, 29) 0px, transparent 50%);
}
.button:hover span {
background-color: rgb(26, 25, 25);
}
/* Overlay (unchanged) */
.button-overlay {
position: absolute;
inset: 0;
pointer-events: none;
background: repeating-conic-gradient(
rgb(48, 47, 47) 0.0000001%,
rgb(51, 51, 51) 0.000104%
)
60% 60%/600% 600%;
filter: opacity(10%) contrast(105%);
-webkit-filter: opacity(10%) contrast(105%);
}
.button svg {
width: 15px;
height: 15px;
}
/* 🔥 Circular hover effect */
.button::after {
content: "";
position: absolute;
top: 50%;
left: 50%;
width: 0;
height: 0;
border-radius: 50%;
background: radial-gradient(
circle,
rgba(255, 255, 255, 0.25) 0%,
rgba(255, 255, 255, 0) 70%
);
transform: translate(-50%, -50%) scale(0);
transition:
transform 0.6s ease,
opacity 0.8s ease;
opacity: 0;
pointer-events: none;
}
.button:hover::after {
width: 200%;
height: 200%;
transform: translate(-50%, -50%) scale(1);
opacity: 1;
}
/* 🌊 Click ripple effect */
.button:active::before {
content: "";
position: absolute;
top: 50%;
left: 50%;
width: 40px;
height: 40px;
border-radius: 50%;
background: rgba(255, 255, 255, 0.2);
transform: translate(-50%, -50%) scale(0);
animation: ripple-click 0.5s ease-out forwards;
pointer-events: none;
}
/* Press-in scaling effect */
.button:active {
transform: scale(0.97);
filter: brightness(1.1);
}
/* Optional: subtle glow */
.button:hover {
box-shadow: 0 0 12px rgba(255, 255, 255, 0.08);
}