File tree Expand file tree Collapse file tree 1 file changed +15
-1
lines changed
packages/docz/src/instructions Expand file tree Collapse file tree 1 file changed +15
-1
lines changed Original file line number Diff line number Diff line change @@ -13,7 +13,7 @@ gsap.registerPlugin(SlowMo)
1313
1414# Easing
1515
16- With gsap 3 the easing functions are more easily usable as string without importing. They can be used in the "ease" prop of the ` Tween ` .
16+ With GSAP 3 the easing functions are more easily usable as string without importing. They can be used in the "ease" prop of the ` Tween ` .
1717
1818Have a look at the docs: https://greensock.com/docs/v3/Eases
1919
@@ -47,3 +47,17 @@ This is an extra ease that has to be registered first:
4747 </Tween >
4848 </Controls >
4949</Playground >
50+
51+ ## Custom easing function
52+
53+ You can also pass a function to the ease prop. In this way you can have your custom easing functions.
54+
55+ In the example it's an ` easeInOutQuart ` . Take a look at this resource for inspiration: https://easings.net/
56+
57+ <Playground >
58+ <Controls playState = { PlayState .stop } >
59+ <Tween to = { { x: ' 200px' }} duration = { 2 } ease = { (x ) => x < 0.5 ? 8 * x * x * x * x : 1 - Math .pow (- 2 * x + 2 , 4 ) / 2 } >
60+ <div style = { { width: ' 100px' , height: ' 100px' , background: ' #ccc' }} />
61+ </Tween >
62+ </Controls >
63+ </Playground >
You can’t perform that action at this time.
0 commit comments