Skip to content

Commit 5d444c0

Browse files
committed
add loader
1 parent 5714ff0 commit 5d444c0

File tree

3 files changed

+100
-5
lines changed

3 files changed

+100
-5
lines changed

components/Loader.tsx

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ const Loader = () => {
44
return (
55
<>
66
<div className="h-screen flex items-center justify-center">
7-
<button
7+
{/* <button
88
disabled
99
type="button"
1010
className="text-white bg-primary font-medium rounded text-sm px-5 py-2.5 text-center mr-2 dark:bg-blue-600 dark:hover:bg-blue-700 dark:focus:ring-blue-800 inline-flex items-center"
@@ -27,7 +27,17 @@ const Loader = () => {
2727
/>
2828
</svg>
2929
Loading...
30-
</button>
30+
</button> */}
31+
<section className="loading">
32+
<div className="lds-css ng-scope">
33+
<div className="lds-cube">
34+
<div></div>
35+
<div></div>
36+
<div></div>
37+
<div></div>
38+
</div>
39+
</div>
40+
</section>
3141
</div>
3242
</>
3343
);

components/shared/LoadingPlaceHolder.tsx

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,17 @@ import React from 'react'
33
const LoadingPlaceHolder = () => {
44
return (
55
<div className="w-full h-[60vh] flex items-center justify-center">
6-
<button
6+
<section className="loading">
7+
<div className="lds-css ng-scope">
8+
<div className="lds-cube">
9+
<div></div>
10+
<div></div>
11+
<div></div>
12+
<div></div>
13+
</div>
14+
</div>
15+
</section>
16+
{/* <button
717
disabled
818
type="button"
919
className="text-white bg-primary font-medium rounded text-sm px-5 py-2.5 text-center mr-2 dark:bg-blue-600 dark:hover:bg-blue-700 dark:focus:ring-blue-800 inline-flex items-center"
@@ -26,9 +36,9 @@ const LoadingPlaceHolder = () => {
2636
/>
2737
</svg>
2838
Loading...
29-
</button>
39+
</button> */}
3040
</div>
3141
)
3242
}
3343

34-
export default LoadingPlaceHolder
44+
export default LoadingPlaceHolder

styles/style.css

Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -212,3 +212,78 @@ input[type='number'] {
212212
overflow: hidden !important;
213213
}
214214
}
215+
216+
.loading {
217+
position: fixed;
218+
top: 0;
219+
left: 0;
220+
min-width: 100%;
221+
min-height: 100%;
222+
display: flex;
223+
justify-content: center;
224+
align-items: center;
225+
z-index:10000 !important;
226+
}
227+
.loading .lds-cube {
228+
position: relative;
229+
}
230+
.loading .lds-cube div {
231+
position: absolute;
232+
width: 80px;
233+
height: 80px;
234+
top: 10px;
235+
left: 10px;
236+
background: #fc4309;
237+
-webkit-animation: lds-cube 1s cubic-bezier(0, 0.5, 0.5, 1) infinite;
238+
animation: lds-cube 1s cubic-bezier(0, 0.5, 0.5, 1) infinite;
239+
-webkit-animation-delay: -0.3s;
240+
animation-delay: -0.3s;
241+
}
242+
.loading .lds-cube div:nth-child(2) {
243+
top: 10px;
244+
left: 110px;
245+
background: #ff765c;
246+
-webkit-animation-delay: -0.2s;
247+
animation-delay: -0.2s;
248+
}
249+
.loading .lds-cube div:nth-child(3) {
250+
top: 110px;
251+
left: 110px;
252+
background: #ff9900;
253+
-webkit-animation-delay: 0s;
254+
animation-delay: 0s;
255+
}
256+
.loading .lds-cube div:nth-child(4) {
257+
top: 110px;
258+
left: 10px;
259+
background: #ffb646;
260+
-webkit-animation-delay: -0.1s;
261+
animation-delay: -0.1s;
262+
}
263+
.loading .lds-cube {
264+
width: 200px !important;
265+
height: 200px !important;
266+
-webkit-transform: translate(-100px, -100px) scale(1) translate(100px, 100px);
267+
transform: translate(-100px, -100px) scale(1) translate(100px, 100px);
268+
}
269+
@keyframes lds-cube {
270+
0% {
271+
-webkit-transform: scale(1.5);
272+
transform: scale(1.5);
273+
}
274+
100% {
275+
-webkit-transform: scale(1);
276+
transform: scale(1);
277+
}
278+
}
279+
@-webkit-keyframes lds-cube {
280+
0% {
281+
-webkit-transform: scale(1.5);
282+
transform: scale(1.5);
283+
}
284+
100% {
285+
-webkit-transform: scale(1);
286+
transform: scale(1);
287+
}
288+
}
289+

0 commit comments

Comments
 (0)