Skip to content

Transform & Morph

0.00s / 2.97s · F0

Animates spatial properties — position, scale, rotation, and opacity — between two states. Use Transform for any motion that moves or resizes an element.

PropTypeDescription
from{ translateX?, translateY?, scale?, rotate?, opacity? }Starting state
to{ translateX?, translateY?, scale?, rotate?, opacity? }Ending state
durationnumberLength of the animation in frames
easingEasingFunctionEasing curve (default: linear)
<Transform
from={{ translateX: -100, opacity: 0 }}
to={{ translateX: 0, opacity: 1 }}
duration={30}
easing={easeOutCubic}
>
<Circle cx={200} cy={150} r={40} fill="#4f9eff" />
</Transform>

Transitions visual properties — fill color, scale, and opacity — between two states. Use Morph when the element stays in place but changes appearance.

PropTypeDescription
from{ fill?, scale?, opacity? }Starting visual state
to{ fill?, scale?, opacity? }Ending visual state
durationnumberLength of the animation in frames
easingEasingFunctionEasing curve (default: linear)
<Morph
from={{ fill: "#ff6b6b", opacity: 0.5 }}
to={{ fill: "#4f9eff", opacity: 1 }}
duration={45}
easing={easeInOutQuad}
>
<Rect x={150} y={100} width={100} height={100} />
</Morph>
import { Player, Transform, Morph, Circle, Rect } from '@elucim/core';
<Player width={500} height={250} fps={30} durationInFrames={90}>
<Transform
from={{ scale: 0.5, opacity: 0.3 }}
to={{ scale: 1.2, rotate: 360, opacity: 1 }}
duration={60}
>
<Circle cx={150} cy={125} r={40} stroke="#6c5ce7" strokeWidth={3} fill="rgba(108,92,231,0.2)" />
</Transform>
<Morph
from={{ fill: '#ff6b6b', opacity: 0.3 }}
to={{ fill: '#4ecdc4', scale: 1.3, opacity: 1 }}
duration={50}
>
<Rect x={310} y={85} width={80} height={80} stroke="#ff6b6b" strokeWidth={2} rx={6} />
</Morph>
</Player>