Skip to content

@feds01/graphika


@feds01/graphika / core/animation

core/animation ​

Interfaces ​

EasingAnimationFn() ​

Defined in: core/animation.ts:6

Interface representing an easing function for animations.

ts
EasingAnimationFn(t): number;

Defined in: core/animation.ts:7

Interface representing an easing function for animations.

Parameters ​

ParameterType
tnumber

Returns ​

number

Type Aliases ​

Vec2 ​

ts
type Vec2 = {
  x: number;
  y: number;
};

Defined in: core/animation.ts:85

A 2D point for bezier calculations.

Properties ​

PropertyTypeDefined in
xnumbercore/animation.ts:85
ynumbercore/animation.ts:85

Functions ​

easeInCubic() ​

ts
function easeInCubic(t): number;

Defined in: core/animation.ts:31

Ease-in cubic easing function that starts slowly and accelerates towards the end.

Parameters ​

ParameterType
tnumber

Returns ​

number


easeInOutCubic() ​

ts
function easeInOutCubic(t): number;

Defined in: core/animation.ts:41

Ease-in-out cubic easing function that starts and ends slowly, with a faster middle phase.

Parameters ​

ParameterType
tnumber

Returns ​

number


easeInOutQuad() ​

ts
function easeInOutQuad(t): number;

Defined in: core/animation.ts:26

Ease-in-out quadratic easing function that starts and ends slowly, with a faster middle phase.

Parameters ​

ParameterType
tnumber

Returns ​

number


easeInOutSine() ​

ts
function easeInOutSine(t): number;

Defined in: core/animation.ts:80

Parameters ​

ParameterType
tnumber

Returns ​

number


easeInQuad() ​

ts
function easeInQuad(t): number;

Defined in: core/animation.ts:16

Ease-in quadratic easing function that starts slowly and accelerates towards the end.

Parameters ​

ParameterType
tnumber

Returns ​

number


easeInSine() ​

ts
function easeInSine(t): number;

Defined in: core/animation.ts:72

Parameters ​

ParameterType
tnumber

Returns ​

number


easeOutBounce() ​

ts
function easeOutBounce(t): number;

Defined in: core/animation.ts:46

Ease-out bounce easing function that simulates a bouncing effect at the end of the animation.

Parameters ​

ParameterType
tnumber

Returns ​

number


easeOutCubic() ​

ts
function easeOutCubic(t): number;

Defined in: core/animation.ts:36

Ease-out cubic easing function that starts quickly and decelerates towards the end.

Parameters ​

ParameterType
tnumber

Returns ​

number


easeOutElastic() ​

ts
function easeOutElastic(t): number;

Defined in: core/animation.ts:62

Elastic easing function that creates an oscillating effect, simulating a spring-like motion.

Parameters ​

ParameterType
tnumber

Returns ​

number


easeOutQuad() ​

ts
function easeOutQuad(t): number;

Defined in: core/animation.ts:21

Ease-out quadratic easing function that starts quickly and decelerates towards the end.

Parameters ​

ParameterType
tnumber

Returns ​

number


easeOutSine() ​

ts
function easeOutSine(t): number;

Defined in: core/animation.ts:76

Parameters ​

ParameterType
tnumber

Returns ​

number


lerp() ​

ts
function lerp(
   a, 
   b, 
   t
): Vec2;

Defined in: core/animation.ts:103

Linear interpolation between two points.

Parameters ​

ParameterType
aVec2
bVec2
tnumber

Returns ​

Vec2


linearEasing() ​

ts
function linearEasing(t): number;

Defined in: core/animation.ts:11

Linear easing function that returns the input value as is, resulting in a constant speed animation.

Parameters ​

ParameterType
tnumber

Returns ​

number


splitCubicAt() ​

ts
function splitCubicAt(
   p0, 
   cp1, 
   cp2, 
   p1, 
   t
): PartialCubic;

Defined in: core/animation.ts:135

Splits a cubic bezier curve at parameter t and returns the first portion. Uses de Casteljau's algorithm.

Parameters ​

ParameterType
p0Vec2
cp1Vec2
cp2Vec2
p1Vec2
tnumber

Returns ​

PartialCubic


splitQuadraticAt() ​

ts
function splitQuadraticAt(
   p0, 
   cp, 
   p1, 
   t
): PartialQuadratic;

Defined in: core/animation.ts:114

Splits a quadratic bezier curve at parameter t and returns the first portion. Uses de Casteljau's algorithm.

Parameters ​

ParameterType
p0Vec2
cpVec2
p1Vec2
tnumber

Returns ​

PartialQuadratic

Released under the ISC License.