Skip to content

Instantly share code, notes, and snippets.

@kobitoDevelopment
Last active July 20, 2022 06:58
Show Gist options
  • Select an option

  • Save kobitoDevelopment/4d7bcf87e59dff81d2d4fef614e56b73 to your computer and use it in GitHub Desktop.

Select an option

Save kobitoDevelopment/4d7bcf87e59dff81d2d4fef614e56b73 to your computer and use it in GitHub Desktop.
<button class="blobs">
<div class="blob1"></div>
<div class="blob2"></div>
<div class="blob3"></div>
<p class="text">ぷるん</p>
</button>
<svg xmlns="http://www.w3.org/2000/svg" version="1.1">
<defs>
<filter id="goo">
<feGaussianBlur in="SourceGraphic" stdDeviation="10" result="blur" />
<feColorMatrix in="blur" mode="matrix" values="1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 18 -7" result="goo" />
<feBlend in="SourceGraphic" in2="goo" />
<feComposite in="SourceGraphic" in2="goo" operator="atop" />
</filter>
</defs>
</svg>
.blobs {
filter: url(#goo);
width: 200px;
height: 100px;
position: relative;
margin: 100px auto;
display: block;
@include hover {
.blob1 {
animation: slime ease-in 1.6s forwards;
}
.blob2 {
animation: rightDown ease-in 1.6s forwards;
}
.blob3 {
animation: leftUp ease-in 1.6s forwards;
}
.text {
animation: slime ease-in 1.6s forwards;
}
}
.blob1 {
background: #469536;
width: 100%;
height: 100%;
}
.blob2 {
background: #469536;
width: 80px;
height: 80px;
position: absolute;
right: 10%;
bottom: 10%;
border-radius: 50%;
}
.blob3 {
background: #469536;
width: 80px;
height: 80px;
position: absolute;
left: 10%;
top: 10%;
border-radius: 50%;
}
.text {
color: #fff;
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
display: flex;
align-items: center;
justify-content: center;
}
}
@keyframes slime {
0% {
transform: scale(1);
}
20% {
transform: scale(1);
}
62% {
transform: scale(1.05);
}
80% {
transform: scale(1);
}
}
@keyframes rightDown {
0% {
transform: translateX(0px);
opacity: 1;
}
80% {
transform: translateX(100px) translateY(100px) scale(0.6);
opacity: 0.8;
}
100% {
transform: translateX(140px) translateY(140px) scale(0.3);
opacity: 0;
}
}
@keyframes leftUp {
0% {
transform: translateX(0px);
opacity: 1;
}
80% {
transform: translateX(-100px) translateY(-100px) scale(0.6);
opacity: 0.8;
}
100% {
transform: translateX(-140px) translateY(-140px) scale(0.3);
opacity: 0;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment