Skip to content

Commit c9798c9

Browse files
committed
Adding some loading dots
Because why not lol
1 parent f5a215a commit c9798c9

2 files changed

Lines changed: 84 additions & 0 deletions

File tree

css/miscs.css

Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,3 +13,71 @@ See the License for the specific language governing permissions and
1313
limitations under the License. */
1414

1515

16+
@charset "UTF-8";
17+
/**
18+
*
19+
* three-dots.css v0.1.0
20+
*
21+
* https://nzbin.github.io/three-dots/
22+
*
23+
* Copyright (c) 2018 nzbin
24+
*
25+
* Released under the MIT license
26+
*
27+
*/
28+
29+
30+
.dot-bricks {
31+
position: relative;
32+
top: 8px;
33+
left: -9999px;
34+
width: 10px;
35+
height: 10px;
36+
border-radius: 5px;
37+
background-color: #9880ff;
38+
color: #9880ff;
39+
box-shadow: 9991px -16px 0 0 #9880ff, 9991px 0 0 0 #9880ff, 10007px 0 0 0 #9880ff;
40+
animation: dotBricks 2s infinite ease;
41+
}
42+
43+
@keyframes dotBricks {
44+
0% {
45+
box-shadow: 9991px -16px 0 0 #9880ff, 9991px 0 0 0 #9880ff, 10007px 0 0 0 #9880ff;
46+
}
47+
8.333% {
48+
box-shadow: 10007px -16px 0 0 #9880ff, 9991px 0 0 0 #9880ff, 10007px 0 0 0 #9880ff;
49+
}
50+
16.667% {
51+
box-shadow: 10007px -16px 0 0 #9880ff, 9991px -16px 0 0 #9880ff, 10007px 0 0 0 #9880ff;
52+
}
53+
25% {
54+
box-shadow: 10007px -16px 0 0 #9880ff, 9991px -16px 0 0 #9880ff, 9991px 0 0 0 #9880ff;
55+
}
56+
33.333% {
57+
box-shadow: 10007px 0 0 0 #9880ff, 9991px -16px 0 0 #9880ff, 9991px 0 0 0 #9880ff;
58+
}
59+
41.667% {
60+
box-shadow: 10007px 0 0 0 #9880ff, 10007px -16px 0 0 #9880ff, 9991px 0 0 0 #9880ff;
61+
}
62+
50% {
63+
box-shadow: 10007px 0 0 0 #9880ff, 10007px -16px 0 0 #9880ff, 9991px -16px 0 0 #9880ff;
64+
}
65+
58.333% {
66+
box-shadow: 9991px 0 0 0 #9880ff, 10007px -16px 0 0 #9880ff, 9991px -16px 0 0 #9880ff;
67+
}
68+
66.666% {
69+
box-shadow: 9991px 0 0 0 #9880ff, 10007px 0 0 0 #9880ff, 9991px -16px 0 0 #9880ff;
70+
}
71+
75% {
72+
box-shadow: 9991px 0 0 0 #9880ff, 10007px 0 0 0 #9880ff, 10007px -16px 0 0 #9880ff;
73+
}
74+
83.333% {
75+
box-shadow: 9991px -16px 0 0 #9880ff, 10007px 0 0 0 #9880ff, 10007px -16px 0 0 #9880ff;
76+
}
77+
91.667% {
78+
box-shadow: 9991px -16px 0 0 #9880ff, 9991px 0 0 0 #9880ff, 10007px -16px 0 0 #9880ff;
79+
}
80+
100% {
81+
box-shadow: 9991px -16px 0 0 #9880ff, 9991px 0 0 0 #9880ff, 10007px 0 0 0 #9880ff;
82+
}
83+
}

js/channelSelect.js

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,19 @@ let channelSelect = (c, name) => {
4646
messages.removeChild(messages.firstChild);
4747
}
4848

49+
// Creates the loading dots
50+
var container = document.createElement('div'); // Centred container
51+
var loadingDots = document.createElement('div') // Loading dots
52+
loadingDots.innerHTML = 'Loading...';
53+
loadingDots.classList.add('dot-bricks')
54+
container.style.position = "absolute";
55+
container.style.top = "50%";
56+
container.style.left = "50%";
57+
container.style.transform = "translate(-50%, -50%)";
58+
container.id = "loading-container";
59+
container.appendChild(loadingDots);
60+
messages.appendChild(container);
61+
4962
// Set colour of the channel
5063
try {
5164
selectedChanDiv.style.color = '#606266';
@@ -96,6 +109,9 @@ let channelSelect = (c, name) => {
96109

97110
messages.scrollTop = messages.scrollHeight;
98111
generatingMessages = false;
112+
113+
// Remove the loading dots
114+
messages.removeChild(document.getElementById('loading-container'));
99115
}
100116
};
101117

0 commit comments

Comments
 (0)