Skip to content

Commit

Permalink
- Adding "Random In", "Random Out", and "Random Visible" options to O…
Browse files Browse the repository at this point in the history
…verlay animation selection
  • Loading branch information
Matthew Olivo committed Oct 3, 2024
1 parent 70af827 commit bc1d3a4
Show file tree
Hide file tree
Showing 3 changed files with 179 additions and 0 deletions.
143 changes: 143 additions & 0 deletions MixItUp.Base/Model/Overlay/OverlayAnimationV3Model.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using MixItUp.Base.Util;
using Newtonsoft.Json.Linq;
using StreamingClient.Base.Util;
using System;
using System.Collections.Generic;
Expand Down Expand Up @@ -127,11 +128,138 @@ public enum OverlayAnimateCSSAnimationType
SlideOutLeft,
SlideOutRight,
SlideOutUp,

RandomIn = 1000,
RandomOut = 1001,
RandomVisible = 1002,
}

[DataContract]
public class OverlayAnimationV3Model
{
private static readonly List<OverlayAnimateCSSAnimationType> RandomInAnimations = new List<OverlayAnimateCSSAnimationType>()
{
OverlayAnimateCSSAnimationType.BackInDown,
OverlayAnimateCSSAnimationType.BackInLeft,
OverlayAnimateCSSAnimationType.BackInRight,
OverlayAnimateCSSAnimationType.BackInUp,

OverlayAnimateCSSAnimationType.BounceIn,
OverlayAnimateCSSAnimationType.BounceInDown,
OverlayAnimateCSSAnimationType.BounceInLeft,
OverlayAnimateCSSAnimationType.BounceInRight,
OverlayAnimateCSSAnimationType.BounceInUp,

OverlayAnimateCSSAnimationType.FadeIn,
OverlayAnimateCSSAnimationType.FadeInDown,
OverlayAnimateCSSAnimationType.FadeInDownBig,
OverlayAnimateCSSAnimationType.FadeInLeft,
OverlayAnimateCSSAnimationType.FadeInLeftBig,
OverlayAnimateCSSAnimationType.FadeInRight,
OverlayAnimateCSSAnimationType.FadeInRightBig,
OverlayAnimateCSSAnimationType.FadeInUp,
OverlayAnimateCSSAnimationType.FadeInUpBig,
OverlayAnimateCSSAnimationType.FadeInTopLeft,
OverlayAnimateCSSAnimationType.FadeInTopRight,
OverlayAnimateCSSAnimationType.FadeInBottomLeft,
OverlayAnimateCSSAnimationType.FadeInBottomRight,

OverlayAnimateCSSAnimationType.FlipInX,
OverlayAnimateCSSAnimationType.FlipInY,

OverlayAnimateCSSAnimationType.LightSpeedInRight,
OverlayAnimateCSSAnimationType.LightSpeedInLeft,

OverlayAnimateCSSAnimationType.RotateIn,
OverlayAnimateCSSAnimationType.RotateInDownLeft,
OverlayAnimateCSSAnimationType.RotateInDownRight,
OverlayAnimateCSSAnimationType.RotateInUpLeft,
OverlayAnimateCSSAnimationType.RotateInUpRight,

OverlayAnimateCSSAnimationType.SlideInDown,
OverlayAnimateCSSAnimationType.SlideInLeft,
OverlayAnimateCSSAnimationType.SlideInRight,
OverlayAnimateCSSAnimationType.SlideInUp,

OverlayAnimateCSSAnimationType.ZoomIn,
OverlayAnimateCSSAnimationType.ZoomInDown,
OverlayAnimateCSSAnimationType.ZoomInLeft,
OverlayAnimateCSSAnimationType.ZoomInRight,
OverlayAnimateCSSAnimationType.ZoomInUp,
};

private static readonly List<OverlayAnimateCSSAnimationType> RandomOutAnimations = new List<OverlayAnimateCSSAnimationType>()
{
OverlayAnimateCSSAnimationType.BackOutDown,
OverlayAnimateCSSAnimationType.BackOutLeft,
OverlayAnimateCSSAnimationType.BackOutRight,
OverlayAnimateCSSAnimationType.BackOutUp,

OverlayAnimateCSSAnimationType.BounceOut,
OverlayAnimateCSSAnimationType.BounceOutDown,
OverlayAnimateCSSAnimationType.BounceOutLeft,
OverlayAnimateCSSAnimationType.BounceOutRight,
OverlayAnimateCSSAnimationType.BounceOutUp,

OverlayAnimateCSSAnimationType.FadeOut,
OverlayAnimateCSSAnimationType.FadeOutDown,
OverlayAnimateCSSAnimationType.FadeOutDownBig,
OverlayAnimateCSSAnimationType.FadeOutLeft,
OverlayAnimateCSSAnimationType.FadeOutLeftBig,
OverlayAnimateCSSAnimationType.FadeOutRight,
OverlayAnimateCSSAnimationType.FadeOutRightBig,
OverlayAnimateCSSAnimationType.FadeOutUp,
OverlayAnimateCSSAnimationType.FadeOutUpBig,
OverlayAnimateCSSAnimationType.FadeOutTopLeft,
OverlayAnimateCSSAnimationType.FadeOutTopRight,
OverlayAnimateCSSAnimationType.FadeOutBottomLeft,
OverlayAnimateCSSAnimationType.FadeOutBottomRight,

OverlayAnimateCSSAnimationType.FlipOutX,
OverlayAnimateCSSAnimationType.FlipOutY,

OverlayAnimateCSSAnimationType.LightSpeedOutRight,
OverlayAnimateCSSAnimationType.LightSpeedOutLeft,

OverlayAnimateCSSAnimationType.RotateOut,
OverlayAnimateCSSAnimationType.RotateOutDownLeft,
OverlayAnimateCSSAnimationType.RotateOutDownRight,
OverlayAnimateCSSAnimationType.RotateOutUpLeft,
OverlayAnimateCSSAnimationType.RotateOutUpRight,

OverlayAnimateCSSAnimationType.SlideOutDown,
OverlayAnimateCSSAnimationType.SlideOutLeft,
OverlayAnimateCSSAnimationType.SlideOutRight,
OverlayAnimateCSSAnimationType.SlideOutUp,

OverlayAnimateCSSAnimationType.ZoomOut,
OverlayAnimateCSSAnimationType.ZoomOutDown,
OverlayAnimateCSSAnimationType.ZoomOutLeft,
OverlayAnimateCSSAnimationType.ZoomOutRight,
OverlayAnimateCSSAnimationType.ZoomOutUp,
};

private static readonly List<OverlayAnimateCSSAnimationType> RandomVisibleAnimations = new List<OverlayAnimateCSSAnimationType>()
{
OverlayAnimateCSSAnimationType.Bounce,
OverlayAnimateCSSAnimationType.Flash,
OverlayAnimateCSSAnimationType.Pulse,
OverlayAnimateCSSAnimationType.RubberBand,
OverlayAnimateCSSAnimationType.ShakeX,
OverlayAnimateCSSAnimationType.ShakeY,
OverlayAnimateCSSAnimationType.HeadShake,
OverlayAnimateCSSAnimationType.Swing,
OverlayAnimateCSSAnimationType.Tada,
OverlayAnimateCSSAnimationType.Wobble,
OverlayAnimateCSSAnimationType.Jello,
OverlayAnimateCSSAnimationType.HeartBeat,
OverlayAnimateCSSAnimationType.Flip,
OverlayAnimateCSSAnimationType.Hinge,
OverlayAnimateCSSAnimationType.JackInTheBox,
OverlayAnimateCSSAnimationType.RollIn,
OverlayAnimateCSSAnimationType.RollOut,
};

[DataMember]
public double StartTime { get; set; }

Expand All @@ -151,8 +279,23 @@ public string AnimateCSSAnimationName
HashSet<OverlayAnimateCSSAnimationType> values = new HashSet<OverlayAnimateCSSAnimationType>(EnumHelper.GetEnumList<OverlayAnimateCSSAnimationType>().ToList());
values.Remove(OverlayAnimateCSSAnimationType.None);
values.Remove(OverlayAnimateCSSAnimationType.Random);
values.Remove(OverlayAnimateCSSAnimationType.RandomIn);
values.Remove(OverlayAnimateCSSAnimationType.RandomOut);
values.Remove(OverlayAnimateCSSAnimationType.RandomVisible);
animation = values.Random();
}
else if (animation == OverlayAnimateCSSAnimationType.RandomIn)
{
animation = RandomInAnimations.Random();
}
else if (animation == OverlayAnimateCSSAnimationType.RandomOut)
{
animation = RandomOutAnimations.Random();
}
else if (animation == OverlayAnimateCSSAnimationType.RandomVisible)
{
animation = RandomVisibleAnimations.Random();
}

string animationName = animation.ToString();
return Char.ToLowerInvariant(animationName[0]) + animationName.Substring(1);
Expand Down
27 changes: 27 additions & 0 deletions MixItUp.Base/Resources.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 9 additions & 0 deletions MixItUp.Base/Resources.resx
Original file line number Diff line number Diff line change
Expand Up @@ -10769,4 +10769,13 @@ We have detected that you have more than 1 Overlay Endpoint created, meaning the
<data name="AlwaysUseCommandLocksWhenTestingCommands" xml:space="preserve">
<value>Always Use Command Locks When Testing Commands</value>
</data>
<data name="RandomIn" xml:space="preserve">
<value>Random In</value>
</data>
<data name="RandomOut" xml:space="preserve">
<value>Random Out</value>
</data>
<data name="RandomVisible" xml:space="preserve">
<value>Random Visible</value>
</data>
</root>

0 comments on commit bc1d3a4

Please sign in to comment.