File tree Expand file tree Collapse file tree 2 files changed +11
-24
lines changed Expand file tree Collapse file tree 2 files changed +11
-24
lines changed Original file line number Diff line number Diff line change 11
11
</ head >
12
12
13
13
< body >
14
- < div class ="transition "> transition</ div >
15
14
< div class ="animation "> animation</ div >
16
15
</ body >
17
16
</ html >
Original file line number Diff line number Diff line change 1
1
/*
2
- Transtion 0 = 100%
3
- from start state to end state
4
- ANIMATION 0 1% 2% .... 100%
5
- multiple states
2
+ animation-fill-mode:what values are applied by the animation outside the time it is executing.
6
3
*/
7
4
8
5
div {
9
6
width : 200px ;
10
7
height : 200px ;
11
8
color : white;
12
9
margin : 20px ;
13
- }
14
-
15
- .transition {
16
- background : red;
17
- transition : all 2s linear;
18
- }
19
-
20
- .transition : hover {
21
- background : blue;
22
- transform : translateX (200px );
10
+ opacity : 0 ;
23
11
}
24
12
25
13
.animation {
26
14
background : blue;
27
- /* animation-name: move;
28
- animation-duration: 10s;
29
- animation-iteration-count: 3; */
30
- animation : move 3s infinite;
15
+ animation : move 3s 3 ;
16
+ animation-fill-mode : forwards;
31
17
}
32
18
33
19
@keyframes move {
34
20
0% {
35
- background : red;
21
+ opacity : 0.1 ;
22
+ }
23
+ 25% {
24
+ opacity : 0.25 ;
36
25
transform : translateX (50px );
37
26
}
38
27
50% {
39
- background : green ;
28
+ opacity : 0.5 ;
40
29
transform : translateX (200px );
41
30
}
42
31
75% {
43
- background : fuchsia;
44
- transform : translateX (-200px );
32
+ opacity : 0.75 ;
45
33
}
46
34
100% {
47
- background : aqua ;
35
+ opacity : 1 ;
48
36
transform : translateX (50px );
49
37
}
50
38
}
You can’t perform that action at this time.
0 commit comments