JSFiddle - React, Tailwind, and code Playground
HTML
<body>
<div class="splash" ng-cloak="">
<p>Loading</p>
<div class="activity-box" >
<img src="http://i.imgur.com/O24aDk1.png" width="40" height="40"/>
</div>
</div>
<!-- rest of app -->
<div ng-cloak="">
<input ng-model="name" type="text" placeholder="Your name">
<h1>Hello {{ name }}</h1>
</div>
</body>
CSS
.activity-box {
display: block;
position: fixed; /* fixed position so it doesn't scroll */
z-index: 9999; /* on top of everything else */
width: 250px;
margin-left: -125px; /* horizontally centered */
left: 50%;
top: 10px; /* displayed on the top of the page, just like Gmail's yellow info-box */
height: 40px;
padding: 10px;
background-color: #f3e9b5;
border-radius: 4px;
}
/* styles for the activity text */
.activity-box span {
display: block;
position: relative;
margin-left: 60px;
margin-top: 10px;
font-family: arial;
font-size: 15px;
}
/* animating a static image */
.activity-box img {
display: block;
position: absolute;
width: 40px;
height: 40px;
/* Below is the key for the rotating animation */
-webkit-animation: spin 1s infinite linear;
-moz-animation: spin 1s infinite linear;
-o-animation: spin 1s infinite linear;
animation: spin 1s infinite linear;
}
/* keyframe animation defined for various browsers */
@-moz-keyframes spin {
0% { -moz-transform: rotate(0deg); }
100% { -moz-transform: rotate(359deg); }
}
@-webkit-keyframes spin {
0% { -webkit-transform: rotate(0deg); }
100% { -webkit-transform: rotate(359deg); }
}
@-o-keyframes spin {
0% { -o-transform: rotate(0deg); }
100% { -o-transform: rotate(359deg); }
}
@-ms-keyframes spin {
0% { -ms-transform: rotate(0deg); }
100% { -ms-transform: rotate(359deg); }
}
@keyframes spin {
0% { transform: rotate(0deg); }
100% { transform: rotate(359deg); }
}
[ng-cloak].splash {
display: block !important;
}
.splash {
background-color: #428bca;
display: none;
}
JavaScript
angular.module('myApp', []);
var body = document.getElementsByTagName('body')[0];
setTimeout(function() {
body.setAttribute('ng-app', 'myApp');
angular.bootstrap(body, ['ng', 'myApp']);
}, 1000);