galaxy/Buttons/Carlos-vargs_breezy-horse-95.html

78 lines
1.8 KiB
HTML

<button class="button">
<span class="text">send message</span>
<span class="icon"><svg viewBox="0 0 512 512" xmlns="http://www.w3.org/2000/svg" data-icon="paper-plane" width="20px" aria-hidden="true"><path d="M476 3.2L12.5 270.6c-18.1 10.4-15.8 35.6 2.2 43.2L121 358.4l287.3-253.2c5.5-4.9 13.3 2.6 8.6 8.3L176 407v80.5c0 23.6 28.5 32.9 42.5 15.8L282 426l124.6 52.2c14.2 6 30.4-2.9 33-18.2l72-432C515 7.8 493.3-6.8 476 3.2z" fill="currentColor"></path></svg></span>
</button>
<style>
/* From Uiverse.io by Carlos-vargs - Tags: button, hover, animated */
.button {
display: flex;
align-items: center;
justify-content: center;
position: relative;
width: 100%;
border-radius: 36px;
font-weight: 700;
height: 54px;
font-size: 16px;
padding-inline: 20px;
background-color: transparent;
color: #fff;
text-transform: uppercase;
overflow: hidden;
text-align: center;
transition: all .25s ease-in-out;
z-index: 1;
border: none;
}
.button:is(:hover, :focus)::before {
transform: translateX(0%);
}
.text {
white-space: nowrap;
line-height: 1.2;
padding-inline-end: 44px;
z-index: 2;
}
/* change the width and height to 100% when you use it in your layout */
.button::after {
content: '';
position: absolute;
height: calc(100% - 2px);
width: calc(100% - 2px);
border: 1px solid #FFB400;
border-radius: 36px;
z-index: 2;
}
.button::before {
content: "";
position: absolute;
height: 100%;
width: 100%;
background-color: #FFB400;
z-index: 1;
left: -2px;
transform: translateX(90%);
transition: all .3s ease-out;
}
.icon {
display: inherit;
position: absolute;
top: 50%;
transform: translateY(-50%);
right: 0;
width: 54px;
height: 54px;
justify-content: center;
align-items: center;
border-radius: 100%;
background-color: #FFB400;
z-index: 2;
}
</style>