Raxol.Animation.Hint (Raxol v2.6.0)

View Source

Declarative animation hint metadata attached to view elements.

Hints describe what is being animated so surface renderers can optionally accelerate rendering. For example, LiveView can emit CSS transition properties instead of re-rendering every frame server-side.

The server always computes the correct frame via Animation.Framework.apply_animations_to_state/1. Hints are optional acceleration -- surfaces that don't understand them render the server-computed values as-is.

CSS mapping functions delegate to Raxol.Core.Animation.Hint in raxol_core, eliminating duplication with TerminalBridge.

Summary

Functions

Maps a Raxol animation property to a CSS property name.

Maps a Raxol easing atom to a CSS timing function string.

Types

t()

@type t() :: %Raxol.Animation.Hint{
  delay_ms: non_neg_integer(),
  duration_ms: non_neg_integer(),
  easing: atom(),
  from: any(),
  property: atom(),
  to: any()
}

Functions

to_css_property(property)

Maps a Raxol animation property to a CSS property name.

Returns nil for properties that have no CSS equivalent.

to_css_timing(easing)

Maps a Raxol easing atom to a CSS timing function string.