/* Main vars */
@pen-bg: #e7edf5;
/* Button vars */
@btn-bg: #fff;
@btn-color: #f5ce67;
@btn-active-color: #cfd2d9;
@btn-border-radius: 100px;
@btn-height: 72px;
@btn-width: 200px;
@btn-active-height: 270px;
@btn-active-width: 260px;
@btn-active-border-radius: 50px;
/* Close icon */
@close-color: #cfd2d9;
/* Transition vars */
@transition: all .25s ease-in-out;
/* Social color */
@facebook: #3b5998;
@twitter: #55acee;
@google: #d34836;
/* Input */
@input-color: #b2b5bc;
@input-bg: #f3f6fb;
/* Mixins */
.center {
top: 50%;
left: 50%;
transform: translateX(-50%) translateY(-50%);
}
.no-center {
transform: translateX(0) translateY(0);
}
/* Fonts */
@import url(https://fonts.googleapis.com/css?family=Montserrat:400,700);
body {
background-color: @pen-bg;
font-family: "Montserrat";
}
.share-btn {
position: absolute;
background-color: @btn-bg;
border-radius: @btn-border-radius;
width: @btn-width;
height: @btn-height;
box-shadow: 0 5px 10px rgba(0,0,40,0.03);
transition: all .4s cubic-bezier(.3, 0, 0, 1.3);
overflow: hidden;
cursor: pointer;
.center;
}
.share-btn .cta {
position: absolute;
color: @btn-color;
text-transform: uppercase;
font-size: 22px;
letter-spacing: 1px;
transition: @transition;
.center;
}
.share-btn .close {
position: absolute;
right: 38px;
top: 31px;
cursor: pointer;
color: @close-color;
font-size: 20px;
opacity: 0;
transition: all .4s cubic-bezier(.3, 0, 0, 1.3);
transform: rotate(-45deg);
transform-origin: center center;
}
.share-btn .social {
width: 70%;
padding-left: 0;
list-style-type: none;
margin: 75px auto 0 auto;
span {
float: right;
}
li {
padding-bottom: 15px;
transform: scale(0.7) translateX(10px) translateY(-10px);
transition: @transition;
transform-origin: 0% 0%;
opacity: 0;
&:nth-child(1) {
color: @facebook;
}
&:nth-child(2) {
color: @twitter;
}
&:nth-child(3) {
color: @google;
}
}
}
.share-btn .fake-input {
width: 60%;
margin: 10px auto 0 auto;
background-color: @input-bg;
color: @input-color;
border-radius: 10px;
padding: 15px;
font-size: 15px;
overflow: hidden;
}
.clicked {
width: @btn-active-width;
height: @btn-active-height;
border-radius: @btn-active-border-radius;
cursor: auto;
}
.share-btn.clicked .cta {
left: 40px;
top: 30px;
.no-center;
color: #cfd2d9;
}
.share-btn.clicked .close {
opacity: 1;
transform: rotate(0deg);
}
.share-btn.clicked .social li {
transform: scale(1) translateX(0) translateY(0);
opacity: 1;
&:nth-child(1) {
transition-delay: .05s;
}
&:nth-child(2) {
transition-delay: .1s;
}
&:nth-child(3) {
transition-delay: .15s;
}
}
View Compiled