-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
57 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
37 changes: 37 additions & 0 deletions
37
src/main/java/me/oneqxz/riseloader/fxml/animations/CFadeInLeft.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
package me.oneqxz.riseloader.fxml.animations; | ||
|
||
import animatefx.animation.AnimateFXInterpolator; | ||
import animatefx.animation.AnimationFX; | ||
import javafx.animation.KeyFrame; | ||
import javafx.animation.KeyValue; | ||
import javafx.animation.Timeline; | ||
import javafx.scene.Node; | ||
import javafx.util.Duration; | ||
|
||
public class CFadeInLeft extends AnimationFX { | ||
|
||
public CFadeInLeft(Node node) { | ||
setNode(node); | ||
} | ||
|
||
@Override | ||
protected AnimationFX resetNode() { | ||
getNode().setOpacity(1); | ||
getNode().setTranslateX(0); | ||
return this; | ||
} | ||
|
||
@Override | ||
protected void initTimeline() { | ||
setTimeline(new Timeline( | ||
new KeyFrame(Duration.millis(0), | ||
new KeyValue(getNode().opacityProperty(), 0, AnimateFXInterpolator.EASE), | ||
new KeyValue(getNode().translateXProperty(), -10, AnimateFXInterpolator.EASE) | ||
), | ||
new KeyFrame(Duration.millis(1000), | ||
new KeyValue(getNode().opacityProperty(), 1, AnimateFXInterpolator.EASE), | ||
new KeyValue(getNode().translateXProperty(), 0, AnimateFXInterpolator.EASE) | ||
) | ||
)); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters