@@ -3,6 +3,11 @@ import { ref, nextTick } from "vue";
3
3
import Top from " ./components/Top.vue" ;
4
4
import Bottom from " ./components/Bottom.vue" ;
5
5
import Checkbox from " ./components/Checkbox.vue" ;
6
+ import ScopedLoader from " ./components/ScopedLoader.vue" ;
7
+
8
+ const counts = [20 , 50 , 100 , 120 , 150 , 200 , 250 , 300 , 350 , 400 , 450 , 500 ];
9
+ const showLoaders = ref (false );
10
+ const displayMessage = ref (" Display" );
6
11
let page = 0 ;
7
12
let mount = ref (true );
8
13
let resetData = ref (false );
@@ -11,6 +16,11 @@ let distance = ref(0);
11
16
let top = ref (false );
12
17
let comments = ref ([]);
13
18
let mountname = ref (" Unmount" );
19
+
20
+ const displayMultipleLoader = () => {
21
+ showLoaders .value = ! showLoaders .value ;
22
+ displayMessage .value = showLoaders .value ? " Hide" : " Display" ;
23
+ };
14
24
const refresh = () => {
15
25
page = 0 ;
16
26
comments .value .length = 0 ;
@@ -113,15 +123,15 @@ const load = async $state => {
113
123
</span >
114
124
<span class =" buttons" >
115
125
<button
116
- class =" btn-mount"
126
+ class =" btn btn -mount"
117
127
@click =" mountToggler"
118
128
>{{ mountname }}</button >
119
129
<button
120
130
class =" btn-refresh"
121
131
@click =" refresh"
122
132
>Refresh</button >
123
133
<button
124
- class =" btn-reset"
134
+ class =" btn btn -reset"
125
135
@click =" reset"
126
136
>Reset</button >
127
137
</span >
@@ -144,18 +154,38 @@ const load = async $state => {
144
154
@infinite =" load"
145
155
/>
146
156
</div >
157
+ <button
158
+ class =" btn btn-show-loaders"
159
+ @click =" displayMultipleLoader"
160
+ >
161
+ {{ displayMessage }} multiple infinites
162
+ </button >
163
+ <div
164
+ v-if =" showLoaders"
165
+ class =" loaders"
166
+ >
167
+ <ScopedLoader
168
+ v-for =" i in counts"
169
+ :key =" i"
170
+ :count =" i"
171
+ class =" results"
172
+ />
173
+ </div >
147
174
</template >
148
175
149
176
<style >
150
177
* {
151
178
box-sizing : border-box ;
152
179
}
180
+
153
181
body {
154
182
background-color : #272727 ;
155
183
font-family : system-ui , -apple-system ;
156
184
font-weight : 400 ;
157
185
font-size : 15px ;
186
+ overflow-y : scroll ;
158
187
}
188
+
159
189
#app {
160
190
color : #e9e9e9 ;
161
191
max-width : 1500px ;
@@ -168,6 +198,7 @@ body {
168
198
gap : 10px ;
169
199
text-align : center ;
170
200
}
201
+
171
202
.settings {
172
203
position : relative ;
173
204
display : flex ;
@@ -184,16 +215,19 @@ body {
184
215
border-radius : 10px ;
185
216
padding : 10px ;
186
217
}
218
+
187
219
.settings a {
188
220
position : absolute ;
189
221
top : 4px ;
190
222
right : 5px ;
191
223
}
224
+
192
225
.props {
193
226
display : flex ;
194
227
gap : 20px ;
195
228
flex-wrap : wrap ;
196
229
}
230
+
197
231
.distance {
198
232
width : 50px ;
199
233
border-radius : 5px ;
@@ -203,11 +237,13 @@ body {
203
237
background : #6a6c6d ;
204
238
color : inherit ;
205
239
}
240
+
206
241
.buttons {
207
242
display : flex ;
208
243
gap : 20px ;
209
244
flex-wrap : wrap ;
210
245
}
246
+
211
247
.btn-refresh {
212
248
width : 100px ;
213
249
font-family : inherit ;
@@ -220,8 +256,8 @@ body {
220
256
text-decoration : none ;
221
257
outline : none ;
222
258
}
223
- .btn-reset ,
224
- .btn-mount {
259
+
260
+ .btn {
225
261
width : 90px ;
226
262
font-family : inherit ;
227
263
color : white ;
@@ -232,12 +268,21 @@ body {
232
268
text-decoration : none ;
233
269
outline : none ;
234
270
}
271
+
235
272
.btn-reset {
236
273
background : #e45252 ;
237
274
}
275
+
238
276
.btn-mount {
239
277
background : #5268e4 ;
240
278
}
279
+
280
+ .btn-show-loaders {
281
+ background : #5268e4 ;
282
+ width : 180px ;
283
+ height : 30px ;
284
+ }
285
+
241
286
.result {
242
287
display : flex ;
243
288
flex-direction : column ;
@@ -252,19 +297,37 @@ body {
252
297
background : #101011 ;
253
298
border-radius : 10px ;
254
299
}
300
+
255
301
.loader {
256
302
padding : 10px ;
257
303
}
258
- .results ::-webkit-scrollbar-track {
304
+
305
+ .loaders {
306
+ display : flex ;
307
+ flex-wrap : wrap ;
308
+ justify-content : center ;
309
+ gap : 1rem ;
310
+ }
311
+
312
+ .loaders > .results {
313
+ width : 300px ;
314
+ height : 300px ;
315
+ background : #333536 ;
316
+ overflow-y : scroll ;
317
+ }
318
+
319
+ ::-webkit-scrollbar-track {
259
320
border-radius : 4px ;
260
321
background : #333536 ;
261
322
}
262
- .results ::-webkit-scrollbar {
323
+
324
+ ::-webkit-scrollbar {
263
325
border-radius : 4px ;
264
326
width : 8px ;
265
327
background : #7e7e7e ;
266
328
}
267
- .results ::-webkit-scrollbar-thumb {
329
+
330
+ ::-webkit-scrollbar-thumb {
268
331
border-radius : 4px ;
269
332
background : #7e7e7e ;
270
333
}
0 commit comments