JSFiddle - React, Tailwind, and code Playground
by anup1986
HTML
<div id="follower" style="display: none"></div>
<button style="button" id="showLoading">Click me</button>
<br/>
<br/>
<div id="test"></div>
<div id="loading" style="display: none">
<div class="windows8">
<div class="wBall" id="wBall_1">
<div class="wInnerBall">
</div>
</div>
<div class="wBall" id="wBall_2">
<div class="wInnerBall">
</div>
</div>
<div class="wBall" id="wBall_3">
<div class="wInnerBall">
</div>
</div>
<div class="wBall" id="wBall_4">
<div class="wInnerBall">
</div>
</div>
<div class="wBall" id="wBall_5">
<div class="wInnerBall">
</div>
</div>
</div>
</div>
CSS
#loading {
position: absolute;
float: left;
}
.windows8 {
position: relative;
width: 17px;
height:17px;
}
.windows8 .wBall {
position: absolute;
width: 16px;
height: 16px;
opacity: 0;
-moz-transform: rotate(225deg);
-moz-animation: orbit 7.15s infinite;
-webkit-transform: rotate(225deg);
-webkit-animation: orbit 7.15s infinite;
-ms-transform: rotate(225deg);
-ms-animation: orbit 7.15s infinite;
-o-transform: rotate(225deg);
-o-animation: orbit 7.15s infinite;
transform: rotate(225deg);
animation: orbit 7.15s infinite;
}
.windows8 .wBall .wInnerBall{
position: absolute;
width: 2px;
height: 2px;
background: #3891F0;
left:0px;
top:0px;
-moz-border-radius: 2px;
-webkit-border-radius: 2px;
-ms-border-radius: 2px;
-o-border-radius: 2px;
border-radius: 2px;
}
.windows8 #wBall_1 {
-moz-animation-delay: 1.56s;
-webkit-animation-delay: 1.56s;
-ms-animation-delay: 1.56s;
-o-animation-delay: 1.56s;
animation-delay: 1.56s;
}
.windows8 #wBall_2 {
-moz-animation-delay: 0.31s;
-webkit-animation-delay: 0.31s;
-ms-animation-delay: 0.31s;
-o-animation-delay: 0.31s;
animation-delay: 0.31s;
}
.windows8 #wBall_3 {
-moz-animation-delay: 0.62s;
-webkit-animation-delay: 0.62s;
-ms-animation-delay: 0.62s;
-o-animation-delay: 0.62s;
animation-delay: 0.62s;
}
.windows8 #wBall_4 {
-moz-animation-delay: 0.94s;
-webkit-animation-delay: 0.94s;
-ms-animation-delay: 0.94s;
-o-animation-delay: 0.94s;
animation-delay: 0.94s;
}
.windows8 #wBall_5 {
-moz-animation-delay: 1.25s;
-webkit-animation-delay: 1.25s;
-ms-animation-delay: 1.25s;
-o-animation-delay: 1.25s;
animation-delay: 1.25s;
}
@-moz-keyframes orbit {
0% {
opacity: 1;
z-index:99;
-moz-transform: rotate(180deg);
-moz-animation-timing-function: ease-out;
}
7% {
opacity: 1;
-moz-transform: rotate(300deg);
-moz-animation-timing-function: linear;
-moz-origin:0%;
}
30% {
opacity: 1;
-moz-transform:rotate(410deg);
-moz-animation-timing-function: ease-in-out;
-moz-origin:7%;
}
39% {
opacity: 1;
-moz-transform:...
JavaScript
$(document).bind('mousemove', function(e){
$("#loading").css({
left: e.pageX + 20,
top: e.pageY
});
});
$('#showLoading').click(function() {
$('#loading').toggle();
});
$(document).ready(function() {
$('#test').html('x: ' + e.pageX + ', y: ' + e.pageY);
});