File tree 1 file changed +43
-0
lines changed
Square_Rotation_Animation
1 file changed +43
-0
lines changed Original file line number Diff line number Diff line change
1
+ <!DOCTYPE html>
2
+ < html >
3
+ < head >
4
+ < style >
5
+ /* The animation code */
6
+ @keyframes example {
7
+ 0% {background-color : # e74c3c ; transform : translate (0 , 0 ) rotate (0deg );}
8
+ 25% {background-color : # f1c40f ; transform : translate (200px , 0 ) rotate (90deg );}
9
+ 50% {background-color : # 3498db ; transform : translate (200px , 200px ) rotate (180deg );}
10
+ 75% {background-color : # 2ecc71 ; transform : translate (0 , 200px ) rotate (270deg );}
11
+ 100% {background-color : # e74c3c ; transform : translate (0 , 0 ) rotate (360deg );}
12
+ }
13
+
14
+ /* The element to apply the animation to */
15
+ div {
16
+ width : 100px ;
17
+ height : 100px ;
18
+ position : relative;
19
+ background-color : # e74c3c ;
20
+ animation-name : example;
21
+ animation-duration : 4s ;
22
+ animation-timing-function : ease-in-out;
23
+ animation-iteration-count : infinite;
24
+ animation-direction : alternate;
25
+ animation-fill-mode : both;
26
+ }
27
+
28
+ body {
29
+ display : flex;
30
+ justify-content : center;
31
+ align-items : center;
32
+ height : 100vh ;
33
+ margin : 0 ;
34
+ background-color : # f0f0f0 ;
35
+ }
36
+ </ style >
37
+ </ head >
38
+ < body >
39
+
40
+ < div > </ div >
41
+
42
+ </ body >
43
+ </ html >
You can’t perform that action at this time.
0 commit comments