Created
September 27, 2016 21:40
-
-
Save richardhundt/8d53e77dcaa7878dc46540968cb88ba0 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<html> | |
<style> | |
.loader { | |
font-size: 10px; | |
margin: 50px auto; | |
text-indent: -9999em; | |
width: 11em; | |
height: 11em; | |
border-radius: 50%; | |
background: #ffffff; | |
background: -moz-linear-gradient(left, #ffffff 10%, rgba(255, 255, 255, 0) 42%); | |
background: -webkit-linear-gradient(left, #ffffff 10%, rgba(255, 255, 255, 0) 42%); | |
background: -o-linear-gradient(left, #ffffff 10%, rgba(255, 255, 255, 0) 42%); | |
background: -ms-linear-gradient(left, #ffffff 10%, rgba(255, 255, 255, 0) 42%); | |
background: linear-gradient(to right, #ffffff 10%, rgba(255, 255, 255, 0) 42%); | |
position: relative; | |
-webkit-animation: load3 1.4s infinite linear; | |
animation: load3 1.4s infinite linear; | |
-webkit-transform: translateZ(0); | |
-ms-transform: translateZ(0); | |
transform: translateZ(0); | |
} | |
.loader:before { | |
width: 50%; | |
height: 50%; | |
background: #ffffff; | |
border-radius: 100% 0 0 0; | |
position: absolute; | |
top: 0; | |
left: 0; | |
content: ''; | |
} | |
.loader:after { | |
background: #0dc5c1; | |
width: 75%; | |
height: 75%; | |
border-radius: 50%; | |
content: ''; | |
margin: auto; | |
position: absolute; | |
top: 0; | |
left: 0; | |
bottom: 0; | |
right: 0; | |
} | |
@-webkit-keyframes load3 { | |
0% { | |
-webkit-transform: rotate(0deg); | |
transform: rotate(0deg); | |
} | |
100% { | |
-webkit-transform: rotate(360deg); | |
transform: rotate(360deg); | |
} | |
} | |
@keyframes load3 { | |
0% { | |
-webkit-transform: rotate(0deg); | |
transform: rotate(0deg); | |
} | |
100% { | |
-webkit-transform: rotate(360deg); | |
transform: rotate(360deg); | |
} | |
} | |
</style> | |
<body> | |
<div style="padding: 20px; background: darkcyan"> | |
<div id="spinner" class="loader">loading...</div> | |
</div> | |
</body> | |
<script> | |
window.addEventListener("load", function(e) { | |
console.log("loaded") | |
var iframe = document.createElement("iframe") | |
iframe.style.display = 'none' | |
document.body.appendChild(iframe) | |
iframe.addEventListener("load", function(e) { | |
console.log("iframe loaded") | |
document.getElementById("spinner").style.display = 'none' | |
iframe.style.display = '' | |
}) | |
iframe.setAttribute("src", "iframe.html") | |
}) | |
</script> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment