Handles swipe gestures for navigating image sequences, particularly for swipe galleries and Omni object rotation.

Marcel Duin marcel@micr.io

Constructors

Properties

Accessors

Methods

Constructors

  • Creates a GallerySwiper instance.

    Parameters

    • micrio: HTMLMicrioElement

      The main HTMLMicrioElement instance.

    • length: number

      The total number of images/frames in the sequence.

    • goto: ((i: number) => void)

      Callback function to navigate to a specific index.

        • (i): void
        • Parameters

          • i: number

          Returns void

    • opts: {
          continuous?: boolean;
          coverLimit?: boolean;
          sensitivity?: number;
      } = {}

      Swiper options: sensitivity, continuous looping, coverLimit.

      • Optionalcontinuous?: boolean
      • OptionalcoverLimit?: boolean
      • Optionalsensitivity?: number

    Returns GallerySwiper

Properties

goto: ((i: number) => void)

Callback function to navigate to a specific index.

Accessors

  • get currentIndex(): number
  • Getter for the current active image/frame index from the Wasm module.

    Returns number

Methods

  • Animates smoothly to a target index using requestAnimationFrame.

    Parameters

    • idx: number

      The target index.

    Returns void

  • Cleans up event listeners when the swiper is destroyed.

    Returns void