load-more
by Himanshu Joshi
HTML
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css">
<script src="https://fonts.googleapis.com/css?family=Roboto:100&subset=latin-ext"></script>
<div id="load-more" class="btn btn-primary btn-block">
<span class="load-more-text">Load More</span>
<span class="reloadDouble"></span>
</div>
SCSS
@import url(https://fonts.googleapis.com/css?family=Roboto:100&subset=latin-ext);
#load-more {
height: 44px;
background-color: #00a5e3;
border-radius: 2px;
font-family: 'Roboto', sans-serif;
font-size: 14px;
font-weight: bold;
font-style: normal;
font-stretch: normal;
line-height: 2.29;
letter-spacing: normal;
.fa{
padding-left: 15px;
}
.load-more-text{
display: inline-block;
position: relative;
//left: 50%;
transform: translateY(-50%);
}
// Double
.reloadDouble {
border-color: transparent white;
border-radius: 50%;
border-style: solid;
border-width: 2px;
height: 20px;
margin: 8px;
width: 20px;
display: inline-block;
position: relative;
//left: 50%;
/* -webkit-animation: rotate 1.5s linear infinite;
animation: rotate 1.5s linear infinite; */
&:before, &:after {
border-style: solid;
content: '';
display: block;
position: absolute;
width: 0;
-webkit-transform: rotate(-45deg);
transform: rotate(-45deg);
}
&:after {
border-color: transparent transparent transparent white;
border-width: 4px 0 4px 7px;
top: -2px;
left: 0px;
}
&:before {
border-color: transparent white transparent transparent;
border-width: 4px 7px 4px 0;
bottom: -2px;
right: 0px;
}
}
.rotate{
-webkit-animation: rotate 1.5s linear infinite;
animation: rotate 1.5s linear infinite;
}
@-webkit-keyframes rotate {
100% { -webkit-transform: rotate(360deg); }
}
@keyframes rotate {
100% { transform: rotate(360deg); }
}
}
JavaScript
$('#load-more').click(function(){
$(this).find('.reloadDouble').toggleClass('rotate');
});