button hover
by Kim Ara
HTML
<div class="button">
<a href="#">
<p>Hover me</p>
<div class="hoverBtn"></div>
<div class="hoverBtn-bottom"></div>
</a>
</div>
CSS
.button {
width: 200px;
margin: 100px auto;
position: relative;
border: solid 2px #cbd4d9;
height: 55px;
}
.button:hover .hoverBtn:before, .button:hover .hoverBtn:after {
opacity: 1;
-webkit-animation: open 0.4s;
/* Chrome, Safari, Opera */
animation: open 0.4s;
animation-fill-mode: forwards;
animation-timing-function: cubic-bezier(0.39, 0.575, 0.565, 1);
animation-direction: normal;
}
.button:hover .hoverBtn-bottom:before, .button:hover .hoverBtn-bottom:after {
opacity: 1;
-webkit-animation: openB 0.4s;
/* Chrome, Safari, Opera */
animation: openB 0.4s;
animation-delay: 0.4s;
animation-fill-mode: forwards;
animation-timing-function: cubic-bezier(0.39, 0.575, 0.565, 1);
animation-direction: normal;
}
.button p {
position: absolute;
top: 0;
left: 0;
right: 0;
margin: 0 auto;
text-align: center;
color: #587785;
font-size: 22px;
line-height: 55px;
}
.hoverBtn {
width: 100%;
height: 55px;
position: absolute;
top: -1px;
}
.hoverBtn:before {
position: absolute;
content: '';
height: 0;
width: 0;
display: block;
opacity: 0;
border-top: solid 2px #517180;
border-left: solid 2px #517180;
right: 100px;
}
.hoverBtn:after {
position: absolute;
content: '';
height: 0;
width: 0;
display: block;
opacity: 0;
border-top: solid 2px #517180;
border-right: solid 2px #517180;
left: 100px;
}
.hoverBtn-bottom {
width: 100%;
height: 55px;
position: absolute;
}
.hoverBtn-bottom:before {
position: absolute;
content: '';
height: 0;
width: 0;
display: block;
opacity: 0;
height: 55px;
border-bottom: solid 2px #517180;
right: 0;
}
.hoverBtn-bottom:after {
position: absolute;
content: '';
height: 0;
width: 0;
display: block;
opacity: 0;
height: 55px;
border-bottom: solid 2px #517180;
left: 0;
}
p.credits {
text-align: center
color: #888;
font-size: 16px;
}
@keyframes open {
0% {
width: 0;
height: 0;
}
50% {
width: 100px;
...