Skip to content

Commit 992d783

Browse files
authored
Merge pull request #182 from migue802/master
Adding some loading dots
2 parents f5a215a + afe2602 commit 992d783

2 files changed

Lines changed: 83 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: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,18 @@ 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.classList.add('dot-bricks')
53+
container.style.position = "absolute";
54+
container.style.top = "50%";
55+
container.style.left = "50%";
56+
container.style.transform = "translate(-50%, -50%)";
57+
container.id = "loading-container";
58+
container.appendChild(loadingDots);
59+
messages.appendChild(container);
60+
4961
// Set colour of the channel
5062
try {
5163
selectedChanDiv.style.color = '#606266';
@@ -96,6 +108,9 @@ let channelSelect = (c, name) => {
96108

97109
messages.scrollTop = messages.scrollHeight;
98110
generatingMessages = false;
111+
112+
// Remove the loading dots
113+
messages.removeChild(document.getElementById('loading-container'));
99114
}
100115
};
101116

0 commit comments

Comments
 (0)