پیش‌نمایش زنده
کد HTML
<button
  class="cursor-pointer text-white font-bold relative text-[14px] w-[9em] h-[3em] text-center bg-gradient-to-r from-violet-500 from-10% via-sky-500 via-30% to-pink-500 to-90% bg-[length:400%] rounded-[30px] z-10 hover:animate-gradient-xy hover:bg-[length:100%] before:content-[''] before:absolute before:-top-[5px] before:-bottom-[5px] before:-left-[5px] before:-right-[5px] before:bg-gradient-to-r before:from-violet-500 before:from-10% before:via-sky-500 before:via-30% before:to-pink-500 before:bg-[length:400%] before:-z-10 before:rounded-[35px] before:hover:blur-xl before:transition-all before:ease-in-out before:duration-[1s] before:hover:bg-[length:10%] active:bg-violet-700 focus:ring-violet-700"
>
  HOVER ME
</button>
کد CSS
.relative {
  position: relative;
}
.z-10 {
  z-index: 10;
}
.h-\[3em\] {
  height: 3em;
}
.w-\[9em\] {
  width: 9em;
}
.cursor-pointer {
  cursor: pointer;
}
.rounded-\[30px\] {
  border-radius: 30px;
}
.bg-gradient-to-r {
  background-image: linear-gradient(to right, var(--tw-gradient-stops));
}
.from-violet-500 {
  --tw-gradient-from: #8b5cf6 var(--tw-gradient-from-position);
  --tw-gradient-to: rgb(139 92 246 / 0) var(--tw-gradient-to-position);
  --tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to);
}
.from-10\% {
  --tw-gradient-from-position: 10%;
}
.via-sky-500 {
  --tw-gradient-to: rgb(14 165 233 / 0) var(--tw-gradient-to-position);
  --tw-gradient-stops: var(--tw-gradient-from),
    #0ea5e9 var(--tw-gradient-via-position), var(--tw-gradient-to);
}
.via-30\% {
  --tw-gradient-via-position: 30%;
}
.to-pink-500 {
  --tw-gradient-to: #ec4899 var(--tw-gradient-to-position);
}
.to-90\% {
  --tw-gradient-to-position: 90%;
}
.bg-\[length\:400\%\] {
  background-size: 400%;
}
.text-center {
  text-align: center;
}
.text-\[14px\] {
  font-size: 14px;
}
.font-bold {
  font-weight: 700;
}
.text-white {
  --tw-text-opacity: 1;
  color: rgb(255 255 255 / var(--tw-text-opacity));
}
.before\:absolute::before {
  content: var(--tw-content);
  position: absolute;
}
.before\:-bottom-\[5px\]::before {
  content: var(--tw-content);
  bottom: -5px;
}
.before\:-left-\[5px\]::before {
  content: var(--tw-content);
  left: -5px;
}
.before\:-right-\[5px\]::before {
  content: var(--tw-content);
  right: -5px;
}
.before\:-top-\[5px\]::before {
  content: var(--tw-content);
  top: -5px;
}
.before\:-z-10::before {
  content: var(--tw-content);
  z-index: -10;
}
.before\:rounded-\[35px\]::before {
  content: var(--tw-content);
  border-radius: 35px;
}
.before\:bg-gradient-to-r::before {
  content: var(--tw-content);
  background-image: linear-gradient(to right, var(--tw-gradient-stops));
}
.before\:from-violet-500::before {
  content: var(--tw-content);
  --tw-gradient-from: #8b5cf6 var(--tw-gradient-from-position);
  --tw-gradient-to: rgb(139 92 246 / 0) var(--tw-gradient-to-position);
  --tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to);
}
.before\:from-10\%::before {
  content: var(--tw-content);
  --tw-gradient-from-position: 10%;
}
.before\:via-sky-500::before {
  content: var(--tw-content);
  --tw-gradient-to: rgb(14 165 233 / 0) var(--tw-gradient-to-position);
  --tw-gradient-stops: var(--tw-gradient-from),
    #0ea5e9 var(--tw-gradient-via-position), var(--tw-gradient-to);
}
.before\:via-30\%::before {
  content: var(--tw-content);
  --tw-gradient-via-position: 30%;
}
.before\:to-pink-500::before {
  content: var(--tw-content);
  --tw-gradient-to: #ec4899 var(--tw-gradient-to-position);
}
.before\:bg-\[length\:400\%\]::before {
  content: var(--tw-content);
  background-size: 400%;
}
.before\:transition-all::before {
  content: var(--tw-content);
  transition-property: all;
  transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
  transition-duration: 150ms;
}
.before\:duration-\[1s\]::before {
  content: var(--tw-content);
  transition-duration: 1s;
}
.before\:ease-in-out::before {
  content: var(--tw-content);
  transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
}
.before\:content-\[\'\'\]::before {
  --tw-content: "";
  content: var(--tw-content);
}
.hover\:bg-\[length\:100\%\]:hover {
  background-size: 100%;
}
.before\:hover\:bg-\[length\:10\%\]:hover::before {
  content: var(--tw-content);
  background-size: 10%;
}
.before\:hover\:blur-xl:hover::before {
  content: var(--tw-content);
  --tw-blur: blur(24px);
  filter: var(--tw-blur) var(--tw-brightness) var(--tw-contrast)
    var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate)
    var(--tw-sepia) var(--tw-drop-shadow);
}
.focus\:ring-violet-700:focus {
  --tw-ring-opacity: 1;
  --tw-ring-color: rgb(109 40 217 / var(--tw-ring-opacity));
}
.active\:bg-violet-700:active {
  --tw-bg-opacity: 1;
  background-color: rgb(109 40 217 / var(--tw-bg-opacity));
}
نوع: button
تاریخ ایجاد: 2026/06/05
آخرین بروزرسانی: 2026/06/05