پیشنمایش زنده
کد HTML
<button>
<span class="text">Button</span>
<span class="blob"></span>
<span class="blob"></span>
<span class="blob"></span>
<span class="blob"></span>
</button>
کد CSS
button {
position: relative;
font-family: inherit;
font-size: 18px;
border-radius: 40em;
width: 8em;
height: 3em;
z-index: 1;
color: white;
overflow: hidden;
border: none;
}
button .text {
position: absolute;
left: 0;
top: 0;
width: 100%;
height: 100%;
line-height: 3em;
border-radius: 40em;
border: none;
background: linear-gradient(rgba(255, 255, 255, 0.473), rgba(150, 150,150, 0.25));
z-index: 1;
backdrop-filter: blur(10px);
-webkit-backdrop-filter: blur(10px);
}
button .blob {
position: absolute;
z-index: -1;
border-radius: 5em;
width: 5em;
height: 3em;
transition: transform .3s ease-in-out, background .3s ease-in-out;
}
button .blob:nth-child(2) {
left: 0em;
top: 0;
background: #541388;
}
button .blob:nth-child(3) {
left: 1.8em;
top: 0;
z-index: -1;
background: #1768AC;
}
button .blob:nth-child(4) {
left: 4em;
top: -1em;
background: #A2D7D3;
}
button .blob:nth-child(5) {
left: 4.3em;
top: 1.6em;
background: #F5A962;
}
button:hover .blob:nth-child(2) {
background: #F5A962;
}
button:hover .blob:nth-child(3) {
background: #A2D7D3;
}
button:hover .blob:nth-child(4) {
background: #1768AC;
}
button:hover .blob:nth-child(5) {
background: #541388;
}
button:hover .blob {
transform: scale(1.3);
}
button:active {
border: 2px solid white;
}