elastic.inOut(1, 0.3) ease
Also known as Elastic in-out, easeInOutElastic.
Elastic in-out is an elastic curve that swings around its target like a rubber band before it comes to rest. The in-out variant is slow at both ends and fastest in the middle, good for moving something between two positions on screen. Amplitude 1, period 0.3. It is identical to GSAP's built-in "elastic.inOut(1, 0.3)" ease, so no plugin is needed there.
Measings shows it on real UI animations and lets you fine-tune the curve before you copy the code.
Code
GSAP
gsap.to(".box", { x: 200, duration: 0.6, ease: "elastic.inOut(1, 0.3)" });
GSAP CustomEase
gsap.registerPlugin(CustomEase);
CustomEase.create("elasticDefaultInOut", "M0,0 C0,-0.0081 0,-0.0002 0.0001,-0.0002 C0.0001,-0.0002 0.0001,-0.0002 0.0001,-0.0002 C0.0002,-0.0002 0.0002,-0.0002 0.0002,-0.0002 C0.0003,-0.0002 0.0004,-0.0002 0.0005,-0.0002 C0.0007,-0.0002 0.0008,-0.0002 0.001,-0.0002 C0.0013,-0.0002 0.0016,-0.0002 0.002,-0.0002 C0.0026,-0.0002 0.0033,-0.0002 0.0039,-0.0002 C0.0052,-0.0002 0.0065,-0.0001 0.0078,-0.0001 C0.0104,-0.0001 0.013,0 0.0156,0.0001 C0.0208,0.0002 0.026,0.0004 0.0313,0.0005 C0.0417,0.0008 0.0521,0.0011 0.0625,0.001 C0.0833,0.0008 0.1042,-0.002 0.125,-0.0028 C0.1458,-0.0036 0.1667,0.0012 0.1875,0.0057 C0.1979,0.0079 0.2083,0.0093 0.2188,0.0072 C0.2292,0.0051 0.2396,-0.0008 0.25,-0.0078 C0.2604,-0.0148 0.2708,-0.0226 0.2813,-0.0233 C0.2917,-0.0239 0.3021,-0.0162 0.3125,0 C0.3229,0.0162 0.3333,0.0409 0.3438,0.0554 C0.3542,0.0698 0.3646,0.0712 0.375,0.0442 C0.3802,0.0307 0.3854,0.0104 0.3906,-0.0143 C0.3958,-0.0391 0.401,-0.0684 0.4063,-0.0964 C0.4167,-0.1524 0.4271,-0.2016 0.4375,-0.1821 C0.4427,-0.1723 0.4479,-0.1453 0.4531,-0.0999 C0.4583,-0.0545 0.4635,0.0095 0.4688,0.0839 C0.474,0.1583 0.4792,0.2429 0.4844,0.3194 C0.4896,0.396 0.4948,0.4639 0.5,0.5 C0.5052,0.5361 0.5104,0.604 0.5156,0.6806 C0.5208,0.7571 0.526,0.8417 0.5313,0.9161 C0.5365,0.9905 0.5417,1.0545 0.5469,1.0999 C0.5521,1.1453 0.5573,1.1723 0.5625,1.1821 C0.5729,1.2016 0.5833,1.1524 0.5938,1.0964 C0.599,1.0684 0.6042,1.0391 0.6094,1.0143 C0.6146,0.9896 0.6198,0.9693 0.625,0.9558 C0.6354,0.9288 0.6458,0.9302 0.6563,0.9446 C0.6667,0.9591 0.6771,0.9838 0.6875,1 C0.6979,1.0162 0.7083,1.0239 0.7188,1.0233 C0.7292,1.0226 0.7396,1.0148 0.75,1.0078 C0.7604,1.0008 0.7708,0.9949 0.7813,0.9928 C0.7917,0.9907 0.8021,0.9921 0.8125,0.9943 C0.8333,0.9988 0.8542,1.0036 0.875,1.0028 C0.8958,1.002 0.9167,0.9992 0.9375,0.999 C0.9479,0.9989 0.9583,0.9992 0.9688,0.9995 C0.974,0.9996 0.9792,0.9998 0.9844,0.9999 C0.987,1 0.9896,1.0001 0.9922,1.0001 C0.9935,1.0001 0.9948,1.0002 0.9961,1.0002 C0.9967,1.0002 0.9974,1.0002 0.998,1.0002 C0.9984,1.0002 0.9987,1.0002 0.999,1.0002 C0.9992,1.0002 0.9993,1.0002 0.9995,1.0002 C0.9996,1.0002 0.9997,1.0002 0.9998,1.0002 C0.9998,1.0002 0.9998,1.0002 0.9999,1.0002 C0.9999,1.0002 0.9999,1.0002 0.9999,1.0002 C1,1.0002 1,1.0081 1,1");
gsap.to(".box", { x: 200, duration: 0.6, ease: "elasticDefaultInOut" });
CSS linear()
transition-timing-function: linear(0, 0.0009 6.67%, -0.0028 13.87%, 0.0074 19.67%, 0.0081 21.2%, 0.0022 23.33%, -0.0208 27.13%, -0.0229 28.67%, -0.0173 29.8%, -0.0056 30.87%, 0.0103 31.87%, 0.0464 33.8%, 0.0591 34.67%, 0.0651 35.4%, 0.0653 36.07%, 0.0611 36.6%, 0.0539 37.07%, 0.0433 37.53%, 0.0293 38%, 0.0092 38.53%, -0.0145 39.07%, -0.1229 41.13%, -0.1588 41.93%, -0.1742 42.4%, -0.1828 42.8%, -0.1865 43.2%, -0.1852 43.53%, -0.1796 43.87%, -0.1718 44.13%, -0.161 44.4%, -0.147 44.67%, -0.1298 44.93%, -0.1094 45.2%, -0.086 45.47%, -0.0523 45.8%, 0.0021 46.27%, 0.0733 46.8%, 0.1414 47.27%, 0.3237 48.47%, 0.4062 49.07%, 0.4382 49.33%, 0.4664 49.6%, 0.4901 49.87%, 0.5154 50.2%, 0.5402 50.47%, 0.5695 50.73%, 0.6111 51.07%, 0.6861 51.6%, 0.9077 53.07%, 0.9722 53.53%, 1.0222 53.93%, 1.0594 54.27%, 1.086 54.53%, 1.1094 54.8%, 1.1298 55.07%, 1.147 55.33%, 1.161 55.6%, 1.1718 55.87%, 1.1811 56.2%, 1.1858 56.53%, 1.1859 56.93%, 1.1805 57.33%, 1.1682 57.8%, 1.1536 58.2%, 1.1328 58.67%, 1.0276 60.67%, 0.9828 61.67%, 0.9623 62.27%, 0.9487 62.8%, 0.9397 63.33%, 0.9347 63.93%, 0.9349 64.6%, 0.9409 65.33%, 0.9536 66.2%, 0.9897 68.13%, 1.0056 69.13%, 1.0173 70.2%, 1.0229 71.33%, 1.0208 72.87%, 0.9978 76.67%, 0.9919 78.8%, 0.9926 80.33%, 1.0028 86.13%, 0.9991 93.33%, 1);CSS has no built-in curve of this shape, so it is sampled into linear(), which works in all current browsers.
Tailwind
ease-[linear(0,0.0009_6.67%,-0.0028_13.87%,0.0074_19.67%,0.0081_21.2%,0.0022_23.33%,-0.0208_27.13%,-0.0229_28.67%,-0.0173_29.8%,-0.0056_30.87%,0.0103_31.87%,0.0464_33.8%,0.0591_34.67%,0.0651_35.4%,0.0653_36.07%,0.0611_36.6%,0.0539_37.07%,0.0433_37.53%,0.0293_38%,0.0092_38.53%,-0.0145_39.07%,-0.1229_41.13%,-0.1588_41.93%,-0.1742_42.4%,-0.1828_42.8%,-0.1865_43.2%,-0.1852_43.53%,-0.1796_43.87%,-0.1718_44.13%,-0.161_44.4%,-0.147_44.67%,-0.1298_44.93%,-0.1094_45.2%,-0.086_45.47%,-0.0523_45.8%,0.0021_46.27%,0.0733_46.8%,0.1414_47.27%,0.3237_48.47%,0.4062_49.07%,0.4382_49.33%,0.4664_49.6%,0.4901_49.87%,0.5154_50.2%,0.5402_50.47%,0.5695_50.73%,0.6111_51.07%,0.6861_51.6%,0.9077_53.07%,0.9722_53.53%,1.0222_53.93%,1.0594_54.27%,1.086_54.53%,1.1094_54.8%,1.1298_55.07%,1.147_55.33%,1.161_55.6%,1.1718_55.87%,1.1811_56.2%,1.1858_56.53%,1.1859_56.93%,1.1805_57.33%,1.1682_57.8%,1.1536_58.2%,1.1328_58.67%,1.0276_60.67%,0.9828_61.67%,0.9623_62.27%,0.9487_62.8%,0.9397_63.33%,0.9347_63.93%,0.9349_64.6%,0.9409_65.33%,0.9536_66.2%,0.9897_68.13%,1.0056_69.13%,1.0173_70.2%,1.0229_71.33%,1.0208_72.87%,0.9978_76.67%,0.9919_78.8%,0.9926_80.33%,1.0028_86.13%,0.9991_93.33%,1)]
Webflow
In Interactions, choose a custom ease and paste this path:
M0,0 C0,-0.0081 0,-0.0002 0.0001,-0.0002 C0.0001,-0.0002 0.0001,-0.0002 0.0001,-0.0002 C0.0002,-0.0002 0.0002,-0.0002 0.0002,-0.0002 C0.0003,-0.0002 0.0004,-0.0002 0.0005,-0.0002 C0.0007,-0.0002 0.0008,-0.0002 0.001,-0.0002 C0.0013,-0.0002 0.0016,-0.0002 0.002,-0.0002 C0.0026,-0.0002 0.0033,-0.0002 0.0039,-0.0002 C0.0052,-0.0002 0.0065,-0.0001 0.0078,-0.0001 C0.0104,-0.0001 0.013,0 0.0156,0.0001 C0.0208,0.0002 0.026,0.0004 0.0313,0.0005 C0.0417,0.0008 0.0521,0.0011 0.0625,0.001 C0.0833,0.0008 0.1042,-0.002 0.125,-0.0028 C0.1458,-0.0036 0.1667,0.0012 0.1875,0.0057 C0.1979,0.0079 0.2083,0.0093 0.2188,0.0072 C0.2292,0.0051 0.2396,-0.0008 0.25,-0.0078 C0.2604,-0.0148 0.2708,-0.0226 0.2813,-0.0233 C0.2917,-0.0239 0.3021,-0.0162 0.3125,0 C0.3229,0.0162 0.3333,0.0409 0.3438,0.0554 C0.3542,0.0698 0.3646,0.0712 0.375,0.0442 C0.3802,0.0307 0.3854,0.0104 0.3906,-0.0143 C0.3958,-0.0391 0.401,-0.0684 0.4063,-0.0964 C0.4167,-0.1524 0.4271,-0.2016 0.4375,-0.1821 C0.4427,-0.1723 0.4479,-0.1453 0.4531,-0.0999 C0.4583,-0.0545 0.4635,0.0095 0.4688,0.0839 C0.474,0.1583 0.4792,0.2429 0.4844,0.3194 C0.4896,0.396 0.4948,0.4639 0.5,0.5 C0.5052,0.5361 0.5104,0.604 0.5156,0.6806 C0.5208,0.7571 0.526,0.8417 0.5313,0.9161 C0.5365,0.9905 0.5417,1.0545 0.5469,1.0999 C0.5521,1.1453 0.5573,1.1723 0.5625,1.1821 C0.5729,1.2016 0.5833,1.1524 0.5938,1.0964 C0.599,1.0684 0.6042,1.0391 0.6094,1.0143 C0.6146,0.9896 0.6198,0.9693 0.625,0.9558 C0.6354,0.9288 0.6458,0.9302 0.6563,0.9446 C0.6667,0.9591 0.6771,0.9838 0.6875,1 C0.6979,1.0162 0.7083,1.0239 0.7188,1.0233 C0.7292,1.0226 0.7396,1.0148 0.75,1.0078 C0.7604,1.0008 0.7708,0.9949 0.7813,0.9928 C0.7917,0.9907 0.8021,0.9921 0.8125,0.9943 C0.8333,0.9988 0.8542,1.0036 0.875,1.0028 C0.8958,1.002 0.9167,0.9992 0.9375,0.999 C0.9479,0.9989 0.9583,0.9992 0.9688,0.9995 C0.974,0.9996 0.9792,0.9998 0.9844,0.9999 C0.987,1 0.9896,1.0001 0.9922,1.0001 C0.9935,1.0001 0.9948,1.0002 0.9961,1.0002 C0.9967,1.0002 0.9974,1.0002 0.998,1.0002 C0.9984,1.0002 0.9987,1.0002 0.999,1.0002 C0.9992,1.0002 0.9993,1.0002 0.9995,1.0002 C0.9996,1.0002 0.9997,1.0002 0.9998,1.0002 C0.9998,1.0002 0.9998,1.0002 0.9999,1.0002 C0.9999,1.0002 0.9999,1.0002 0.9999,1.0002 C1,1.0002 1,1.0081 1,1
Related easings
- elastic.in(1, 0.3)
- elastic.out(1, 0.3)
- Elastic out-in
- elastic.in(1, 1.2)
- elastic.out(1, 1.2)
- elastic.inOut(1, 1.2)
- Elastic light out-in
- power2.inOut
- sine.inOut
- Expo in-out
- circ.inOut
- back.inOut(1.7)
See how elastic.inOut(1, 0.3) measures up against all 91 easings in the easing comparison: progress over time, overshoot and peak speed.
