Skip to content

Commit 669b5c1

Browse files
committed
feat: custom loader v1
1 parent e9d082c commit 669b5c1

File tree

3 files changed

+62
-2
lines changed

3 files changed

+62
-2
lines changed

pages/custom-loader-v1.tsx

+54
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
import React from 'react';
2+
import Container from '@components/Container';
3+
4+
const CustomLoader = () => {
5+
return <>
6+
<Container>
7+
<span className="loader"></span>
8+
</Container>
9+
<style jsx>
10+
{`
11+
.loader {
12+
width: 54px;
13+
height: 54px;
14+
border: 4px solid #FFF;
15+
border-radius: 50%;
16+
position: relative;
17+
box-sizing: border-box;
18+
display: inline-block;
19+
animation: loader-anim 3s linear infinite;
20+
}
21+
22+
.loader::after {
23+
content: '';
24+
box-sizing: border-box;
25+
position: absolute;
26+
left: 50%;
27+
top: 50%;
28+
transform: translate(-50%, -50%);
29+
width: 70px;
30+
height: 70px;
31+
border-radius: 50%;
32+
border: 4px solid;
33+
border-color: #FF9950 transparent;
34+
}
35+
36+
@keyframes loader-anim {
37+
0% {
38+
transform: scale(1) rotate(360deg);
39+
}
40+
41+
50% {
42+
transform: scale(.7) rotate(-360deg);
43+
}
44+
45+
100% {
46+
transform: scale(1) rotate(360deg);
47+
}
48+
}
49+
`}
50+
</style>
51+
</>
52+
}
53+
54+
export default CustomLoader;

pages/index.tsx

+7
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,13 @@ const DirectoryPage = () => {
8888
</a>
8989
</Link>
9090
</li>
91+
<li>
92+
<Link href="/custom-loader-v1">
93+
<a>
94+
Pure CSS Loader (v1)
95+
</a>
96+
</Link>
97+
</li>
9198
<li>
9299
<Link href="/custom-loader">
93100
<a>

pages/zoom-image-hover-effect.tsx

+1-2
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,7 @@ const zoomPage = () => {
2525
}`}
2626
</style>
2727
</>
28-
)
29-
28+
)
3029
}
3130

3231
export default zoomPage;

0 commit comments

Comments
 (0)