File tree Expand file tree Collapse file tree 2 files changed +38
-38
lines changed Expand file tree Collapse file tree 2 files changed +38
-38
lines changed Original file line number Diff line number Diff line change 11
11
</ head >
12
12
13
13
< body >
14
- < div class ="default "> default</ div >
15
- < div class ="ease "> ease</ div >
16
- < div class ="linear "> linear</ div >
17
- < div class ="ease-in "> ease-in</ div >
18
- < div class ="ease-out "> ease-out</ div >
19
- < div class ="ease-in-out "> ease-in-out</ div >
14
+ < div class ="transition "> transition</ div >
15
+ < div class ="animation "> animation</ div >
20
16
</ body >
21
17
</ html >
Original file line number Diff line number Diff line change 1
1
/*
2
- how the transition takes place
3
- transition-timing-function
4
- transition:all 3s here 5s;
5
- ease = default
6
- ease = slow start, fast, slow end
7
- linear = same speed start to end
8
- ease-in = slow start
9
- ease-out = slow end
10
- ease-in-out = slow start,fast, slow end
2
+ Transtion 0 = 100%
3
+ from start state to end state
4
+ ANIMATION 0 1% 2% .... 100%
5
+ multiple states
11
6
*/
12
7
13
8
div {
14
- background : blue;
9
+ width : 200px ;
10
+ height : 200px ;
15
11
color : white;
16
- margin : 10px ;
17
- width : 100px ;
18
- height : 100px ;
19
- font-size : 20px ;
20
- text-align : center;
21
- transition : all 2s ;
12
+ margin : 20px ;
22
13
}
23
14
24
- div : hover {
25
- transform : translateX (200px );
15
+ .transition {
16
+ background : red;
17
+ transition : all 2s linear;
26
18
}
27
19
28
- .ease {
29
- transition-timing-function : ease;
30
- }
31
-
32
- .linear {
33
- transition-timing-function : linear;
34
- }
35
-
36
- .ease-in {
37
- transition-timing-function : ease-in;
20
+ .transition : hover {
21
+ background : blue;
22
+ transform : translateX (200px );
38
23
}
39
24
40
- .ease-out {
41
- transition-timing-function : ease-out;
25
+ .animation {
26
+ background : blue;
27
+ /* animation-name: move;
28
+ animation-duration: 10s;
29
+ animation-iteration-count: 3; */
30
+ animation : move 3s infinite;
42
31
}
43
32
44
- .ease-in-out {
45
- transition-timing-function : ease-in-out;
33
+ @keyframes move {
34
+ 0% {
35
+ background : red;
36
+ transform : translateX (50px );
37
+ }
38
+ 50% {
39
+ background : green;
40
+ transform : translateX (200px );
41
+ }
42
+ 75% {
43
+ background : fuchsia;
44
+ transform : translateX (-200px );
45
+ }
46
+ 100% {
47
+ background : aqua;
48
+ transform : translateX (50px );
49
+ }
46
50
}
You can’t perform that action at this time.
0 commit comments