aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/cc/polyfrost/oneconfig/gui/animations/EaseInQuartReversed.java
diff options
context:
space:
mode:
authorDeDiamondPro <67508414+DeDiamondPro@users.noreply.github.com>2022-06-01 20:06:36 +0200
committerDeDiamondPro <67508414+DeDiamondPro@users.noreply.github.com>2022-06-01 20:06:36 +0200
commitef98c272d57161ea1de222fe4ee04ee701877b4f (patch)
tree368d63b62b0cd04b179350d7477eacedf19917be /src/main/java/cc/polyfrost/oneconfig/gui/animations/EaseInQuartReversed.java
parent18ddce4242a5a68bef111f9bce43b6c3f3a45ce6 (diff)
downloadOneConfig-ef98c272d57161ea1de222fe4ee04ee701877b4f.tar.gz
OneConfig-ef98c272d57161ea1de222fe4ee04ee701877b4f.tar.bz2
OneConfig-ef98c272d57161ea1de222fe4ee04ee701877b4f.zip
sidebar and animation stuff
Diffstat (limited to 'src/main/java/cc/polyfrost/oneconfig/gui/animations/EaseInQuartReversed.java')
-rw-r--r--src/main/java/cc/polyfrost/oneconfig/gui/animations/EaseInQuartReversed.java20
1 files changed, 20 insertions, 0 deletions
diff --git a/src/main/java/cc/polyfrost/oneconfig/gui/animations/EaseInQuartReversed.java b/src/main/java/cc/polyfrost/oneconfig/gui/animations/EaseInQuartReversed.java
new file mode 100644
index 0000000..9e77714
--- /dev/null
+++ b/src/main/java/cc/polyfrost/oneconfig/gui/animations/EaseInQuartReversed.java
@@ -0,0 +1,20 @@
+package cc.polyfrost.oneconfig.gui.animations;
+
+public class EaseInQuartReversed extends Animation {
+ /**
+ * @param duration The duration of the animation
+ * @param start The start of the animation
+ * @param end The end of the animation
+ * @param reverse Reverse the animation
+ */
+ public EaseInQuartReversed(float duration, float start, float end, boolean reverse) {
+ super(duration, start, end, reverse);
+ }
+
+ @Override
+ protected float animate(float timePassed, float duration, float start, float change) {
+ float x = timePassed / duration;
+ if (x < 0.5f) return (float) (16 * Math.pow(x, 4) * change + start);
+ return (float) (Math.pow(2 * x - 2, 4) * change + start);
+ }
+}