Your system asks for reduced motion, so VFX-JS draws nothing. Demos on this site show plain HTML.

API Reference

Every class, function and type in @vfx-js/core and @vfx-js/effects, generated from the source. New to VFX-JS? Start with Getting Started.

@vfx-js/core

The VFX class, its options, and the types for custom effects and transitions.

Classes

  • Crossfade A transition made of one shader. frag defines vec4 transition(vec2 uv, float t) and reads the two sides with readFrom / readTo.
  • ShaderTransition A transition made of one shader. frag defines vec4 transition(vec2 uv, float t) and reads the two sides with readFrom / readTo.
  • VFX The main interface of VFX-JS.

Functions

  • isHicCanvas True if el is a canvas that captures its children with drawElementImage.
  • markHicCanvas Mark canvas as an html-in-canvas wrapper and child as drawable.
  • setupCapture Set up the paint handler + ResizeObservers on an html-in-canvas wrapper (<canvas layoutsubtree content="drawable">). Returns the initial OffscreenCanvas from the first paint.
  • supportsHtmlInCanvas
  • teardownCapture Tear down onpaint handler + ResizeObservers set up by setupCapture.

Interfaces

  • CaptureOpts
  • Effect Effect interface.
  • Transition A transition: one effect plus the defaults a spec can override. Write it as a class.
  • TransitionEffect An effect that takes part in a run. Outside a run it is skipped and the chain passes its input through. render also runs while the old content is held (ctx.holding); pass the input through then unless you need those frames. update runs only while the animation plays.
  • TransitionHandle Controls the transitions of one element.

Types

Variables

  • shaders Shader code for presets. Shaders in shader can be looked up with keys in ShaderPreset.

@vfx-js/effects

Ready-made effects to pass to the effect option, and their parameters.

Classes

Types

Variables

  • ASCII_PRESETS Built-in character ramps, ordered dark → light. Suited for light-on-dark output (more "ink" = brighter); flip with invert: true for dark-on-light.
  • MATRIX_GLYPHS Default glyph pool: half-width katakana (the look the film used) plus digits and a few symbols. Mirrored katakana isn't reproducible from a normal font, so these render upright.