Skip to content

Commit

Permalink
added loading-spinner to thread view (closes #8)
Browse files Browse the repository at this point in the history
  • Loading branch information
RealDekkia committed Apr 14, 2024
1 parent 901ed65 commit b101205
Show file tree
Hide file tree
Showing 4 changed files with 121 additions and 1 deletion.
92 changes: 92 additions & 0 deletions css/spinner.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
/* Licensed under CC0 BY https: //loading.io/css/ */

/*
<div class="lds-grid"><div></div><div></div><div></div><div></div><div></div><div></div><div></div><div></div><div></div></div>
*/

.lds-grid,
.lds-grid div {
box-sizing: border-box;
}

.lds-grid {
display: inline-block;
position: relative;
width: 80px;
height: 80px;
}

.lds-grid div {
position: absolute;
width: 16px;
height: 16px;
border-radius: 50%;
background: currentColor;
animation: lds-grid 1.2s linear infinite;
}

.lds-grid div:nth-child(1) {
top: 8px;
left: 8px;
animation-delay: 0s;
}

.lds-grid div:nth-child(2) {
top: 8px;
left: 32px;
animation-delay: -0.4s;
}

.lds-grid div:nth-child(3) {
top: 8px;
left: 56px;
animation-delay: -0.8s;
}

.lds-grid div:nth-child(4) {
top: 32px;
left: 8px;
animation-delay: -0.4s;
}

.lds-grid div:nth-child(5) {
top: 32px;
left: 32px;
animation-delay: -0.8s;
}

.lds-grid div:nth-child(6) {
top: 32px;
left: 56px;
animation-delay: -1.2s;
}

.lds-grid div:nth-child(7) {
top: 56px;
left: 8px;
animation-delay: -0.8s;
}

.lds-grid div:nth-child(8) {
top: 56px;
left: 32px;
animation-delay: -1.2s;
}

.lds-grid div:nth-child(9) {
top: 56px;
left: 56px;
animation-delay: -1.6s;
}

@keyframes lds-grid {

0%,
100% {
opacity: 1;
}

50% {
opacity: 0.5;
}
}
12 changes: 12 additions & 0 deletions thread/css/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,18 @@ body {
width: 100%;
}

.spinnerContainer {
height: 100%;
width: 100%;
display: grid;
}

.spinnerContainer>.lds-grid {
align-self: center;
justify-self: center;
zoom: 1.5;
}

section {
margin: unset;
padding: unset;
Expand Down
17 changes: 16 additions & 1 deletion thread/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@

<link rel="stylesheet" href="../lib/simple.css-2.3.0/simple.min.css" type="text/css" />
<link rel="stylesheet" href="../css/global.css" type="text/css" />
<link rel="stylesheet" href="../css/spinner.css" type="text/css" />
<link rel="stylesheet" href="css/style.css" type="text/css" />
</head>

Expand All @@ -21,7 +22,21 @@ <h1 id="topBarText">Unroll Ninja</h1>
</a>
</div>

<div class="mainBody" id="mainBody"></div>
<div class="mainBody" id="mainBody">
<div class="spinnerContainer">
<div class="lds-grid">
<div></div>
<div></div>
<div></div>
<div></div>
<div></div>
<div></div>
<div></div>
<div></div>
<div></div>
</div>
</div>
</div>

<div id="pageFooter">
<a href="https://github.com/RealDekkia/unroll-ninja">https://github.com/RealDekkia/unroll-ninja</a>
Expand Down
1 change: 1 addition & 0 deletions thread/js/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ const threadUnroll = {
drawstatuses: function (statusArr) {
console.log(statusArr);
var mb = document.getElementById("mainBody");
mb.innerHTML = "";

//Draw header with info about the user and the thread
var userHeader = document.createElement("div");
Expand Down

0 comments on commit b101205

Please sign in to comment.