bga-animations
    Preparing search index...

    Base functions to help create animations.

    Index

    Constructors

    Methods

    • Make an empty space grow or shrink to replace where a moved object was or will be. Ignore the animation settings, prefer addAnimatedSpaceIfNecessary.

      Parameters

      • element: HTMLElement
      • parent: HTMLElement
      • type: "grow" | "on" | "shrink"
      • animationSettings: AnimationSettings
      • OptionalinsertBefore: Element

      Returns Promise<AnimationResult>

    • Make an empty space grow or shrink to replace where a moved object was or will be. Only if the animation settings says so.

      Parameters

      • element: HTMLElement
      • parent: HTMLElement
      • type: "from" | "to"
      • animationSettings: AnimationSettings
      • OptionalinsertBefore: Element

      Returns Promise<AnimationResult>

    • Make an empty space grow or shrink to replace where a moved object was or will be. Ignore the animation settings, prefer addAnimatedSpaceIfNecessary.

      Parameters

      • element: HTMLElement
      • parent: HTMLElement
      • OptionalinsertBefore: Element

      Returns HTMLElement

    • Add a wrapper layer. Needed before doing sub-animations without messing to the animation on the main wrapper

      Parameters

      • baseWrapper: HTMLElement

      Returns HTMLElement

    • Animate an object on the animation surface, from a matrix to a matrix.

      Parameters

      • animationWrapper: HTMLElement
      • fromMatrix: DOMMatrixReadOnly
      • toMatrix: DOMMatrixReadOnly
      • animationSettings: AnimationSettings

      Returns Promise<SurfaceAnimationResult>

    • Attach an element to a new parent.

      Parameters

      • element: HTMLElement
      • toElement: HTMLElement
      • OptionalinsertBefore: Element

      Returns void

    • Creates a bump animation, that simulates a physical item being lifted from one place to another.

      Parameters

      • bump: number

      Returns ParallelAnimation

    • Creates a fade animation, 'in' for appearing and 'out' for disappearing.

      Parameters

      • type: "in" | "out"

      Returns ParallelAnimation

    • Create a temp div of the same size as the element.

      Parameters

      • elem: HTMLElement

      Returns HTMLElement

    • End a RunningAnimation, by attaching the element to its final destination and cleaning the temporary elements.

      Parameters

      Returns void

    • returns the getBoundingClientRect of an element with zoom awareness, independant to browser native handling of CSS zoom property.

      Parameters

      • element: HTMLElement

      Returns
          | DOMRect
          | {
              bottom: number;
              height: number;
              left: number;
              right: number;
              top: number;
              width: number;
              x: number;
              y: number;
          }

    • Get translation, rotation & scale matrix for an element, relative to the top of the page.

      Parameters

      Returns DOMMatrixReadOnly

    • Get rotation & scale matrix for an element, relative to the top of the page.

      Parameters

      • element: HTMLElement
      • includeSelf: boolean = false

      Returns DOMMatrix

    • Pause the growing placeholder animations and consider they are at full duration (taking final space). Allow to get the real position of the moved element including the shift from animations started just before this one.

      Returns void

    • Remove an element from the DOM.

      Parameters

      • element: HTMLElement

      Returns void

    • Remove the rotation part of a matrix.

      Parameters

      • matrix: DOMMatrix

      Returns DOMMatrix

    • Remove the scale part of a matrix.

      Parameters

      • matrix: DOMMatrix

      Returns DOMMatrix

    • Remove the translation part of a matrix.

      Parameters

      • matrix: DOMMatrix

      Returns DOMMatrix

    • Restore the growing placeholder animations to before the pause.

      Returns void

    • Prepare an attach animation. Wraps the object to the animation surface and return a RunningAnimation.

      Parameters

      • element: HTMLElement
      • toElement: HTMLElement
      • OptionalinsertBefore: HTMLElement
      • OptionalfromPlaceholder: HTMLElement
      • OptionaltoPlaceholder: HTMLElement

      Returns RunningAnimation

    • Prepare a slide in animation. Wraps the object to the animation surface and return a RunningAnimation.

      Parameters

      • element: HTMLElement
      • OptionalfromElement: HTMLElement
      • fromIgnoreScale: boolean = true
      • fromIgnoreRotation: boolean = true
      • preserveScale: boolean = true

      Returns RunningAnimation

    • Prepare a slide out animation. Wraps the object to the animation surface and return a RunningAnimation.

      Parameters

      • element: HTMLElement
      • OptionaltoElement: HTMLElement
      • fromIgnoreScale: boolean = true
      • fromIgnoreRotation: boolean = true
      • preserveScale: boolean = true

      Returns RunningAnimation

    • Return a Promise that resolves at the end of a given number of ms.

      Parameters

      • delay: number

        the time to wait, in milliseconds

      Returns Promise<void>

      a promise when the timer ends

    • Add a wrapper around an element, and add the elment on that wrapper. Needed before doing animations on the surface

      Parameters

      Returns HTMLElement