console
<link href="https://cdn.bootcss.com/font-awesome/4.7.0/css/font-awesome.min.css" rel="stylesheet">
<section>
<div class="button">
<a href="javascript:void(0)"><i class="fa fa-weibo" aria-hidden="true"></i>关注 @CC君</a>
</div>
<div class="cover">
<div class="innie"></div>
<div class="spine"></div>
<div class="outie"></div>
</div>
<div class="shadow"></div>
</section>
section, section div {
transition-duration: .6s;
}
body {
background-image: radial-gradient(circle farthest-corner at center top, #FFFFFF 0%, #D8DFE9 100%);
overflow: hidden;
}
section, .button {
transition-timing-function: ease;
}
section {
position: relative;
display: inline-block;
height: 2.5rem;
padding: .375rem .375rem 0;
background: #A9ADB6;
border-radius: .25rem;
perspective: 300;
box-shadow: 0 -1px 2px #fff, inset 0 1px 2px rgba(0,0,0,.2), inset 0 .25rem 1rem rgba(0,0,0,.1);
}
.button {
opacity: 0;
}
.button a {
display: inline-block;
height: 28px;
line-height: 28px;
padding: 1px 50px 1px 50px;
color: #FFF;
background: #ee2436;
border-radius: 4px;
font-family: "Microsoft Yahei", Helvetica, sans-serif;
font-size: 15px;
text-decoration: none;
}
.button a .fa {
margin-right: 5px;
font-size: 17px;
}
.cover {
position: absolute;
top: 0;
left: 0;
right: 0;
bottom: 0;
color: white;
font: 1.25em "Helvetica";
line-height: calc(2.5rem + .375rem);
text-align: center;
transform-origin: center bottom;
transform-style: preserve-3d;
pointer-events: none;
z-index: 1;
}
.innie, .outie, .spine, .shadow {
position: absolute;
width: 100%;
}
.innie, .outie {
height: 100%;
background-image: linear-gradient(to bottom, transparent 0%, rgba(0,0,0,.1) 100%);
border-radius: .25rem;
}
.innie:after, .outie:after {
content: "weibo";
}
.innie {
background-color: #ff555f;
text-shadow: 0 -2px 4px rgba(0,0,0,.2);
}
.spine {
top: .25rem;
height: .25rem;
background: #f53746;
transform: rotateX(90deg);
transform-origin: center top;
}
.outie {
background-color: #ff555f;
transform: translateZ(.25rem);
text-shadow: 0 2px 4px rgba(0,0,0,.2);
}
.shadow {
left: 0;
top: 100%;
height: 3.5rem;
transform-origin: center top;
transform: rotateX(90deg);
opacity: 0;
background-image: linear-gradient(to bottom, rgba(0,0,0,.6) 0%, transparent 100%);
border-radius: .4rem;
}
section:hover {
background: #EBEFF2;
}
section:hover .button {
opacity: 1;
}
section:hover .cover, section:hover .innie, section:hover .spine, section:hover .outie, section:hover .shadow {
transition-timing-function: cubic-bezier(.2,.7,.1,1.1);
}
section:hover .cover {
transform: rotateX(-120deg);
}
section:hover .innie {
background-color: #ff555f;
}
section:hover .spine {
background-color: #ff555f;
}
section:hover .outie {
background-color: #ec1e31;
color: rgba(255,255,255,0);
}
section:hover .shadow {
opacity: 1;
transform: rotateX(45deg) scale(.95);
}