Options
All
  • Public
  • Public/Protected
  • All
Menu

Module @okikio/animate

Index

Classes

Interfaces

Type aliases

Variables

Functions

Type aliases

TypeAnimatableCSSProperties

TypeAnimatableCSSProperties: CamelCase<"-webkit-line-clamp" | "-webkit-text-fill-color" | "-webkit-text-stroke" | "-webkit-text-stroke-color" | "all" | "background" | "background-color" | "background-position" | "background-size" | "block-size" | "border" | "border-block-end" | "border-block-end-color" | "border-block-end-width" | "border-block-start" | "border-block-start-color" | "border-block-start-width" | "border-bottom" | "border-bottom-color" | "border-bottom-left-radius" | "border-bottom-right-radius" | "border-bottom-width" | "border-color" | "border-end-end-radius" | "border-end-start-radius" | "border-image-outset" | "border-image-slice" | "border-image-width" | "border-inline-end" | "border-inline-end-color" | "border-inline-end-width" | "border-inline-start" | "border-inline-start-color" | "border-inline-start-width" | "border-left" | "border-left-color" | "border-left-width" | "border-radius" | "border-right" | "border-right-color" | "border-right-width" | "border-start-end-radius" | "border-start-start-radius" | "border-top" | "border-top-color" | "border-top-left-radius" | "border-top-right-radius" | "border-top-width" | "border-width" | "bottom" | "box-shadow" | "caret-color" | "clip" | "clip-path" | "color" | "column-count" | "column-gap" | "column-rule" | "column-rule-color" | "column-rule-width" | "column-width" | "columns" | "filter" | "flex" | "flex-basis" | "flex-grow" | "flex-shrink" | "font" | "font-size" | "font-size-adjust" | "font-stretch" | "font-variation-settings" | "font-weight" | "gap" | "grid-column-gap" | "grid-gap" | "grid-row-gap" | "grid-template-columns" | "grid-template-rows" | "height" | "inline-size" | "inset" | "inset-block" | "inset-block-end" | "inset-block-start" | "inset-inline" | "inset-inline-end" | "inset-inline-start" | "left" | "letter-spacing" | "line-height" | "margin" | "margin-block-end" | "margin-block-start" | "margin-bottom" | "margin-inline-end" | "margin-inline-start" | "margin-left" | "margin-right" | "margin-top" | "mask" | "max-block-size" | "max-height" | "max-inline-size" | "max-width" | "min-block-size" | "min-height" | "min-inline-size" | "min-width" | "object-position" | "offset" | "offset-anchor" | "offset-distance" | "offset-path" | "offset-rotate" | "opacity" | "order" | "outline" | "outline-color" | "outline-offset" | "outline-width" | "padding" | "padding-block-end" | "padding-block-start" | "padding-bottom" | "padding-inline-end" | "padding-inline-start" | "padding-left" | "padding-right" | "padding-top" | "perspective" | "perspective-origin" | "right" | "rotate" | "row-gap" | "scale" | "scroll-margin" | "scroll-margin-block" | "scroll-margin-block-end" | "scroll-margin-block-start" | "scroll-margin-bottom" | "scroll-margin-inline" | "scroll-margin-inline-end" | "scroll-margin-inline-start" | "scroll-margin-left" | "scroll-margin-right" | "scroll-margin-top" | "scroll-padding" | "scroll-padding-block" | "scroll-padding-block-end" | "scroll-padding-block-start" | "scroll-padding-bottom" | "scroll-padding-inline" | "scroll-padding-inline-end" | "scroll-padding-inline-start" | "scroll-padding-left" | "scroll-padding-right" | "scroll-padding-top" | "shape-image-threshold" | "shape-margin" | "shape-outside" | "tab-size" | "text-decoration" | "text-decoration-color" | "text-decoration-thickness" | "text-emphasis" | "text-emphasis-color" | "text-indent" | "text-shadow" | "text-underline-offset" | "top" | "transform" | "transform-origin" | "translate" | "vertical-align" | "visibility" | "width" | "word-spacing" | "z-index" | "opacity">

TypeAnimatableSVGAttributes

TypeAnimatableSVGAttributes: { [ property in TypeSVGPresentationAttributes]?: TypeAnimationOptionTypes }

TypeAnimationEvents

TypeAnimationEvents: "update" | "play" | "pause" | "begin" | "cancel" | "finish" | "error" | "stop" | "playstate-change"

TypeAnimationOptionTypes

TypeAnimationOptionTypes: TypeCallback | TypeComputedAnimationOptions

TypeAnimationTarget

TypeAnimationTarget: string | Node | NodeList | HTMLCollection | HTMLElement[] | TypeAnimationTarget[]

TypeCSSAnimationOptions

TypeCSSAnimationOptions: { [ K in keyof CSSStyleDeclaration]?: CSSStyleDeclaration[K] | CSSStyleDeclaration[K][] | TypeAnimationOptionTypes } & { [ K in keyof CSSStyleDeclaration as KebabCase<K>]?: CSSStyleDeclaration[K] | CSSStyleDeclaration[K][] | TypeAnimationOptionTypes } & TypeCSSTransformableProperties & KebabCasedProperties<TypeCSSTransformableProperties> & TypeMissingCSSProperties & KebabCasedProperties<TypeMissingCSSProperties> & TypeAnimatableSVGAttributes & KebabCasedProperties<TypeAnimatableSVGAttributes>

Full list of CSS & SVG Animatable Properties & Animation Options that are supported

Animatable CSS properties are TypeMissingCSSProperties SVG Presentation Attributes are TypeAnimatableSVGAttributes

TypeCSSLikeKeyframe

TypeCSSLikeKeyframe: {}

Type declaration

TypeCSSPropertyValue

TypeCSSPropertyValue: (string | number)[]

TypeCSSTransformableProperties

TypeCSSTransformableProperties: { [ K in keyof ICSSComputedTransformableProperties]?: ICSSComputedTransformableProperties[K] | TypeCallback }

CSS properties the ParseTransformableCSSProperties can parse

TypeCallback

TypeCallback: (index?: number, total?: number, element?: HTMLElement) => TypeComputedAnimationOptions

Type declaration

TypeCallbackArgs

TypeCallbackArgs: [number, number, HTMLElement]

TypeComputedAnimationOptions

TypeComputedAnimationOptions: TypeGeneric | TypeGeneric[] | TypeKeyFrameOptionsType | KeyframeEffectOptions | ICSSComputedTransformableProperties

TypeComputedOptions

TypeComputedOptions: {}

Type declaration

TypeCustomEasingOptions

TypeCustomEasingOptions: { decimal?: number; duration?: number; easing?: string | TypeEasingFunction; numPoints?: number }

Custom Easing has 3 properties they are easing (all the easings from #easing are supported on top of custom easing functions, like spring, bounce, etc...), numPoints (the size of the Array the Custom Easing function should create), and decimal (the number of decimal places of the values within said Array).

Properties Default Value
easing spring(1, 100, 10, 0)
numPoints 50
decimal 3

Type declaration

  • Optional decimal?: number
  • Optional duration?: number
  • Optional easing?: string | TypeEasingFunction

    By default, Custom Easing support easing functions, in the form,

    constant accelerate decelerate accelerate-decelerate decelerate-accelerate
    linear ease-in / in ease-out / out ease-in-out / in-out ease-out-in / out-in
    ease in-sine out-sine in-out-sine out-in-sine
    steps in-quad out-quad in-out-quad out-in-quad
    step-start in-cubic out-cubic in-out-cubic out-in-cubic
    step-end in-quart out-quart in-out-quart out-in-quart
    in-quint out-quint in-out-quint out-in-quint
    in-expo out-expo in-out-expo out-in-expo
    in-circ out-circ in-out-circ out-in-circ
    in-back out-back in-out-back out-in-back
    in-bounce out-bounce in-out-bounce out-in-bounce
    in-elastic out-elastic in-out-elastic out-in-elastic
    spring / spring-in spring-out spring-in-out spring-out-in

    All Elastic easing's can be configured using theses parameters,

    *-elastic(amplitude, period)

    Each parameter comes with these defaults

    Parameter Default Value
    amplitude 1
    period 0.5

    All Spring easing's can be configured using theses parameters,

    spring-*(mass, stiffness, damping, velocity)

    Each parameter comes with these defaults

    Parameter Default Value
    mass 1
    stiffness 100
    damping 10
    velocity 0

    You can create your own custom cubic-bezier easing curves. Similar to css you type cubic-bezier(...) with 4 numbers representing the shape of the bezier curve, for example, cubic-bezier(0.47, 0, 0.745, 0.715) this is the bezier curve for in-sine.

    Note: the easing property supports the original values and functions for easing as well, for example, steps(1), and etc... are supported.

    Note: you can also use camelCase when defining easing functions, e.g. inOutCubic to represent in-out-cubic

  • Optional numPoints?: number

TypeEasingFunction

TypeEasingFunction: (t: number, params?: (string | number)[], duration?: number) => number

Type declaration

    • (t: number, params?: (string | number)[], duration?: number): number
    • The format to use when defining custom easing functions

      Parameters

      • t: number
      • Optional params: (string | number)[]
      • Optional duration: number

      Returns number

TypeGeneric

TypeGeneric: boolean | object | string | number

TypeKeyFrameOptionsType

TypeKeyFrameOptionsType: TypeCSSLikeKeyframe | Keyframe[] | PropertyIndexedKeyframes

TypeMissingCSSProperties

TypeMissingCSSProperties: { backdropFilter?: string | string[] | TypeCallback; d?: string | string[] | TypeCallback; lineClamp?: number | string | (string | number)[] | TypeCallback; maskBorder?: string | string[] | TypeCallback; maskPosition?: number | string | (string | number)[] | TypeCallback; maskSize?: number | string | (string | number)[] | TypeCallback; maxLines?: number | string | (string | number)[] | TypeCallback; offsetPosition?: number | string | (string | number)[] | TypeCallback; scrollbarColor?: string | string[] | TypeCallback } & { [ K in TypeAnimatableCSSProperties]?: TypeAnimationOptionTypes }

CSS Properties that are missing from the type definition

TypePlayStates

TypePlayStates: "idle" | "running" | "paused" | "finished"

TypeSVGPresentationAttributes

TypeSVGPresentationAttributes: CamelCase<"alignment-baseline" | "baseline-shift" | "clip-rule" | "color-interpolation" | "color-interpolation-filters" | "color-profile" | "color-rendering" | "cursor" | "direction" | "display" | "fill" | "fill-opacity" | "fill-rule" | "flood-color" | "flood-opacity" | "font-family" | "font-style" | "font-variant" | "kerning" | "lighting-color" | "marker-end" | "marker-mid" | "marker-start" | "overflow" | "pointer-events" | "stroke" | "stroke-dasharray" | "stroke-dashoffset" | "stroke-linecap" | "stroke-linejoin" | "stroke-miterlimit" | "stroke-opacity" | "stroke-width" | "text-anchor" | "text-rendering" | "vector-effect" | "writing-mode">

TypeSingleValueCSSProperty

TypeSingleValueCSSProperty: string | number | TypeCSSPropertyValue

Variables

ALL_TIMING_KEYS

ALL_TIMING_KEYS: string[] = ...

CSSPXDataType

CSSPXDataType: string = ...

Common CSS Property names with the units "px" as an acceptable value

CSSVarSupport

CSSVarSupport: boolean = ...

CSS_CACHE

CSS_CACHE: Manager<unknown, unknown> = ...

Cache previously converted CSS values to avoid lots of Layout, Style, and Paint computations when computing CSS values

DefaultAnimationOptions

DefaultAnimationOptions: IAnimationOptions = ...

The default options for every Animate instance

{
  keyframes: [],

  loop: 1,
  delay: 0,
  speed: 1,
  endDelay: 0,
  easing: "ease",
  autoplay: true,
  duration: 1000,

  persist: true,
  fillMode: "none",

  direction: "normal",
  padEndDelay: false,
  timeline: document.timeline,
  extend: {}
}

EASINGS

EASINGS: { in: string; in-back: string; in-circ: string; in-cubic: string; in-expo: string; in-out: string; in-out-back: string; in-out-circ: string; in-out-cubic: string; in-out-expo: string; in-out-quad: string; in-out-quart: string; in-out-quint: string; in-out-sine: string; in-quad: string; in-quart: string; in-quint: string; in-sine: string; out: string; out-back: string; out-circ: string; out-cubic: string; out-expo: string; out-quad: string; out-quart: string; out-quint: string; out-sine: string } = ...

Read More about easings on MDN

{
    "in": "ease-in",
    "out": "ease-out",
    "in-out": "ease-in-out",

    // Sine
    "in-sine": "cubic-bezier(0.47, 0, 0.745, 0.715)",
    "out-sine": "cubic-bezier(0.39, 0.575, 0.565, 1)",
    "in-out-sine": "cubic-bezier(0.445, 0.05, 0.55, 0.95)",

    // Quad
    "in-quad": "cubic-bezier(0.55, 0.085, 0.68, 0.53)",
    "out-quad": "cubic-bezier(0.25, 0.46, 0.45, 0.94)",
    "in-out-quad": "cubic-bezier(0.455, 0.03, 0.515, 0.955)",

    // Cubic
    "in-cubic": "cubic-bezier(0.55, 0.055, 0.675, 0.19)",
    "out-cubic": "cubic-bezier(0.215, 0.61, 0.355, 1)",
    "in-out-cubic": "cubic-bezier(0.645, 0.045, 0.355, 1)",

    // Quart
    "in-quart": "cubic-bezier(0.895, 0.03, 0.685, 0.22)",
    "out-quart": "cubic-bezier(0.165, 0.84, 0.44, 1)",
    "in-out-quart": "cubic-bezier(0.77, 0, 0.175, 1)",

    // Quint
    "in-quint": "cubic-bezier(0.755, 0.05, 0.855, 0.06)",
    "out-quint": "cubic-bezier(0.23, 1, 0.32, 1)",
    "in-out-quint": "cubic-bezier(0.86, 0, 0.07, 1)",

    // Expo
    "in-expo": "cubic-bezier(0.95, 0.05, 0.795, 0.035)",
    "out-expo": "cubic-bezier(0.19, 1, 0.22, 1)",
    "in-out-expo": "cubic-bezier(1, 0, 0, 1)",

    // Circ
    "in-circ": "cubic-bezier(0.6, 0.04, 0.98, 0.335)",
    "out-circ": "cubic-bezier(0.075, 0.82, 0.165, 1)",
    "in-out-circ": "cubic-bezier(0.785, 0.135, 0.15, 0.86)",

    // Back
    "in-back": "cubic-bezier(0.6, -0.28, 0.735, 0.045)",
    "out-back": "cubic-bezier(0.175, 0.885, 0.32, 1.275)",
    "in-out-back": "cubic-bezier(0.68, -0.55, 0.265, 1.55)"
}

Type declaration

  • in: string
  • in-back: string
  • in-circ: string
  • in-cubic: string
  • in-expo: string
  • in-out: string
  • in-out-back: string
  • in-out-circ: string
  • in-out-cubic: string
  • in-out-expo: string
  • in-out-quad: string
  • in-out-quart: string
  • in-out-quint: string
  • in-out-sine: string
  • in-quad: string
  • in-quart: string
  • in-quint: string
  • in-sine: string
  • out: string
  • out-back: string
  • out-circ: string
  • out-cubic: string
  • out-expo: string
  • out-quad: string
  • out-quart: string
  • out-quint: string
  • out-sine: string

EFFECTS

EFFECTS: {} = {}

I don't really want to put in the effort to create a complete list, so instead just look through the animate.css github and copy and paste the effects you need, into using a CSS Keyframe style JSON object, make sure to read the documentation for KeyframeParse

I suggest @shoelace-style/animations for all your animate.css needs.

or

if you just need some quick effects go to github.com/wellyshen/use-web-animations/ and copy the keyframes array for the effect you want, remember to say thank you to @wellyshen for all his hardwork, 😂.

internal

Type declaration

    EasingDurationCache

    EasingDurationCache: Map<string | TypeEasingFunction, number> = ...

    Cache the durations at set easing parameters

    EasingFunctionKeys

    EasingFunctionKeys: string[] = ...

    EasingFunctions

    EasingFunctions: {} = ...

    The default list of easing functions, do note this is different from {@link EASING}

    Type declaration

    EasingKeys

    EasingKeys: string[] = ...

    The keys of EASINGS

    remark

    "in", "out", "in-out", "in-sine", "out-sine", "in-out-sine", "in-quad", "out-quad", "in-out-quad", "in-cubic", "out-cubic", "in-out-cubic", "in-quart", "out-quart", "in-out-quart", "in-quint", "out-quint", "in-out-quint", "in-expo", "out-expo", "in-out-expo", "in-circ", "out-circ", "in-out-circ", "in-back", "out-back", "in-out-back"

    EmptyTweenElContainer

    EmptyTweenElContainer: HTMLElement = ...

    For better performance push empty elements into EmptyTweenElContainer

    FUNCTION_SUPPORTED_TIMING_KEYS

    FUNCTION_SUPPORTED_TIMING_KEYS: string[] = ...

    INTINITE_LOOP_LIMIT

    INTINITE_LOOP_LIMIT: 10000 = 10000

    The threshold for an infinite loop

    NOT_FUNCTION_SUPPORTED_TIMING_KEYS

    NOT_FUNCTION_SUPPORTED_TIMING_KEYS: string[] = ...

    TransformFunctionNames

    TransformFunctionNames: string[] = ...

    Store all the supported transform functions as an Array

    TransformFunctions

    TransformFunctions: ITransformFunctions = ...

    Details how to compute each transform function

    TweenCache

    TweenCache: Map<any, any> = ...

    Cache calculated tween points for commonly used easing functions

    UIDCount

    UIDCount: number = 0

    Keeps track of how many empty tween elements are in use

    transformCSSVars

    transformCSSVars: { perspective: string; rotate: string; rotate3d: string[]; rotateX: string; rotateY: string; rotateZ: string; scale: string[]; scale3d: string[]; scaleX: string; scaleY: string; scaleZ: string; skew: string[]; skewX: string; skewY: string; translate: string[]; translate3d: string[]; translateX: string; translateY: string; translateZ: string } = ...

    Type declaration

    • perspective: string
    • rotate: string
    • rotate3d: string[]
    • rotateX: string
    • rotateY: string
    • rotateZ: string
    • scale: string[]
    • scale3d: string[]
    • scaleX: string
    • scaleY: string
    • scaleZ: string
    • skew: string[]
    • skewX: string
    • skewY: string
    • translate: string[]
    • translate3d: string[]
    • translateX: string
    • translateY: string
    • translateZ: string

    transformProperyNames

    transformProperyNames: string[] = ...

    Functions

    Const ApplyCustomEasing

    • Applies the same custom easings to all properties of the object and returns an object with each property having an array of custom eased values

      If you use the spring or spring-in easings it will also return the optimal duration as a key in the object it returns. If you set duration to a number, it will prioritize that duration over optimal duration given by the spring easings.

      Read more about CustomEasing

      e.g.

      import { animate, ApplyCustomEasing } from "@okikio/animate";
      animate({
           target: "div",
      
           ...ApplyCustomEasing({
             border: ["1px solid red", "3 dashed green", "2 solid black"],
             translateX: [0, 250],
             rotate: ["0turn", 1, 0, 0.5],
             "background-color": ["#616aff", "white"],
      
             // You don't need to enter any parameters, you can just use the default values
             easing: "spring",
      
             // You can change the size of Array for the CustomEasing function to generate
             numPoints: 200,
      
             // The number of decimal places to round, final values in the generated Array
             decimal: 5,
      
             // You can also set the duration from here.
             // When using spring animations, the duration you set here is not nesscary,
             // since by default springs will try to determine the most appropriate duration for the spring animation.
             // But the duration value here will override `spring` easings optimal duration value
             duration: 3000
           })
      })
      

      Parameters

      Returns IAnimationOptions & TypeCustomEasingOptions & {}

    Const Back

    • Back(t: number, params?: (string | number)[], duration?: number): number
    • Parameters

      • t: number
      • Optional params: (string | number)[]
      • Optional duration: number

      Returns number

    Const Bezier

    • Bezier(t: number, params?: (string | number)[], duration?: number): number
    • Parameters

      • t: number
      • Optional params: (string | number)[]
      • Optional duration: number

      Returns number

    Const Bounce

    • Bounce(t: number, params?: (string | number)[], duration?: number): number
    • Parameters

      • t: number
      • Optional params: (string | number)[]
      • Optional duration: number

      Returns number

    Const CSSArrValue

    • Takes TypeSingleValueCSSProperty or an array of TypeSingleValueCSSProperty and adds units approriately

      Parameters

      Returns TypeSingleValueCSSProperty[]

      an array of an array of strings with units e.g.

      import { CSSArrValue, UnitPX } from "@okikio/animate";
      
      CSSArrValue([
           [25, "50px", "60%"],
           "25 35 60%",
           50
      ], UnitPX)
      
      //= [ 
      //=      [ '25px', '50px', '60%' ], 
      //=      [ '25px', '35px', '60%' ], 
      //=      [ '50px' ] 
      //= ]
      

    Const CSSCamelCase

    • CSSCamelCase(obj: object): {}
    • Removes dashes from CSS properties & maps the values to camelCase keys

      Parameters

      • obj: object

      Returns {}

      Const CSSValue

      • Returns a closure function, which adds units to numbers, strings or arrays of both

        Parameters

        • unit: (value: string | number) => string

          a unit function to use to add units to TypeSingleValueCSSProperty's

            • (value: string | number): string
            • Parameters

              • value: string | number

              Returns string

        Returns (input: TypeSingleValueCSSProperty) => any[]

        if input is a string split it into an array at the comma's, and add units else if the input is a number add the default units otherwise if the input is an array of both add units according to addCSSUnit

      Const Circ

      • Circ(t: number, params?: (string | number)[], duration?: number): number
      • Parameters

        • t: number
        • Optional params: (string | number)[]
        • Optional duration: number

        Returns number

      Const ComplexEasingSyntax

      • ComplexEasingSyntax(ease: string): string
      • Convert string easing to their proper form

        Parameters

        • ease: string

        Returns string

      Const ComplexStrtoArr

      • ComplexStrtoArr(str: string): string[]
      • Converts "10px solid red #555 rgba(255, 0,5,6, 7) " to [ '10px', 'solid', 'red', '#555', 'rgba(255, 0,5,6, 7)' ]

        Parameters

        • str: string

        Returns string[]

      Const Cubic

      • Cubic(t: number, params?: (string | number)[], duration?: number): number
      • Parameters

        • t: number
        • Optional params: (string | number)[]
        • Optional duration: number

        Returns number

      Const CustomEasing

      • Generates an Array of values using easing functions which in turn create the effect of custom easing. To use this properly make sure to set the easing animation option to "linear". Check out a demo of CustomEasing at https://codepen.io/okikio/pen/abJMWNy?editors=0010

        Custom Easing has 3 properties they are easing (all the easings from EasingFunctions are supported on top of custom easing functions like spring, bounce, etc...), numPoints (the size of the Array the Custom Easing function should create), and decimal (the number of decimal places of the values within said Array).

        Properties Default Value
        easing spring(1, 100, 10, 0)
        numPoints 50
        decimal 3

        By default, Custom Easing support easing functions, in the form,

        constant accelerate decelerate accelerate-decelerate decelerate-accelerate
        linear ease-in / in ease-out / out ease-in-out / in-out ease-out-in / out-in
        ease in-sine out-sine in-out-sine out-in-sine
        steps in-quad out-quad in-out-quad out-in-quad
        step-start in-cubic out-cubic in-out-cubic out-in-cubic
        step-end in-quart out-quart in-out-quart out-in-quart
        in-quint out-quint in-out-quint out-in-quint
        in-expo out-expo in-out-expo out-in-expo
        in-circ out-circ in-out-circ out-in-circ
        in-back out-back in-out-back out-in-back
        in-bounce out-bounce in-out-bounce out-in-bounce
        in-elastic out-elastic in-out-elastic out-in-elastic
        spring / spring-in spring-out spring-in-out spring-out-in

        All Elastic easing's can be configured using theses parameters,

        *-elastic(amplitude, period)

        Each parameter comes with these defaults

        Parameter Default Value
        amplitude 1
        period 0.5

        All Spring easing's can be configured using theses parameters,

        spring-*(mass, stiffness, damping, velocity)

        Each parameter comes with these defaults

        Parameter Default Value
        mass 1
        stiffness 100
        damping 10
        velocity 0

        You can create your own custom cubic-bezier easing curves. Similar to css you type cubic-bezier(...) with 4 numbers representing the shape of the bezier curve, for example, cubic-bezier(0.47, 0, 0.745, 0.715) this is the bezier curve for in-sine.

        Note: the easing property supports the original values and functions for easing as well, for example, steps(1), and etc... are supported.

        Note: you can also use camelCase when defining easing functions, e.g. inOutCubic to represent in-out-cubic

        Suggestion: if you decide to use CustomEasing on one CSS property, I suggest using CustomEasing or ApplyCustomEasing on the rest (this is no longer necessary, but for the sake of readability it's better to do)

        e.g.

        import { animate, CustomEasing, EaseOut, Quad } from "@okikio/animate";
        animate({
          target: "div",
        
          // Notice how only, the first value in the Array uses the "px" unit
          border: CustomEasing(["1px solid red", "3 dashed green", "2 solid black"], {
              // This is a custom easing function
              easing: EaseOut(Quad)
          }),
        
          translateX: CustomEasing([0, 250], {
              easing: "linear",
        
              // You can change the size of Array for the CustomEasing function to generate
              numPoints: 200,
        
              // The number of decimal places to round, final values in the generated Array
              decimal: 5,
          }),
        
          // You can set the easing without an object
          // Also, if units are detected in the values Array,
          // the unit of the first value in the values Array are
          // applied to other values in the values Array, even if they
          // have prior units
          rotate: CustomEasing(["0turn", 1, 0, 0.5], "out"),
          "background-color": CustomEasing(["#616aff", "white"]),
              easing: "linear"
          }),
        
          // TIP... Use linear easing for the proper effect
          easing: "linear"
        })
        

        Parameters

        Returns (string | number)[]

      Const CustomEasingOptions

      • returns a CustomEasingOptions object from a easing "string", or function

        Parameters

        Returns { decimal: number; duration: number; easing: string | TypeEasingFunction; numPoints: number }

      Const EaseInOut

      Const EaseOut

      Const EaseOutIn

      Const EasingPts

      Const Elastic

      • Elastic(t: number, params?: (string | number)[], duration?: number): number
      • Parameters

        • t: number
        • Optional params: (string | number)[]
        • Optional duration: number

        Returns number

      Const Expo

      • Expo(t: number, params?: (string | number)[], duration?: number): number
      • Parameters

        • t: number
        • Optional params: (string | number)[]
        • Optional duration: number

        Returns number

      Const GetEase

      • GetEase(ease?: string): string
      • Converts users input into a usable easing function string

        Parameters

        • ease: string = "ease"

          easing functions; EasingKeys, cubic-bezier, steps, linear, etc...

        Returns string

        an easing function that KeyframeEffect can accept

      Const GetEasingFunction

      • Re-maps a number from one range to another. Numbers outside the range are not clamped to 0 and 1, because out-of-range values are often intentional and useful.

        Parameters

        • ease: string

        Returns TypeEasingFunction

      Const KeyframeParse

      • KeyframeParse(input: object): Keyframe[]
      • Allows you to quickly convert CSS like JSON into keyframes

        example
        let keyframes = KeyframeParse({
            "from, 50%, to": {
                opacity: 1
            },
        
            "25%, 0.7": {
                opacity: 0
            }
        });
        
        console.log(keyframes);
        //= [
        //=   { opacity: 1, offset: 0 },
        //=   { opacity: 0, offset: 0.25 },
        //=   { opacity: 1, offset: 0.5 },
        //=   { opacity: 0, offset: 0.7 },
        //=   { opacity: 1, offset: 1 }
        //= ]
        

        Parameters

        • input: object

          CSS style JSON; check the example to understand what I mean

        Returns Keyframe[]

      Const ParseTransformableCSSKeyframes

      • Similar to ParseTransformableCSSProperties except it transforms the CSS properties in each Keyframe

        Parameters

        Returns (({ transform: string } & {}) & ({ transform: string } & {}))[]

        an array of keyframes, with transformed CSS properties

      Const ParseTransformableCSSProperties

      • Removes the need for the full transform statement in order to use translate, rotate, scale, skew, or perspective including their X, Y, Z, and 3d varients Also, adds the ability to use single string or number values for transform functions

        Note: the transform animation option will override all transform function properties

        Note: the order of where/when you define transform function matters, for example, depending on the order you define translate, and rotate, you can create change the radius of the rotation

        example
        ParseTransformableCSSProperties({
             // It will automatically add the "px" units for you, or you can write a string with the units you want
             translate3d: [
                 "25 35 60%",
                 [50, "60px", 70],
                 ["70", 50]
             ],
             translate: "25 35 60%",
             translateX: [50, "60px", "70"],
             translateY: ["50, 60", "60"], // Note: this will actually result in an error, make sure to pay attention to where you are putting commas
             translateZ: 0,
             perspective: 0,
             opacity: "0, 5",
             scale: [
                 [1, "2"],
                 ["2", 1]
             ],
             rotate3d: [
                 [1, 2, 5, "3deg"], // The last value in the array must be a string with units for rotate3d
                 [2, "4", 6, "45turn"],
                 ["2", "4", "6", "-1rad"]
             ],
        
             // Units are required for non transform CSS properties
             // String won't be split into array, they will be wrappeed in an Array
             // It will transform border-left to camelCase "borderLeft"
             "border-left": 50,
             "offset-rotate": "10 20",
             margin: 5,
        
             // When writing in this formation you must specify the units
             padding: "5px 6px 7px"
        })
        
        // On Chromium based browsers, e.g. Chrome, Edge, Brave, Opera, etc... or browsers that support `CSS.registerProperty` this will be the result
        //= {
        //=      "--translate3d0": [ "25px", "50px", "70px" ],
        //=      "--translate3d1": [ "35px", "60px", "50px" ],
        //=      "--translate3d2": [ "60%", "70px" ],
        //=      "--translate0": [ "25px" ],
        //=      "--translate1": [ "35px" ],
        //=      "--translateX": [ "50px", "60px", "70px" ],
        //=      "--translateY": [ "50,,60", "60px" ],
        //=      "--translateZ": [ "0px" ],
        //=      "--rotate3d0": [ "1deg", "2deg", "2deg" ],
        //=      "--rotate3d1": [ "2deg", "4deg", "4deg" ],
        //=      "--rotate3d2": [ "5deg", "6deg", "6deg" ],
        //=      "--rotate3d3": [ "3deg", "45turn", "-1rad" ],
        //=      "--scale0": [ "1", "2" ],
        //=      "--scale1": [ "2", "1" ],
        //=      "--perspective": [ "0px" ],
        //=      "opacity": [ "0, 5" ],
        //=      "borderLeft": [ "50px" ],
        //=      "offsetRotate": [ "10deg", "20deg" ],
        //=      "margin": [ "5px" ],
        //=      "padding": [ "5px", "6px", "7px" ]
        //= }
        
        // Browsers that don't support `CSS.registerProperty` will result in the following, namely Firefox and Safari
        //= {
        //=   transform: [
        //=       // `translateY(50, 60)` will actually result in an error
        //=       'translate(25px) translate3d(25px, 35px, 60%) translateX(50px) translateY(50, 60) translateZ(0px) rotate3d(1, 2, 5, 3deg) scale(1, 2) perspective(0px)',
        //=       'translate(35px) translate3d(50px, 60px, 70px) translateX(60px) translateY(60px) rotate3d(2, 4, 6, 45turn) scale(2, 1)',
        //=       'translate(60%) translate3d(70px, 50px) translateX(70px) rotate3d(2, 4, 6, -1rad)'
        //=   ],
        //=   opacity: [ '0', '5' ],
        //=   borderLeft: ["50px"],
        //=
        //=   // Notice the "deg"
        //=   offsetRotate: ["10deg", "20deg"],
        //=   margin: ["5px"],
        //=   padding: ["5px 6px 7px"]
        //= }
        
        // The key difference between the two is that the former will allow other animations to be used to 
        // manipulate multiple different transforms at the same time, 
        // while the latter will not, and must continously update the transform property,
        // meaning that new animations will always override the previous ones on the same element,
        // on browsers that *don't* support `CSS.registerProperty`
        

        Parameters

        Returns ICSSProperties

        an object with a properly formatted transform and opactity, as well as other unformatted CSS properties

        
        

      Const Quad

      • Quad(t: number, params?: (string | number)[], duration?: number): number
      • Easing Functions from anime.js, they are tried and true, so, its better to use them instead of other alternatives

        Parameters

        • t: number
        • Optional params: (string | number)[]
        • Optional duration: number

        Returns number

      Const Quart

      • Quart(t: number, params?: (string | number)[], duration?: number): number
      • Parameters

        • t: number
        • Optional params: (string | number)[]
        • Optional duration: number

        Returns number

      Const Quint

      • Quint(t: number, params?: (string | number)[], duration?: number): number
      • Parameters

        • t: number
        • Optional params: (string | number)[]
        • Optional duration: number

        Returns number

      Const Sine

      • Sine(t: number, params?: (string | number)[], duration?: number): number
      • Parameters

        • t: number
        • Optional params: (string | number)[]
        • Optional duration: number

        Returns number

      Const Spring

      • Spring(t: number, params?: (string | number)[], duration?: number): number
      • Parameters

        • t: number
        • Optional params: (string | number)[]
        • Optional duration: number

        Returns number

      Const SpringEasing

      • SpringEasing(values: (string | number)[], options?: string | TypeCustomEasingOptions): [(string | number)[], number]
      • Returns an array containing [easing pts, duration], it's meant to be a self enclosed way to create spring easing. Springs have an optimal duration; using getEasingDuration() we are able to have the determine the optimal duration for a spring with given parameters.

        By default it will only give the optimal duration for spring or spring-in easing, this is to avoid infinite loops caused by the getEasingDuration() function.

        Internally the SpringEasing uses CustomEasing, read more on it, to understand how the SpringEasing function works.

        e.g.

        import { animate, SpringEasing } from "@okikio/animate";
        
        // `duration` is the optimal duration for the spring with the set parameters
        let [translateX, duration] = SpringEasing([0, 250], "spring(5, 100, 10, 1)");
        // or
        // `duration` is 5000 here
        let [translateX, duration] = SpringEasing([0, 250], {
             easing: "spring(5, 100, 10, 1)",
             numPoints: 50,
             duration: 5000,
             decimal: 3
        });
        
        animate({
             target: "div",
             translateX,
             duration
        });
        

        Parameters

        Returns [(string | number)[], number]

      Const StaggerCustomEasing

      • Returns an AnimationOption callback, with support for stagger and CustomEasing. Thus all the same options and restrictions apply, make sure you read more on stagger and CustomEasing.

        StaggerCustomEasing only supports array range values.

        To use StaggerCustomEasing you need to do this,

        import { animate, stagger, StaggerCustomEasing } from "@okikio/animate";
        animate({
             target: ".div",
             
             translate: StaggerCustomEasing([0, 250], {
                 // To set stagger options you need to do this
                 stagger: { from "center" },
                 
                 // These options are for `CustomEasing`
                 easing: "out-elastic",
                 numPoints: 150
             }),
             delay: stagger(100),
        
             fillMode: "both",
             easing: "linear",
             duration: 5000
        })
        

        Check out demos on Codepen

        Parameters

        Returns TypeCallback

      Const Steps

      • Steps(t: number, params?: (string | number)[], duration?: number): number

      Const UnitDEG

      • UnitDEG(value: string | number): string
      • Function adds "deg" unit to numbers

        Parameters

        • value: string | number

        Returns string

      Const UnitDEGCSSValue

      • Parses CSSValues and adds the "deg" unit if required

        Parameters

        Returns any[]

      Const UnitLess

      • UnitLess(value: string | number): string
      • Function doesn't add any units by default

        Parameters

        • value: string | number

        Returns string

      Const UnitLessCSSValue

      • Parses CSSValues without adding any units

        Parameters

        Returns any[]

      Const UnitPX

      • UnitPX(value: string | number): string
      • Function adds "px" unit to numbers

        Parameters

        • value: string | number

        Returns string

      Const UnitPXCSSValue

      • Parses CSSValues and adds the "px" unit if required

        Parameters

        Returns any[]

      Const addCSSUnit

      • addCSSUnit(unit?: string): (value: string | number) => string
      • Returns a closure Function, which adds a unit to numbers but simply returns strings with no edits assuming the value has a unit if it's a string

        Parameters

        • unit: string = ""

          the default unit to give the CSS Value

        Returns (value: string | number) => string

        if value already has a unit (we assume the value has a unit if it's a string), we return it; else return the value plus the default unit

          • (value: string | number): string
          • Parameters

            • value: string | number

            Returns string

      Const animate

      Const arrFill

      • arrFill(arr: any[] | any[][], maxLen?: number): any
      • It fills in the gap between different size transform functions, so, for example,

        {
             translateX: [50, 60, 80, 90],
             scale: [0.5, 2]
        }
        

        There are more values of translateX, so the transform property created will look like this,

        {
             transform: [
                 "translateX(50px) scale(0.5)",
                 "translateX(60px) scale(2)",
                 "translateX(80px)",
                 "translateX(90px)"
             ]
        }
        

        arrFill interpolates between all missing portions of transform functions, and helps create a uniform size transform property, e.g.

        {
             transform: [
                 "translateX(50px) scale(0.5)",
                 "translateX(60px) scale(1)",
                 "translateX(80px) scale(1.5)",
                 "translateX(90px) scale(2)"
             ]
        }
        

        Parameters

        • arr: any[] | any[][]
        • Optional maxLen: number

        Returns any

      Const camelCase

      • camelCase(str: string): string
      • Convert a dash-separated string into camelCase strings (opposite of convertToDash)

        Parameters

        • str: string

        Returns string

      Const computeOption

      Const convertToDash

      • convertToDash(str: string): string
      • Convert a camelCase string to a dash-separated string (opposite of camelCase)

        Parameters

        • str: string

        Returns string

      Const createEmptyEl

      • createEmptyEl(): HTMLDivElement
      • Creates a new empty tween element

        Returns HTMLDivElement

      Const createTransformProperty

      • createTransformProperty(transformFnNames: string[], arr: any[]): string
      • Creates the transform property text

        Parameters

        • transformFnNames: string[]
        • arr: any[]

        Returns string

      Const createTransformValue

      • createTransformValue(opts?: {}): string
      • Parameters

        • opts: {} = {}

          Returns string

        Const createTweenOptions

          • create a empty new element,
          • attach it to the DOM,
          • animate the opacity of said element
          • You can then use the "update" event to watch for changes in opacity and use the opacity as a progress bar of values between 0 to 1

          Parameters

          Returns IAnimationOptions

        Const easein

        • easein(t: number, params?: (string | number)[], duration?: number): number
        • The default ease-in easing function

          Parameters

          • t: number
          • Optional params: (string | number)[]
          • Optional duration: number

          Returns number

        Const flatten

        • flatten(arr: any[]): any[]
        • Merges 2-dimensional Arrays into a single 1-dimensional array

          Parameters

          • arr: any[]

          Returns any[]

        Const getEasingDuration

        • The spring easing function will only look smooth at certain durations, with certain parameters. This functions returns the optimal duration to create a smooth springy animation based on physics

          Note: it can also be used to determine the optimal duration of other types of easing function, but be careful of "in-" easing functions, because of the nature of the function it can sometimes create an infinite loop, I suggest only using getEasingDuration for spring, specifically "out-spring" and "spring"

          Parameters

          Returns number

        Const getElements

        • getElements(selector: string | Node): Node[]
        • Parameters

          • selector: string | Node

          Returns Node[]

        Const getTargets

        • Parameters

          Returns Node[]

        Const getUnit

        • getUnit(str: string | number): string
        • Returns the unit of a string, it does this by removing the number in the string

          Parameters

          • str: string | number

          Returns string

        Const interpolateColor

        • interpolateColor(t: number, values: string[], decimal?: number): number[]
        • Use the color-rgba npm package, to convert all color formats to an Array of rgba values, e.g. [red, green, blue, alpha]. Then, use the interpolateNumber functions to interpolate over the array

          Note: the red, green, and blue colors are rounded to intergers with no decimal places, while the alpha color gets rounded to a specific decimal place

          Make sure to read interpolateNumber.

          Parameters

          • t: number
          • values: string[]
          • decimal: number = 3

          Returns number[]

        Const interpolateComplex

        • interpolateComplex(t: number, values: (string | number)[], decimal?: number): any
        • Interpolates all types of values including number, string, color, and complex values. Complex values are values like "10px solid red", that border, and other CSS Properties use.

          Parameters

          • t: number
          • values: (string | number)[]
          • decimal: number = 3

          Returns any

        Const interpolateNumber

        • interpolateNumber(t: number, values: number[], decimal?: number): number
        • Given an Array of numbers, estimate the resulting number, at a t value between 0 to 1 Based on d3.interpolateBasis [https://github.com/d3/d3-interpolate#interpolateBasis], check out the link above for more detail.

          Basic interpolation works by scaling t from 0 - 1, to some start number and end number, in this case lets use 0 as our start number and 100 as our end number, so, basic interpolation would interpolate between 0 to 100.

          If we use a t of 0.5, the interpolated value between 0 to 100, is 50. interpolateNumber takes it further, by allowing you to interpolate with more than 2 values, it allows for multiple values.

          E.g. Given an Array of values [0, 100, 0], and a t of 0.5, the interpolated value would become 100.

          Parameters

          • t: number
          • values: number[]
          • decimal: number = 3

          Returns number

        Const interpolateString

        • interpolateString(t: number, values: (string | number)[], decimal?: number): string
        • Functions the same way interpolateNumber works. Convert strings to numbers, and then interpolates the numbers, at the end if there are units on the first value in the values array, it will use that unit for the interpolated result.

          Make sure to read interpolateNumber.

          Parameters

          • t: number
          • values: (string | number)[]
          • decimal: number = 3

          Returns string

        Const interpolateUsingIndex

        • interpolateUsingIndex(t: number, values: (string | number)[]): string | number
        • Given an Array of values, find a value using t (t goes from 0 to 1), by using t to estimate the index of said value in the array of values

          Parameters

          • t: number
          • values: (string | number)[]

          Returns string | number

        Const isEmpty

        • isEmpty(obj: any): boolean
        • Determines if an object is empty

          Parameters

          • obj: any

          Returns boolean

        Const isNumberLike

        • isNumberLike(num: string | number): boolean
        • If a value can be converted to a valid number, then it's most likely a number

          Parameters

          • num: string | number

          Returns boolean

        Const isObject

        • isObject(obj: any): boolean
        • Determines whether value is an pure object (not array, not function, etc...)

          Parameters

          • obj: any

          Returns boolean

        Const isValid

        • isValid(value: any): boolean
        • Checks if a value is valid/truthy; it counts empty arrays and strings as falsey, as well as null, undefined, and NaN, everything else is valid

          Note: 0 counts as valid

          Parameters

          • value: any

            anything

          Returns boolean

          true or false

        Const limit

        • limit(value: number, min: number, max: number): number
        • Parameters

          • value: number
          • min: number
          • max: number

          Returns number

        Const mapAnimationOptions

        Const mapObject

        • mapObject(obj: object, fn: (value: any, key: any, obj: any) => any): {}
        • Acts like array.map(...) but for functions

          Parameters

          • obj: object
          • fn: (value: any, key: any, obj: any) => any
              • (value: any, key: any, obj: any): any
              • Parameters

                • value: any
                • key: any
                • obj: any

                Returns any

          Returns {}

          Const omit

          • omit(keys: string[], obj: {}): {}
          • Return a copy of the object without the keys specified in the keys argument

            Parameters

            • keys: string[]

              arrays of keys to remove from the object

            • obj: {}

              the object in question

              • [key: string]: any

            Returns {}

            a copy of the object without certain keys

            Const parseEasingParameters

            • parseEasingParameters(str: string): (string | number)[]
            • Convert easing parameters to Array of numbers, e.g. "spring(2, 500)" to [2, 500]

              Parameters

              • str: string

              Returns (string | number)[]

            Const parseOffset

            • parseOffset(input: string | number): number
            • Convert the words "from", and "to" as well as percentage or numbers to offset value between 0 and 1

              Parameters

              • input: string | number

              Returns number

            Const parseOptions

            • Parses the different ways to define options, and returns a merged options object

              Parameters

              Returns IAnimationOptions

            Const pick

            • pick(keys: string[], obj: {}): {}
            • Return a copy of the object with only the keys specified in the keys argument

              Parameters

              • keys: string[]

                arrays of keys to keep from the object

              • obj: {}

                the object in question

                • [key: string]: any

              Returns {}

              a copy of the object with only certain keys

              Const queue

              • Creates a new Queue instance, and passes the options to the constructor

                Parameters

                Returns Queue

              Const random

              • random(min: number, max: number): number
              • Generates random values within a range of values

                Parameters

                • min: number
                • max: number

                Returns number

              Const registerEasingFunction

              • Allows you to register new easing functions

                Parameters

                Returns void

              Const registerEasingFunctions

              • registerEasingFunctions(...obj: {}[]): void
              • Allows you to register multiple new easing functions

                Parameters

                • Rest ...obj: {}[]

                Returns void

              Const relativeTo

              • relativeTo(input: string | number, base: number): number
              • If the input value is a string starting with with "=" (the equal sign), it removes the "=" and return the remaining number Otherwise, parse string or numbers to a number and add the base number to it, to create relative numbers (relative to the base value)

                Parameters

                • input: string | number
                • base: number

                Returns number

              Const scale

              • scale(t: number, start: number, end: number): number
              • map t from 0 to 1, to start to end

                Parameters

                • t: number
                • start: number
                • end: number

                Returns number

              Const stagger

              • Creates complex staggered animations, it does it by creating a closure function and using it as an AnimationOption Based on animejs's stagger function, it function the same way

                Staggering allows you to animate multiple elements with follow through and overlapping action.

                It can be used like this,

                import { animate, stagger } from "@okikio/animate";
                animate({
                     target: ".div",
                     
                     // `stagger` accepts range values but only an Array of 2 values are accepted,
                     // the values can be either a "string" or a "number".
                
                     // `stagger` distributes values evenly between two numbers,
                     // so, given 5 elements, translate on the first element will be 0,
                     // on the second element 50, on the third element 100, etc...
                
                     // the equation is: 
                     // (start value or first value in array range) + (((second value in the range) - (first value in the range)) / (total number of elements)) * (current index of element)
                     // For an array of range `[-360, 360]`, 5 elements, and an undefined start value, you will get:
                     //= -360 + ((360 - (-360)) / 5) * 0
                     //= -360 + ((360 - (-360)) / 5) * 1
                     //= -360 + ((360 - (-360)) / 5) * 2
                     //= -360 + ((360 - (-360)) / 5) * 3
                     //= -360 + ((360 - (-360)) / 5) * 4
                     translate: stagger([0, 250]),
                
                     // Single value staggers are also possible.
                     // This increase delay by 100ms for each element.
                     delay: stagger(100),
                
                     fillMode: "both",
                     easing: "linear",
                     duration: 5000
                });
                

                stagger can also be used for grids. For grids you do this,

                import { animate, stagger } from "@okikio/animate";
                animate({
                     target: ".div",
                     
                     // For grids you need to specify the size of the grid via stagger options
                     // { grid: [number of columns, number of rows] }
                
                     // and in this scenario we also need to specify the axis
                     // { axis: "x" or "y" }
                     translate: stagger([0, 30], { 
                         grid: [14, 5], 
                         axis: "x" 
                     }),
                
                     // Single value staggers are still possible.
                     delay: stagger(100, { grid: [14, 5] }),
                
                     fillMode: "both",
                     easing: "linear",
                     duration: 5000
                });
                

                the full list of staggering options are:

                Stagger option Types Default value Use case
                start Number | String The first value in an Array range or 0 Starts the staggering effect from a specific value.
                axis "x" | "y" Undefined Forces the direction of a grid staggering effect. It's often used together with the grid stagger option
                from Number | "center" | "first" | "last" 0 Starts the stagger effect from a specific element.
                direction "reverse" | "normal" Undefined Changes the order in which the stagger effect operates. e.g. instead of top to bottom, go bottom to top.
                easing String | Function Undefined Stagger values using an easing function. Allows stagger effect to have certain easing characteristics, e.g. in-out-quad, is very smooth so, the stagger effect will also be very smooth
                grid Array of 2 values, [number of columns, number of rows] Undefined Stagger values based on a 2D array that states the [number of columns, number of rows].

                Check out demos on Codepen as well as animejs's stagger documentation

                Because stagger returns an AnimationOption callback, it fundementally doesn't work with CustomEasing, so, you need to use StaggerCustomEasing to enable custom easing.

                Parameters

                Returns TypeCallback

              Const toArr

              • toArr(input: any): any[]
              • Convert the input to an array For strings if type == "split", split the string at spaces, if type == "wrap" wrap the string in an array For array do nothing For everything else wrap the input in an array

                Parameters

                • input: any

                Returns any[]

              Const toCSSVars

              • toCSSVars(opts?: {}): {}
              • Convert transform function properties to CSS variables to create the desired animation e.g.

                ```js toCSSVars({ translate: ["0px 60px", "100px 100px"], translateX: ["60px", "500px"], translateY: ["60px", "500px"], });

                // { // "--translate0": [ // "0px", // "100px" // ], // "--translate1": [ // "60px", // "100px" // ], // "--translateX": [ // "60px", // "500px" // ], // "--translateY": [ // "60px", // "500px" // ] // }

                
                

                Parameters

                • opts: {} = {}

                  Returns {}

                  Const toFixed

                  • toFixed(value: number, decimal: number): number
                  • Rounds numbers to a fixed decimal place

                    Parameters

                    • value: number
                    • decimal: number

                    Returns number

                  Const toRGBAArr

                  • toRGBAArr(color?: string): unknown
                  • Convert colors to an [r, g, b, a] Array

                    Parameters

                    • color: string = "transparent"

                    Returns unknown

                  Const toStr

                  • toStr(input: any): string
                  • Converts values to strings

                    Parameters

                    • input: any

                    Returns string

                  Const transpose

                  • transpose(...args: any[]): any[]
                  • Flips the rows and columns of 2-dimensional arrays

                    example
                    transpose(
                         ['moe', 'larry', 'curly'],
                         [30, 40, 50],
                         [true, false, false]
                    );
                    // [
                    //     ["moe", 30, true],
                    //     ["larry", 40, false],
                    //     ["curly", 50, false]
                    // ]
                    

                    Parameters

                    • Rest ...args: any[]

                    Returns any[]

                    returns the new array of grouped elements

                  Const trim

                  • trim(str: string): string
                  • Convert value to string, then trim any extra white space and line terminator characters from the string.

                    Parameters

                    • str: string

                    Returns string

                  Const tweenAttr

                  Generated using TypeDoc