$green: #1ECD97;
$gray: #bbbbbb;
* {
font-family: 'Roboto', sans-serif;
}
.container {
position: absolute;
top:50%;
left:50%;
margin-left: -65px;
margin-top: -20px;
width: 130px;
height: 40px;
text-align: center;
}
button {
outline:none;
height: 40px;
text-align: center;
width: 130px;
border-radius:40px;
background: #fff;
border: 2px solid $green;
color:$green;
letter-spacing:1px;
text-shadow:0;
font:{
size:12px;
weight:bold;
}
cursor: pointer;
transition: all 0.25s ease;
&:hover {
color:white;
background: $green;
}
&:active {
//letter-spacing: 2px;
letter-spacing: 2px ;
}
&:after {
content:"SUBMIT";
}
}
.onclic {
width: 40px;
border-color:$gray;
border-width:3px;
font-size:0;
border-left-color:$green;
animation: rotating 2s 0.25s linear infinite;
&:after {
content:"";
}
&:hover {
color:$green;
background: white;
}
}
.validate {
font-size:13px;
color: white;
background: $green;
&:after {
font-family:'FontAwesome';
content:"\f00c";
}
}
@keyframes rotating {
from {
transform: rotate(0deg);
}
to {
transform: rotate(360deg);
}
}
View Compiled
$(function() {
$( "#button" ).click(function() {
$( "#button" ).addClass( "onclic", 250, validate);
});
function validate() {
setTimeout(function() {
$( "#button" ).removeClass( "onclic" );
$( "#button" ).addClass( "validate", 450, callback );
}, 2250 );
}
function callback() {
setTimeout(function() {
$( "#button" ).removeClass( "validate" );
}, 1250 );
}
});