composer require smnandre/easing-functions
EasingFunctions is a PHP library that provides easing functions for animations, transitions, etc/
x | In | InOut | Out |
---|---|---|---|
Cubic | easeInCubic |
easeInOutCubic |
easeOutCubic |
Quart | easeInQuart |
easeInOutQuart |
easeOutQuart |
Quad | easeInQuad |
easeInOutQuad |
easeOutQuad |
composer require smnandre/easing-functions
Easing\Functions::easeOutCubic(0);
// 0
Easing\Functions::easeOutCubic(0.5);
// 0.875
$values = array_map(Easing\Functions::easeOutCubic(...), range(0, 1, 0.1));
echo implode(" ", $values);
// 0 0.271 0.488 0.657 0.784 0.875 0.936 0.973 0.992 0.999 1
Function | 12.5% | 25% | 37.5% | 50% | 62.5% | 75% | 87.5% |
---|---|---|---|---|---|---|---|
OutQuart | ██ | ███▎ | ████ | ████▌ | ████▊ | ████▊ | ████▊ |
OutCubic | █▌ | ██▊ | ███▊ | ████▎ | ████▌ | ████▊ | ████▊ |
OutQuad | █ | ██ | ███ | ███▊ | ████▎ | ████▌ | ████▊ |
InOutQuad | ▌ | █▎ | ██▌ | ███▌ | ████▎ | ████▊ | |
InOutCubic | ▎ | █ | ██▌ | ███▊ | ████▌ | ████▊ | |
InOutQuart | ▊ | ██▌ | ████ | ████▊ | ████▊ | ||
InQuad | ▎ | ▌ | █▎ | █▊ | ██▊ | ███▊ | |
InCubic | ▎ | ▌ | █ | ██ | ███▎ | ||
InQuart | ▎ | ▊ | █▌ | ██▊ |
This project is licensed under the MIT License. See the LICENSE file for more information.