OLD | NEW |
(Empty) | |
| 1 var translateSteps = { |
| 2 keyframes: [ |
| 3 {transform: 'translateX(100px)'}, |
| 4 {transform: 'translateX(500px)'} |
| 5 ], |
| 6 easing: 'steps(9)', |
| 7 style: `background: maroon; float: none;`, |
| 8 samples: [ |
| 9 {at: 0}, |
| 10 {at: 0.25}, |
| 11 {at: 0.5}, |
| 12 {at: 0.75}, |
| 13 {at: 1.1}, |
| 14 ] |
| 15 }; |
| 16 |
| 17 var translateStepsPerKeyframe = { |
| 18 keyframes: [ |
| 19 {transform: 'translateX(100px)', easing: 'steps(18)'}, |
| 20 {transform: 'translateX(400px)', easing: 'steps(9)'}, |
| 21 {transform: 'translateX(500px)'} |
| 22 ], |
| 23 style: `background: navy; float: none;`, |
| 24 samples: [ |
| 25 {at: 0}, |
| 26 {at: 0.25}, |
| 27 {at: 0.35}, |
| 28 {at: 0.5}, |
| 29 {at: 0.65}, |
| 30 {at: 0.75}, |
| 31 {at: 1.1}, |
| 32 ] |
| 33 }; |
| 34 |
| 35 var translateStepsWithCubicBezier = { |
| 36 keyframes: [ |
| 37 {transform: 'translateX(100px)', easing: 'steps(9)'}, |
| 38 {transform: 'translateX(500px)'} |
| 39 ], |
| 40 easing: 'cubic-bezier(.5, -1, .5, 2)', |
| 41 style: `background: black; float: none;`, |
| 42 samples: [ |
| 43 {at: 0}, |
| 44 {at: 0.4}, |
| 45 {at: 0.45}, |
| 46 {at: 0.5}, |
| 47 {at: 0.6}, |
| 48 {at: 1.41}, |
| 49 ] |
| 50 }; |
| 51 |
| 52 var translateCubicBezierWithSteps = { |
| 53 keyframes: [ |
| 54 {transform: 'translateX(100px)', easing: 'cubic-bezier(.5, -1, .5, 2)'}, |
| 55 {transform: 'translateX(500px)'} |
| 56 ], |
| 57 easing: 'steps(9)', |
| 58 style: `background: peru; float: none;`, |
| 59 samples: [ |
| 60 {at: 0}, |
| 61 {at: 0.25}, |
| 62 {at: 0.35}, |
| 63 {at: 0.5}, |
| 64 {at: 0.65}, |
| 65 {at: 0.75}, |
| 66 {at: 1.39}, |
| 67 ] |
| 68 }; |
| 69 |
| 70 var timingFunctionTests = [translateSteps, translateStepsPerKeyframe, |
| 71 translateStepsWithCubicBezier, translateCubicBezierWi
thSteps]; |
| 72 |
OLD | NEW |