Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Empty file modified LICENSE.txt
100644 → 100755
Empty file.
Empty file modified README.md
100644 → 100755
Empty file.
Empty file modified assets/linux-icon.png
100644 → 100755
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified assets/macos-icon.icns
100644 → 100755
Empty file.
Empty file modified assets/windows-icon.ico
100644 → 100755
Empty file.
Empty file modified pom.xml
100644 → 100755
Empty file.
Empty file modified src/android/AndroidManifest.xml
100644 → 100755
Empty file.
Empty file modified src/android/mods/MainActivity.java
100644 → 100755
Empty file.
Empty file modified src/android/res/mipmap-hdpi/ic_launcher.png
100644 → 100755
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified src/android/res/mipmap-mdpi/ic_launcher.png
100644 → 100755
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified src/android/res/mipmap-xhdpi/ic_launcher.png
100644 → 100755
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified src/android/res/mipmap-xxhdpi/ic_launcher.png
100644 → 100755
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified src/android/res/mipmap-xxxhdpi/ic_launcher.png
100644 → 100755
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified src/ios/assets/Assets.xcassets/AppIcon.appiconset/100.png
100644 → 100755
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified src/ios/assets/Assets.xcassets/AppIcon.appiconset/1024.png
100644 → 100755
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified src/ios/assets/Assets.xcassets/AppIcon.appiconset/114.png
100644 → 100755
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified src/ios/assets/Assets.xcassets/AppIcon.appiconset/120.png
100644 → 100755
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified src/ios/assets/Assets.xcassets/AppIcon.appiconset/144.png
100644 → 100755
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified src/ios/assets/Assets.xcassets/AppIcon.appiconset/152.png
100644 → 100755
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified src/ios/assets/Assets.xcassets/AppIcon.appiconset/167.png
100644 → 100755
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified src/ios/assets/Assets.xcassets/AppIcon.appiconset/180.png
100644 → 100755
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified src/ios/assets/Assets.xcassets/AppIcon.appiconset/20.png
100644 → 100755
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified src/ios/assets/Assets.xcassets/AppIcon.appiconset/29.png
100644 → 100755
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified src/ios/assets/Assets.xcassets/AppIcon.appiconset/40.png
100644 → 100755
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified src/ios/assets/Assets.xcassets/AppIcon.appiconset/50.png
100644 → 100755
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified src/ios/assets/Assets.xcassets/AppIcon.appiconset/57.png
100644 → 100755
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified src/ios/assets/Assets.xcassets/AppIcon.appiconset/58.png
100644 → 100755
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified src/ios/assets/Assets.xcassets/AppIcon.appiconset/60.png
100644 → 100755
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified src/ios/assets/Assets.xcassets/AppIcon.appiconset/72.png
100644 → 100755
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified src/ios/assets/Assets.xcassets/AppIcon.appiconset/76.png
100644 → 100755
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified src/ios/assets/Assets.xcassets/AppIcon.appiconset/80.png
100644 → 100755
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified src/ios/assets/Assets.xcassets/AppIcon.appiconset/87.png
100644 → 100755
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified src/ios/assets/Assets.xcassets/AppIcon.appiconset/Contents.json
100644 → 100755
Empty file.
Empty file modified src/ios/assets/Assets.xcassets/Contents.json
100644 → 100755
Empty file.
Empty file modified src/ios/assets/Base.lproj/LaunchScreen.storyboard
100644 → 100755
Empty file.
Empty file modified src/ios/assets/Base.lproj/MainScreen.storyboard
100644 → 100755
Empty file.
Empty file modified src/ios/assets/Default-375w-667h@2x~iphone.png
100644 → 100755
Empty file modified src/ios/assets/Default-375w-812h-landscape@3x~iphone.png
100644 → 100755
Empty file modified src/ios/assets/Default-375w-812h@3x~iphone.png
100644 → 100755
Empty file modified src/ios/assets/Default-414w-736h-landscape@3x~iphone.png
100644 → 100755
Empty file modified src/ios/assets/Default-414w-736h@3x~iphone.png
100644 → 100755
Empty file modified src/ios/assets/Default-414w-896h-landscape@3x~iphone.png
100644 → 100755
Empty file modified src/ios/assets/Default-414w-896h@3x~iphone.png
100644 → 100755
Empty file modified src/ios/assets/Default-568h@2x~iphone.png
100644 → 100755
Empty file modified src/ios/assets/Default-landscape@2x~ipad.png
100644 → 100755
Empty file modified src/ios/assets/Default-landscape~ipad.png
100644 → 100755
Empty file modified src/ios/assets/Default-portrait@2x~ipad.png
100644 → 100755
Empty file modified src/ios/assets/Default-portrait~ipad.png
100644 → 100755
Empty file modified src/ios/assets/Default@2x~iphone.png
100644 → 100755
Empty file modified src/ios/assets/iTunesArtwork.png
100644 → 100755
Empty file modified src/ios/assets/iTunesArtwork@2x.png
100644 → 100755
Empty file modified src/main/java/com/stream_pi/client/Main.java
100644 → 100755
Empty file.
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
package com.stream_pi.client.animations;

import javafx.animation.Interpolator;

public final class AnimateFXInterpolator {

private AnimateFXInterpolator() {
throw new IllegalStateException("AnimateFX Interpolator");
}

public static final Interpolator EASE = Interpolator.SPLINE(0.25, 0.1, 0.25, 1);

}
204 changes: 204 additions & 0 deletions src/main/java/com/stream_pi/client/animations/AnimationFX.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,204 @@
package com.stream_pi.client.animations;

import javafx.animation.Animation;
import javafx.animation.Timeline;
import javafx.event.ActionEvent;
import javafx.event.EventHandler;
import javafx.scene.Node;
import javafx.util.Duration;


/**
* @author Loïc Sculier aka typhon0
*/
public abstract class AnimationFX {

/**
* Used to specify an animation that repeats indefinitely, until the
* {@code stop()} method is called.
*/
public static final int INDEFINITE = -1;
private Timeline timeline;
private boolean reset;
private Node node;
private AnimationFX nextAnimation;
private boolean hasNextAnimation;

/**
* Create a new animation
*
* @param node the node to affect
*/
public AnimationFX(Node node) {
super();
setNode(node);

}

/**
* Default constructor
*/
public AnimationFX() {
hasNextAnimation = false;
this.reset = false;
}

/**
* Handle when the animation is finished
*
* @return
*/
private AnimationFX onFinished() {
if (reset) {
resetNode();
}
if (this.nextAnimation != null) {
this.nextAnimation.play();
}
return this;
}

/**
* Set the next animation to play
*
* @param animation
* @return
*/
public AnimationFX playOnFinished(AnimationFX animation) {
setNextAnimation(animation);
return this;

}

/**
* Function to reset the node or not when the animation is finished
*
* @param reset
* @return
*/
public AnimationFX setResetOnFinished(boolean reset) {
this.reset = reset;
return this;
}

/**
* Play the animation
*/
public void play() {
timeline.play();
}

/**
* Stop the animation
*
* @return
*/
public AnimationFX stop() {
timeline.stop();
return this;
}

/**
* Function the reset the node to original state
*
* @return
*/
abstract AnimationFX resetNode();

/**
* Function to initialize the timeline
*/
abstract void initTimeline();


public Timeline getTimeline() {
return timeline;
}

public void setTimeline(Timeline timeline) {
this.timeline = timeline;
}

public boolean isResetOnFinished() {
return reset;
}

protected void setReset(boolean reset) {
this.reset = reset;
}

public Node getNode() {
return node;
}

public void setNode(Node node) {
this.node = node;
initTimeline();
timeline.statusProperty().addListener((observable, oldValue, newValue) -> {
if (newValue.equals(Animation.Status.STOPPED)) {
onFinished();
}

});
}

public AnimationFX getNextAnimation() {
return nextAnimation;
}

protected void setNextAnimation(AnimationFX nextAnimation) {
hasNextAnimation = true;
this.nextAnimation = nextAnimation;
}

public boolean hasNextAnimation() {
return hasNextAnimation;
}

protected void setHasNextAnimation(boolean hasNextAnimation) {
this.hasNextAnimation = hasNextAnimation;
}

/**
* Define the number of cycles in this animation
*
* @param value
* @return
*/
public AnimationFX setCycleCount(int value) {
this.timeline.setCycleCount(value);
return this;
}

/**
* Set the speed factor of the animation
*
* @param value
* @return
*/
public AnimationFX setSpeed(double value) {
this.timeline.setRate(value);
return this;
}

/**
* Delays the start of an animation
*
* @param value
* @return
*/
public AnimationFX setDelay(Duration value) {
this.timeline.setDelay(value);
return this;
}

/**
* Set event when the animation ended.
*
* @param value
*/
public final void setOnFinished(EventHandler<ActionEvent> value) {
this.timeline.setOnFinished(value);
}

}
66 changes: 66 additions & 0 deletions src/main/java/com/stream_pi/client/animations/Bounce.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
package com.stream_pi.client.animations;

import javafx.animation.Interpolator;
import javafx.animation.KeyFrame;
import javafx.animation.KeyValue;
import javafx.animation.Timeline;
import javafx.scene.Node;
import javafx.util.Duration;


/**
* @author Loïc Sculier aka typhon0
*/
public class Bounce extends AnimationFX {


/**
* Create new Bounce
*
* @param node The node to affect
*/
public Bounce(Node node) {
super(node);
}

public Bounce() {
super();
}

@Override
public AnimationFX resetNode() {
getNode().setTranslateY(0);
return this;
}

@Override
void initTimeline() {
setTimeline(
new Timeline(

new KeyFrame(Duration.millis(0),
new KeyValue(getNode().translateYProperty(), 0, Interpolator.SPLINE(0.215, 0.610, 0.355, 1.000))
),
new KeyFrame(Duration.millis(400),
new KeyValue(getNode().translateYProperty(), -30, Interpolator.SPLINE(0.755, 0.050, 0.855, 0.060))
),
new KeyFrame(Duration.millis(550),
new KeyValue(getNode().translateYProperty(), 0, Interpolator.SPLINE(0.215, 0.610, 0.355, 1.000))
),
new KeyFrame(Duration.millis(700),
new KeyValue(getNode().translateYProperty(), -15, Interpolator.SPLINE(0.755, 0.050, 0.855, 0.060))
),
new KeyFrame(Duration.millis(800),
new KeyValue(getNode().translateYProperty(), 0, Interpolator.SPLINE(0.215, 0.610, 0.355, 1.000))
),
new KeyFrame(Duration.millis(900),
new KeyValue(getNode().translateYProperty(), -5, Interpolator.SPLINE(0.755, 0.050, 0.855, 0.060))
),
new KeyFrame(Duration.millis(1000),
new KeyValue(getNode().translateYProperty(), 0, Interpolator.SPLINE(0.215, 0.610, 0.355, 1.000))
)

));
}
}

72 changes: 72 additions & 0 deletions src/main/java/com/stream_pi/client/animations/BounceIn.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
package com.stream_pi.client.animations;

import javafx.animation.Interpolator;
import javafx.animation.KeyFrame;
import javafx.animation.KeyValue;
import javafx.animation.Timeline;
import javafx.scene.Node;
import javafx.util.Duration;

/**
* @author Loïc Sculier aka typhon0
*/
public class BounceIn extends AnimationFX {


/**
* Create new BounceIn
*
* @param node The node to affect
*/
public BounceIn(Node node) {
super(node);

}

public BounceIn() {
super();
}

@Override
AnimationFX resetNode() {
getNode().setOpacity(1);
getNode().setScaleX(1);
getNode().setScaleY(1);
return this;
}

@Override
void initTimeline() {
setTimeline(new Timeline(
new KeyFrame(Duration.millis(0),
new KeyValue(getNode().opacityProperty(), 0, Interpolator.SPLINE(0.215, 0.610, 0.355, 1.000)),
new KeyValue(getNode().scaleXProperty(), 0.3, Interpolator.SPLINE(0.215, 0.610, 0.355, 1.000)),
new KeyValue(getNode().scaleYProperty(), 0.3, Interpolator.SPLINE(0.215, 0.610, 0.355, 1.000))
),
new KeyFrame(Duration.millis(200),
new KeyValue(getNode().scaleXProperty(), 1.1, Interpolator.SPLINE(0.215, 0.610, 0.355, 1.000)),
new KeyValue(getNode().scaleYProperty(), 1.1, Interpolator.SPLINE(0.215, 0.610, 0.355, 1.000))
),
new KeyFrame(Duration.millis(400),
new KeyValue(getNode().scaleXProperty(), 0.9, Interpolator.SPLINE(0.215, 0.610, 0.355, 1.000)),
new KeyValue(getNode().scaleYProperty(), 0.9, Interpolator.SPLINE(0.215, 0.610, 0.355, 1.000))
),
new KeyFrame(Duration.millis(600),
new KeyValue(getNode().opacityProperty(), 1, Interpolator.SPLINE(0.215, 0.610, 0.355, 1.000)),
new KeyValue(getNode().scaleXProperty(), 1.03, Interpolator.SPLINE(0.215, 0.610, 0.355, 1.000)),
new KeyValue(getNode().scaleYProperty(), 1.03, Interpolator.SPLINE(0.215, 0.610, 0.355, 1.000))
),
new KeyFrame(Duration.millis(800),
new KeyValue(getNode().scaleXProperty(), 0.97, Interpolator.SPLINE(0.215, 0.610, 0.355, 1.000)),
new KeyValue(getNode().scaleYProperty(), 0.97, Interpolator.SPLINE(0.215, 0.610, 0.355, 1.000))
),
new KeyFrame(Duration.millis(1000),
new KeyValue(getNode().opacityProperty(), 1, Interpolator.SPLINE(0.215, 0.610, 0.355, 1.000)),
new KeyValue(getNode().scaleXProperty(), 1, Interpolator.SPLINE(0.215, 0.610, 0.355, 1.000)),
new KeyValue(getNode().scaleYProperty(), 1, Interpolator.SPLINE(0.215, 0.610, 0.355, 1.000))
)

));

}
}
Loading