Skip to content

Commit 55f553b

Browse files
Add loading page (#2)
* Added loading page * fix loading screen * Adjusted size of loading skull --------- Co-authored-by: FlyingChilli04 <lmaisnam2@gmail.com>
1 parent 64d9ff9 commit 55f553b

File tree

4 files changed

+39
-0
lines changed

4 files changed

+39
-0
lines changed

overload/src/app/components/coursesList.tsx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,9 @@ type Term = {
1919
};
2020

2121
export const CoursesList = async () => {
22+
//imitate delay
23+
await new Promise(resolve => setTimeout(resolve, 3000));
24+
2225
const res = await fetch('http://localhost:3000/api/home', {
2326
cache: 'no-store',
2427
});

overload/src/app/loading.css

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
@keyframes bounce {
2+
0%, 100% {
3+
transform: translateY(0);
4+
}
5+
50% {
6+
transform: translateY(-20px);
7+
}
8+
}
9+
10+
@keyframes spin {
11+
0% {
12+
transform: rotate(0);
13+
}
14+
100% {
15+
transform: rotate(360deg);
16+
}
17+
}
18+
19+
.animate-spin {
20+
animation: spin 2s linear infinite;
21+
}

overload/src/app/loading.tsx

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
import './loading.css'
2+
import skullSvg from './resources/skull-head-svgrepo-com.svg';
3+
import Image from 'next/image'
4+
5+
export default function Loading() {
6+
return (
7+
<div className="min-h-screen flex justify-center items-center flex-col">
8+
<div className="w-1/4 h-1/4">
9+
<Image src={skullSvg} alt="OverLoad" className="animate-spin colored-svg" layout="responsive"/>
10+
</div>
11+
</div>
12+
)
13+
}
Lines changed: 2 additions & 0 deletions
Loading

0 commit comments

Comments
 (0)