/* From Uiverse.io by satyamchaudharydev */
.button {
--width: 100px;
--height: 35px;
--tooltip-height: 35px;
--tooltip-width: 90px;
--gap-between-tooltip-to-button: 18px;
--button-color: #1163ff;
--tooltip-color: #fff;
width: var(--width);
height: var(--height);
background: var(--button-color);
position: relative;
text-align: center;
border-radius: 0.45em;
font-family: "Arial";
transition: background 0.3s;
}
.button::before {
position: absolute;
content: attr(data-tooltip);
width: var(--tooltip-width);
height: var(--tooltip-height);
background-color: var(--tooltip-color);
font-size: 0.9rem;
color: #111;
border-radius: .25em;
line-height: var(--tooltip-height);
bottom: calc(var(--height) + var(--gap-between-tooltip-to-button) + 10px);
left: calc(50% - var(--tooltip-width) / 2);
}
.button::after {
position: absolute;
content: '';
width: 0;
height: 0;
border: 10px solid transparent;
border-top-color: var(--tooltip-color);
left: calc(50% - 10px);
bottom: calc(100% + var(--gap-between-tooltip-to-button) - 10px);
}
.button::after,.button::before {
opacity: 0;
visibility: hidden;
transition: all 0.5s;
}
.text {
display: flex;
align-items: center;
justify-content: center;
}
.button-wrapper,.text,.icon {
overflow: hidden;
position: absolute;
width: 100%;
height: 100%;
left: 0;
color: #fff;
}
.text {
top: 0
}
.text,.icon {
transition: top 0.5s;
}
.icon {
color: #fff;
top: 100%;
display: flex;
align-items: center;
justify-content: center;
}
.icon svg {
width: 24px;
height: 24px;
}
.button:hover {
background: #6c18ff;
}
.button:hover .text {
top: -100%;
}
.button:hover .icon {
top: 0;
}
.button:hover:before,.button:hover:after {
opacity: 1;
visibility: visible;
}
.button:hover:after {
bottom: calc(var(--height) + var(--gap-between-tooltip-to-button) - 20px);
}
.button:hover:before {
bottom: calc(var(--height) + var(--gap-between-tooltip-to-button));
}
Download
/* From Uiverse.io by SelfMadeSystem */
.button-container {
position: relative;
margin: 0 2em;
}
.button-border {
padding: 3px;
inset: 0;
background: #0005;
border-radius: inherit;
clip-path: path(
"M 90 0 C 121 0 126 5 126 33 C 126 61 121 66 90 66 L 33 66 C 5 66 0 61 0 33 C 0 5 5 0 33 0 Z"
);
}
.button {
justify-content: center;
align-items: center;
border: none;
border-radius: 0.875em;
clip-path: path(
"M 90 0 C 115 0 120 5 120 30 C 120 55 115 60 90 60 L 30 60 C 5 60 0 55 0 30 C 0 5 5 0 30 0 Z"
);
width: 120px;
height: 60px;
background: #111215;
display: flex;
flex-direction: column;
color: #fff;
overflow: hidden;
}
.real-button {
position: absolute;
width: 120px;
height: 60px;
z-index: 1;
outline: none;
border: none;
border-radius: 17px;
cursor: pointer;
opacity: 0;
}
.backdrop {
position: absolute;
inset: -9900%;
background: radial-gradient(
circle at 50% 50%,
#0000 0,
#0000 20%,
#111111aa 50%
);
background-size: 3px 3px;
z-index: -1;
}
.spin {
position: absolute;
inset: 0;
z-index: -2;
opacity: 0.5;
overflow: hidden;
transition: 0.3s;
}
.real-button:active ~ div .spin {
opacity: 1;
}
.spin-blur {
filter: blur(2em) url(#unopaq);
}
.spin-intense {
inset: -0.125em;
filter: blur(0.25em) url(#unopaq2);
border-radius: 0.75em;
}
.spin-inside {
inset: -2px;
border-radius: inherit;
filter: blur(2px) url(#unopaq3);
z-index: 0;
}
.spin::before {
content: "";
position: absolute;
inset: -150%;
animation:
speen 8s cubic-bezier(0.56, 0.15, 0.28, 0.86) infinite,
woah 4s infinite;
animation-play-state: paused;
}
.real-button:hover ~ div .spin::before {
animation-play-state: running;
}
.spin-blur::before {
background: linear-gradient(90deg, #f50 30%, #0000 50%, #05f 70%);
}
.spin-intense::before {
background: linear-gradient(90deg, #f95 20%, #0000 45% 55%, #59f 80%);
}
.spin-inside::before {
background: linear-gradient(90deg, #fc9 30%, #0000 45% 55%, #9cf 70%);
}
@keyframes speen {
0% {
rotate: 10deg;
}
50% {
rotate: 190deg;
}
to {
rotate: 370deg;
}
}
@keyframes woah {
0%. to {
scale: 1;
}
50% {
scale: 0.75;
}
}
Button