mirror of
https://github.com/uiverse-io/galaxy.git
synced 2025-11-28 05:00:22 +08:00
183 lines
2.6 KiB
HTML
183 lines
2.6 KiB
HTML
<button>
|
|
<span class="button-text">
|
|
</span>
|
|
<span class="animation">
|
|
<span class="paper-wrapper">
|
|
<span class="paper">
|
|
</span>
|
|
</span>
|
|
<span class="shredded-wrapper">
|
|
<span class="shredded">
|
|
</span>
|
|
</span>
|
|
<span class="lid">
|
|
</span>
|
|
<span class="can">
|
|
<span class="filler">
|
|
</span>
|
|
</span>
|
|
</span>
|
|
</button>
|
|
<style>
|
|
/* From Uiverse.io by Lucaasbre - Source: Frontend Joe - https://frontendjoe.com - Tags: button, active, delete, animated, css */
|
|
button {
|
|
display: flex;
|
|
align-items: center;
|
|
justify-content: center;
|
|
border-radius: 10px;
|
|
border: 0;
|
|
background: #ff2c6c;
|
|
font-size: 22px;
|
|
font-weight: 400;
|
|
font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
|
|
color: #f9f9f9;
|
|
padding: 0 0 0 24px;
|
|
width: 210px;
|
|
height: 64px;
|
|
text-align: left;
|
|
cursor: pointer;
|
|
transition: 0.3s;
|
|
}
|
|
|
|
.button-text {
|
|
flex: 0 0 120px;
|
|
}
|
|
|
|
.button-text::before {
|
|
content: "Delete";
|
|
}
|
|
|
|
.animation {
|
|
position: relative;
|
|
overflow: hidden;
|
|
display: grid;
|
|
place-items: center;
|
|
width: 64px;
|
|
height: 64px;
|
|
scale: 1;
|
|
}
|
|
|
|
.can {
|
|
overflow: hidden;
|
|
position: relative;
|
|
translate: 0 3px;
|
|
width: 20px;
|
|
height: 22px;
|
|
border-left-radius: 5px;
|
|
border-right-radius: 5px;
|
|
border: 2px solid #ffffff;
|
|
}
|
|
|
|
.lid {
|
|
position: absolute;
|
|
top: 20px;
|
|
left: 50%;
|
|
translate: -50% 0;
|
|
width: 22px;
|
|
height: 2px;
|
|
background: #ffffff;
|
|
}
|
|
|
|
@keyframes move {
|
|
75%,
|
|
100% {
|
|
translate: 0 88px;
|
|
}
|
|
}
|
|
|
|
.paper-wrapper,
|
|
.shredded-wrapper {
|
|
overflow: hidden;
|
|
position: absolute;
|
|
display: flex;
|
|
top: -20px;
|
|
left: 50%;
|
|
margin-left: -5px;
|
|
width: 10px;
|
|
height: 64px;
|
|
}
|
|
|
|
.paper-wrapper {
|
|
height: 40px;
|
|
}
|
|
|
|
.shredded-wrapper {
|
|
top: 24px;
|
|
height: 20px;
|
|
justify-content: center;
|
|
}
|
|
|
|
.paper, .shredded {
|
|
display: block;
|
|
background: #ffffff;
|
|
height: 20px;
|
|
}
|
|
|
|
.paper {
|
|
width: 10px;
|
|
}
|
|
|
|
.shredded {
|
|
margin-top: -40px;
|
|
width: 2px;
|
|
}
|
|
|
|
.shredded::before,
|
|
.shredded::after {
|
|
content: "";
|
|
position: absolute;
|
|
z-index: 1;
|
|
top: 0;
|
|
width: inherit;
|
|
height: inherit;
|
|
background: inherit;
|
|
}
|
|
|
|
.shredded::before {
|
|
left: -4px;
|
|
}
|
|
|
|
.shredded::after {
|
|
right: -4px;
|
|
}
|
|
|
|
@keyframes fill {
|
|
0%, 20% {
|
|
translate: 0 0;
|
|
}
|
|
|
|
40%, 70% {
|
|
translate: 0 -50%;
|
|
}
|
|
|
|
90%, 100% {
|
|
translate: 0 -100%;
|
|
}
|
|
}
|
|
|
|
.filler {
|
|
position: absolute;
|
|
top: 100%;
|
|
left: 50%;
|
|
margin-left: -32px;
|
|
width: 64px;
|
|
height: 120%;
|
|
background: #ffffff;
|
|
}
|
|
|
|
button:hover {
|
|
opacity: 0.75;
|
|
}
|
|
|
|
button:active .button-text::before {
|
|
content: "Deleting...";
|
|
}
|
|
|
|
button:active :is(.paper, .shredded) {
|
|
animation: move 1.25s linear 2 both;
|
|
}
|
|
|
|
button:active .filler {
|
|
animation: fill 2.5s both;
|
|
}
|
|
</style>
|