1
+ *
2
+ {
3
+ margin : 0 ;
4
+ padding : 0 ;
5
+ box-sizing : border-box;
6
+ }
7
+ body
8
+ {
9
+ display : flex;
10
+ justify-content : center;
11
+ align-items : center;
12
+ background-color : # edf1f4 ;
13
+ min-width : 100vh ;
14
+ }
15
+ .loader
16
+ {
17
+ display : flex;
18
+ flex-direction : row;
19
+ }
20
+ .loader div
21
+ {
22
+ position : relative;
23
+ width : 40px ;
24
+ height : 200px ;
25
+ margin : 20px ;
26
+ overflow : hidden;
27
+ border-radius : 40px ;
28
+ background : linear-gradient (top bottom, rgba (0 , 0 , 0 , 0.05 , # edf1f4 ));
29
+ border : 2px solid # edf1f4 ;
30
+ box-shadow : 15px 15px 20px rgba (0 , 0 , 0 , 0.1 ),
31
+ .15px -15px 20px # fff,
32
+ inset -5px -5px 5px rgba (255 , 255 , 255 , 0.5 ),
33
+ inset 5px 5px 5px rgba (0 , 0 , 0 , 0.05 );
34
+ }
35
+ .loader div ::before
36
+ {
37
+ content : '' ;
38
+ position : absolute;
39
+ top : 0 ;
40
+ left : 0 ;
41
+ width : 100% ;
42
+ height : 100% ;
43
+ z-index : 10 ;
44
+ border-radius : 40px ;
45
+ box-shadow : 15px 15px 20px rgba (0 , 0 , 0 , 0.1 ),
46
+ .15px -15px 20px # fff,
47
+ inset -5px -5px 5px rgba (255 , 255 , 255 , 0.5 ),
48
+ inset 5px 5px 5px rgba (0 , 0 , 0 , 0.05 );
49
+ }
50
+ .loader div ::after
51
+ {
52
+ content : '' ;
53
+ position : absolute;
54
+ top : 0 ;
55
+ left : 0 ;
56
+ width : 36px ;
57
+ height : 36px ;
58
+ background : # fff ;
59
+ border-radius : 50% ;
60
+ box-shadow : inset -5px -5px 5px rgba (0 , 0 , 0 , 0.2 ),
61
+ 0 420px 0 400px # 2196f3 ;
62
+ animation : animate 2.5s ease-in-out infinite;
63
+ animation-delay : calc (-0.5 s*var(--i )) ;
64
+ }
65
+ @keyframes animate
66
+ {
67
+ 0%
68
+ {
69
+ transform : translateY (160px );
70
+ filter : hue-rotate (180deg );
71
+ }
72
+ 50%
73
+ {
74
+ transform : translateY (0px );
75
+ }
76
+ 100%
77
+ {
78
+ transform : translateY (160px );
79
+ }
80
+ }
0 commit comments