Class Fade
The element smoothly transitions between full opacity and a configurable
minimum opacity, creating a pulsing visibility effect. The minimum opacity
can be customized with setMinOpacity(float).
Note: This is com.oorian.css.animations.Fade — a continuous
looping fade animation. For one-shot opacity transitions, use
Fade instead.
Usage:
// Default fade animation (fades to 40% opacity)
icon.animate(new Fade());
// Fade to near-invisible
icon.animate(new Fade().setMinOpacity(0.1f));
- Since:
- 2026
- Version:
- 1.0
- Author:
- Marvin P. Warble Jr.
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionFade()Constructs a Fade animation with default opacity and speed 1 (1000ms). -
Method Summary
Modifier and TypeMethodDescriptionCreates the@keyframesdefinition for this animation.protected AnimationTimingFunctionReturns the default timing function for this animation.Returns the unique ID for this animation's keyframes style element.floatReturns the minimum opacity.protected StringReturns the CSS timing function value as a string.setMinOpacity(float minOpacity) Sets the minimum opacity during the fade-out phase.Methods inherited from class com.oorian.css.animations.Animation
apply, getDurationMs, getStyleSheet, setDelay, setDirection, setDuration, setFillMode, setIterationCount, setSpeed
-
Constructor Details
-
Fade
public Fade()Constructs a Fade animation with default opacity and speed 1 (1000ms).
-
-
Method Details
-
setMinOpacity
Sets the minimum opacity during the fade-out phase.- Parameters:
minOpacity- the minimum opacity (0.0 = transparent, 1.0 = opaque)- Returns:
- this Fade for method chaining
-
getMinOpacity
public float getMinOpacity()Returns the minimum opacity.- Returns:
- the minimum opacity 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
-
getTimingFunctionValue
Returns the CSS timing function value as a string.By default, delegates to
Animation.getDefaultTimingFunction(). Override this method to provide custom timing function values likecubic-bezier(...)orsteps(...)that are not represented by the enum.- Overrides:
getTimingFunctionValuein classAnimation- Returns:
- the CSS timing function value
-