Skip to content

docs: Updated docs to include information on easing functions #16070

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions documentation/docs/98-reference/21-svelte-easing.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,6 @@
title: svelte/easing
---

This module provides a set of functions that allow you to manipulate time values in different ways. It’s particularly useful for animations when combined with the `motion` module.

> MODULE: svelte/easing
62 changes: 62 additions & 0 deletions packages/svelte/src/easing/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ Distributed under MIT License https://github.com/mattdesl/eases/blob/master/LICE
*/

/**
* Returns value as is.
*
* @param {number} t
* @returns {number}
*/
Expand All @@ -12,6 +14,8 @@ export function linear(t) {
}

/**
* Rebound effect on start and end of value range.
*
* @param {number} t
* @returns {number}
*/
Expand All @@ -22,6 +26,8 @@ export function backInOut(t) {
}

/**
* Rebound effect on start.
*
* @param {number} t
* @returns {number}
*/
Expand All @@ -31,6 +37,8 @@ export function backIn(t) {
}

/**
* Rebound effect on end.
*
* @param {number} t
* @returns {number}
*/
Expand All @@ -40,6 +48,8 @@ export function backOut(t) {
}

/**
* Bounce effect on end.
*
* @param {number} t
* @returns {number}
*/
Expand All @@ -61,6 +71,8 @@ export function bounceOut(t) {
}

/**
* Bounce effect on start and end.
*
* @param {number} t
* @returns {number}
*/
Expand All @@ -69,6 +81,8 @@ export function bounceInOut(t) {
}

/**
* Rebound effect on start.
*
* @param {number} t
* @returns {number}
*/
Expand All @@ -77,6 +91,8 @@ export function bounceIn(t) {
}

/**
* Circular effect, accelerate on start, decelerate towards end.
*
* @param {number} t
* @returns {number}
*/
Expand All @@ -86,6 +102,8 @@ export function circInOut(t) {
}

/**
* Circular effect, accelerate on start.
*
* @param {number} t
* @returns {number}
*/
Expand All @@ -94,6 +112,8 @@ export function circIn(t) {
}

/**
* Circular effect, decelerate towards end.
*
* @param {number} t
* @returns {number}
*/
Expand All @@ -102,6 +122,8 @@ export function circOut(t) {
}

/**
* Cubic scaling, accelerate on start, decelerate towards end.
*
* @param {number} t
* @returns {number}
*/
Expand All @@ -110,6 +132,8 @@ export function cubicInOut(t) {
}

/**
* Cubic scaling, accelerate on start
*
* @param {number} t
* @returns {number}
*/
Expand All @@ -118,6 +142,8 @@ export function cubicIn(t) {
}

/**
* Cubic scaling, decelerate towards end.
*
* @param {number} t
* @returns {number}
*/
Expand All @@ -127,6 +153,8 @@ export function cubicOut(t) {
}

/**
* Elastic effect on start and end.
*
* @param {number} t
* @returns {number}
*/
Expand All @@ -140,6 +168,8 @@ export function elasticInOut(t) {
}

/**
* Elastic effect on start.
*
* @param {number} t
* @returns {number}
*/
Expand All @@ -148,6 +178,8 @@ export function elasticIn(t) {
}

/**
* Elastic effect on end.
*
* @param {number} t
* @returns {number}
*/
Expand All @@ -156,6 +188,8 @@ export function elasticOut(t) {
}

/**
* Exponential effect on start and end.
*
* @param {number} t
* @returns {number}
*/
Expand All @@ -168,6 +202,8 @@ export function expoInOut(t) {
}

/**
* Exponential effect on start.
*
* @param {number} t
* @returns {number}
*/
Expand All @@ -176,6 +212,8 @@ export function expoIn(t) {
}

/**
* Exponential effect on end.
*
* @param {number} t
* @returns {number}
*/
Expand All @@ -184,6 +222,8 @@ export function expoOut(t) {
}

/**
* Quadratic scaling, accelerate on start, decelerate towards end.
*
* @param {number} t
* @returns {number}
*/
Expand All @@ -195,6 +235,8 @@ export function quadInOut(t) {
}

/**
* Quadratic scaling, accelerate on start.
*
* @param {number} t
* @returns {number}
*/
Expand All @@ -203,6 +245,8 @@ export function quadIn(t) {
}

/**
* Quadratic scaling, decelerate towards end.
*
* @param {number} t
* @returns {number}
*/
Expand All @@ -211,6 +255,8 @@ export function quadOut(t) {
}

/**
* Quartic scaling, accelerate on start, decelerate towards end.
*
* @param {number} t
* @returns {number}
*/
Expand All @@ -219,6 +265,8 @@ export function quartInOut(t) {
}

/**
* Quartic scaling, accelerate on start.
*
* @param {number} t
* @returns {number}
*/
Expand All @@ -227,6 +275,8 @@ export function quartIn(t) {
}

/**
* Quartic scaling, decelerate towards end.
*
* @param {number} t
* @returns {number}
*/
Expand All @@ -235,6 +285,8 @@ export function quartOut(t) {
}

/**
* Quintic scaling, accelerate on start, decelerate towards end.
*
* @param {number} t
* @returns {number}
*/
Expand All @@ -244,6 +296,8 @@ export function quintInOut(t) {
}

/**
* Quintic scaling, accelerate on start.
*
* @param {number} t
* @returns {number}
*/
Expand All @@ -252,6 +306,8 @@ export function quintIn(t) {
}

/**
* Quintic scaling, decelerate towards end.
*
* @param {number} t
* @returns {number}
*/
Expand All @@ -260,6 +316,8 @@ export function quintOut(t) {
}

/**
* Sinusoidal effect, accelerate on start, decelerate towards end.
*
* @param {number} t
* @returns {number}
*/
Expand All @@ -268,6 +326,8 @@ export function sineInOut(t) {
}

/**
* Sinusoidal effect, accelerate on start.
*
* @param {number} t
* @returns {number}
*/
Expand All @@ -278,6 +338,8 @@ export function sineIn(t) {
}

/**
* Sinusoidal effect, decelerate towards end.
*
* @param {number} t
* @returns {number}
*/
Expand Down