File tree Expand file tree Collapse file tree 3 files changed +57
-0
lines changed Expand file tree Collapse file tree 3 files changed +57
-0
lines changed Original file line number Diff line number Diff line change @@ -5,3 +5,4 @@ Experiments in drawing and animating with pure CSS.
5
5
1 . [ Blinking cat] ( /cat )
6
6
2 . [ Jumping mustache] ( /mustache )
7
7
3 . [ Cat eyes in a signle div] ( /cat-eyes )
8
+ 4 . [ Spinning sun] ( /sun )
Original file line number Diff line number Diff line change
1
+ body {
2
+ background-color : khaki;
3
+ height : 100% ;
4
+ display : flex;
5
+ align-items : center;
6
+ justify-content : center;
7
+ }
8
+
9
+ .container {
10
+ position : relative;
11
+ height : 100px ;
12
+ width : 100px ;
13
+ }
14
+
15
+ .sun {
16
+ position : absolute;
17
+ width : 100px ;
18
+ height : 100px ;
19
+ background-color : gold;
20
+ border-radius : 50% ;
21
+ animation : circleAround 1s linear infinite;
22
+ }
23
+
24
+ .sun : after {
25
+ content : '' ;
26
+ position : absolute;
27
+ top : 40px ;
28
+ left : -40px ;
29
+ background-color : gold;
30
+ color : gold;
31
+ height : 20px ;
32
+ width : 20px ;
33
+ border-radius : 50% ;
34
+ box-shadow : 80px -80px 0 currentColor,
35
+ 160px 0px 0 currentColor,
36
+ 80px 80px 0 currentColor,
37
+ 25px 55px 0 currentColor,
38
+ 135px 55px 0 currentColor,
39
+ 25px -55px 0 currentColor,
40
+ 135px -55px 0 currentColor;
41
+ }
42
+
43
+ @keyframes circleAround {
44
+ 0% { transform : rotate (0deg ); }
45
+ 100% { transform : rotate (360deg ); }
46
+ }
Original file line number Diff line number Diff line change
1
+ < html >
2
+ < head >
3
+ < link rel ="stylesheet " href ="sun.css ">
4
+ </ head >
5
+ < body >
6
+ < div class ="container ">
7
+ < div class ="sun "> </ div >
8
+ </ div >
9
+ </ body >
10
+ </ html >
You can’t perform that action at this time.
0 commit comments