From ef98c272d57161ea1de222fe4ee04ee701877b4f Mon Sep 17 00:00:00 2001 From: DeDiamondPro <67508414+DeDiamondPro@users.noreply.github.com> Date: Wed, 1 Jun 2022 20:06:36 +0200 Subject: sidebar and animation stuff --- .../gui/animations/EaseInQuartReversed.java | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 src/main/java/cc/polyfrost/oneconfig/gui/animations/EaseInQuartReversed.java (limited to 'src/main/java/cc/polyfrost/oneconfig/gui/animations/EaseInQuartReversed.java') 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); + } +} -- cgit