Skip to content

Commit

Permalink
Merge pull request #182 from migue802/master
Browse files Browse the repository at this point in the history
Adding some loading dots
  • Loading branch information
SebOuellette authored Jun 2, 2022
2 parents f5a215a + afe2602 commit 992d783
Show file tree
Hide file tree
Showing 2 changed files with 83 additions and 0 deletions.
68 changes: 68 additions & 0 deletions css/miscs.css
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,71 @@ See the License for the specific language governing permissions and
limitations under the License. */


@charset "UTF-8";
/**
*
* three-dots.css v0.1.0
*
* https://nzbin.github.io/three-dots/
*
* Copyright (c) 2018 nzbin
*
* Released under the MIT license
*
*/


.dot-bricks {
position: relative;
top: 8px;
left: -9999px;
width: 10px;
height: 10px;
border-radius: 5px;
background-color: #9880ff;
color: #9880ff;
box-shadow: 9991px -16px 0 0 #9880ff, 9991px 0 0 0 #9880ff, 10007px 0 0 0 #9880ff;
animation: dotBricks 2s infinite ease;
}

@keyframes dotBricks {
0% {
box-shadow: 9991px -16px 0 0 #9880ff, 9991px 0 0 0 #9880ff, 10007px 0 0 0 #9880ff;
}
8.333% {
box-shadow: 10007px -16px 0 0 #9880ff, 9991px 0 0 0 #9880ff, 10007px 0 0 0 #9880ff;
}
16.667% {
box-shadow: 10007px -16px 0 0 #9880ff, 9991px -16px 0 0 #9880ff, 10007px 0 0 0 #9880ff;
}
25% {
box-shadow: 10007px -16px 0 0 #9880ff, 9991px -16px 0 0 #9880ff, 9991px 0 0 0 #9880ff;
}
33.333% {
box-shadow: 10007px 0 0 0 #9880ff, 9991px -16px 0 0 #9880ff, 9991px 0 0 0 #9880ff;
}
41.667% {
box-shadow: 10007px 0 0 0 #9880ff, 10007px -16px 0 0 #9880ff, 9991px 0 0 0 #9880ff;
}
50% {
box-shadow: 10007px 0 0 0 #9880ff, 10007px -16px 0 0 #9880ff, 9991px -16px 0 0 #9880ff;
}
58.333% {
box-shadow: 9991px 0 0 0 #9880ff, 10007px -16px 0 0 #9880ff, 9991px -16px 0 0 #9880ff;
}
66.666% {
box-shadow: 9991px 0 0 0 #9880ff, 10007px 0 0 0 #9880ff, 9991px -16px 0 0 #9880ff;
}
75% {
box-shadow: 9991px 0 0 0 #9880ff, 10007px 0 0 0 #9880ff, 10007px -16px 0 0 #9880ff;
}
83.333% {
box-shadow: 9991px -16px 0 0 #9880ff, 10007px 0 0 0 #9880ff, 10007px -16px 0 0 #9880ff;
}
91.667% {
box-shadow: 9991px -16px 0 0 #9880ff, 9991px 0 0 0 #9880ff, 10007px -16px 0 0 #9880ff;
}
100% {
box-shadow: 9991px -16px 0 0 #9880ff, 9991px 0 0 0 #9880ff, 10007px 0 0 0 #9880ff;
}
}
15 changes: 15 additions & 0 deletions js/channelSelect.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,18 @@ let channelSelect = (c, name) => {
messages.removeChild(messages.firstChild);
}

// Creates the loading dots
var container = document.createElement('div'); // Centred container
var loadingDots = document.createElement('div') // Loading dots
loadingDots.classList.add('dot-bricks')
container.style.position = "absolute";
container.style.top = "50%";
container.style.left = "50%";
container.style.transform = "translate(-50%, -50%)";
container.id = "loading-container";
container.appendChild(loadingDots);
messages.appendChild(container);

// Set colour of the channel
try {
selectedChanDiv.style.color = '#606266';
Expand Down Expand Up @@ -96,6 +108,9 @@ let channelSelect = (c, name) => {

messages.scrollTop = messages.scrollHeight;
generatingMessages = false;

// Remove the loading dots
messages.removeChild(document.getElementById('loading-container'));
}
};

Expand Down

0 comments on commit 992d783

Please sign in to comment.