源码Demo:
<!DOCTYPE html>
<html lang="zh">
<head>
<meta charset="UTF-8">
<title>ink_button</title>
<style>
* {margin: 0; padding: 0;}
body {
width: 100%;
height: 100%;
font-family: sans-serif;
background-image: linear-gradient(to right, #4facfe 0%, #00f2fe 100%);
}
#wrapper {
width: 800px;
height: 400px;
display: flex;
justify-content: center;
align-items: center;
margin: 0 auto;
}
.button {
position: relative;
width: 260px;
height: 70px;
display: flex;
justify-content: center;
align-items: center;
overflow: hidden;
margin: 0 0.8rem;
border-radius: 10px;
box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2), 0 3px 8px rgba(0, 0, 0, 0.1);
cursor: pointer;
transition: all 0.3s cubic-bezier(0.1, 0.22, 0.3, 1);
}
#btn1 {
background: #2980b9;
}
#btn2 {
background: #8e44ad;
}
#btn3 {
background: #16a085;
}
#btn4 {
background: #e74c3c;
}
.button span {
color: #fff;
font-size: 1rem;
z-index: 10;
text-transform: uppercase;
letter-spacing: 2px;
}
.back {
position: absolute;
width: 0;
height: 0;
filter: url(#filter);
border-radius: 50%;
z-index: 5;
transition: all 2.5s cubic-bezier(0.1, 0.22, 0.3, 1);
}
#btn1 .back {
left: -50%;
top: -50%;
background: #27ae60;
}
#btn2 .back {
right: -50%;
top: -50%;
background: #c0392b;
}
#btn3 .back {
left: -50%;
bottom: -50%;
background: #34495e;
}
#btn4 .back {
right: -50%;
bottom: -50%;
background: #2980b9;
}
.button:hover .back {
width: 330px;
height: 160px;
}
</style>
</head>
<body>
<svg width="0" height="0">
<filter id="filter">
<feTurbulence type="fractalNoise" baseFrequency=".02" numOctaves="9" />
<feDisplacementMap in="SourceGraphic" scale="100" />
</filter>
</svg>
<div id="wrapper">
<div class="button" id="btn1">
<span>hover</span>
<div class="back"></div>
</div>
<div class="button" id="btn2">
<span>hover</span>
<div class="back"></div>
</div>
<div class="button" id="btn3">
<span>hover</span>
<div class="back"></div>
</div>
<div class="button" id="btn4">
<span>hover</span>
<div class="back"></div>
</div>
</div>
</body>
</html>
公众号:
微信: