Home / File/ index.js — svelte Source File

index.js — svelte Source File

Architecture documentation for index.js, a javascript file in the svelte codebase. 0 imports, 2 dependents.

File javascript AnimationLibrary Easing 2 dependents 31 functions

Entity Profile

Dependency Diagram

graph LR
  8d8f0ca3_5d92_5886_ea4e_cf91e157cffe["index.js"]
  f6212c25_7a1e_6392_8ec8_309b3ffcc39d["index.js"]
  f6212c25_7a1e_6392_8ec8_309b3ffcc39d --> 8d8f0ca3_5d92_5886_ea4e_cf91e157cffe
  99a316ef_52a9_1ecb_3a20_489761af28ad["tweened.js"]
  99a316ef_52a9_1ecb_3a20_489761af28ad --> 8d8f0ca3_5d92_5886_ea4e_cf91e157cffe
  style 8d8f0ca3_5d92_5886_ea4e_cf91e157cffe fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

/*
Adapted from https://github.com/mattdesl
Distributed under MIT License https://github.com/mattdesl/eases/blob/master/LICENSE.md
*/

/**
 * @param {number} t
 * @returns {number}
 */
export function linear(t) {
	return t;
}

/**
 * @param {number} t
 * @returns {number}
 */
export function backInOut(t) {
	const s = 1.70158 * 1.525;
	if ((t *= 2) < 1) return 0.5 * (t * t * ((s + 1) * t - s));
	return 0.5 * ((t -= 2) * t * ((s + 1) * t + s) + 2);
}

/**
 * @param {number} t
 * @returns {number}
 */
export function backIn(t) {
	const s = 1.70158;
	return t * t * ((s + 1) * t - s);
}

/**
 * @param {number} t
 * @returns {number}
 */
export function backOut(t) {
	const s = 1.70158;
	return --t * t * ((s + 1) * t + s) + 1;
}

/**
 * @param {number} t
 * @returns {number}
 */
export function bounceOut(t) {
	const a = 4.0 / 11.0;
	const b = 8.0 / 11.0;
	const c = 9.0 / 10.0;
	const ca = 4356.0 / 361.0;
	const cb = 35442.0 / 1805.0;
	const cc = 16061.0 / 1805.0;
	const t2 = t * t;
	return t < a
		? 7.5625 * t2
		: t < b
			? 9.075 * t2 - 9.9 * t + 3.4
			: t < c
				? ca * t2 - cb * t + cc
				: 10.8 * t * t - 20.52 * t + 10.72;
// ... (227 more lines)

Subdomains

Frequently Asked Questions

What does index.js do?
index.js is a source file in the svelte codebase, written in javascript. It belongs to the AnimationLibrary domain, Easing subdomain.
What functions are defined in index.js?
index.js defines 31 function(s): backIn, backInOut, backOut, bounceIn, bounceInOut, bounceOut, circIn, circInOut, circOut, cubicIn, and 21 more.
What files import index.js?
index.js is imported by 2 file(s): index.js, tweened.js.
Where is index.js in the architecture?
index.js is located at packages/svelte/src/easing/index.js (domain: AnimationLibrary, subdomain: Easing, directory: packages/svelte/src/easing).

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free