Package com.oorian.css.animations
Class Flip
java.lang.Object
com.oorian.css.animations.Animation
com.oorian.css.animations.Flip
A looping animation that flips an element around an axis.
By default, the element flips around the Y axis (horizontal flip). The flip
axis and angle can be customized with setFlipAxis(String) and
setAngle(String).
Usage:
// Default Y-axis flip
icon.animate(new Flip());
// Flip around X axis
icon.animate(new Flip().setFlipAxis("x"));
// Custom flip angle
icon.animate(new Flip().setAngle("-90deg"));
- Since:
- 2026
- Version:
- 1.0
- Author:
- Marvin P. Warble Jr.
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionFlip()Constructs a Flip animation with default Y-axis flip and speed 1 (1000ms). -
Method Summary
Modifier and TypeMethodDescriptionCreates the@keyframesdefinition for this animation.getAngle()Returns the flip angle.protected AnimationTimingFunctionReturns the default timing function for this animation.Returns the flip axis.Returns the unique ID for this animation's keyframes style element.Sets the rotation angle for the flip.setFlipAxis(String axis) Sets the axis around which the element flips.Methods inherited from class com.oorian.css.animations.Animation
apply, getDurationMs, getStyleSheet, getTimingFunctionValue, setDelay, setDirection, setDuration, setFillMode, setIterationCount, setSpeed
-
Constructor Details
-
Flip
public Flip()Constructs a Flip animation with default Y-axis flip and speed 1 (1000ms).
-
-
Method Details
-
setFlipAxis
Sets the axis around which the element flips.- Parameters:
axis- the flip axis ("x", "y", or "z")- Returns:
- this Flip for method chaining
-
getFlipAxis
Returns the flip axis.- Returns:
- the flip axis
-
setAngle
Sets the rotation angle for the flip.- Parameters:
angle- the rotation angle as a CSS value (e.g., "-180deg", "90deg")- Returns:
- this Flip for method chaining
-
getAngle
Returns the flip angle.- Returns:
- the flip angle CSS value
-
getKeyFramesId
Returns the unique ID for this animation's keyframes style element.This ID is used to deduplicate keyframe injection into the page head. Subclasses with configurable keyframes (e.g., Beat with a custom scale) should return a unique ID per configuration to avoid collisions.
- Specified by:
getKeyFramesIdin classAnimation- Returns:
- the keyframes style element ID
-
createKeyFrames
Creates the@keyframesdefinition for this animation.- Specified by:
createKeyFramesin classAnimation- Returns:
- a KeyFrames object defining the animation sequence
-
getDefaultTimingFunction
Returns the default timing function for this animation.Each animation subclass provides its own default timing function. For custom cubic-bezier or steps timing, override
Animation.getTimingFunctionValue()instead.- Specified by:
getDefaultTimingFunctionin classAnimation- Returns:
- the default timing function, or null if
Animation.getTimingFunctionValue()provides a custom value
-