HTML _CSS
Wave BG Button
HiroDaegu
2022. 9. 4. 21:59
728x90
SMALL

<!DOCTYPE html>
<html lang="ko">
<head>
<meta charset="UTF-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>WAVE BG BTN</title>
<link rel="stylesheet" href="style.css" />
</head>
<body>
<a href="#">
<span>Button</span>
<div class="liquid"></div>
</a>
</body>
</html>
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
body {
display: flex;
justify-content: center;
align-items: center;
min-height: 100vh;
background-color: #0C0C0C;
}
a {
position: relative;
padding: 20px 50px;
display: block;
text-decoration: none;
text-transform: uppercase;
width: 200px;
overflow: hidden;
border-radius: 40px;
}
a span {
position: relative;
color: #FFF;
font-size: 20px;
font-family: Arial, Helvetica, sans-serif;
letter-spacing: 8px;
z-index: 1;
}
a .liquid {
position: absolute;
top: -80px;
left: 0;
width: 200px;
height: 200px;
background-color: #4973FF;
box-shadow: inset 0 0 50px rgba(0, 0, 0, .5);
transition: .5s;
}
a .liquid::before, a .liquid::after {
content: '';
width: 200%;
height: 200%;
position: absolute;
top: 0;
left: 50%;
transform: translate(-50%, -75%);
background-color: #000;
}
a .liquid::before {
border-radius: 45%;
background-color: rgba(20, 20, 20, 1);
animation: animate 5s linear infinite;
}
a .liquid::after {
border-radius: 40%;
background-color: rgba(20, 20, 20, .5);
animation: animate 10s linear infinite;
}
a:hover .liquid {
top: -120px;
}
@keyframes animate {
0% {
transform: translate(-50%, -75%) rotate(0deg);
}
100% {
transform: translate(-50%, -75%) rotate(360deg);
}
}728x90
LIST