Skip to content

Animation System

Basic Format

Animations are defined directly in the .llmui widget definition:

json
"animations": [
  {
    "name": "fadeIn",
    "property": "RenderOpacity",
    "fromValue": 0,
    "toValue": 1,
    "duration": 0.5,
    "easing": "EaseOut",
    "autoPlay": true
  }
]

Animation Properties

PropertyTypeDescription
namestringUnique name for this animation
propertystringProperty to animate
fromValue / toValuefloatStart and end values
fromVector / toVectorVector2DFor 2D properties
fromColor / toColorColorFor color properties
durationfloatDuration in seconds
delayfloatDelay before starting
easingstringEasing function name
loopintNumber of loops (-1 = infinite, 1 = once)
autoPlayboolStart automatically on spawn
keyframesarrayKeyframe array (overrides from/to)

Keyframe Format

json
{
  "name": "bounce",
  "property": "RenderScale",
  "keyframes": [
    { "time": 0,   "value": { "x": 1.0, "y": 1.0 } },
    { "time": 0.1, "value": { "x": 1.2, "y": 1.2 } },
    { "time": 0.2, "value": { "x": 0.9, "y": 0.9 } },
    { "time": 0.4, "value": { "x": 1.0, "y": 1.0 } }
  ],
  "duration": 0.4,
  "easing": "OutBack"
}

Animatable Properties

Property NameValue TypeDescription
RenderOpacityFloat (0-1)Transparency
RenderTranslationVector2DPosition offset (X, Y)
RenderScaleVector2DScale factor (X, Y)
RenderRotationFloatRotation angle in degrees
BackgroundColorColorBackground tint (Border/Button)
TintColor / ColorAndOpacityColorTint for Image widgets
WidgetWidthFloatWidth in pixels
WidgetHeightFloatHeight in pixels
FillColorAndOpacityColorFill color for ProgressBar
PercentFloatProgress value (0-1) for ProgressBar
SliderValueFloatSlider position (0-1)

Easing Functions

CategoryFunctions
BasicLinear, EaseIn, EaseOut, EaseInOut
QuadraticInQuad, OutQuad, InOutQuad
CubicInCubic, OutCubic, InOutCubic
SineInSine, OutSine, InOutSine
ExponentialInExpo, OutExpo, InOutExpo
ElasticInElastic, OutElastic
BounceInBounce, OutBounce
BackInBack, OutBack

Examples

Fade In

json
{ "name": "fadeIn", "property": "RenderOpacity", "fromValue": 0, "toValue": 1, "duration": 0.5, "easing": "EaseOut", "autoPlay": true }

Slide In from Left

json
{ "name": "slideIn", "property": "RenderTranslation", "fromVector": { "x": -100, "y": 0 }, "toVector": { "x": 0, "y": 0 }, "duration": 0.3, "easing": "OutQuad" }

Color Pulse (infinite loop)

json
{ "name": "colorPulse", "property": "BackgroundColor", "fromColor": { "R": 0.2, "G": 0.5, "B": 0.8, "A": 1 }, "toColor": { "R": 0.4, "G": 0.7, "B": 1.0, "A": 1 }, "duration": 1.5, "easing": "InOutSine", "loop": -1, "autoPlay": true }

Infinite Bounce Scale

json
{ "name": "bounceScale", "property": "RenderScale", "fromVector": { "x": 1.0, "y": 1.0 }, "toVector": { "x": 1.05, "y": 1.05 }, "duration": 0.8, "easing": "InOutSine", "loop": -1 }

Powered by VitePress