simple-visual-novel
    Preparing search index...

    Function fadeIn

    • Fades in an element by animating its opacity from 0 to 1.

      Uses CSS transitions for smooth animation. The returned promise can be cancelled to immediately show the element at full opacity.

      Parameters

      • element: HTMLElement

        The DOM element to fade in

      • Optionaloptions: FadeOptions = {}

        Fade options

        Options for configuring fade effects.

        FadeOptions

        • Optionalduration?: number

          Animation duration in milliseconds.

        • OptionalonComplete?: () => void

          Callback function invoked when the animation completes (either naturally or when cancelled).

      Returns CancellablePromise

      A cancellable promise that resolves when animation completes. Call .cancel() to immediately show the element at full opacity.

      const element = document.getElementById("character");
      const animation = fadeIn(element, { duration: 300 });

      // Optionally cancel to show immediately
      animation.cancel();