Skip to content

Instantly share code, notes, and snippets.

@b0c0de
Created November 20, 2019 03:45
Show Gist options
  • Save b0c0de/27ad9ab6bf4bfac7b5c0a0d86976c2b6 to your computer and use it in GitHub Desktop.
Save b0c0de/27ad9ab6bf4bfac7b5c0a0d86976c2b6 to your computer and use it in GitHub Desktop.
Animation Loading Page / Loader
<body onload="loader()">
<h1>Animation Loading Page</h1>
<div id="Loading">
<div></div>
</div>
</body>
function loader(){
loader = setTimeout(showPage, 36000)
}
function showPage(){
document.getElementById("Loading").style.display = "none"
}
@charset "utf8";
*,*:after,*:before,html{box-sizing:border-box}
body{margin:0;padding:0}
h1{
font-family:font-family:Tahoma,Geneva,sans-serif;
font-style:normal;
font-weight:700;
font-size:32px
}
h1,#Loading>div{
top:50%;
left:50%;
display:block;
position:absolute;
transform:translate(-50%,-50%)
}
#Loading{
background:#000;
width:100%;
height:100%;
display:block;
position:absolute;
z-index:999
}
#Loading>div{width:200px;height:200px}
#Loading>div:before,#Loading>div:after{
content:"";
display:block;
position:absolute;
border-radius:50%;
border:4px solid red;
border-top-color:blue
}
#Loading>div:before{width:100%;height:100%;animation:loading 5s linear infinite}
#Loading>div:after{
width:150px;
height:150px;
top:25px;
left:25px;
animation:loading 5s linear infinite reverse
}
@keyframes loading{
from{transform:rotate(0deg)}
to{transform:rotate(360deg)}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment