<html lang="en">
<head>
<meta charset="utf-8">
<title>CSS-Button hover effect</title>
<link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.4.1/css/all.css">
</head>
<body>
<div class="middle">
<a class="btn" href="#">
<i class="fab fa-facebook-f"></i>
</a>
<a class="btn" href="#">
<i class="fab fa-twitter"></i>
</a>
<a class="btn" href="#">
<i class="fab fa-google"></i>
</a>
<a class="btn" href="#">
<i class="fab fa-instagram"></i>
</a>
<a class="btn" href="#">
<i class="fab fa-youtube"></i>
</a>
</div>
</body>
</html>
:root {
--bg: #3a4fba;
--btn-hover: #596dd4;
--btn: #f2f2f2;
--icon: #5e6dba;
}
body {
padding: 0;
margin: 0;
background-color: var(--bg);
}
.middle {
position: absolute;
top: 50%;
transform: translateY(-50%);
width: 100%;
text-align: center;
}
.btn {
display: inline-block;
width: 90px;
height: 90px;
background: var(--btn);
margin: 10px;
border-radius: 30%;
box-shadow: 0 5px 15px -5px #000;
color: var(--icon);
overflow: hidden;
position: relative;
transition: 0.4s ease-in-out;
}
.btn i{
position: relative;
top: 30px;
font-size: 26px;
transition: 0.6s ease-in-out;
}
.btn:hover {
background-color: var(--bg);
box-shadow: none;
}
.btn:hover i {
transform: scale(1.2);
color: white;
}
.btn::before {
content: "";
position: absolute;
width: 120%;
height: 120%;
background: var(--btn-hover);
transform: rotate(45deg);
left: -110%;
top: 90%;
transform-origin: 50% 50%;
border-radius: 50%;
opacity: 0;
}
.btn:hover::before {
transform: scale(1.2);
box-shadow: inset 0px 10px 46px -18px #000;
opacity: 1;
animation: sweet 0.7s 1;
top: -10%;
left: -10%;
}
@keyframes sweet {
0%{
left: -110%;
top: 90%;
}50%{
left: 10%;
top: -30%;
}100%{
top: -10%;
left: -10%;
}
}
This Pen doesn't use any external CSS resources.
This Pen doesn't use any external JavaScript resources.