File tree Expand file tree Collapse file tree 2 files changed +37
-29
lines changed Expand file tree Collapse file tree 2 files changed +37
-29
lines changed Original file line number Diff line number Diff line change 11
11
</ head >
12
12
13
13
< body >
14
- < div class ="one "> </ div >
15
- < div class ="two "> </ div >
16
- < div class ="three "> </ div >
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 >
17
20
</ body >
18
21
</ html >
Original file line number Diff line number Diff line change 1
1
/*
2
- transition: change over time
3
- transition-delay:
4
- shorthand
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
5
11
*/
6
12
7
13
div {
8
- width : 150px ;
9
- height : 150px ;
10
- display : inline-block;
14
+ background : blue;
15
+ color : white;
16
+ margin : 10px ;
17
+ width : 100px ;
18
+ height : 100px ;
19
+ font-size : 20px ;
20
+ text-align : center;
21
+ transition : all 2s ;
11
22
}
12
23
13
- . one {
14
- background : red ;
24
+ div : hover {
25
+ transform : translateX ( 200 px ) ;
15
26
}
16
27
17
- .two {
18
- background : blue;
19
- /* transition-property: background, border-radius;
20
- transition-duration: 4s, 2s; */
21
-
22
- /* transition delay */
23
- /* transition-delay: 2s; */
28
+ .ease {
29
+ transition-timing-function : ease;
30
+ }
24
31
25
- /* Transition shorthand for specific*/
26
- /* transition: background 4s 2s, border-radius 2s 1s; */
32
+ .linear {
33
+ transition-timing-function : linear;
34
+ }
27
35
28
- /* Transition shorthand for all */
29
- transition : all 2 s 1 s ;
36
+ . ease-in {
37
+ transition-timing-function : ease-in ;
30
38
}
31
39
32
- .two : hover {
33
- background : chartreuse;
34
- border-radius : 50% ;
35
- transform : scale (2 , 2 );
36
- margin-top : 50% ;
40
+ .ease-out {
41
+ transition-timing-function : ease-out;
37
42
}
38
43
39
- .three {
40
- background : green ;
44
+ .ease-in-out {
45
+ transition-timing-function : ease-in-out ;
41
46
}
You can’t perform that action at this time.
0 commit comments