Skip to content

Commit

Permalink
Added loading animation
Browse files Browse the repository at this point in the history
  • Loading branch information
Mr-Thunder committed Jul 14, 2020
1 parent ac273af commit 366597f
Show file tree
Hide file tree
Showing 4 changed files with 35 additions and 6 deletions.
10 changes: 7 additions & 3 deletions src/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,14 @@
<script src="/js/all.min.js"></script>
</head>
<body>
<div class="loader">
<div>
<img class="size-auto rotate align-centre" src="assets/images/logo.svg" alt="">
Loading
</div>
</div>
<div class="wrapper">
<div class="loader">
FUCKKKCKC
</div>


<div class="align-centre row">
<!-- <img src="assets/images/logo.svg" alt=""> -->
Expand Down
3 changes: 3 additions & 0 deletions src/js/global.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
console.log("hello there yo");

// Loading Animation
window.addEventListener("load", function () {
loader = document.querySelector(".loader");
loader.className += " hidden";

});
6 changes: 6 additions & 0 deletions src/pages/about.html
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,12 @@
<link rel="stylesheet" type="text/css" media="screen" href="/css/main.min.css" />
<script src="/js/all.min.js"></script>
</head>
<div class="loader">
<div>
<img class="size-auto rotate align-centre" src="assets/images/logo.svg" alt="">
Loading
</div>
</div>
<body>
</body>
</html>
22 changes: 19 additions & 3 deletions src/scss/components/_loading-animation.scss
Original file line number Diff line number Diff line change
Expand Up @@ -6,18 +6,34 @@
left: 0;
width: 100%;
height: 100%;
background: aqua;
background: hotpink;
display: flex;
justify-content: center;
align-items: center;
transform: translateY(0);
}
.loader.hidden{
animation: fadeOut 1s;
animation: 1s ease-in-out fadeOut .5s;
animation-fill-mode: forwards;
}
@keyframes fadeOut {
100%{
opacity: 0;
// opacity: 0;
transform: translateY(-100%);
visibility: hidden;
}
}


.rotate {
animation: rotation 1s infinite linear;
}

@keyframes rotation {
from {
transform: rotate(0deg);
}
to {
transform: rotate(359deg);
}
}

0 comments on commit 366597f

Please sign in to comment.