Lucit Template Animation Guide¶
Overview¶
Lucit Templates support adding animations to elements in the Template Designer. These animations are executed at the appropriate time during editing and during render/play.
Important Concepts and Prerequisites¶
- Animations are stored in the
x-animationsattribute on the element being animated, not in inline CSS or style attributes. This lets the Render App execute animations at the right time, both in the editor and at render/play. - Animations are only supported for templates with Motion enabled (Template → {SettingsGearIcon} → Advanced tab → enable "Motion Capable").
- Animations are only supported in Lucit campaigns where HTML Source Type is set to
Drive Template(Campaigns → {Campaign} → {3VerticalDotsIcon} → Settings → HTML Source Type dropdown → change from Snapshot to Drive Template). - Animations are only supported by third-party CMS/Player systems that can render HTML on the screen.
Adding Animations to an Element¶
Assuming Motion is enabled for your template:
To add and edit animations and their settings:
- Add an element to your canvas (for example, a rectangle).
- Click the element.
- In the
Editpanel, scroll down toAnimationsand click+ANIMATION. - Select the Animation Name (e.g.,
Bounce InorFade In Right). - Configure the Duration, Delay, Loop, Direction, and Fill Mode.
This animation appears under a numbered tab (e.g., 1), which indicates its order.
To add another animation, click the {PlusSignIcon} next to the last numbered tab under Animations, then repeat.
Playing Animations¶
Animations play in these scenarios:
- Auto play when the
designer_readymessage is emitted and auto play is enabled. - Triggered play when
designer_readyis emitted, auto play is disabled, and the Render App receives adesigner_play_contentmessage from the host (parent container/player).- This mode is used in the Template Designer editor and by some player systems that support Lucit animations directly, like the Lighting Player by Lucit.
In the Template Designer, you can play animations by:
- Clicking the
PLAYbutton on theEdittab in theAnimationssection. - Clicking the
{PlayIcon}in theAction Barat the bottom of the canvas.
Animations Architecture¶
Animations are keyframes that are executed according to their settings.
Keyframes
Keyframes come from two sources:
- Built-in The standard Lucit-provided keyframes are stored in the CSS file
dt_animations.cssprovided by the Render App. See Template Animations Keyframes for a complete list of available keyframes. - Custom Add custom keyframes by adding
@keyframesrules to the template's Global CSS.- Important: Because keyframes must be global, add them to the template before changing the template's Editor Mode to
Each Size Independently. To add custom keyframes, the Editor Mode must be set toAll Sizes.
- Important: Because keyframes must be global, add them to the template before changing the template's Editor Mode to
The combined list of keyframes (built-in and custom) is listed in the Animations dropdown in the Edit panel. Click element on canvas → Edit tab → Animations → {PlusSign} ANIMATION → Choose Animation.
Settings
The following settings are supported for each animation added to an element (multiple animations are supported):
numberOrder An order number identifying each animationnameKeyframe the keyframe to use.durationDuration how long the animation runs (seconds; decimals supported).delayDelay seconds to wait before starting (decimals supported).iterationLoop None, Once, Forever, or a custom count.directionDirection one of Normal, Reverse, Alternate, Alternate Reverse (stored as CSS-style values in JSON).fillModeFill Mode one of None, Forwards, Backwards, Both (stored as CSS-style values in JSON).
Note: UI labels may be title-cased (e.g., "Alternate Reverse"), while stored JSON uses CSS-style lowercase values with hyphens (e.g., alternate-reverse, forwards).
The values of these settings are represented in the x-animations attribute JSON array as follows (comments for illustration):
[
{
"number": 1,
"name": "bounceIn",
"duration": 1,
"delay": 0,
"iteration": 1,
"direction": "normal",
"fillMode": "backwards"
}
]
An element with multiple animations will look like this:
[
{
"number": 1,
"name": "bounceIn",
"duration": 1,
"delay": 0,
"iteration": 1,
"direction": "normal",
"fillMode": "backwards",
"isCustomIteration": false
},
{
"number": 2,
"name": "bounceOutDown",
"duration": 1,
"delay": 1.5,
"iteration": 1,
"direction": "normal",
"fillMode": "forwards"
}
]
A complete element HTML with animations would look like this:
<div
id="obj_rectangle_8ytgoz0n"
title="Rectangle"
x-objectcode="rectangle"
class="lc_ut_designer lc_dt_element lc_dt_object"
style=""
x-fieldname="rectangle"
x-optional-field="false"
x-element-settings="{}"
x-element-setting-values="{}"
x-animations='[{"number":1,"name":"bounceIn","duration":1,"delay":0,"iteration":1,"direction":"normal","fillMode":"backwards","isCustomIteration":false},{"number":2,"name":"bounceOutDown","duration":1,"delay":1.5,"iteration":1,"direction":"normal","fillMode":"forwards"}]'>
<div></div>
</div>
Troubleshooting¶
If animations aren’t playing:
- Ensure Motion is enabled for the template.
- For Lucit campaigns, verify HTML Source Type is set to
Drive Template. - Confirm the player/CMS supports rendering HTML and, if needed, Lucit animation messages.