Compare commits
41 Commits
3d9a474aae
...
v2.0.0.5
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
7da6549bf9 | ||
|
|
2e6c1534b1 | ||
|
|
0a301564ac | ||
|
|
85e69a0b34 | ||
|
|
5adaf202ae | ||
|
|
99ac46a384 | ||
|
|
3a2750388b | ||
|
|
33e89ec16b | ||
|
|
9adbe92e7c | ||
|
|
103d63f1b1 | ||
|
|
49bad2e880 | ||
|
|
04616c2ac4 | ||
|
|
3b73dd1728 | ||
|
|
d5df90a6ae | ||
|
|
494e475f42 | ||
|
|
4703ba48ed | ||
|
|
93d5686b77 | ||
|
|
71d07aa0f3 | ||
|
|
c43f031617 | ||
|
|
89ce903e8a | ||
|
|
cbf5d73629 | ||
|
|
8be17dae74 | ||
|
|
76006dc162 | ||
|
|
492acb4052 | ||
|
|
68dc9efa4d | ||
|
|
7b15ed46c1 | ||
|
|
8019ba760f | ||
|
|
9d1a268875 | ||
|
|
9e5feafd64 | ||
|
|
5283a69bb8 | ||
|
|
a4b2d2edd5 | ||
|
|
d0634e4487 | ||
|
|
79c4f988f2 | ||
|
|
cee1fa6736 | ||
|
|
8510674d58 | ||
|
|
5ee724201b | ||
|
|
b85c038df0 | ||
|
|
3d4e04ab0f | ||
|
|
b1d1ce79e6 | ||
|
|
0b7b506b8d | ||
|
|
f3ea84cc80 |
@@ -18,40 +18,40 @@ public class PluginConfiguration : BasePluginConfiguration
|
|||||||
EnableClientSideToggle = true;
|
EnableClientSideToggle = true;
|
||||||
|
|
||||||
Autumn = new AutumnOptions();
|
Autumn = new AutumnOptions();
|
||||||
Snowflakes = new SnowflakesOptions();
|
Birthday = new BirthdayOptions();
|
||||||
Snowfall = new SnowfallOptions();
|
Carnival = new CarnivalOptions();
|
||||||
Snowstorm = new SnowstormOptions();
|
CherryBlossom = new CherryBlossomOptions();
|
||||||
|
Christmas = new ChristmasOptions();
|
||||||
|
EarthDay = new EarthDayOptions();
|
||||||
|
Easter = new EasterOptions();
|
||||||
|
Eid = new EidOptions();
|
||||||
|
Eurovision = new EurovisionOptions();
|
||||||
|
FilmNoir = new FilmNoirOptions();
|
||||||
Fireworks = new FireworksOptions();
|
Fireworks = new FireworksOptions();
|
||||||
|
Friday13 = new Friday13Options();
|
||||||
|
Frost = new FrostOptions();
|
||||||
Halloween = new HalloweenOptions();
|
Halloween = new HalloweenOptions();
|
||||||
Hearts = new HeartsOptions();
|
Hearts = new HeartsOptions();
|
||||||
Christmas = new ChristmasOptions();
|
|
||||||
Santa = new SantaOptions();
|
|
||||||
Easter = new EasterOptions();
|
|
||||||
Resurrection = new ResurrectionOptions();
|
|
||||||
Spring = new SpringOptions();
|
|
||||||
Summer = new SummerOptions();
|
|
||||||
CherryBlossom = new CherryBlossomOptions();
|
|
||||||
Carnival = new CarnivalOptions();
|
|
||||||
Matrix = new MatrixOptions();
|
|
||||||
Eurovision = new EurovisionOptions();
|
|
||||||
Storm = new StormOptions();
|
|
||||||
Pride = new PrideOptions();
|
|
||||||
EarthDay = new EarthDayOptions();
|
|
||||||
Rain = new RainOptions();
|
|
||||||
Frost = new FrostOptions();
|
|
||||||
FilmNoir = new FilmNoirOptions();
|
|
||||||
Oscar = new OscarOptions();
|
|
||||||
MarioDay = new MarioDayOptions();
|
MarioDay = new MarioDayOptions();
|
||||||
StarWars = new StarWarsOptions();
|
Matrix = new MatrixOptions();
|
||||||
Oktoberfest = new OktoberfestOptions();
|
Oktoberfest = new OktoberfestOptions();
|
||||||
Friday13 = new Friday13Options();
|
Olympia = new OlympiaOptions();
|
||||||
Eid = new EidOptions();
|
Oscar = new OscarOptions();
|
||||||
|
Rain = new RainOptions();
|
||||||
|
Pride = new PrideOptions();
|
||||||
|
Resurrection = new ResurrectionOptions();
|
||||||
|
Santa = new SantaOptions();
|
||||||
|
Snowfall = new SnowfallOptions();
|
||||||
|
Snowflakes = new SnowflakesOptions();
|
||||||
|
Snowstorm = new SnowstormOptions();
|
||||||
|
Space = new SpaceOptions();
|
||||||
Spooky = new SpookyOptions();
|
Spooky = new SpookyOptions();
|
||||||
Sports = new SportsOptions();
|
Sports = new SportsOptions();
|
||||||
Olympia = new OlympiaOptions();
|
Spring = new SpringOptions();
|
||||||
Space = new SpaceOptions();
|
StarWars = new StarWarsOptions();
|
||||||
|
Storm = new StormOptions();
|
||||||
|
Summer = new SummerOptions();
|
||||||
Underwater = new UnderwaterOptions();
|
Underwater = new UnderwaterOptions();
|
||||||
Birthday = new BirthdayOptions();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@@ -83,296 +83,245 @@ public class PluginConfiguration : BasePluginConfiguration
|
|||||||
/// Gets or sets the Seasonals options.
|
/// Gets or sets the Seasonals options.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public AutumnOptions Autumn { get; set; }
|
public AutumnOptions Autumn { get; set; }
|
||||||
public SnowflakesOptions Snowflakes { get; set; }
|
public BirthdayOptions Birthday { get; set; }
|
||||||
public SnowfallOptions Snowfall { get; set; }
|
public CarnivalOptions Carnival { get; set; }
|
||||||
public SnowstormOptions Snowstorm { get; set; }
|
public CherryBlossomOptions CherryBlossom { get; set; }
|
||||||
|
public ChristmasOptions Christmas { get; set; }
|
||||||
|
public EarthDayOptions EarthDay { get; set; }
|
||||||
|
public EasterOptions Easter { get; set; }
|
||||||
|
public EidOptions Eid { get; set; }
|
||||||
|
public EurovisionOptions Eurovision { get; set; }
|
||||||
|
public FilmNoirOptions FilmNoir { get; set; }
|
||||||
public FireworksOptions Fireworks { get; set; }
|
public FireworksOptions Fireworks { get; set; }
|
||||||
|
public Friday13Options Friday13 { get; set; }
|
||||||
|
public FrostOptions Frost { get; set; }
|
||||||
public HalloweenOptions Halloween { get; set; }
|
public HalloweenOptions Halloween { get; set; }
|
||||||
public HeartsOptions Hearts { get; set; }
|
public HeartsOptions Hearts { get; set; }
|
||||||
public ChristmasOptions Christmas { get; set; }
|
|
||||||
public SantaOptions Santa { get; set; }
|
|
||||||
public EasterOptions Easter { get; set; }
|
|
||||||
public ResurrectionOptions Resurrection { get; set; }
|
|
||||||
public SpringOptions Spring { get; set; }
|
|
||||||
public SummerOptions Summer { get; set; }
|
|
||||||
public CherryBlossomOptions CherryBlossom { get; set; }
|
|
||||||
public CarnivalOptions Carnival { get; set; }
|
|
||||||
public MatrixOptions Matrix { get; set; }
|
|
||||||
public EurovisionOptions Eurovision { get; set; }
|
|
||||||
public StormOptions Storm { get; set; }
|
|
||||||
public PrideOptions Pride { get; set; }
|
|
||||||
public EarthDayOptions EarthDay { get; set; }
|
|
||||||
public RainOptions Rain { get; set; }
|
|
||||||
public FrostOptions Frost { get; set; }
|
|
||||||
public FilmNoirOptions FilmNoir { get; set; }
|
|
||||||
public OscarOptions Oscar { get; set; }
|
|
||||||
public MarioDayOptions MarioDay { get; set; }
|
public MarioDayOptions MarioDay { get; set; }
|
||||||
public StarWarsOptions StarWars { get; set; }
|
public MatrixOptions Matrix { get; set; }
|
||||||
public OktoberfestOptions Oktoberfest { get; set; }
|
public OktoberfestOptions Oktoberfest { get; set; }
|
||||||
public Friday13Options Friday13 { get; set; }
|
public OlympiaOptions Olympia { get; set; }
|
||||||
public EidOptions Eid { get; set; }
|
public OscarOptions Oscar { get; set; }
|
||||||
|
public PrideOptions Pride { get; set; }
|
||||||
|
public RainOptions Rain { get; set; }
|
||||||
|
public ResurrectionOptions Resurrection { get; set; }
|
||||||
|
public SantaOptions Santa { get; set; }
|
||||||
|
public SnowfallOptions Snowfall { get; set; }
|
||||||
|
public SnowflakesOptions Snowflakes { get; set; }
|
||||||
|
public SnowstormOptions Snowstorm { get; set; }
|
||||||
|
public SpaceOptions Space { get; set; }
|
||||||
public SpookyOptions Spooky { get; set; }
|
public SpookyOptions Spooky { get; set; }
|
||||||
public SportsOptions Sports { get; set; }
|
public SportsOptions Sports { get; set; }
|
||||||
public OlympiaOptions Olympia { get; set; }
|
public SpringOptions Spring { get; set; }
|
||||||
public SpaceOptions Space { get; set; }
|
public StarWarsOptions StarWars { get; set; }
|
||||||
|
public StormOptions Storm { get; set; }
|
||||||
|
public SummerOptions Summer { get; set; }
|
||||||
public UnderwaterOptions Underwater { get; set; }
|
public UnderwaterOptions Underwater { get; set; }
|
||||||
public BirthdayOptions Birthday { get; set; }
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public class AutumnOptions
|
public class AutumnOptions {
|
||||||
{
|
|
||||||
public int LeafCount { get; set; } = 25;
|
|
||||||
public bool EnableAutumn { get; set; } = true;
|
public bool EnableAutumn { get; set; } = true;
|
||||||
public bool EnableRandomLeaves { get; set; } = true;
|
public int LeafCount { get; set; } = 35;
|
||||||
public bool EnableRandomLeavesMobile { get; set; } = false;
|
public int LeafCountMobile { get; set; } = 10;
|
||||||
public bool EnableDifferentDuration { get; set; } = true;
|
public bool EnableDifferentDuration { get; set; } = true;
|
||||||
public bool EnableRotation { get; set; } = false;
|
public bool EnableRotation { get; set; } = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
public class SnowflakesOptions
|
public class BirthdayOptions {
|
||||||
{
|
public bool EnableBirthday { get; set; } = true;
|
||||||
public int SnowflakeCount { get; set; } = 25;
|
public int SymbolCount { get; set; } = 12;
|
||||||
public bool EnableSnowflakes { get; set; } = true;
|
public int SymbolCountMobile { get; set; } = 5;
|
||||||
public bool EnableRandomSnowflakes { get; set; } = true;
|
public bool EnableDifferentDuration { get; set; } = true;
|
||||||
public bool EnableRandomSnowflakesMobile { get; set; } = false;
|
public int ConfettiCount { get; set; } = 60;
|
||||||
public bool EnableColoredSnowflakes { get; set; } = true;
|
}
|
||||||
|
|
||||||
|
public class CarnivalOptions {
|
||||||
|
public bool EnableCarnival { get; set; } = true;
|
||||||
|
public bool EnableDifferentDuration { get; set; } = true;
|
||||||
|
public bool EnableCarnivalSway { get; set; } = true;
|
||||||
|
public int ObjectCount { get; set; } = 120;
|
||||||
|
public int ObjectCountMobile { get; set; } = 60;
|
||||||
|
}
|
||||||
|
|
||||||
|
public class CherryBlossomOptions {
|
||||||
|
public bool EnableCherryBlossom { get; set; } = true;
|
||||||
|
public int PetalCount { get; set; } = 25;
|
||||||
|
public int PetalCountMobile { get; set; } = 15;
|
||||||
public bool EnableDifferentDuration { get; set; } = true;
|
public bool EnableDifferentDuration { get; set; } = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
public class SnowfallOptions
|
public class ChristmasOptions {
|
||||||
{
|
public bool EnableChristmas { get; set; } = true;
|
||||||
public int SnowflakesCount { get; set; } = 500;
|
public int SymbolCount { get; set; } = 25;
|
||||||
public int SnowflakesCountMobile { get; set; } = 250;
|
public int SymbolCountMobile { get; set; } = 10;
|
||||||
public double Speed { get; set; } = 3;
|
public bool EnableDifferentDuration { get; set; } = true;
|
||||||
public bool EnableSnowfall { get; set; } = true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public class SnowstormOptions
|
public class EarthDayOptions {
|
||||||
{
|
public bool EnableEarthDay { get; set; } = true;
|
||||||
public int SnowflakesCount { get; set; } = 500;
|
public int VineCount { get; set; } = 4;
|
||||||
public int SnowflakesCountMobile { get; set; } = 250;
|
|
||||||
public double Speed { get; set; } = 6;
|
|
||||||
public bool EnableSnowstorm { get; set; } = true;
|
|
||||||
public double HorizontalWind { get; set; } = 4;
|
|
||||||
public double VerticalVariation { get; set; } = 2;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public class FireworksOptions
|
public class EasterOptions {
|
||||||
{
|
public bool EnableEaster { get; set; } = true;
|
||||||
public int ParticleCount { get; set; } = 50;
|
public bool EnableBunny { get; set; } = true;
|
||||||
public int LaunchInterval { get; set; } = 3200;
|
public int MinBunnyRestTime { get; set; } = 2000;
|
||||||
|
public int MaxBunnyRestTime { get; set; } = 5000;
|
||||||
|
public int EggCount { get; set; } = 15;
|
||||||
|
}
|
||||||
|
|
||||||
|
public class EidOptions {
|
||||||
|
public bool EnableEid { get; set; } = true;
|
||||||
|
public int LanternCount { get; set; } = 8;
|
||||||
|
public int LanternCountMobile { get; set; } = 3;
|
||||||
|
}
|
||||||
|
|
||||||
|
public class EurovisionOptions {
|
||||||
|
public bool EnableEurovision { get; set; } = true;
|
||||||
|
public int SymbolCount { get; set; } = 25;
|
||||||
|
public bool EnableDifferentDuration { get; set; } = true;
|
||||||
|
public bool EnableColorfulNotes { get; set; } = true;
|
||||||
|
public string EurovisionColors { get; set; } = "#ff0026ff,#17a6ffff,#32d432ff,#FFD700,#f0821bff,#f826f8ff";
|
||||||
|
public int EurovisionGlowSize { get; set; } = 2;
|
||||||
|
}
|
||||||
|
|
||||||
|
public class FilmNoirOptions {
|
||||||
|
public bool EnableFilmNoir { get; set; } = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
public class FireworksOptions {
|
||||||
public bool EnableFireworks { get; set; } = true;
|
public bool EnableFireworks { get; set; } = true;
|
||||||
public bool ScrollFireworks { get; set; } = true;
|
public bool ScrollFireworks { get; set; } = true;
|
||||||
|
public int ParticleCount { get; set; } = 50;
|
||||||
public int MinFireworks { get; set; } = 3;
|
public int MinFireworks { get; set; } = 3;
|
||||||
public int MaxFireworks { get; set; } = 6;
|
public int MaxFireworks { get; set; } = 6;
|
||||||
|
public int LaunchInterval { get; set; } = 3200;
|
||||||
}
|
}
|
||||||
|
|
||||||
public class HalloweenOptions
|
public class Friday13Options {
|
||||||
{
|
public bool EnableFriday13 { get; set; } = true;
|
||||||
public int SymbolCount { get; set; } = 25;
|
}
|
||||||
|
|
||||||
|
public class FrostOptions {
|
||||||
|
public bool EnableFrost { get; set; } = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
public class HalloweenOptions {
|
||||||
public bool EnableHalloween { get; set; } = true;
|
public bool EnableHalloween { get; set; } = true;
|
||||||
public bool EnableRandomSymbols { get; set; } = true;
|
public int SymbolCount { get; set; } = 25;
|
||||||
public bool EnableRandomSymbolsMobile { get; set; } = false;
|
public int SymbolCountMobile { get; set; } = 10;
|
||||||
public bool EnableDifferentDuration { get; set; } = true;
|
public bool EnableDifferentDuration { get; set; } = true;
|
||||||
public bool EnableSpiders { get; set; } = true;
|
public bool EnableSpiders { get; set; } = true;
|
||||||
public bool EnableMice { get; set; } = true;
|
public bool EnableMice { get; set; } = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
public class HeartsOptions
|
public class HeartsOptions {
|
||||||
{
|
|
||||||
public int SymbolCount { get; set; } = 25;
|
|
||||||
public bool EnableHearts { get; set; } = true;
|
public bool EnableHearts { get; set; } = true;
|
||||||
public bool EnableRandomSymbols { get; set; } = true;
|
|
||||||
public bool EnableRandomSymbolsMobile { get; set; } = false;
|
|
||||||
public bool EnableDifferentDuration { get; set; } = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
public class ChristmasOptions
|
|
||||||
{
|
|
||||||
public int SymbolCount { get; set; } = 25;
|
public int SymbolCount { get; set; } = 25;
|
||||||
public bool EnableChristmas { get; set; } = true;
|
public int SymbolCountMobile { get; set; } = 10;
|
||||||
public bool EnableRandomChristmas { get; set; } = true;
|
|
||||||
public bool EnableRandomChristmasMobile { get; set; } = false;
|
|
||||||
public bool EnableDifferentDuration { get; set; } = true;
|
public bool EnableDifferentDuration { get; set; } = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
public class SantaOptions
|
public class MarioDayOptions {
|
||||||
{
|
public bool EnableMarioDay { get; set; } = true;
|
||||||
|
public bool LetMarioJump { get; set; } = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
public class MatrixOptions {
|
||||||
|
public bool EnableMatrix { get; set; } = true;
|
||||||
|
public int SymbolCount { get; set; } = 25;
|
||||||
|
public bool EnableMatrixBackground { get; set; } = false;
|
||||||
|
public string MatrixChars { get; set; } = "0123456789";
|
||||||
|
}
|
||||||
|
|
||||||
|
public class OktoberfestOptions {
|
||||||
|
public bool EnableOktoberfest { get; set; } = true;
|
||||||
|
public int SymbolCount { get; set; } = 25;
|
||||||
|
public int SymbolCountMobile { get; set; } = 10;
|
||||||
|
public bool EnableDifferentDuration { get; set; } = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
public class OlympiaOptions {
|
||||||
|
public bool EnableOlympia { get; set; } = true;
|
||||||
|
public int SymbolCount { get; set; } = 25;
|
||||||
|
public int SymbolCountMobile { get; set; } = 10;
|
||||||
|
public bool EnableDifferentDuration { get; set; } = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
public class OscarOptions {
|
||||||
|
public bool EnableOscar { get; set; } = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
public class PrideOptions {
|
||||||
|
public bool EnablePride { get; set; } = true;
|
||||||
|
public int HeartCount { get; set; } = 20;
|
||||||
|
public double HeartSize { get; set; } = 1.5;
|
||||||
|
public bool ColorHeader { get; set; } = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
public class RainOptions {
|
||||||
|
public bool EnableRain { get; set; } = true;
|
||||||
|
public int RaindropCount { get; set; } = 300;
|
||||||
|
public int RaindropCountMobile { get; set; } = 150;
|
||||||
|
public double RainSpeed { get; set; } = 1.0;
|
||||||
|
}
|
||||||
|
|
||||||
|
public class ResurrectionOptions {
|
||||||
|
public bool EnableResurrection { get; set; } = true;
|
||||||
|
public int SymbolCount { get; set; } = 12;
|
||||||
|
public int SymbolCountMobile { get; set; } = 5;
|
||||||
|
public bool EnableDifferentDuration { get; set; } = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
public class SantaOptions {
|
||||||
|
public bool EnableSanta { get; set; } = true;
|
||||||
public int SnowflakesCount { get; set; } = 500;
|
public int SnowflakesCount { get; set; } = 500;
|
||||||
public int SnowflakesCountMobile { get; set; } = 250;
|
public int SnowflakesCountMobile { get; set; } = 250;
|
||||||
|
public double SnowFallSpeed { get; set; } = 3;
|
||||||
public double SantaSpeed { get; set; } = 10;
|
public double SantaSpeed { get; set; } = 10;
|
||||||
public double SantaSpeedMobile { get; set; } = 8;
|
public double SantaSpeedMobile { get; set; } = 8;
|
||||||
public bool EnableSanta { get; set; } = true;
|
|
||||||
public double SnowFallSpeed { get; set; } = 3;
|
|
||||||
public double MaxSantaRestTime { get; set; } = 8;
|
public double MaxSantaRestTime { get; set; } = 8;
|
||||||
public double MinSantaRestTime { get; set; } = 3;
|
public double MinSantaRestTime { get; set; } = 3;
|
||||||
public double MaxPresentFallSpeed { get; set; } = 5;
|
public double MaxPresentFallSpeed { get; set; } = 5;
|
||||||
public double MinPresentFallSpeed { get; set; } = 2;
|
public double MinPresentFallSpeed { get; set; } = 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
public class EasterOptions
|
public class SnowfallOptions {
|
||||||
{
|
public bool EnableSnowfall { get; set; } = true;
|
||||||
public int EggCount { get; set; } = 20;
|
public int SnowflakesCount { get; set; } = 500;
|
||||||
public bool EnableEaster { get; set; } = true;
|
public int SnowflakesCountMobile { get; set; } = 250;
|
||||||
public bool EnableRandomEaster { get; set; } = true;
|
public double Speed { get; set; } = 3;
|
||||||
public bool EnableRandomEasterMobile { get; set; } = false;
|
|
||||||
public bool EnableDifferentDuration { get; set; } = true;
|
|
||||||
public bool EnableBunny { get; set; } = true;
|
|
||||||
public int BunnyDuration { get; set; } = 12000;
|
|
||||||
public int HopHeight { get; set; } = 12;
|
|
||||||
public int MinBunnyRestTime { get; set; } = 2000;
|
|
||||||
public int MaxBunnyRestTime { get; set; } = 5000;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public class ResurrectionOptions
|
public class SnowflakesOptions {
|
||||||
{
|
public bool EnableSnowflakes { get; set; } = true;
|
||||||
public int SymbolCount { get; set; } = 12;
|
public int SnowflakeCount { get; set; } = 25;
|
||||||
public bool EnableResurrection { get; set; } = true;
|
public int SnowflakeCountMobile { get; set; } = 10;
|
||||||
public bool EnableRandomSymbols { get; set; } = true;
|
public bool EnableColoredSnowflakes { get; set; } = true;
|
||||||
public bool EnableRandomSymbolsMobile { get; set; } = false;
|
|
||||||
public bool EnableDifferentDuration { get; set; } = true;
|
public bool EnableDifferentDuration { get; set; } = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
public class SpringOptions
|
public class SnowstormOptions {
|
||||||
{
|
public bool EnableSnowstorm { get; set; } = true;
|
||||||
public int PollenCount { get; set; } = 30;
|
public int SnowflakesCount { get; set; } = 500;
|
||||||
public int SunbeamCount { get; set; } = 5;
|
public int SnowflakesCountMobile { get; set; } = 250;
|
||||||
public int BirdCount { get; set; } = 4;
|
public double Speed { get; set; } = 6;
|
||||||
public int ButterflyCount { get; set; } = 4;
|
public double HorizontalWind { get; set; } = 4;
|
||||||
public int BeeCount { get; set; } = 2;
|
public double VerticalVariation { get; set; } = 2;
|
||||||
public int LadybugCount { get; set; } = 2;
|
}
|
||||||
public bool EnableSpring { get; set; } = true;
|
|
||||||
public bool EnableSpringSunbeams { get; set; } = true;
|
public class SpaceOptions {
|
||||||
public bool EnableRandomSpring { get; set; } = true;
|
public bool EnableSpace { get; set; } = true;
|
||||||
public bool EnableRandomSpringMobile { get; set; } = false;
|
public int PlanetCount { get; set; } = 6;
|
||||||
|
public int AstronautCount { get; set; } = 1;
|
||||||
|
public int SatelliteCount { get; set; } = 4;
|
||||||
|
public int IssCount { get; set; } = 1;
|
||||||
|
public int RocketCount { get; set; } = 1;
|
||||||
public bool EnableDifferentDuration { get; set; } = true;
|
public bool EnableDifferentDuration { get; set; } = true;
|
||||||
|
public int SymbolCountMobile { get; set; } = 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
public class SummerOptions
|
public class SpookyOptions {
|
||||||
{
|
|
||||||
public int BubbleCount { get; set; } = 20;
|
|
||||||
public int DustCount { get; set; } = 50;
|
|
||||||
public bool EnableSummer { get; set; } = true;
|
|
||||||
public bool EnableRandomSummer { get; set; } = true;
|
|
||||||
public bool EnableRandomSummerMobile { get; set; } = false;
|
|
||||||
public bool EnableDifferentDuration { get; set; } = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
public class CarnivalOptions
|
|
||||||
{
|
|
||||||
public int ObjectCount { get; set; } = 25;
|
|
||||||
public bool EnableCarnival { get; set; } = true;
|
|
||||||
public bool EnableRandomCarnival { get; set; } = true;
|
|
||||||
public bool EnableRandomCarnivalMobile { get; set; } = false;
|
|
||||||
public bool EnableDifferentDuration { get; set; } = true;
|
|
||||||
public bool EnableCarnivalSway { get; set; } = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
public class CherryBlossomOptions
|
|
||||||
{
|
|
||||||
public int PetalCount { get; set; } = 25;
|
|
||||||
public bool EnableCherryBlossom { get; set; } = true;
|
|
||||||
public bool EnableRandomCherryBlossom { get; set; } = true;
|
|
||||||
public bool EnableRandomCherryBlossomMobile { get; set; } = false;
|
|
||||||
public bool EnableDifferentDuration { get; set; } = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
public class MatrixOptions
|
|
||||||
{
|
|
||||||
public int SymbolCount { get; set; } = 25;
|
|
||||||
public bool EnableMatrix { get; set; } = true;
|
|
||||||
public bool EnableRandomMatrix { get; set; } = true;
|
|
||||||
public bool EnableRandomMatrixMobile { get; set; } = false;
|
|
||||||
public bool EnableDifferentDuration { get; set; } = true;
|
|
||||||
public bool EnableMatrixBackground { get; set; } = false;
|
|
||||||
public string MatrixChars { get; set; } = "0123456789";
|
|
||||||
}
|
|
||||||
|
|
||||||
public class EurovisionOptions
|
|
||||||
{
|
|
||||||
public int SymbolCount { get; set; } = 25;
|
|
||||||
public bool EnableEurovision { get; set; } = true;
|
|
||||||
public bool EnableRandomEurovision { get; set; } = true;
|
|
||||||
public bool EnableRandomEurovisionMobile { get; set; } = false;
|
|
||||||
public bool EnableDifferentDuration { get; set; } = true;
|
|
||||||
public bool EnableColorfulNotes { get; set; } = true;
|
|
||||||
public string EurovisionColors { get; set; } = "#ff0026ff,#17a6ffff,#32d432ff,#FFD700,#f0821bff,#f826f8ff";
|
|
||||||
public int EurovisionGlowSize { get; set; } = 8;
|
|
||||||
}
|
|
||||||
|
|
||||||
public class StormOptions
|
|
||||||
{
|
|
||||||
public int RaindropCount { get; set; } = 300;
|
|
||||||
public int RaindropCountMobile { get; set; } = 150;
|
|
||||||
public bool EnableStorm { get; set; } = true;
|
|
||||||
public bool EnableLightning { get; set; } = true;
|
|
||||||
public double RainSpeed { get; set; } = 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
public class PrideOptions
|
|
||||||
{
|
|
||||||
public bool EnablePride { get; set; } = true;
|
|
||||||
public int HeartCount { get; set; } = 20;
|
|
||||||
public int HeartSize { get; set; } = 2;
|
|
||||||
public bool ColorHeader { get; set; } = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
public class EarthDayOptions
|
|
||||||
{
|
|
||||||
public bool EnableEarthDay { get; set; } = true;
|
|
||||||
public int VineCount { get; set; } = 4;
|
|
||||||
}
|
|
||||||
|
|
||||||
public class RainOptions
|
|
||||||
{
|
|
||||||
public bool EnableRain { get; set; } = true;
|
|
||||||
public int RaindropCount { get; set; } = 300;
|
|
||||||
public int RaindropCountMobile { get; set; } = 150;
|
|
||||||
public double RainSpeed { get; set; } = 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
public class FrostOptions
|
|
||||||
{
|
|
||||||
public bool EnableFrost { get; set; } = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
public class FilmNoirOptions
|
|
||||||
{
|
|
||||||
public bool EnableFilmNoir { get; set; } = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
public class OscarOptions
|
|
||||||
{
|
|
||||||
public bool EnableOscar { get; set; } = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
public class MarioDayOptions
|
|
||||||
{
|
|
||||||
public bool EnableMarioDay { get; set; } = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
public class StarWarsOptions
|
|
||||||
{
|
|
||||||
public bool EnableStarWars { get; set; } = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
public class OktoberfestOptions
|
|
||||||
{
|
|
||||||
public bool EnableOktoberfest { get; set; } = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
public class Friday13Options
|
|
||||||
{
|
|
||||||
public bool EnableFriday13 { get; set; } = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
public class EidOptions
|
|
||||||
{
|
|
||||||
public bool EnableEid { get; set; } = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
public class SpookyOptions
|
|
||||||
{
|
|
||||||
public bool EnableSpooky { get; set; } = true;
|
public bool EnableSpooky { get; set; } = true;
|
||||||
public int SymbolCount { get; set; } = 25;
|
public int SymbolCount { get; set; } = 25;
|
||||||
public bool EnableDifferentDuration { get; set; } = true;
|
public bool EnableDifferentDuration { get; set; } = true;
|
||||||
@@ -381,49 +330,54 @@ public class SpookyOptions
|
|||||||
public int SpookyGlowSize { get; set; } = 2;
|
public int SpookyGlowSize { get; set; } = 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
public class SportsOptions
|
public class SportsOptions {
|
||||||
{
|
|
||||||
public int SymbolCount { get; set; } = 5;
|
|
||||||
public bool EnableSports { get; set; } = true;
|
public bool EnableSports { get; set; } = true;
|
||||||
public bool EnableRandomSymbols { get; set; } = true;
|
public int SymbolCount { get; set; } = 5;
|
||||||
public bool EnableRandomSymbolsMobile { get; set; } = false;
|
|
||||||
public bool EnableDifferentDuration { get; set; } = true;
|
public bool EnableDifferentDuration { get; set; } = true;
|
||||||
public string TurfColor { get; set; } = "#228b22";
|
public string TurfColor { get; set; } = "#228b22";
|
||||||
public string SportsBalls { get; set; } = "football,basketball,tennis,volleyball";
|
public string SportsBalls { get; set; } = "football,basketball,tennis,volleyball";
|
||||||
public bool EnableTrophy { get; set; } = false;
|
public bool EnableTrophy { get; set; } = false;
|
||||||
|
public string ConfettiColors { get; set; } = "#000000,#FF0000,#FFCC00";
|
||||||
}
|
}
|
||||||
|
|
||||||
public class OlympiaOptions
|
public class SpringOptions {
|
||||||
{
|
public bool EnableSpring { get; set; } = true;
|
||||||
public int SymbolCount { get; set; } = 25;
|
public int PollenCount { get; set; } = 30;
|
||||||
public bool EnableOlympia { get; set; } = true;
|
public bool EnableSpringSunbeams { get; set; } = true;
|
||||||
public bool EnableRandomSymbols { get; set; } = true;
|
public int SunbeamCount { get; set; } = 5;
|
||||||
public bool EnableRandomSymbolsMobile { get; set; } = false;
|
public int BirdCount { get; set; } = 3;
|
||||||
|
public int ButterflyCount { get; set; } = 4;
|
||||||
|
public int BeeCount { get; set; } = 2;
|
||||||
|
public int LadybugCount { get; set; } = 2;
|
||||||
|
public int SymbolCountMobile { get; set; } = 2;
|
||||||
|
}
|
||||||
|
|
||||||
|
public class StarWarsOptions {
|
||||||
|
public bool EnableStarWars { get; set; } = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
public class StormOptions {
|
||||||
|
public bool EnableStorm { get; set; } = true;
|
||||||
|
public int RaindropCount { get; set; } = 300;
|
||||||
|
public int RaindropCountMobile { get; set; } = 150;
|
||||||
|
public bool EnableLightning { get; set; } = true;
|
||||||
|
public double RainSpeed { get; set; } = 1.0;
|
||||||
|
}
|
||||||
|
|
||||||
|
public class SummerOptions {
|
||||||
|
public bool EnableSummer { get; set; } = true;
|
||||||
|
public int BubbleCount { get; set; } = 30;
|
||||||
|
public int DustCount { get; set; } = 50;
|
||||||
|
public int SymbolCountMobile { get; set; } = 2;
|
||||||
public bool EnableDifferentDuration { get; set; } = true;
|
public bool EnableDifferentDuration { get; set; } = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
public class SpaceOptions
|
public class UnderwaterOptions {
|
||||||
{
|
|
||||||
public int PlanetCount { get; set; } = 12;
|
|
||||||
public int AstronautCount { get; set; } = 5;
|
|
||||||
public int SatelliteCount { get; set; } = 2;
|
|
||||||
public int IssCount { get; set; } = 1;
|
|
||||||
public int RocketCount { get; set; } = 1;
|
|
||||||
public bool EnableSpace { get; set; } = true;
|
|
||||||
public bool EnableRandomSymbols { get; set; } = true;
|
|
||||||
public bool EnableRandomSymbolsMobile { get; set; } = false;
|
|
||||||
public bool EnableDifferentDuration { get; set; } = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
public class UnderwaterOptions
|
|
||||||
{
|
|
||||||
public int SymbolCount { get; set; } = 15;
|
|
||||||
public bool EnableUnderwater { get; set; } = true;
|
public bool EnableUnderwater { get; set; } = true;
|
||||||
public bool EnableRandomSymbols { get; set; } = true;
|
public int SymbolCountMobile { get; set; } = 2;
|
||||||
public bool EnableRandomSymbolsMobile { get; set; } = false;
|
|
||||||
public bool EnableDifferentDuration { get; set; } = true;
|
public bool EnableDifferentDuration { get; set; } = true;
|
||||||
public bool EnableLightRays { get; set; } = true;
|
public bool EnableLightRays { get; set; } = true;
|
||||||
public int SeaweedCount { get; set; } = 30;
|
public int SeaweedCount { get; set; } = 50;
|
||||||
public int CrabCount { get; set; } = 2;
|
public int CrabCount { get; set; } = 2;
|
||||||
public int StarfishCount { get; set; } = 2;
|
public int StarfishCount { get; set; } = 2;
|
||||||
public int ShellCount { get; set; } = 2;
|
public int ShellCount { get; set; } = 2;
|
||||||
@@ -432,14 +386,3 @@ public class UnderwaterOptions
|
|||||||
public int JellyfishCount { get; set; } = 3;
|
public int JellyfishCount { get; set; } = 3;
|
||||||
public int TurtleCount { get; set; } = 1;
|
public int TurtleCount { get; set; } = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
public class BirthdayOptions
|
|
||||||
{
|
|
||||||
public int SymbolCount { get; set; } = 5;
|
|
||||||
public int ConfettiCount { get; set; } = 60;
|
|
||||||
public bool EnableBirthday { get; set; } = true;
|
|
||||||
public bool EnableRandomSymbols { get; set; } = true;
|
|
||||||
public bool EnableRandomSymbolsMobile { get; set; } = false;
|
|
||||||
public bool EnableDifferentDuration { get; set; } = true;
|
|
||||||
public bool EnableGarland { get; set; } = true;
|
|
||||||
}
|
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@@ -12,7 +12,7 @@
|
|||||||
<!-- <TreatWarningsAsErrors>false</TreatWarningsAsErrors> -->
|
<!-- <TreatWarningsAsErrors>false</TreatWarningsAsErrors> -->
|
||||||
<Title>Jellyfin Seasonals Plugin</Title>
|
<Title>Jellyfin Seasonals Plugin</Title>
|
||||||
<Authors>CodeDevMLH</Authors>
|
<Authors>CodeDevMLH</Authors>
|
||||||
<Version>2.0.0.1</Version>
|
<Version>2.0.0.5</Version>
|
||||||
<RepositoryUrl>https://github.com/CodeDevMLH/Jellyfin-Seasonals</RepositoryUrl>
|
<RepositoryUrl>https://github.com/CodeDevMLH/Jellyfin-Seasonals</RepositoryUrl>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
|
|||||||
@@ -21,7 +21,9 @@
|
|||||||
color: #fff;
|
color: #fff;
|
||||||
font-family: Arial, sans-serif;
|
font-family: Arial, sans-serif;
|
||||||
text-shadow: 0 0 5px #000;
|
text-shadow: 0 0 5px #000;
|
||||||
user-select: none;
|
user-select: none;
|
||||||
|
cursor: default;
|
||||||
|
animation-name: leaf-fall, leaf-shake;
|
||||||
animation-duration: 7s, 4s;
|
animation-duration: 7s, 4s;
|
||||||
animation-timing-function: linear, ease-in-out;
|
animation-timing-function: linear, ease-in-out;
|
||||||
animation-iteration-count: infinite, infinite;
|
animation-iteration-count: infinite, infinite;
|
||||||
@@ -53,87 +55,3 @@
|
|||||||
transform: translateX(80px) rotate(var(--rotate-end, 20deg));
|
transform: translateX(80px) rotate(var(--rotate-end, 20deg));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.leaf:nth-of-type(0) {
|
|
||||||
left: 0%;
|
|
||||||
animation-delay: 0s, 0s;
|
|
||||||
--rotate-start: -25deg;
|
|
||||||
--rotate-end: 22deg;
|
|
||||||
}
|
|
||||||
|
|
||||||
.leaf:nth-of-type(1) {
|
|
||||||
left: 10%;
|
|
||||||
animation-delay: 1s, 0.5s;
|
|
||||||
--rotate-start: -32deg;
|
|
||||||
--rotate-end: 35deg;
|
|
||||||
}
|
|
||||||
|
|
||||||
.leaf:nth-of-type(2) {
|
|
||||||
left: 20%;
|
|
||||||
animation-delay: 6s, 1s;
|
|
||||||
--rotate-start: -28deg;
|
|
||||||
--rotate-end: 28deg;
|
|
||||||
}
|
|
||||||
|
|
||||||
.leaf:nth-of-type(3) {
|
|
||||||
left: 30%;
|
|
||||||
animation-delay: 4s, 1.5s;
|
|
||||||
--rotate-start: -38deg;
|
|
||||||
--rotate-end: 32deg;
|
|
||||||
}
|
|
||||||
|
|
||||||
.leaf:nth-of-type(4) {
|
|
||||||
left: 40%;
|
|
||||||
animation-delay: 2s, 0.8s;
|
|
||||||
--rotate-start: -22deg;
|
|
||||||
--rotate-end: 38deg;
|
|
||||||
}
|
|
||||||
|
|
||||||
.leaf:nth-of-type(5) {
|
|
||||||
left: 50%;
|
|
||||||
animation-delay: 8s, 2s;
|
|
||||||
--rotate-start: -35deg;
|
|
||||||
--rotate-end: 25deg;
|
|
||||||
}
|
|
||||||
|
|
||||||
.leaf:nth-of-type(6) {
|
|
||||||
left: 60%;
|
|
||||||
animation-delay: 6s, 1.2s;
|
|
||||||
--rotate-start: -40deg;
|
|
||||||
--rotate-end: 40deg;
|
|
||||||
}
|
|
||||||
|
|
||||||
.leaf:nth-of-type(7) {
|
|
||||||
left: 70%;
|
|
||||||
animation-delay: 2.5s, 0.3s;
|
|
||||||
--rotate-start: -30deg;
|
|
||||||
--rotate-end: 30deg;
|
|
||||||
}
|
|
||||||
|
|
||||||
.leaf:nth-of-type(8) {
|
|
||||||
left: 80%;
|
|
||||||
animation-delay: 1s, 1.8s;
|
|
||||||
--rotate-start: -26deg;
|
|
||||||
--rotate-end: 36deg;
|
|
||||||
}
|
|
||||||
|
|
||||||
.leaf:nth-of-type(9) {
|
|
||||||
left: 90%;
|
|
||||||
animation-delay: 3s, 0.7s;
|
|
||||||
--rotate-start: -34deg;
|
|
||||||
--rotate-end: 24deg;
|
|
||||||
}
|
|
||||||
|
|
||||||
.leaf:nth-of-type(10) {
|
|
||||||
left: 25%;
|
|
||||||
animation-delay: 2s, 2.3s;
|
|
||||||
--rotate-start: -29deg;
|
|
||||||
--rotate-end: 33deg;
|
|
||||||
}
|
|
||||||
|
|
||||||
.leaf:nth-of-type(11) {
|
|
||||||
left: 65%;
|
|
||||||
animation-delay: 4s, 1.4s;
|
|
||||||
--rotate-start: -37deg;
|
|
||||||
@@ -1,11 +1,10 @@
|
|||||||
const config = window.SeasonalsPluginConfig?.Autumn || {};
|
const config = window.SeasonalsPluginConfig?.Autumn || {};
|
||||||
|
|
||||||
const leaves = config.EnableAutumn !== undefined ? config.EnableAutumn : true; // enable/disable leaves
|
const leaves = config.EnableAutumn !== undefined ? config.EnableAutumn : true; // enable/disable autumn
|
||||||
const randomLeaves = config.EnableRandomLeaves !== undefined ? config.EnableRandomLeaves : true; // enable random leaves
|
const enableDiffrentDuration = config.EnableDifferentDuration !== undefined ? config.EnableDifferentDuration : true; // enable different durations
|
||||||
const randomLeavesMobile = config.EnableRandomLeavesMobile !== undefined ? config.EnableRandomLeavesMobile : false; // enable random leaves on mobile devices (Warning: High values may affect performance)
|
const enableRotation = config.EnableRotation !== undefined ? config.EnableRotation : false; // enable/disable rotation
|
||||||
const enableDiffrentDuration = config.EnableDifferentDuration !== undefined ? config.EnableDifferentDuration : true; // enable different duration for the random leaves
|
const leafCount = config.LeafCount !== undefined ? config.LeafCount : 35; // count of random extra leaves
|
||||||
const enableRotation = config.EnableRotation !== undefined ? config.EnableRotation : false; // enable/disable leaf rotation
|
const leafCountMobile = config.LeafCountMobile !== undefined ? config.LeafCountMobile : 10; // count of random extra leaves on mobile
|
||||||
const leafCount = config.LeafCount || 25; // count of random extra leaves
|
|
||||||
|
|
||||||
const images = [
|
const images = [
|
||||||
"../Seasonals/Resources/autumn_images/acorn1.png",
|
"../Seasonals/Resources/autumn_images/acorn1.png",
|
||||||
@@ -64,11 +63,16 @@ observer.observe(document.body, {
|
|||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
function addRandomLeaves(count) {
|
function initLeaves(count) {
|
||||||
const autumnContainer = document.querySelector('.autumn-container'); // get the leave container
|
let autumnContainer = document.querySelector('.autumn-container'); // get the leave container
|
||||||
if (!autumnContainer) return; // exit if leave container is not found
|
if (!autumnContainer) {
|
||||||
|
autumnContainer = document.createElement("div");
|
||||||
|
autumnContainer.className = "autumn-container";
|
||||||
|
autumnContainer.setAttribute("aria-hidden", "true");
|
||||||
|
document.body.appendChild(autumnContainer);
|
||||||
|
}
|
||||||
|
|
||||||
console.log('Adding random leaves');
|
console.log('Adding leaves');
|
||||||
|
|
||||||
// Array of leave characters
|
// Array of leave characters
|
||||||
for (let i = 0; i < count; i++) {
|
for (let i = 0; i < count; i++) {
|
||||||
@@ -87,6 +91,8 @@ function addRandomLeaves(count) {
|
|||||||
// set random horizontal position, animation delay and size(uncomment lines to enable)
|
// set random horizontal position, animation delay and size(uncomment lines to enable)
|
||||||
const randomLeft = Math.random() * 100; // position (0% to 100%)
|
const randomLeft = Math.random() * 100; // position (0% to 100%)
|
||||||
const randomAnimationDelay = Math.random() * 12; // delay for fall (0s to 12s)
|
const randomAnimationDelay = Math.random() * 12; // delay for fall (0s to 12s)
|
||||||
|
// Display directly symbols on full screen (below) or let it build up (above)
|
||||||
|
// const randomAnimationDelay = -(Math.random() * 16); // delay for fall (-16s to 0s)
|
||||||
const randomAnimationDelay2 = -(Math.random() * 4); // delay for shake+rotate (-4s to 0s)
|
const randomAnimationDelay2 = -(Math.random() * 4); // delay for shake+rotate (-4s to 0s)
|
||||||
|
|
||||||
// apply styles
|
// apply styles
|
||||||
@@ -115,60 +121,18 @@ function addRandomLeaves(count) {
|
|||||||
// add the leave to the container
|
// add the leave to the container
|
||||||
autumnContainer.appendChild(leaveDiv);
|
autumnContainer.appendChild(leaveDiv);
|
||||||
}
|
}
|
||||||
console.log('Random leaves added');
|
console.log('Leaves added');
|
||||||
}
|
}
|
||||||
|
|
||||||
// initialize standard leaves
|
// initialize leaves
|
||||||
function initLeaves() {
|
|
||||||
const container = document.querySelector('.autumn-container') || document.createElement("div");
|
|
||||||
|
|
||||||
if (!document.querySelector('.autumn-container')) {
|
|
||||||
container.className = "autumn-container";
|
|
||||||
container.setAttribute("aria-hidden", "true");
|
|
||||||
document.body.appendChild(container);
|
|
||||||
}
|
|
||||||
|
|
||||||
for (let i = 0; i < 12; i++) {
|
|
||||||
const leafDiv = document.createElement("div");
|
|
||||||
leafDiv.className = enableRotation ? "leaf" : "leaf no-rotation";
|
|
||||||
|
|
||||||
const img = document.createElement("img");
|
|
||||||
img.src = images[Math.floor(Math.random() * images.length)];
|
|
||||||
|
|
||||||
// set random animation duration
|
|
||||||
if (enableDiffrentDuration) {
|
|
||||||
const randomAnimationDuration = Math.random() * 10 + 6; // fall duration (6s to 16s)
|
|
||||||
const randomAnimationDuration2 = Math.random() * 3 + 2; // shake+rotate duration (2s to 5s)
|
|
||||||
leafDiv.style.animationDuration = `${randomAnimationDuration}s, ${randomAnimationDuration2}s`;
|
|
||||||
}
|
|
||||||
|
|
||||||
// set random rotation angles for standard leaves too (only if rotation is enabled)
|
|
||||||
if (enableRotation) {
|
|
||||||
const randomRotateStart = -(Math.random() * 40 + 20); // -20deg to -60deg
|
|
||||||
const randomRotateEnd = Math.random() * 40 + 20; // 20deg to 60deg
|
|
||||||
leafDiv.style.setProperty('--rotate-start', `${randomRotateStart}deg`);
|
|
||||||
leafDiv.style.setProperty('--rotate-end', `${randomRotateEnd}deg`);
|
|
||||||
} else {
|
|
||||||
// No rotation - set to 0 degrees
|
|
||||||
leafDiv.style.setProperty('--rotate-start', '0deg');
|
|
||||||
leafDiv.style.setProperty('--rotate-end', '0deg');
|
|
||||||
}
|
|
||||||
|
|
||||||
leafDiv.appendChild(img);
|
|
||||||
container.appendChild(leafDiv);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// initialize leaves and add random leaves
|
|
||||||
function initializeLeaves() {
|
function initializeLeaves() {
|
||||||
if (!leaves) return; // exit if leaves are disabled
|
if (!leaves) return; // exit if leaves are disabled
|
||||||
initLeaves();
|
|
||||||
toggleAutumn();
|
|
||||||
|
|
||||||
const screenWidth = window.innerWidth; // get the screen width to detect mobile devices
|
const isMobile = window.matchMedia("only screen and (max-width: 768px)").matches;
|
||||||
if (randomLeaves && (screenWidth > 768 || randomLeavesMobile)) { // add random leaves only on larger screens, unless enabled for mobile devices
|
const count = !isMobile ? leafCount : leafCountMobile;
|
||||||
addRandomLeaves(leafCount);
|
|
||||||
}
|
initLeaves(count);
|
||||||
|
toggleAutumn();
|
||||||
}
|
}
|
||||||
|
|
||||||
initializeLeaves();
|
initializeLeaves();
|
||||||
@@ -1,12 +1,15 @@
|
|||||||
const config = window.SeasonalsPluginConfig?.Birthday || {};
|
const config = window.SeasonalsPluginConfig?.Birthday || {};
|
||||||
|
|
||||||
const birthday = config.EnableBirthday !== undefined ? config.EnableBirthday : true;
|
const birthday = config.EnableBirthday !== undefined ? config.EnableBirthday : true; // enable/disable birthday symbols
|
||||||
const symbolCount = config.SymbolCount || 5;
|
const symbolCount = config.SymbolCount !== undefined ? config.SymbolCount : 15; // count of balloons
|
||||||
const useRandomSymbols = config.EnableRandomSymbols !== undefined ? config.EnableRandomSymbols : true;
|
const enableDifferentDuration = config.EnableDifferentDuration !== undefined ? config.EnableDifferentDuration : true; // enable different duration for the symbols
|
||||||
const enableRandomMobile = config.EnableRandomSymbolsMobile !== undefined ? config.EnableRandomSymbolsMobile : false;
|
const symbolCountMobile = config.SymbolCountMobile !== undefined ? config.SymbolCountMobile : 5; // count of mobile balloons
|
||||||
const enableDifferentDuration = config.EnableDifferentDuration !== undefined ? config.EnableDifferentDuration : true;
|
const baseConfettiCount = config.ConfettiCount !== undefined ? config.ConfettiCount : 60; // count of confetti
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Base ballon image: https://www.flaticon.com/de/kostenloses-icon/ballon_1512470
|
||||||
|
* modified by CodeDevMLH
|
||||||
|
*/
|
||||||
const birthdayImages = [
|
const birthdayImages = [
|
||||||
'../Seasonals/Resources/birthday_assets/balloon_blue.gif',
|
'../Seasonals/Resources/birthday_assets/balloon_blue.gif',
|
||||||
'../Seasonals/Resources/birthday_assets/balloon_green.gif',
|
'../Seasonals/Resources/birthday_assets/balloon_green.gif',
|
||||||
@@ -142,15 +145,8 @@ function createBirthday() {
|
|||||||
|
|
||||||
// Cake and Garland have been removed
|
// Cake and Garland have been removed
|
||||||
|
|
||||||
const standardCount = 15;
|
|
||||||
const totalSymbols = symbolCount + standardCount;
|
|
||||||
|
|
||||||
let isMobile = window.matchMedia("only screen and (max-width: 768px)").matches;
|
let isMobile = window.matchMedia("only screen and (max-width: 768px)").matches;
|
||||||
let finalCount = totalSymbols;
|
let finalCount = isMobile ? symbolCountMobile : symbolCount;
|
||||||
|
|
||||||
if (isMobile) {
|
|
||||||
finalCount = enableRandomMobile ? totalSymbols : standardCount;
|
|
||||||
}
|
|
||||||
|
|
||||||
const useRandomDuration = enableDifferentDuration !== false;
|
const useRandomDuration = enableDifferentDuration !== false;
|
||||||
|
|
||||||
@@ -254,8 +250,7 @@ function createBirthday() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Party Confetti
|
// Party Confetti
|
||||||
const baseConfettiCount = config.ConfettiCount !== undefined ? config.ConfettiCount : 60;
|
const confettiCount = baseConfettiCount;
|
||||||
const confettiCount = isMobile ? Math.floor(baseConfettiCount / 2) : baseConfettiCount;
|
|
||||||
const allColors = ['#e6194b', '#3cb44b', '#ffe119', '#4363d8', '#f58231', '#911eb4', '#46f0f0', '#f032e6', '#bcf60c', '#fabebe', '#008080', '#e6beff', '#9a6324', '#fffac8', '#800000', '#aaffc3', '#808000', '#ffd8b1', '#000075', '#808080', '#ffffff', '#000000'];
|
const allColors = ['#e6194b', '#3cb44b', '#ffe119', '#4363d8', '#f58231', '#911eb4', '#46f0f0', '#f032e6', '#bcf60c', '#fabebe', '#008080', '#e6beff', '#9a6324', '#fffac8', '#800000', '#aaffc3', '#808000', '#ffd8b1', '#000075', '#808080', '#ffffff', '#000000'];
|
||||||
|
|
||||||
for (let i = 0; i < confettiCount; i++) {
|
for (let i = 0; i < confettiCount; i++) {
|
||||||
|
|||||||
@@ -1,11 +1,10 @@
|
|||||||
const config = window.SeasonalsPluginConfig?.Carnival || {};
|
const config = window.SeasonalsPluginConfig?.Carnival || {};
|
||||||
|
|
||||||
const carnival = config.EnableCarnival !== undefined ? config.EnableCarnival : true; // Enable/disable carnival
|
const carnival = config.EnableCarnival !== undefined ? config.EnableCarnival : true; // enable/disable carnival
|
||||||
const randomCarnival = config.EnableRandomCarnival !== undefined ? config.EnableRandomCarnival : true; // Enable random carnival objects
|
const carnivalCount = config.ObjectCount !== undefined ? config.ObjectCount : 120; // Number of confetti pieces to spawn
|
||||||
const randomCarnivalMobile = config.EnableRandomCarnivalMobile !== undefined ? config.EnableRandomCarnivalMobile : false; // Enable random carnival objects on mobile
|
const carnivalCountMobile = config.ObjectCountMobile !== undefined ? config.ObjectCountMobile : 60; // Number of confetti pieces to spawn on mobile
|
||||||
const enableDifferentDuration = config.EnableDifferentDuration !== undefined ? config.EnableDifferentDuration : true; // Randomize falling and flutter speeds
|
const enableDifferentDuration = config.EnableDifferentDuration !== undefined ? config.EnableDifferentDuration : true; // enable different durations
|
||||||
const enableSway = config.EnableCarnivalSway !== undefined ? config.EnableCarnivalSway : true; // Enable side-to-side sway animation
|
const enableSway = config.EnableCarnivalSway !== undefined ? config.EnableCarnivalSway : true; // enable/disable carnivalsway
|
||||||
const carnivalCount = config.ObjectCount || 120; // Number of confetti pieces to spawn
|
|
||||||
|
|
||||||
const confettiColors = [
|
const confettiColors = [
|
||||||
'#fce18a', '#ff726d', '#b48def', '#f4306d',
|
'#fce18a', '#ff726d', '#b48def', '#f4306d',
|
||||||
@@ -41,7 +40,6 @@ function toggleCarnival() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// observe changes in the DOM
|
|
||||||
const observer = new MutationObserver(toggleCarnival);
|
const observer = new MutationObserver(toggleCarnival);
|
||||||
observer.observe(document.body, {
|
observer.observe(document.body, {
|
||||||
childList: true,
|
childList: true,
|
||||||
@@ -149,19 +147,8 @@ function createConfettiPiece(container, isInitial = false) {
|
|||||||
container.appendChild(wrapper);
|
container.appendChild(wrapper);
|
||||||
}
|
}
|
||||||
|
|
||||||
function addRandomCarnivalObjects(count) {
|
|
||||||
const carnivalContainer = document.querySelector('.carnival-container');
|
|
||||||
if (!carnivalContainer) return;
|
|
||||||
|
|
||||||
console.log('Adding random carnival confetti');
|
|
||||||
|
|
||||||
for (let i = 0; i < count; i++) {
|
|
||||||
createConfettiPiece(carnivalContainer, true);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// initialize standard carnival objects
|
// initialize standard carnival objects
|
||||||
function initCarnivalObjects() {
|
function initCarnivalObjects(count) {
|
||||||
let container = document.querySelector('.carnival-container');
|
let container = document.querySelector('.carnival-container');
|
||||||
if (!container) {
|
if (!container) {
|
||||||
container = document.createElement("div");
|
container = document.createElement("div");
|
||||||
@@ -171,7 +158,7 @@ function initCarnivalObjects() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Initial confetti
|
// Initial confetti
|
||||||
for (let i = 0; i < 60; i++) {
|
for (let i = 0; i < count; i++) {
|
||||||
createConfettiPiece(container, true);
|
createConfettiPiece(container, true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -179,13 +166,12 @@ function initCarnivalObjects() {
|
|||||||
// initialize carnival
|
// initialize carnival
|
||||||
function initializeCarnival() {
|
function initializeCarnival() {
|
||||||
if (!carnival) return;
|
if (!carnival) return;
|
||||||
initCarnivalObjects();
|
|
||||||
toggleCarnival();
|
|
||||||
|
|
||||||
const screenWidth = window.innerWidth;
|
const isMobile = window.matchMedia("only screen and (max-width: 768px)").matches;
|
||||||
if (randomCarnival && (screenWidth > 768 || randomCarnivalMobile)) {
|
const count = !isMobile ? carnivalCount : carnivalCountMobile;
|
||||||
addRandomCarnivalObjects(carnivalCount);
|
|
||||||
}
|
initCarnivalObjects(count);
|
||||||
|
toggleCarnival();
|
||||||
}
|
}
|
||||||
|
|
||||||
initializeCarnival();
|
initializeCarnival();
|
||||||
|
|||||||
@@ -1,10 +1,9 @@
|
|||||||
const config = window.SeasonalsPluginConfig?.CherryBlossom || {};
|
const config = window.SeasonalsPluginConfig?.CherryBlossom || {};
|
||||||
|
|
||||||
const cherryBlossom = config.EnableCherryBlossom !== undefined ? config.EnableCherryBlossom : true;
|
const cherryBlossom = config.EnableCherryBlossom !== undefined ? config.EnableCherryBlossom : true; // enable/disable cherryblossom
|
||||||
const petalCount = config.PetalCount || 25;
|
const petalCount = config.PetalCount !== undefined ? config.PetalCount : 25; // count of petal
|
||||||
const randomCherryBlossom = config.EnableRandomCherryBlossom !== undefined ? config.EnableRandomCherryBlossom : true;
|
const petalCountMobile = config.PetalCountMobile !== undefined ? config.PetalCountMobile : 10; // count of petal on mobile
|
||||||
const randomCherryBlossomMobile = config.EnableRandomCherryBlossomMobile !== undefined ? config.EnableRandomCherryBlossomMobile : false;
|
const enableDifferentDuration = config.EnableDifferentDuration !== undefined ? config.EnableDifferentDuration : true; // enable different durations
|
||||||
const enableDifferentDuration = config.EnableDifferentDuration !== undefined ? config.EnableDifferentDuration : true;
|
|
||||||
|
|
||||||
let msgPrinted = false;
|
let msgPrinted = false;
|
||||||
|
|
||||||
@@ -67,16 +66,7 @@ function createPetal(container) {
|
|||||||
container.appendChild(petal);
|
container.appendChild(petal);
|
||||||
}
|
}
|
||||||
|
|
||||||
function addRandomObjects() {
|
function initObjects(count) {
|
||||||
const container = document.querySelector('.cherryblossom-container');
|
|
||||||
if (!container) return;
|
|
||||||
|
|
||||||
for (let i = 0; i < petalCount; i++) {
|
|
||||||
createPetal(container);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
function initObjects() {
|
|
||||||
let container = document.querySelector('.cherryblossom-container');
|
let container = document.querySelector('.cherryblossom-container');
|
||||||
if (!container) {
|
if (!container) {
|
||||||
container = document.createElement("div");
|
container = document.createElement("div");
|
||||||
@@ -86,20 +76,19 @@ function initObjects() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Initial batch
|
// Initial batch
|
||||||
for (let i = 0; i < 15; i++) {
|
for (let i = 0; i < count; i++) {
|
||||||
createPetal(container);
|
createPetal(container);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function initializeCherryBlossom() {
|
function initializeCherryBlossom() {
|
||||||
if (!cherryBlossom) return;
|
if (!cherryBlossom) return;
|
||||||
initObjects();
|
|
||||||
toggleCherryBlossom();
|
|
||||||
|
|
||||||
const screenWidth = window.innerWidth;
|
const isMobile = window.matchMedia("only screen and (max-width: 768px)").matches;
|
||||||
if (randomCherryBlossom && (screenWidth > 768 || randomCherryBlossomMobile)) {
|
const count = !isMobile ? petalCount : petalCountMobile;
|
||||||
addRandomObjects();
|
|
||||||
}
|
initObjects(count);
|
||||||
|
toggleCherryBlossom();
|
||||||
}
|
}
|
||||||
|
|
||||||
initializeCherryBlossom();
|
initializeCherryBlossom();
|
||||||
|
|||||||
@@ -22,7 +22,8 @@
|
|||||||
font-family: Arial, sans-serif;
|
font-family: Arial, sans-serif;
|
||||||
text-shadow: 0 0 5px #000;
|
text-shadow: 0 0 5px #000;
|
||||||
user-select: none;
|
user-select: none;
|
||||||
cursor: default;
|
cursor: default;
|
||||||
|
animation-name: christmas-fall, christmas-shake;
|
||||||
animation-duration: 10s, 3s;
|
animation-duration: 10s, 3s;
|
||||||
animation-timing-function: linear, ease-in-out;
|
animation-timing-function: linear, ease-in-out;
|
||||||
animation-iteration-count: infinite, infinite;
|
animation-iteration-count: infinite, infinite;
|
||||||
@@ -50,63 +51,3 @@
|
|||||||
transform: translateX(80px);
|
transform: translateX(80px);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
.christmas:nth-of-type(0) {
|
|
||||||
left: 0%;
|
|
||||||
animation-delay: 0s, 0s;
|
|
||||||
}
|
|
||||||
|
|
||||||
.christmas:nth-of-type(1) {
|
|
||||||
left: 10%;
|
|
||||||
animation-delay: 1s, 1s;
|
|
||||||
}
|
|
||||||
|
|
||||||
.christmas:nth-of-type(2) {
|
|
||||||
left: 20%;
|
|
||||||
animation-delay: 6s, 0.5s;
|
|
||||||
}
|
|
||||||
|
|
||||||
.christmas:nth-of-type(3) {
|
|
||||||
left: 30%;
|
|
||||||
animation-delay: 4s, 2s;
|
|
||||||
}
|
|
||||||
|
|
||||||
.christmas:nth-of-type(4) {
|
|
||||||
left: 40%;
|
|
||||||
animation-delay: 2s, 2s;
|
|
||||||
}
|
|
||||||
|
|
||||||
.christmas:nth-of-type(5) {
|
|
||||||
left: 50%;
|
|
||||||
animation-delay: 8s, 3s;
|
|
||||||
}
|
|
||||||
|
|
||||||
.christmas:nth-of-type(6) {
|
|
||||||
left: 60%;
|
|
||||||
animation-delay: 6s, 2s;
|
|
||||||
}
|
|
||||||
|
|
||||||
.christmas:nth-of-type(7) {
|
|
||||||
left: 70%;
|
|
||||||
animation-delay: 2.5s, 1s;
|
|
||||||
}
|
|
||||||
|
|
||||||
.christmas:nth-of-type(8) {
|
|
||||||
left: 80%;
|
|
||||||
animation-delay: 1s, 0s;
|
|
||||||
}
|
|
||||||
|
|
||||||
.christmas:nth-of-type(9) {
|
|
||||||
left: 90%;
|
|
||||||
animation-delay: 3s, 1.5s;
|
|
||||||
}
|
|
||||||
|
|
||||||
.christmas:nth-of-type(10) {
|
|
||||||
left: 25%;
|
|
||||||
animation-delay: 2s, 0s;
|
|
||||||
}
|
|
||||||
|
|
||||||
.christmas:nth-of-type(11) {
|
|
||||||
left: 65%;
|
|
||||||
animation-delay: 4s, 2.5s;
|
|
||||||
@@ -1,10 +1,9 @@
|
|||||||
const config = window.SeasonalsPluginConfig?.Christmas || {};
|
const config = window.SeasonalsPluginConfig?.Christmas || {};
|
||||||
|
|
||||||
const christmas = config.EnableChristmas !== undefined ? config.EnableChristmas : true; // enable/disable christmas
|
const christmas = config.EnableChristmas !== undefined ? config.EnableChristmas : true; // enable/disable christmas
|
||||||
const randomChristmas = config.EnableRandomChristmas !== undefined ? config.EnableRandomChristmas : true; // enable random Christmas
|
const enableDiffrentDuration = config.EnableDifferentDuration !== undefined ? config.EnableDifferentDuration : true; // enable different durations
|
||||||
const randomChristmasMobile = config.EnableRandomChristmasMobile !== undefined ? config.EnableRandomChristmasMobile : false; // enable random Christmas on mobile devices (Warning: High values may affect performance)
|
const christmasCount = config.SymbolCount !== undefined ? config.SymbolCount : 25; // count of symbol
|
||||||
const enableDiffrentDuration = config.EnableDifferentDuration !== undefined ? config.EnableDifferentDuration : true; // enable different duration for the random Christmas symbols
|
const christmasCountMobile = config.SymbolCountMobile !== undefined ? config.SymbolCountMobile : 10; // count of symbol on mobile
|
||||||
const christmasCount = config.SymbolCount || 25; // count of random extra christmas
|
|
||||||
|
|
||||||
// Array of christmas characters
|
// Array of christmas characters
|
||||||
const christmasSymbols = ['❆', '🎁', '❄️', '🎁', '🎅', '🎊', '🎁', '🎉'];
|
const christmasSymbols = ['❆', '🎁', '❄️', '🎁', '🎅', '🎊', '🎁', '🎉'];
|
||||||
@@ -45,11 +44,16 @@ observer.observe(document.body, {
|
|||||||
attributes: true
|
attributes: true
|
||||||
});
|
});
|
||||||
|
|
||||||
function addRandomChristmas(count) {
|
function initChristmas(count) {
|
||||||
const christmasContainer = document.querySelector('.christmas-container'); // get the christmas container
|
let christmasContainer = document.querySelector('.christmas-container'); // get the christmas container
|
||||||
if (!christmasContainer) return; // exit if christmas container is not found
|
if (!christmasContainer) {
|
||||||
|
christmasContainer = document.createElement("div");
|
||||||
|
christmasContainer.className = "christmas-container";
|
||||||
|
christmasContainer.setAttribute("aria-hidden", "true");
|
||||||
|
document.body.appendChild(christmasContainer);
|
||||||
|
}
|
||||||
|
|
||||||
console.log('Adding random christmas');
|
console.log('Adding christmas');
|
||||||
|
|
||||||
for (let i = 0; i < count; i++) {
|
for (let i = 0; i < count; i++) {
|
||||||
// create a new christmas element
|
// create a new christmas element
|
||||||
@@ -61,8 +65,8 @@ function addRandomChristmas(count) {
|
|||||||
|
|
||||||
// set random horizontal position, animation delay and size(uncomment lines to enable)
|
// set random horizontal position, animation delay and size(uncomment lines to enable)
|
||||||
const randomLeft = Math.random() * 100; // position (0% to 100%)
|
const randomLeft = Math.random() * 100; // position (0% to 100%)
|
||||||
const randomAnimationDelay = Math.random() * 12 + 8; // delay (8s to 12s)
|
const randomAnimationDelay = -(Math.random() * 16); // delay (-16s to 0s)
|
||||||
const randomAnimationDelay2 = Math.random() * 5 + 3; // delay (0s to 5s)
|
const randomAnimationDelay2 = -(Math.random() * 5); // delay (-5s to 0s)
|
||||||
|
|
||||||
// apply styles
|
// apply styles
|
||||||
christmasDiv.style.left = `${randomLeft}%`;
|
christmasDiv.style.left = `${randomLeft}%`;
|
||||||
@@ -78,46 +82,18 @@ function addRandomChristmas(count) {
|
|||||||
// add the christmas to the container
|
// add the christmas to the container
|
||||||
christmasContainer.appendChild(christmasDiv);
|
christmasContainer.appendChild(christmasDiv);
|
||||||
}
|
}
|
||||||
console.log('Random christmas added');
|
console.log('Christmas added');
|
||||||
}
|
}
|
||||||
|
|
||||||
// initialize standard christmas
|
// initialize christmas
|
||||||
function initChristmas() {
|
|
||||||
const christmasContainer = document.querySelector('.christmas-container') || document.createElement("div");
|
|
||||||
|
|
||||||
if (!document.querySelector('.christmas-container')) {
|
|
||||||
christmasContainer.className = "christmas-container";
|
|
||||||
christmasContainer.setAttribute("aria-hidden", "true");
|
|
||||||
document.body.appendChild(christmasContainer);
|
|
||||||
}
|
|
||||||
|
|
||||||
// create the 12 standard christmas
|
|
||||||
for (let i = 0; i < 12; i++) {
|
|
||||||
const christmasDiv = document.createElement('div');
|
|
||||||
christmasDiv.className = 'christmas';
|
|
||||||
christmasDiv.textContent = christmasSymbols[Math.floor(Math.random() * christmasSymbols.length)];
|
|
||||||
|
|
||||||
// set random animation duration
|
|
||||||
if (enableDiffrentDuration) {
|
|
||||||
const randomAnimationDuration = Math.random() * 10 + 6; // delay (6s to 10s)
|
|
||||||
const randomAnimationDuration2 = Math.random() * 5 + 2; // delay (2s to 5s)
|
|
||||||
christmasDiv.style.animationDuration = `${randomAnimationDuration}s, ${randomAnimationDuration2}s`;
|
|
||||||
}
|
|
||||||
|
|
||||||
christmasContainer.appendChild(christmasDiv);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// initialize christmas and add random christmas symbols
|
|
||||||
function initializeChristmas() {
|
function initializeChristmas() {
|
||||||
if (!christmas) return; // exit if christmas is disabled
|
if (!christmas) return; // exit if christmas is disabled
|
||||||
initChristmas();
|
|
||||||
toggleChristmas();
|
|
||||||
|
|
||||||
const screenWidth = window.innerWidth; // get the screen width to detect mobile devices
|
const isMobile = window.matchMedia("only screen and (max-width: 768px)").matches;
|
||||||
if (randomChristmas && (screenWidth > 768 || randomChristmasMobile)) { // add random christmas only on larger screens, unless enabled for mobile devices
|
const count = !isMobile ? christmasCount : christmasCountMobile;
|
||||||
addRandomChristmas(christmasCount);
|
|
||||||
}
|
initChristmas(count);
|
||||||
|
toggleChristmas();
|
||||||
}
|
}
|
||||||
|
|
||||||
initializeChristmas();
|
initializeChristmas();
|
||||||
@@ -1,7 +1,7 @@
|
|||||||
const config = window.SeasonalsPluginConfig?.EarthDay || {};
|
const config = window.SeasonalsPluginConfig?.EarthDay || {};
|
||||||
|
|
||||||
const enabled = config.EnableEarthDay !== undefined ? config.EnableEarthDay : true;
|
const enabled = config.EnableEarthDay !== undefined ? config.EnableEarthDay : true; // enable/disable earthday
|
||||||
const vineCount = config.VineCount || 4;
|
const vineCount = config.VineCount !== undefined ? config.VineCount : 4; // count of vine
|
||||||
|
|
||||||
const flowerColors = ['#FF69B4', '#FFD700', '#87CEFA', '#FF4500', '#BA55D3', '#FFA500', '#FF1493'];
|
const flowerColors = ['#FF69B4', '#FFD700', '#87CEFA', '#FF4500', '#BA55D3', '#FFA500', '#FF1493'];
|
||||||
|
|
||||||
|
|||||||
@@ -1,18 +1,19 @@
|
|||||||
const config = window.SeasonalsPluginConfig?.Easter || {};
|
const config = window.SeasonalsPluginConfig?.Easter || {};
|
||||||
|
|
||||||
const easter = config.EnableEaster !== undefined ? config.EnableEaster : true;
|
const easter = config.EnableEaster !== undefined ? config.EnableEaster : true; // enable/disable easter
|
||||||
const enableBunny = config.EnableBunny !== undefined ? config.EnableBunny : true;
|
const enableBunny = config.EnableBunny !== undefined ? config.EnableBunny : true; // enable/disable bunny
|
||||||
|
const minBunnyRestTime = config.MinBunnyRestTime !== undefined ? config.MinBunnyRestTime : 2000; // timing parameter
|
||||||
|
const maxBunnyRestTime = config.MaxBunnyRestTime !== undefined ? config.MaxBunnyRestTime : 5000; // timing parameter
|
||||||
|
const eggCount = config.EggCount !== undefined ? config.EggCount : 15; // count of egg
|
||||||
|
|
||||||
/* MARK: Bunny movement config */
|
/* MARK: Bunny movement config */
|
||||||
const jumpDistanceVw = 5; // Distance in vw the bunny covers per jump
|
const jumpDistanceVw = 5; // Distance in vw the bunny covers per jump
|
||||||
const jumpDurationMs = 770; // Time in ms the bunny spends moving during a jump
|
const jumpDurationMs = 770; // Time in ms the bunny spends moving during a jump
|
||||||
const pauseDurationMs = 116.6666; // Time in ms the bunny pauses between jumps
|
const pauseDurationMs = 116.6666; // Time in ms the bunny pauses between jumps
|
||||||
|
|
||||||
const minBunnyRestTime = config.MinBunnyRestTime || 2000;
|
|
||||||
const maxBunnyRestTime = config.MaxBunnyRestTime || 5000;
|
|
||||||
const eggCount = config.EggCount || 15;
|
|
||||||
|
|
||||||
const rabbit = "../Seasonals/Resources/easter_images/Osterhase.gif";
|
const rabbit = "../Seasonals/Resources/easter_images/Osterhase.gif";
|
||||||
|
|
||||||
|
// Credit: https://flaticon.com
|
||||||
const easterEggImages = [
|
const easterEggImages = [
|
||||||
"../Seasonals/Resources/easter_images/egg_1.png",
|
"../Seasonals/Resources/easter_images/egg_1.png",
|
||||||
"../Seasonals/Resources/easter_images/egg_2.png",
|
"../Seasonals/Resources/easter_images/egg_2.png",
|
||||||
@@ -197,7 +198,7 @@ function animateRabbit(rabbit) {
|
|||||||
|
|
||||||
rabbit.style.transition = 'none';
|
rabbit.style.transition = 'none';
|
||||||
const transformScale = startFromLeft ? 'scaleX(-1)' : '';
|
const transformScale = startFromLeft ? 'scaleX(-1)' : '';
|
||||||
// Fix bounding box center-of-gravity shift when graphic is flipped
|
// Set bounding box center-of-gravity shift when graphic is flipped
|
||||||
rabbit.style.transformOrigin = startFromLeft ? '59% 50%' : '50% 50%';
|
rabbit.style.transformOrigin = startFromLeft ? '59% 50%' : '50% 50%';
|
||||||
rabbit.style.transform = `translateX(${currentX}vw) ${transformScale}`;
|
rabbit.style.transform = `translateX(${currentX}vw) ${transformScale}`;
|
||||||
|
|
||||||
@@ -213,8 +214,6 @@ function animateRabbit(rabbit) {
|
|||||||
|
|
||||||
if (!startTime) {
|
if (!startTime) {
|
||||||
startTime = timestamp;
|
startTime = timestamp;
|
||||||
// resetting gif, appending a timestamp cache-buster forces the browser
|
|
||||||
// to reload and start the GIF strictly from the first frame.
|
|
||||||
const currSrc = rabbit.src.split('?')[0];
|
const currSrc = rabbit.src.split('?')[0];
|
||||||
rabbit.src = currSrc + '?t=' + Date.now();
|
rabbit.src = currSrc + '?t=' + Date.now();
|
||||||
}
|
}
|
||||||
@@ -236,7 +235,6 @@ function animateRabbit(rabbit) {
|
|||||||
|
|
||||||
currentX = startX + (completedLoops * jumpDistanceVw + currentLoopDistance) * direction;
|
currentX = startX + (completedLoops * jumpDistanceVw + currentLoopDistance) * direction;
|
||||||
|
|
||||||
// Update DOM without CSS transitions
|
|
||||||
rabbit.style.transform = `translateX(${currentX}vw) ${transformScale}`;
|
rabbit.style.transform = `translateX(${currentX}vw) ${transformScale}`;
|
||||||
|
|
||||||
// Check if finished crossing
|
// Check if finished crossing
|
||||||
|
|||||||
@@ -1,5 +1,7 @@
|
|||||||
const config = window.SeasonalsPluginConfig?.Eid || {};
|
const config = window.SeasonalsPluginConfig?.Eid || {};
|
||||||
const eid = config.EnableEid !== undefined ? config.EnableEid : true;
|
const eid = config.EnableEid !== undefined ? config.EnableEid : true; // enable/disable eid
|
||||||
|
const lanternCount = config.LanternCount !== undefined ? config.LanternCount : 8; // count of lantern
|
||||||
|
const lanternCountMobile = config.LanternCountMobile !== undefined ? config.LanternCountMobile : 3; // count of lantern on mobile
|
||||||
|
|
||||||
const eidSymbols = ['🌙', '⭐', '✨'];
|
const eidSymbols = ['🌙', '⭐', '✨'];
|
||||||
|
|
||||||
@@ -39,11 +41,13 @@ observer.observe(document.body, {
|
|||||||
|
|
||||||
function createEid(container) {
|
function createEid(container) {
|
||||||
const starCount = 20;
|
const starCount = 20;
|
||||||
const lanternCount = Math.floor(Math.random() * 3) + 4; // 4 to 6 lanterns
|
|
||||||
|
let isMobile = window.matchMedia("only screen and (max-width: 768px)").matches;
|
||||||
|
let activeLanternCount = isMobile ? lanternCountMobile : lanternCount;
|
||||||
|
|
||||||
// Create evenly spaced lanterns
|
// Create evenly spaced lanterns
|
||||||
const segmentWidth = 100 / lanternCount;
|
const segmentWidth = 100 / activeLanternCount;
|
||||||
for (let i = 0; i < lanternCount; i++) {
|
for (let i = 0; i < activeLanternCount; i++) {
|
||||||
const symbol = document.createElement('div');
|
const symbol = document.createElement('div');
|
||||||
symbol.className = 'eid-symbol lantern-rope';
|
symbol.className = 'eid-symbol lantern-rope';
|
||||||
|
|
||||||
|
|||||||
@@ -1,15 +1,14 @@
|
|||||||
const config = window.SeasonalsPluginConfig?.Eurovision || {};
|
const config = window.SeasonalsPluginConfig?.Eurovision || {};
|
||||||
|
|
||||||
const enabled = config.EnableEurovision !== undefined ? config.EnableEurovision : true;
|
const enabled = config.EnableEurovision !== undefined ? config.EnableEurovision : true; // enable/disable eurovision
|
||||||
const elementCount = config.SymbolCount || 25;
|
const elementCount = config.SymbolCount !== undefined ? config.SymbolCount : 25; // count of notes
|
||||||
const enableDifferentDuration = config.EnableDifferentDuration !== undefined ? config.EnableDifferentDuration : true;
|
const enableDifferentDuration = config.EnableDifferentDuration !== undefined ? config.EnableDifferentDuration : true; // enable different durations
|
||||||
const enableColorfulNotes = config.EnableColorfulNotes !== undefined ? config.EnableColorfulNotes : true;
|
const enableColorfulNotes = config.EnableColorfulNotes !== undefined ? config.EnableColorfulNotes : true; // enable/disable colorful notes
|
||||||
const eurovisionColorsStr = config.EurovisionColors || '#ff0026ff, #17a6ffff, #32d432ff, #FFD700, #f0821bff, #f826f8ff';
|
const eurovisionColorsStr = config.EurovisionColors !== undefined ? config.EurovisionColors : '#ff0026ff, #17a6ffff, #32d432ff, #FFD700, #f0821bff, #f826f8ff'; // colors to use
|
||||||
const glowSize = config.EurovisionGlowSize !== undefined ? config.EurovisionGlowSize : 2;
|
const glowSize = config.EurovisionGlowSize !== undefined ? config.EurovisionGlowSize : 2; // size of eurovision glow
|
||||||
|
|
||||||
let msgPrinted = false;
|
let msgPrinted = false;
|
||||||
|
|
||||||
// Toggle Function
|
|
||||||
function toggleEurovision() {
|
function toggleEurovision() {
|
||||||
const container = document.querySelector('.eurovision-container');
|
const container = document.querySelector('.eurovision-container');
|
||||||
if (!container) return;
|
if (!container) return;
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
const config = window.SeasonalsPluginConfig?.FilmNoir || {};
|
const config = window.SeasonalsPluginConfig?.FilmNoir || {};
|
||||||
const filmnoir = config.EnableFilmNoir !== undefined ? config.EnableFilmNoir : true;
|
const filmnoir = config.EnableFilmNoir !== undefined ? config.EnableFilmNoir : true; // enable/disable filmnoir
|
||||||
|
|
||||||
let msgPrinted = false;
|
let msgPrinted = false;
|
||||||
|
|
||||||
|
|||||||
@@ -2,10 +2,10 @@ const config = window.SeasonalsPluginConfig?.Fireworks || {};
|
|||||||
|
|
||||||
const fireworks = config.EnableFireworks !== undefined ? config.EnableFireworks : true; // enable/disable fireworks
|
const fireworks = config.EnableFireworks !== undefined ? config.EnableFireworks : true; // enable/disable fireworks
|
||||||
const scrollFireworks = config.ScrollFireworks !== undefined ? config.ScrollFireworks : true; // enable fireworks to scroll with page content
|
const scrollFireworks = config.ScrollFireworks !== undefined ? config.ScrollFireworks : true; // enable fireworks to scroll with page content
|
||||||
const particlesPerFirework = config.ParticleCount || 50; // count of particles per firework (Warning: High values may affect performance)
|
const particlesPerFirework = config.ParticleCount !== undefined ? config.ParticleCount : 50; // count of particles per firework
|
||||||
const minFireworks = config.MinFireworks || 3; // minimum number of simultaneous fireworks
|
const minFireworks = config.MinFireworks !== undefined ? config.MinFireworks : 3; // minimum number of simultaneous fireworks
|
||||||
const maxFireworks = config.MaxFireworks || 6; // maximum number of simultaneous fireworks
|
const maxFireworks = config.MaxFireworks !== undefined ? config.MaxFireworks : 6; // maximum number of simultaneous fireworks
|
||||||
const intervalOfFireworks = config.LaunchInterval || 3200; // interval for the fireworks in milliseconds
|
const intervalOfFireworks = config.LaunchInterval !== undefined ? config.LaunchInterval : 3200; // interval for the fireworks in milliseconds
|
||||||
|
|
||||||
// array of color palettes for the fireworks
|
// array of color palettes for the fireworks
|
||||||
const colorPalettes = [
|
const colorPalettes = [
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
const config = window.SeasonalsPluginConfig?.Friday13 || {};
|
const config = window.SeasonalsPluginConfig?.Friday13 || {};
|
||||||
const friday13 = config.EnableFriday13 !== undefined ? config.EnableFriday13 : true;
|
const friday13 = config.EnableFriday13 !== undefined ? config.EnableFriday13 : true; // enable/disable friday13
|
||||||
|
|
||||||
let msgPrinted = false;
|
let msgPrinted = false;
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
const config = window.SeasonalsPluginConfig?.Frost || {};
|
const config = window.SeasonalsPluginConfig?.Frost || {};
|
||||||
|
|
||||||
const frost = config.EnableFrost !== undefined ? config.EnableFrost : true;
|
const frost = config.EnableFrost !== undefined ? config.EnableFrost : true; // enable/disable frost
|
||||||
|
|
||||||
let msgPrinted = false;
|
let msgPrinted = false;
|
||||||
|
|
||||||
|
|||||||
@@ -49,66 +49,6 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.halloween:nth-of-type(0) {
|
|
||||||
left: 1%;
|
|
||||||
animation-delay: 0s, 0s;
|
|
||||||
}
|
|
||||||
|
|
||||||
.halloween:nth-of-type(1) {
|
|
||||||
left: 10%;
|
|
||||||
animation-delay: -1s, -1s;
|
|
||||||
}
|
|
||||||
|
|
||||||
.halloween:nth-of-type(2) {
|
|
||||||
left: 20%;
|
|
||||||
animation-delay: -2s, -2s;
|
|
||||||
}
|
|
||||||
|
|
||||||
.halloween:nth-of-type(3) {
|
|
||||||
left: 30%;
|
|
||||||
animation-delay: -3s, -3s;
|
|
||||||
}
|
|
||||||
|
|
||||||
.halloween:nth-of-type(4) {
|
|
||||||
left: 40%;
|
|
||||||
animation-delay: -4s, -4s;
|
|
||||||
}
|
|
||||||
|
|
||||||
.halloween:nth-of-type(5) {
|
|
||||||
left: 50%;
|
|
||||||
animation-delay: -5s, -5s;
|
|
||||||
}
|
|
||||||
|
|
||||||
.halloween:nth-of-type(6) {
|
|
||||||
left: 60%;
|
|
||||||
animation-delay: -6s, -6s;
|
|
||||||
}
|
|
||||||
|
|
||||||
.halloween:nth-of-type(7) {
|
|
||||||
left: 70%;
|
|
||||||
animation-delay: -7s, -7s;
|
|
||||||
}
|
|
||||||
|
|
||||||
.halloween:nth-of-type(8) {
|
|
||||||
left: 80%;
|
|
||||||
animation-delay: -8s, -8s;
|
|
||||||
}
|
|
||||||
|
|
||||||
.halloween:nth-of-type(9) {
|
|
||||||
left: 90%;
|
|
||||||
animation-delay: -9s, -9s;
|
|
||||||
}
|
|
||||||
|
|
||||||
.halloween:nth-of-type(10) {
|
|
||||||
left: 25%;
|
|
||||||
animation-delay: -10s, -10s;
|
|
||||||
}
|
|
||||||
|
|
||||||
.halloween:nth-of-type(11) {
|
|
||||||
left: 65%;
|
|
||||||
animation-delay: -11s, -11s;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* --- Fog Layer --- */
|
/* --- Fog Layer --- */
|
||||||
.halloween-fog-layer {
|
.halloween-fog-layer {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
|
|||||||
@@ -1,12 +1,11 @@
|
|||||||
const config = window.SeasonalsPluginConfig?.Halloween || {};
|
const config = window.SeasonalsPluginConfig?.Halloween || {};
|
||||||
|
|
||||||
const halloween = config.EnableHalloween !== undefined ? config.EnableHalloween : true; // enable/disable halloween
|
const halloween = config.EnableHalloween !== undefined ? config.EnableHalloween : true; // enable/disable halloween
|
||||||
const randomSymbols = config.EnableRandomSymbols !== undefined ? config.EnableRandomSymbols : true; // enable more random symbols
|
const enableDiffrentDuration = config.EnableDifferentDuration !== undefined ? config.EnableDifferentDuration : true; // enable different durations
|
||||||
const randomSymbolsMobile = config.EnableRandomSymbolsMobile !== undefined ? config.EnableRandomSymbolsMobile : false; // enable random symbols on mobile devices (Warning: High values may affect performance)
|
const enableSpiders = config.EnableSpiders !== undefined ? config.EnableSpiders : true; // enable/disable spiders
|
||||||
const enableDiffrentDuration = config.EnableDifferentDuration !== undefined ? config.EnableDifferentDuration : true; // enable different duration for the random halloween symbols
|
const enableMice = config.EnableMice !== undefined ? config.EnableMice : true; // enable/disable mice
|
||||||
const enableSpiders = config.EnableSpiders !== undefined ? config.EnableSpiders : true;
|
const halloweenCount = config.SymbolCount !== undefined ? config.SymbolCount : 25; // count of symbols
|
||||||
const enableMice = config.EnableMice !== undefined ? config.EnableMice : true;
|
const halloweenCountMobile = config.SymbolCountMobile !== undefined ? config.SymbolCountMobile : 10; // count of symbols on mobile
|
||||||
const halloweenCount = config.SymbolCount || 25; // count of random extra symbols
|
|
||||||
|
|
||||||
const images = [
|
const images = [
|
||||||
"../Seasonals/Resources/halloween_images/ghost_20x20.png",
|
"../Seasonals/Resources/halloween_images/ghost_20x20.png",
|
||||||
@@ -14,7 +13,7 @@ const images = [
|
|||||||
"../Seasonals/Resources/halloween_images/pumpkin_20x20.png",
|
"../Seasonals/Resources/halloween_images/pumpkin_20x20.png",
|
||||||
];
|
];
|
||||||
|
|
||||||
let msgPrinted = false; // flag to prevent multiple console messages
|
let msgPrinted = false;
|
||||||
|
|
||||||
// function to check and control the halloween
|
// function to check and control the halloween
|
||||||
function toggleHalloween() {
|
function toggleHalloween() {
|
||||||
@@ -42,7 +41,6 @@ function toggleHalloween() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// observe changes in the DOM
|
|
||||||
const observer = new MutationObserver(toggleHalloween);
|
const observer = new MutationObserver(toggleHalloween);
|
||||||
observer.observe(document.body, {
|
observer.observe(document.body, {
|
||||||
childList: true,
|
childList: true,
|
||||||
@@ -51,29 +49,31 @@ observer.observe(document.body, {
|
|||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
function addRandomSymbols(count) {
|
function initHalloween(count) {
|
||||||
const halloweenContainer = document.querySelector('.halloween-container'); // get the halloween container
|
let halloweenContainer = document.querySelector('.halloween-container');
|
||||||
if (!halloweenContainer) return; // exit if halloween container is not found
|
if (!halloweenContainer) {
|
||||||
|
halloweenContainer = document.createElement("div");
|
||||||
console.log('Adding random halloween symbols');
|
halloweenContainer.className = "halloween-container";
|
||||||
|
halloweenContainer.setAttribute("aria-hidden", "true");
|
||||||
|
document.body.appendChild(halloweenContainer);
|
||||||
|
}
|
||||||
|
|
||||||
|
console.log('Adding halloween symbols');
|
||||||
|
|
||||||
for (let i = 0; i < count; i++) {
|
for (let i = 0; i < count; i++) {
|
||||||
// create a new halloween elements
|
|
||||||
const halloweenDiv = document.createElement("div");
|
const halloweenDiv = document.createElement("div");
|
||||||
halloweenDiv.className = "halloween";
|
halloweenDiv.className = "halloween";
|
||||||
|
|
||||||
// pick a random halloween symbol
|
|
||||||
const imageSrc = images[Math.floor(Math.random() * images.length)];
|
const imageSrc = images[Math.floor(Math.random() * images.length)];
|
||||||
const img = document.createElement("img");
|
const img = document.createElement("img");
|
||||||
img.src = imageSrc;
|
img.src = imageSrc;
|
||||||
|
|
||||||
halloweenDiv.appendChild(img);
|
halloweenDiv.appendChild(img);
|
||||||
|
|
||||||
|
|
||||||
// set random horizontal position, animation delay and size(uncomment lines to enable)
|
|
||||||
const randomLeft = Math.random() * 100; // position (0% to 100%)
|
const randomLeft = Math.random() * 100; // position (0% to 100%)
|
||||||
const randomAnimationDelay = Math.random() * 10; // delay (0s to 10s)
|
const randomAnimationDelay = Math.random() * 10; // delay (0s to 10s)
|
||||||
|
// Display directly symbols on full screen (below) or let it build up (above)
|
||||||
|
// const randomAnimationDelay = -(Math.random() * 10); // delay (-10s to 0s)
|
||||||
const randomAnimationDelay2 = -(Math.random() * 3); // delay (-3s to 0s)
|
const randomAnimationDelay2 = -(Math.random() * 3); // delay (-3s to 0s)
|
||||||
|
|
||||||
// apply styles
|
// apply styles
|
||||||
@@ -87,41 +87,9 @@ function addRandomSymbols(count) {
|
|||||||
halloweenDiv.style.animationDuration = `${randomAnimationDuration}s, ${randomAnimationDuration2}s`;
|
halloweenDiv.style.animationDuration = `${randomAnimationDuration}s, ${randomAnimationDuration2}s`;
|
||||||
}
|
}
|
||||||
|
|
||||||
// add the halloween to the container
|
|
||||||
halloweenContainer.appendChild(halloweenDiv);
|
halloweenContainer.appendChild(halloweenDiv);
|
||||||
}
|
}
|
||||||
console.log('Random halloween symbols added');
|
console.log('Halloween symbols added');
|
||||||
}
|
|
||||||
|
|
||||||
// create halloween objects
|
|
||||||
function createHalloween() {
|
|
||||||
const container = document.querySelector('.halloween-container') || document.createElement("div");
|
|
||||||
|
|
||||||
if (!document.querySelector('.halloween-container')) {
|
|
||||||
container.className = "halloween-container";
|
|
||||||
container.setAttribute("aria-hidden", "true");
|
|
||||||
document.body.appendChild(container);
|
|
||||||
}
|
|
||||||
|
|
||||||
for (let i = 0; i < 4; i++) {
|
|
||||||
images.forEach(imageSrc => {
|
|
||||||
const halloweenDiv = document.createElement("div");
|
|
||||||
halloweenDiv.className = "halloween";
|
|
||||||
|
|
||||||
const img = document.createElement("img");
|
|
||||||
img.src = imageSrc;
|
|
||||||
|
|
||||||
// set random animation duration
|
|
||||||
if (enableDiffrentDuration) {
|
|
||||||
const randomAnimationDuration = Math.random() * 10 + 6; // delay (6s to 10s)
|
|
||||||
const randomAnimationDuration2 = Math.random() * 5 + 2; // delay (2s to 5s)
|
|
||||||
halloweenDiv.style.animationDuration = `${randomAnimationDuration}s, ${randomAnimationDuration2}s`;
|
|
||||||
}
|
|
||||||
|
|
||||||
halloweenDiv.appendChild(img);
|
|
||||||
container.appendChild(halloweenDiv);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// create fog layer
|
// create fog layer
|
||||||
@@ -235,10 +203,13 @@ function createMouse(container) {
|
|||||||
container.appendChild(mouse);
|
container.appendChild(mouse);
|
||||||
}
|
}
|
||||||
|
|
||||||
// initialize halloween
|
|
||||||
function initializeHalloween() {
|
function initializeHalloween() {
|
||||||
if (!halloween) return; // exit if halloween is disabled
|
if (!halloween) return;
|
||||||
createHalloween();
|
|
||||||
|
const isMobile = window.matchMedia("only screen and (max-width: 768px)").matches;
|
||||||
|
const count = !isMobile ? halloweenCount : halloweenCountMobile;
|
||||||
|
|
||||||
|
initHalloween(count);
|
||||||
toggleHalloween();
|
toggleHalloween();
|
||||||
|
|
||||||
const container = document.querySelector('.halloween-container');
|
const container = document.querySelector('.halloween-container');
|
||||||
@@ -260,11 +231,6 @@ function initializeHalloween() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const screenWidth = window.innerWidth; // get the screen width to detect mobile devices
|
|
||||||
if (randomSymbols && (screenWidth > 768 || randomSymbolsMobile)) { // add random halloweens only on larger screens, unless enabled for mobile devices
|
|
||||||
addRandomSymbols(halloweenCount);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
initializeHalloween();
|
initializeHalloween();
|
||||||
@@ -49,63 +49,3 @@
|
|||||||
transform: translateX(80px)
|
transform: translateX(80px)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.heart:nth-of-type(0) {
|
|
||||||
left: 1%;
|
|
||||||
animation-delay: 0s, 0s
|
|
||||||
}
|
|
||||||
|
|
||||||
.heart:nth-of-type(1) {
|
|
||||||
left: 10%;
|
|
||||||
animation-delay: 1s, 1s
|
|
||||||
}
|
|
||||||
|
|
||||||
.heart:nth-of-type(2) {
|
|
||||||
left: 20%;
|
|
||||||
animation-delay: 6s, .5s
|
|
||||||
}
|
|
||||||
|
|
||||||
.heart:nth-of-type(3) {
|
|
||||||
left: 30%;
|
|
||||||
animation-delay: 4s, 2s
|
|
||||||
}
|
|
||||||
|
|
||||||
.heart:nth-of-type(4) {
|
|
||||||
left: 40%;
|
|
||||||
animation-delay: 2s, 2s
|
|
||||||
}
|
|
||||||
|
|
||||||
.heart:nth-of-type(5) {
|
|
||||||
left: 50%;
|
|
||||||
animation-delay: 8s, 3s
|
|
||||||
}
|
|
||||||
|
|
||||||
.heart:nth-of-type(6) {
|
|
||||||
left: 60%;
|
|
||||||
animation-delay: 6s, 2s
|
|
||||||
}
|
|
||||||
|
|
||||||
.heart:nth-of-type(7) {
|
|
||||||
left: 70%;
|
|
||||||
animation-delay: 2.5s, 1s
|
|
||||||
}
|
|
||||||
|
|
||||||
.heart:nth-of-type(8) {
|
|
||||||
left: 80%;
|
|
||||||
animation-delay: 1s, 0s
|
|
||||||
}
|
|
||||||
|
|
||||||
.heart:nth-of-type(9) {
|
|
||||||
left: 90%;
|
|
||||||
animation-delay: 3s, 1.5s
|
|
||||||
}
|
|
||||||
|
|
||||||
.heart:nth-of-type(10) {
|
|
||||||
left: 25%;
|
|
||||||
animation-delay: 2s, 0s
|
|
||||||
}
|
|
||||||
|
|
||||||
.heart:nth-of-type(11) {
|
|
||||||
left: 65%;
|
|
||||||
animation-delay: 4s, 2.5s
|
|
||||||
}
|
|
||||||
@@ -1,10 +1,9 @@
|
|||||||
const config = window.SeasonalsPluginConfig?.Hearts || {};
|
const config = window.SeasonalsPluginConfig?.Hearts || {};
|
||||||
|
|
||||||
const hearts = config.EnableHearts !== undefined ? config.EnableHearts : true; // enable/disable hearts
|
const hearts = config.EnableHearts !== undefined ? config.EnableHearts : true; // enable/disable hearts
|
||||||
const randomSymbols = config.EnableRandomSymbols !== undefined ? config.EnableRandomSymbols : true; // enable more random symbols
|
const enableDiffrentDuration = config.EnableDifferentDuration !== undefined ? config.EnableDifferentDuration : true; // enable different durations
|
||||||
const randomSymbolsMobile = config.EnableRandomSymbolsMobile !== undefined ? config.EnableRandomSymbolsMobile : false; // enable random symbols on mobile devices (Warning: High values may affect performance)
|
const heartsCount = config.SymbolCount !== undefined ? config.SymbolCount : 25; // count of symbol
|
||||||
const enableDiffrentDuration = config.EnableDifferentDuration !== undefined ? config.EnableDifferentDuration : true; // enable different animation duration for random symbols
|
const heartsCountMobile = config.SymbolCountMobile !== undefined ? config.SymbolCountMobile : 10; // count of symbol on mobile
|
||||||
const heartsCount = config.SymbolCount || 25; // count of random extra symbols
|
|
||||||
|
|
||||||
// Array of hearts characters
|
// Array of hearts characters
|
||||||
const heartSymbols = ['❤️', '💕', '💞', '💓', '💗', '💖'];
|
const heartSymbols = ['❤️', '💕', '💞', '💓', '💗', '💖'];
|
||||||
@@ -46,11 +45,16 @@ observer.observe(document.body, {
|
|||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
function addRandomSymbols(count) {
|
function initHearts(count) {
|
||||||
const heartsContainer = document.querySelector('.hearts-container'); // get the hearts container
|
let heartsContainer = document.querySelector('.hearts-container'); // get the hearts container
|
||||||
if (!heartsContainer) return; // exit if hearts container is not found
|
if (!heartsContainer) {
|
||||||
|
heartsContainer = document.createElement("div");
|
||||||
|
heartsContainer.className = "hearts-container";
|
||||||
|
heartsContainer.setAttribute("aria-hidden", "true");
|
||||||
|
document.body.appendChild(heartsContainer);
|
||||||
|
}
|
||||||
|
|
||||||
console.log('Adding random heart symbols');
|
console.log('Adding heart symbols');
|
||||||
|
|
||||||
for (let i = 0; i < count; i++) {
|
for (let i = 0; i < count; i++) {
|
||||||
// create a new hearts elements
|
// create a new hearts elements
|
||||||
@@ -63,8 +67,8 @@ function addRandomSymbols(count) {
|
|||||||
|
|
||||||
// set random horizontal position, animation delay and size(uncomment lines to enable)
|
// set random horizontal position, animation delay and size(uncomment lines to enable)
|
||||||
const randomLeft = Math.random() * 100; // position (0% to 100%)
|
const randomLeft = Math.random() * 100; // position (0% to 100%)
|
||||||
const randomAnimationDelay = Math.random() * 14; // delay (0s to 14s)
|
const randomAnimationDelay = -(Math.random() * 16); // delay (-16s to 0s)
|
||||||
const randomAnimationDelay2 = Math.random() * 5; // delay (0s to 5s)
|
const randomAnimationDelay2 = -(Math.random() * 5); // delay (-5s to 0s)
|
||||||
|
|
||||||
// apply styles
|
// apply styles
|
||||||
heartsDiv.style.left = `${randomLeft}%`;
|
heartsDiv.style.left = `${randomLeft}%`;
|
||||||
@@ -80,46 +84,18 @@ function addRandomSymbols(count) {
|
|||||||
// add the hearts to the container
|
// add the hearts to the container
|
||||||
heartsContainer.appendChild(heartsDiv);
|
heartsContainer.appendChild(heartsDiv);
|
||||||
}
|
}
|
||||||
console.log('Random hearts symbols added');
|
console.log('Heart symbols added');
|
||||||
}
|
}
|
||||||
|
|
||||||
// create hearts objects
|
|
||||||
function createHearts() {
|
|
||||||
const container = document.querySelector('.hearts-container') || document.createElement("div");
|
|
||||||
|
|
||||||
if (!document.querySelector('.hearts-container')) {
|
|
||||||
container.className = "hearts-container";
|
|
||||||
container.setAttribute("aria-hidden", "true");
|
|
||||||
document.body.appendChild(container);
|
|
||||||
}
|
|
||||||
|
|
||||||
for (let i = 0; i < 12; i++) {
|
|
||||||
const heartsDiv = document.createElement("div");
|
|
||||||
heartsDiv.className = "heart";
|
|
||||||
heartsDiv.textContent = heartSymbols[i % heartSymbols.length];
|
|
||||||
|
|
||||||
// set random animation duration
|
|
||||||
if (enableDiffrentDuration) {
|
|
||||||
const randomAnimationDuration = Math.random() * 16 + 12; // delay (12s to 16s)
|
|
||||||
const randomAnimationDuration2 = Math.random() * 7 + 3; // delay (3s to 7s)
|
|
||||||
heartsDiv.style.animationDuration = `${randomAnimationDuration}s, ${randomAnimationDuration2}s`;
|
|
||||||
}
|
|
||||||
|
|
||||||
container.appendChild(heartsDiv);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// initialize hearts
|
// initialize hearts
|
||||||
function initializeHearts() {
|
function initializeHearts() {
|
||||||
if (!hearts) return; // exit if hearts is disabled
|
if (!hearts) return; // exit if hearts is disabled
|
||||||
createHearts();
|
|
||||||
toggleHearts();
|
|
||||||
|
|
||||||
const screenWidth = window.innerWidth; // get the screen width to detect mobile devices
|
const isMobile = window.matchMedia("only screen and (max-width: 768px)").matches;
|
||||||
if (randomSymbols && (screenWidth > 768 || randomSymbolsMobile)) { // add random heartss only on larger screens, unless enabled for mobile devices
|
const count = !isMobile ? heartsCount : heartsCountMobile;
|
||||||
addRandomSymbols(heartsCount);
|
|
||||||
}
|
initHearts(count);
|
||||||
|
toggleHearts();
|
||||||
}
|
}
|
||||||
|
|
||||||
initializeHearts();
|
initializeHearts();
|
||||||
@@ -1,5 +1,9 @@
|
|||||||
const config = window.SeasonalsPluginConfig?.MarioDay || {};
|
const config = window.SeasonalsPluginConfig?.MarioDay || {};
|
||||||
const marioday = config.EnableMarioDay !== undefined ? config.EnableMarioDay : true;
|
const marioday = config.EnableMarioDay !== undefined ? config.EnableMarioDay : true; // enable/disable marioday
|
||||||
|
const letMarioJump = config.LetMarioJump !== undefined ? config.LetMarioJump : true; // optionally let mario jump occasionally
|
||||||
|
|
||||||
|
// Credit: https://gifs.alphacoders.com/gifs/view/2585
|
||||||
|
const marioImage = '../Seasonals/Resources/mario_assets/mario.gif';
|
||||||
|
|
||||||
let msgPrinted = false;
|
let msgPrinted = false;
|
||||||
|
|
||||||
@@ -45,20 +49,38 @@ function createMarioDay(container) {
|
|||||||
|
|
||||||
const mario = document.createElement('img');
|
const mario = document.createElement('img');
|
||||||
mario.className = 'mario-runner';
|
mario.className = 'mario-runner';
|
||||||
mario.src = '../Seasonals/Resources/mario_assets/mario.gif';
|
mario.src = marioImage;
|
||||||
|
|
||||||
wrapper.appendChild(mario);
|
wrapper.appendChild(mario);
|
||||||
container.appendChild(wrapper);
|
container.appendChild(wrapper);
|
||||||
|
|
||||||
|
let jumpCount = 0;
|
||||||
|
let maxJumpsForThisRun = Math.floor(Math.random() * 3); // 0, 1, or 2
|
||||||
|
|
||||||
|
const resetJumpInterval = setInterval(() => {
|
||||||
|
if (!document.body.contains(container)) { clearInterval(resetJumpInterval); return; }
|
||||||
|
jumpCount = 0;
|
||||||
|
maxJumpsForThisRun = Math.floor(Math.random() * 3); // Randomize jumps for the next pass
|
||||||
|
}, (marioSpeedSeconds / 2) * 1000);
|
||||||
|
|
||||||
// Periodically throw out an 8-bit coin
|
// Periodically throw out an 8-bit coin
|
||||||
const intervalId = setInterval(() => {
|
const intervalId = setInterval(() => {
|
||||||
if (!document.body.contains(container)) { clearInterval(intervalId); return; }
|
if (!document.body.contains(container)) { clearInterval(intervalId); return; }
|
||||||
if (container.style.display === 'none') return;
|
if (container.style.display === 'none') return;
|
||||||
|
|
||||||
|
const marioRect = wrapper.getBoundingClientRect();
|
||||||
|
if (marioRect.left < 0 || marioRect.right > window.innerWidth) return;
|
||||||
|
|
||||||
|
if (letMarioJump && !mario.classList.contains('mario-jump') && jumpCount < maxJumpsForThisRun) {
|
||||||
|
mario.classList.add('mario-jump');
|
||||||
|
jumpCount++;
|
||||||
|
setTimeout(() => mario.classList.remove('mario-jump'), 800);
|
||||||
|
}
|
||||||
|
|
||||||
const coin = document.createElement('div');
|
const coin = document.createElement('div');
|
||||||
coin.className = 'mario-coin';
|
coin.className = 'mario-coin';
|
||||||
|
|
||||||
// Grab Mario's current screen position to lock the coin's X coordinate
|
// Grab Mario's current screen position to lock the coin's X coordinate
|
||||||
const marioRect = wrapper.getBoundingClientRect();
|
|
||||||
coin.style.left = `${marioRect.left + 16}px`;
|
coin.style.left = `${marioRect.left + 16}px`;
|
||||||
coin.style.bottom = '35px'; // bottom offset
|
coin.style.bottom = '35px'; // bottom offset
|
||||||
|
|
||||||
|
|||||||
@@ -1,9 +1,9 @@
|
|||||||
const config = window.SeasonalsPluginConfig?.Matrix || {};
|
const config = window.SeasonalsPluginConfig?.Matrix || {};
|
||||||
|
|
||||||
const enabled = config.EnableMatrix !== undefined ? config.EnableMatrix : true;
|
const enabled = config.EnableMatrix !== undefined ? config.EnableMatrix : true; // enable/disable matrix
|
||||||
const maxTrails = config.SymbolCount || 25;
|
const maxTrails = config.SymbolCount !== undefined ? config.SymbolCount : 25; // count of max trails on screen
|
||||||
const backgroundMode = config.EnableMatrixBackground !== undefined ? config.EnableMatrixBackground : false;
|
const backgroundMode = config.EnableMatrixBackground !== undefined ? config.EnableMatrixBackground : false; // enable/disable matrix as background
|
||||||
const matrixChars = config.MatrixChars || '0123456789';
|
const matrixChars = config.MatrixChars !== undefined ? config.MatrixChars : '0123456789'; // characters to use in the matrix rain, default is '0123456789'
|
||||||
|
|
||||||
let msgPrinted = false;
|
let msgPrinted = false;
|
||||||
let isHidden = false;
|
let isHidden = false;
|
||||||
|
|||||||
@@ -1,5 +1,8 @@
|
|||||||
const config = window.SeasonalsPluginConfig?.Oktoberfest || {};
|
const config = window.SeasonalsPluginConfig?.Oktoberfest || {};
|
||||||
const oktoberfest = config.EnableOktoberfest !== undefined ? config.EnableOktoberfest : true;
|
const oktoberfest = config.EnableOktoberfest !== undefined ? config.EnableOktoberfest : true; // enable/disable oktoberfest
|
||||||
|
const symbolCount = config.SymbolCount !== undefined ? config.SymbolCount : 25; // count of symbols
|
||||||
|
const symbolCountMobile = config.SymbolCountMobile !== undefined ? config.SymbolCountMobile : 10; // count of symbols on mobile
|
||||||
|
const enableDifferentDuration = config.EnableDifferentDuration !== undefined ? config.EnableDifferentDuration : true; // enable different durations
|
||||||
|
|
||||||
const oktoberfestSymbols = ['🥨', '🍺', '🍻', '🥨', '🥨'];
|
const oktoberfestSymbols = ['🥨', '🍺', '🍻', '🥨', '🥨'];
|
||||||
|
|
||||||
@@ -31,7 +34,6 @@ function toggleOktoberfest() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// observe changes in the DOM
|
|
||||||
const observer = new MutationObserver(toggleOktoberfest);
|
const observer = new MutationObserver(toggleOktoberfest);
|
||||||
observer.observe(document.body, {
|
observer.observe(document.body, {
|
||||||
childList: true,
|
childList: true,
|
||||||
@@ -39,8 +41,8 @@ observer.observe(document.body, {
|
|||||||
attributes: true
|
attributes: true
|
||||||
});
|
});
|
||||||
|
|
||||||
function createOktoberfest(container) {
|
function createOktoberfest(container, count) {
|
||||||
for (let i = 0; i < 20; i++) {
|
for (let i = 0; i < count; i++) {
|
||||||
const symbol = document.createElement('div');
|
const symbol = document.createElement('div');
|
||||||
symbol.className = 'oktoberfest-symbol';
|
symbol.className = 'oktoberfest-symbol';
|
||||||
symbol.textContent = oktoberfestSymbols[Math.floor(Math.random() * oktoberfestSymbols.length)];
|
symbol.textContent = oktoberfestSymbols[Math.floor(Math.random() * oktoberfestSymbols.length)];
|
||||||
@@ -48,7 +50,9 @@ function createOktoberfest(container) {
|
|||||||
symbol.style.animationDelay = `${Math.random() * 10}s, ${Math.random() * 5}s`;
|
symbol.style.animationDelay = `${Math.random() * 10}s, ${Math.random() * 5}s`;
|
||||||
const duration1 = Math.random() * 5 + 8;
|
const duration1 = Math.random() * 5 + 8;
|
||||||
const duration2 = Math.random() * 3 + 3;
|
const duration2 = Math.random() * 3 + 3;
|
||||||
symbol.style.animationDuration = `${duration1}s, ${duration2}s`;
|
if (enableDifferentDuration) {
|
||||||
|
symbol.style.animationDuration = `${duration1}s, ${duration2}s`;
|
||||||
|
}
|
||||||
|
|
||||||
container.appendChild(symbol);
|
container.appendChild(symbol);
|
||||||
}
|
}
|
||||||
@@ -62,6 +66,10 @@ function initializeOktoberfest() {
|
|||||||
container.setAttribute("aria-hidden", "true");
|
container.setAttribute("aria-hidden", "true");
|
||||||
document.body.appendChild(container);
|
document.body.appendChild(container);
|
||||||
}
|
}
|
||||||
createOktoberfest(container);
|
|
||||||
|
const isMobile = window.matchMedia("only screen and (max-width: 768px)").matches;
|
||||||
|
const count = !isMobile ? symbolCount : symbolCountMobile;
|
||||||
|
|
||||||
|
createOktoberfest(container, count);
|
||||||
}
|
}
|
||||||
initializeOktoberfest();
|
initializeOktoberfest();
|
||||||
|
|||||||
@@ -1,10 +1,34 @@
|
|||||||
const config = window.SeasonalsPluginConfig?.Olympia || {};
|
const config = window.SeasonalsPluginConfig?.Olympia || {};
|
||||||
|
|
||||||
const olympia = config.EnableOlympia !== undefined ? config.EnableOlympia : true;
|
const olympia = config.EnableOlympia !== undefined ? config.EnableOlympia : true; // enable/disable olympia theme
|
||||||
const symbolCount = config.SymbolCount || 25;
|
const symbolCount = config.SymbolCount !== undefined ? config.SymbolCount : 25; // count of floating symbols
|
||||||
const useRandomSymbols = config.EnableRandomSymbols !== undefined ? config.EnableRandomSymbols : true;
|
const symbolCountMobile = config.SymbolCountMobile !== undefined ? config.SymbolCountMobile : 10; // count of floating symbols on mobile
|
||||||
const enableRandomMobile = config.EnableRandomSymbolsMobile !== undefined ? config.EnableRandomSymbolsMobile : false;
|
const enableDifferentDuration = config.EnableDifferentDuration !== undefined ? config.EnableDifferentDuration : true; // enable different durations
|
||||||
const enableDifferentDuration = config.EnableDifferentDuration !== undefined ? config.EnableDifferentDuration : true;
|
|
||||||
|
// Olympic Ring Colors (Carnival Config)
|
||||||
|
const confettiColors = ['#0081C8', '#FCB131', '#000000', '#00A651', '#EE334E'];
|
||||||
|
const isMobile = window.matchMedia("only screen and (max-width: 768px)").matches;
|
||||||
|
const confettiCount = isMobile ? 30 : 60;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Credits:
|
||||||
|
* https://lottiefiles.com/free-animation/gold-coin-5Spp5kJbLP
|
||||||
|
* https://lottiefiles.com/free-animation/silver-coin-SIgIP59fII
|
||||||
|
* https://lottiefiles.com/free-animation/bronze-coin-wWVCJMsOUq
|
||||||
|
*/
|
||||||
|
const olympicMedals = [
|
||||||
|
"../Seasonals/Resources/olympic_assets/gold_coin.gif",
|
||||||
|
"../Seasonals/Resources/olympic_assets/silver_coin.gif",
|
||||||
|
"../Seasonals/Resources/olympic_assets/bronze_coin.gif"
|
||||||
|
]
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Credits:
|
||||||
|
* https://www.flaticon.com/de/kostenloses-icon/fackel_4683293
|
||||||
|
* merged with:
|
||||||
|
* https://lottiefiles.com/free-animation/abstract-flames-lottie-json-animation-oSb0IFoBrj
|
||||||
|
*/
|
||||||
|
const olympicTorch = "../Seasonals/Resources/olympic_assets/torch.gif";
|
||||||
|
|
||||||
let msgPrinted = false;
|
let msgPrinted = false;
|
||||||
|
|
||||||
@@ -49,27 +73,23 @@ function createOlympia() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const standardCount = 15;
|
const standardCount = 15;
|
||||||
const totalSymbols = symbolCount + standardCount;
|
|
||||||
|
|
||||||
let isMobile = window.matchMedia("only screen and (max-width: 768px)").matches;
|
let isMobile = window.matchMedia("only screen and (max-width: 768px)").matches;
|
||||||
let finalCount = totalSymbols;
|
let finalCount = isMobile ? symbolCountMobile : symbolCount;
|
||||||
|
|
||||||
if (isMobile) {
|
|
||||||
finalCount = enableRandomMobile ? totalSymbols : standardCount;
|
|
||||||
}
|
|
||||||
|
|
||||||
const useRandomDuration = enableDifferentDuration !== false;
|
const useRandomDuration = enableDifferentDuration !== false;
|
||||||
|
|
||||||
const activeItems = ['gold', 'silver', 'bronze', 'torch', 'rings_blue', 'rings_yellow', 'rings_black', 'rings_green', 'rings_red'];
|
const olympicRings = ['ring_blue.css', 'ring_yellow.css', 'ring_black.css', 'ring_green.css', 'ring_red.css'];
|
||||||
|
const activeItems = [...olympicMedals, ...olympicRings];
|
||||||
|
|
||||||
for (let i = 0; i < finalCount; i++) {
|
for (let i = 0; i < finalCount; i++) {
|
||||||
let symbol = document.createElement('div');
|
let symbol = document.createElement('div');
|
||||||
|
|
||||||
const randomItem = activeItems[Math.floor(Math.random() * activeItems.length)];
|
const randomImgUrl = activeItems[Math.floor(Math.random() * activeItems.length)];
|
||||||
const isRing = randomItem.startsWith('rings');
|
const isRing = randomImgUrl.includes('ring_');
|
||||||
const isMedal = ['gold', 'silver', 'bronze'].includes(randomItem);
|
const isMedal = randomImgUrl.includes('_coin');
|
||||||
|
|
||||||
symbol.className = `olympia-symbol olympia-${randomItem}`;
|
symbol.className = `olympia-symbol`;
|
||||||
|
|
||||||
// Create inner div for sway/rotation
|
// Create inner div for sway/rotation
|
||||||
let innerDiv = document.createElement('div');
|
let innerDiv = document.createElement('div');
|
||||||
@@ -77,19 +97,20 @@ function createOlympia() {
|
|||||||
let img = null;
|
let img = null;
|
||||||
|
|
||||||
if (isRing) {
|
if (isRing) {
|
||||||
|
const colorName = randomImgUrl.split('ring_')[1].split('.')[0];
|
||||||
const ringColorMap = {
|
const ringColorMap = {
|
||||||
'rings_blue': '#0081C8',
|
'blue': '#0081C8',
|
||||||
'rings_yellow': '#FCB131',
|
'yellow': '#FCB131',
|
||||||
'rings_black': '#000000',
|
'black': '#000000',
|
||||||
'rings_green': '#00A651',
|
'green': '#00A651',
|
||||||
'rings_red': '#EE334E'
|
'red': '#EE334E'
|
||||||
};
|
};
|
||||||
let ringDiv = document.createElement('div');
|
let ringDiv = document.createElement('div');
|
||||||
ringDiv.className = 'olympia-ring-css';
|
ringDiv.className = 'olympia-ring-css';
|
||||||
ringDiv.style.setProperty('--ring-color', ringColorMap[randomItem]);
|
ringDiv.style.setProperty('--ring-color', ringColorMap[colorName]);
|
||||||
innerDiv.appendChild(ringDiv);
|
innerDiv.appendChild(ringDiv);
|
||||||
|
|
||||||
// Add a 3D flip animation for rings and medals
|
// Add a 3D flip animation for rings
|
||||||
const spinReverse = Math.random() > 0.5 ? 'reverse' : 'normal';
|
const spinReverse = Math.random() > 0.5 ? 'reverse' : 'normal';
|
||||||
innerDiv.style.animation = `olympia-tumble-3d ${Math.random() * 4 + 4}s linear infinite ${spinReverse}`;
|
innerDiv.style.animation = `olympia-tumble-3d ${Math.random() * 4 + 4}s linear infinite ${spinReverse}`;
|
||||||
|
|
||||||
@@ -99,13 +120,7 @@ function createOlympia() {
|
|||||||
innerDiv.style.setProperty('--rot-z', (Math.random() * 2 - 1).toFixed(2));
|
innerDiv.style.setProperty('--rot-z', (Math.random() * 2 - 1).toFixed(2));
|
||||||
} else {
|
} else {
|
||||||
img = document.createElement('img');
|
img = document.createElement('img');
|
||||||
let imgName = randomItem;
|
img.src = randomImgUrl;
|
||||||
if (isMedal) {
|
|
||||||
imgName = `${randomItem}_coin.gif`;
|
|
||||||
} else {
|
|
||||||
imgName = `${randomItem}.png`;
|
|
||||||
}
|
|
||||||
img.src = `../Seasonals/Resources/olympic_assets/${imgName}`;
|
|
||||||
img.onerror = function() {
|
img.onerror = function() {
|
||||||
symbol.remove();
|
symbol.remove();
|
||||||
};
|
};
|
||||||
@@ -182,10 +197,6 @@ function createOlympia() {
|
|||||||
createTorch(true);
|
createTorch(true);
|
||||||
createTorch(false);
|
createTorch(false);
|
||||||
|
|
||||||
// Olympic Ring Colors (Carnival Config)
|
|
||||||
const confettiColors = ['#0081C8', '#FCB131', '#000000', '#00A651', '#EE334E'];
|
|
||||||
const confettiCount = isMobile ? 30 : 60;
|
|
||||||
|
|
||||||
for (let i = 0; i < confettiCount; i++) {
|
for (let i = 0; i < confettiCount; i++) {
|
||||||
let wrapper = document.createElement('div');
|
let wrapper = document.createElement('div');
|
||||||
wrapper.className = 'olympia-confetti-wrapper';
|
wrapper.className = 'olympia-confetti-wrapper';
|
||||||
|
|||||||
Binary file not shown.
|
Before Width: | Height: | Size: 62 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 60 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 61 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 60 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 58 KiB |
@@ -1,5 +1,5 @@
|
|||||||
const config = window.SeasonalsPluginConfig?.Oscar || {};
|
const config = window.SeasonalsPluginConfig?.Oscar || {};
|
||||||
const oscar = config.EnableOscar !== undefined ? config.EnableOscar : true;
|
const oscar = config.EnableOscar !== undefined ? config.EnableOscar : true; // enable/disable oscar
|
||||||
|
|
||||||
let msgPrinted = false;
|
let msgPrinted = false;
|
||||||
|
|
||||||
|
|||||||
@@ -1,9 +1,9 @@
|
|||||||
const config = window.SeasonalsPluginConfig?.Pride || {};
|
const config = window.SeasonalsPluginConfig?.Pride || {};
|
||||||
|
|
||||||
const enabled = config.EnablePride !== undefined ? config.EnablePride : true;
|
const enabled = config.EnablePride !== undefined ? config.EnablePride : true; // enable/disable pride
|
||||||
const elementCount = config.HeartCount || 20;
|
const elementCount = config.HeartCount !== undefined ? config.HeartCount : 20; // count of heart
|
||||||
const heartSize = config.HeartSize || 1.5;
|
const heartSize = config.HeartSize !== undefined ? config.HeartSize : 1.5; // size of hearts
|
||||||
const colorHeader = config.ColorHeader !== undefined ? config.ColorHeader : true;
|
const colorHeader = config.ColorHeader !== undefined ? config.ColorHeader : true; // optionally color the header with pride colors
|
||||||
|
|
||||||
let msgPrinted = false;
|
let msgPrinted = false;
|
||||||
|
|
||||||
|
|||||||
@@ -1,9 +1,9 @@
|
|||||||
const config = window.SeasonalsPluginConfig?.Rain || {};
|
const config = window.SeasonalsPluginConfig?.Rain || {};
|
||||||
|
|
||||||
const enabled = config.EnableRain !== undefined ? config.EnableRain : true;
|
const enabled = config.EnableRain !== undefined ? config.EnableRain : true; // enable/disable rain
|
||||||
const isMobile = window.innerWidth <= 768;
|
const isMobile = window.matchMedia("only screen and (max-width: 768px)").matches;
|
||||||
const elementCount = isMobile ? (config.RaindropCountMobile || 150) : (config.RaindropCount || 300);
|
const elementCount = isMobile ? (config.RaindropCountMobile || 150) : (config.RaindropCount || 300); // count of raindrops
|
||||||
const rainSpeed = config.RainSpeed || 1.0;
|
const rainSpeed = config.RainSpeed !== undefined ? config.RainSpeed : 1.0; // speed of rain
|
||||||
|
|
||||||
let msgPrinted = false;
|
let msgPrinted = false;
|
||||||
|
|
||||||
|
|||||||
@@ -1,10 +1,9 @@
|
|||||||
const config = window.SeasonalsPluginConfig?.Resurrection || {};
|
const config = window.SeasonalsPluginConfig?.Resurrection || {};
|
||||||
|
|
||||||
const enableResurrection = config.EnableResurrection !== undefined ? config.EnableResurrection : true;
|
const enableResurrection = config.EnableResurrection !== undefined ? config.EnableResurrection : true; // enable/disable resurrection
|
||||||
const enableRandomSymbols = config.EnableRandomSymbols !== undefined ? config.EnableRandomSymbols : true;
|
const enableDifferentDuration = config.EnableDifferentDuration !== undefined ? config.EnableDifferentDuration : true; // enable different durations
|
||||||
const enableRandomSymbolsMobile = config.EnableRandomSymbolsMobile !== undefined ? config.EnableRandomSymbolsMobile : false;
|
const symbolCount = config.SymbolCount !== undefined ? config.SymbolCount : 12; // count of symbols
|
||||||
const enableDifferentDuration = config.EnableDifferentDuration !== undefined ? config.EnableDifferentDuration : true;
|
const symbolCountMobile = config.SymbolCountMobile !== undefined ? config.SymbolCountMobile : 5; // count of symbols on mobile
|
||||||
const symbolCount = config.SymbolCount || 12;
|
|
||||||
|
|
||||||
let animationEnabled = true;
|
let animationEnabled = true;
|
||||||
let statusLogged = false;
|
let statusLogged = false;
|
||||||
@@ -78,20 +77,17 @@ function createSymbol(imageSrc, leftPercent, delaySeconds) {
|
|||||||
|
|
||||||
function addSymbols(count) {
|
function addSymbols(count) {
|
||||||
const container = document.querySelector('.resurrection-container');
|
const container = document.querySelector('.resurrection-container');
|
||||||
if (!container || !enableRandomSymbols) return;
|
if (!container) return;
|
||||||
|
|
||||||
const isDesktop = window.innerWidth > 768;
|
|
||||||
if (!isDesktop && !enableRandomSymbolsMobile) return;
|
|
||||||
|
|
||||||
for (let i = 0; i < count; i++) {
|
for (let i = 0; i < count; i++) {
|
||||||
const imageSrc = images[Math.floor(Math.random() * images.length)];
|
const imageSrc = images[Math.floor(Math.random() * images.length)];
|
||||||
const left = Math.random() * 100;
|
const left = Math.random() * 100;
|
||||||
const delay = Math.random() * 12;
|
const delay = -(Math.random() * 12);
|
||||||
container.appendChild(createSymbol(imageSrc, left, delay));
|
container.appendChild(createSymbol(imageSrc, left, delay));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function initResurrection() {
|
function initResurrection(count) {
|
||||||
let container = document.querySelector('.resurrection-container');
|
let container = document.querySelector('.resurrection-container');
|
||||||
if (!container) {
|
if (!container) {
|
||||||
container = document.createElement('div');
|
container = document.createElement('div');
|
||||||
@@ -103,17 +99,21 @@ function initResurrection() {
|
|||||||
// Place one of each of the 8 provided resurrection images first.
|
// Place one of each of the 8 provided resurrection images first.
|
||||||
images.forEach((imageSrc, index) => {
|
images.forEach((imageSrc, index) => {
|
||||||
const left = (index + 1) * (100 / (images.length + 1));
|
const left = (index + 1) * (100 / (images.length + 1));
|
||||||
const delay = Math.random() * 8;
|
const delay = -(Math.random() * 8);
|
||||||
container.appendChild(createSymbol(imageSrc, left, delay));
|
container.appendChild(createSymbol(imageSrc, left, delay));
|
||||||
});
|
});
|
||||||
|
|
||||||
const extraCount = Math.max(symbolCount - images.length, 0);
|
const extraCount = Math.max(count - images.length, 0);
|
||||||
addSymbols(extraCount);
|
addSymbols(extraCount);
|
||||||
}
|
}
|
||||||
|
|
||||||
function initializeResurrection() {
|
function initializeResurrection() {
|
||||||
if (!enableResurrection) return;
|
if (!enableResurrection) return;
|
||||||
initResurrection();
|
|
||||||
|
const isMobile = window.matchMedia("only screen and (max-width: 768px)").matches;
|
||||||
|
const count = !isMobile ? symbolCount : symbolCountMobile;
|
||||||
|
|
||||||
|
initResurrection(count);
|
||||||
toggleResurrection();
|
toggleResurrection();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,15 +1,15 @@
|
|||||||
const config = window.SeasonalsPluginConfig?.Santa || {};
|
const config = window.SeasonalsPluginConfig?.Santa || {};
|
||||||
|
|
||||||
const santaIsFlying = config.EnableSanta !== undefined ? config.EnableSanta : true; // enable/disable santa
|
const santaIsFlying = config.EnableSanta !== undefined ? config.EnableSanta : true; // enable/disable santa
|
||||||
let snowflakesCount = config.SnowflakesCount || 500; // count of snowflakes (recommended values: 300-600)
|
let snowflakesCount = config.SnowflakesCount !== undefined ? config.SnowflakesCount : 500; // count of snowflakes
|
||||||
const snowflakesCountMobile = config.SnowflakesCountMobile || 250; // count of snowflakes on mobile devices (Warning: High values may affect performance)
|
const snowflakesCountMobile = config.SnowflakesCountMobile !== undefined ? config.SnowflakesCountMobile : 250; // count of snowflakes on mobile
|
||||||
const snowFallSpeed = config.SnowFallSpeed || 3; // speed of snowfall (recommended values: 0-5)
|
const snowFallSpeed = config.SnowFallSpeed !== undefined ? config.SnowFallSpeed : 3; // speed of snowfall
|
||||||
const santaSpeed = config.SantaSpeed || 10; // speed of santa in seconds (recommended values: 5-15)
|
const santaSpeed = config.SantaSpeed !== undefined ? config.SantaSpeed : 10; // speed of santa in seconds
|
||||||
const santaSpeedMobile = config.SantaSpeedMobile || 8; // speed of santa on mobile devices in seconds
|
const santaSpeedMobile = config.SantaSpeedMobile !== undefined ? config.SantaSpeedMobile : 8; // speed of santa on mobile devices in seconds
|
||||||
const maxSantaRestTime = config.MaxSantaRestTime || 8; // maximum time santa rests in seconds
|
const maxSantaRestTime = config.MaxSantaRestTime !== undefined ? config.MaxSantaRestTime : 8; // maximum time santa rests in seconds
|
||||||
const minSantaRestTime = config.MinSantaRestTime || 3; // minimum time santa rests in seconds
|
const minSantaRestTime = config.MinSantaRestTime !== undefined ? config.MinSantaRestTime : 3; // minimum time santa rests in seconds
|
||||||
const maxPresentFallSpeed = config.MaxPresentFallSpeed || 5; // maximum speed of falling presents in seconds
|
const maxPresentFallSpeed = config.MaxPresentFallSpeed !== undefined ? config.MaxPresentFallSpeed : 5; // maximum speed of falling presents in seconds
|
||||||
const minPresentFallSpeed = config.MinPresentFallSpeed || 2; // minimum speed of falling presents in seconds
|
const minPresentFallSpeed = config.MinPresentFallSpeed !== undefined ? config.MinPresentFallSpeed : 2; // minimum speed of falling presents in seconds
|
||||||
|
|
||||||
// credits: flaticon.com
|
// credits: flaticon.com
|
||||||
const presentImages = [
|
const presentImages = [
|
||||||
@@ -310,8 +310,8 @@ function initializeSanta() {
|
|||||||
}
|
}
|
||||||
const container = document.querySelector('.santa-container');
|
const container = document.querySelector('.santa-container');
|
||||||
if (container) {
|
if (container) {
|
||||||
const screenWidth = window.innerWidth; // get the screen width to detect mobile devices
|
const isMobile = window.matchMedia("only screen and (max-width: 768px)").matches; // check if mobile device
|
||||||
if (screenWidth < 768) { // lower count of snowflakes on mobile devices
|
if (isMobile) { // lower count of snowflakes on mobile devices
|
||||||
isMobile = true;
|
isMobile = true;
|
||||||
console.log('Mobile device detected. Reducing snowflakes count.');
|
console.log('Mobile device detected. Reducing snowflakes count.');
|
||||||
snowflakesCount = snowflakesCountMobile;
|
snowflakesCount = snowflakesCountMobile;
|
||||||
|
|||||||
@@ -1,9 +1,9 @@
|
|||||||
const config = window.SeasonalsPluginConfig?.Snowfall || {};
|
const config = window.SeasonalsPluginConfig?.Snowfall || {};
|
||||||
|
|
||||||
const snowfall = config.EnableSnowfall !== undefined ? config.EnableSnowfall : true; // enable/disable snowfall
|
const snowfall = config.EnableSnowfall !== undefined ? config.EnableSnowfall : true; // enable/disable snowfall
|
||||||
let snowflakesCount = config.SnowflakesCount || 500; // count of snowflakes (recommended values: 300-600)
|
let snowflakesCount = config.SnowflakesCount !== undefined ? config.SnowflakesCount : 500; // count of snowflakes
|
||||||
const snowflakesCountMobile = config.SnowflakesCountMobile || 250; // count of snowflakes on mobile devices (Warning: High values may affect performance)
|
const snowflakesCountMobile = config.SnowflakesCountMobile !== undefined ? config.SnowflakesCountMobile : 250; // count of snowflakes on mobile
|
||||||
const snowFallSpeed = config.Speed || 3; // speed of snowfall (recommended values: 0-5)
|
const snowFallSpeed = config.Speed !== undefined ? config.Speed : 3; // speed of snowfall
|
||||||
|
|
||||||
let msgPrinted = false; // flag to prevent multiple console messages
|
let msgPrinted = false; // flag to prevent multiple console messages
|
||||||
|
|
||||||
@@ -181,8 +181,8 @@ function initializeSnowfall() {
|
|||||||
}
|
}
|
||||||
const container = document.querySelector('.snowfall-container');
|
const container = document.querySelector('.snowfall-container');
|
||||||
if (container) {
|
if (container) {
|
||||||
const screenWidth = window.innerWidth; // get the screen width to detect mobile devices
|
const isMobile = window.matchMedia("only screen and (max-width: 768px)").matches; // check if mobile device
|
||||||
if (screenWidth < 768) { // lower count of snowflakes on mobile devices
|
if (isMobile) { // lower count of snowflakes on mobile devices
|
||||||
console.log('Mobile device detected. Reducing snowflakes count.');
|
console.log('Mobile device detected. Reducing snowflakes count.');
|
||||||
snowflakesCount = snowflakesCountMobile;
|
snowflakesCount = snowflakesCountMobile;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -21,7 +21,9 @@
|
|||||||
color: #fff;
|
color: #fff;
|
||||||
font-family: Arial, sans-serif;
|
font-family: Arial, sans-serif;
|
||||||
text-shadow: 0 0 5px #000;
|
text-shadow: 0 0 5px #000;
|
||||||
user-select: none;
|
user-select: none;
|
||||||
|
cursor: default;
|
||||||
|
animation-name: snowflakes-fall, snowflakes-shake;
|
||||||
animation-duration: 12s, 3s;
|
animation-duration: 12s, 3s;
|
||||||
animation-timing-function: linear, ease-in-out;
|
animation-timing-function: linear, ease-in-out;
|
||||||
animation-iteration-count: infinite, infinite;
|
animation-iteration-count: infinite, infinite;
|
||||||
@@ -50,63 +52,3 @@
|
|||||||
transform: translateX(80px);
|
transform: translateX(80px);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.snowflake:nth-of-type(0) {
|
|
||||||
left: 0%;
|
|
||||||
animation-delay: 0s, 0s;
|
|
||||||
}
|
|
||||||
|
|
||||||
.snowflake:nth-of-type(1) {
|
|
||||||
left: 10%;
|
|
||||||
animation-delay: 1s, 1s;
|
|
||||||
}
|
|
||||||
|
|
||||||
.snowflake:nth-of-type(2) {
|
|
||||||
left: 20%;
|
|
||||||
animation-delay: 6s, 0.5s;
|
|
||||||
}
|
|
||||||
|
|
||||||
.snowflake:nth-of-type(3) {
|
|
||||||
left: 30%;
|
|
||||||
animation-delay: 4s, 2s;
|
|
||||||
}
|
|
||||||
|
|
||||||
.snowflake:nth-of-type(4) {
|
|
||||||
left: 40%;
|
|
||||||
animation-delay: 2s, 2s;
|
|
||||||
}
|
|
||||||
|
|
||||||
.snowflake:nth-of-type(5) {
|
|
||||||
left: 50%;
|
|
||||||
animation-delay: 8s, 3s;
|
|
||||||
}
|
|
||||||
|
|
||||||
.snowflake:nth-of-type(6) {
|
|
||||||
left: 60%;
|
|
||||||
animation-delay: 6s, 2s;
|
|
||||||
}
|
|
||||||
|
|
||||||
.snowflake:nth-of-type(7) {
|
|
||||||
left: 70%;
|
|
||||||
animation-delay: 2.5s, 1s;
|
|
||||||
}
|
|
||||||
|
|
||||||
.snowflake:nth-of-type(8) {
|
|
||||||
left: 80%;
|
|
||||||
animation-delay: 1s, 0s;
|
|
||||||
}
|
|
||||||
|
|
||||||
.snowflake:nth-of-type(9) {
|
|
||||||
left: 90%;
|
|
||||||
animation-delay: 3s, 1.5s;
|
|
||||||
}
|
|
||||||
|
|
||||||
.snowflake:nth-of-type(10) {
|
|
||||||
left: 25%;
|
|
||||||
animation-delay: 2s, 0s;
|
|
||||||
}
|
|
||||||
|
|
||||||
.snowflake:nth-of-type(11) {
|
|
||||||
left: 65%;
|
|
||||||
@@ -1,11 +1,10 @@
|
|||||||
const config = window.SeasonalsPluginConfig?.Snowflakes || {};
|
const config = window.SeasonalsPluginConfig?.Snowflakes || {};
|
||||||
|
|
||||||
const snowflakes = config.EnableSnowflakes !== undefined ? config.EnableSnowflakes : true; // enable/disable snowflakes
|
const snowflakes = config.EnableSnowflakes !== undefined ? config.EnableSnowflakes : true; // enable/disable snowflakes
|
||||||
const randomSnowflakes = config.EnableRandomSnowflakes !== undefined ? config.EnableRandomSnowflakes : true; // enable random Snowflakes
|
const snowflakeCount = config.SnowflakeCount !== undefined ? config.SnowflakeCount : 25; // count of snowflakes
|
||||||
const randomSnowflakesMobile = config.EnableRandomSnowflakesMobile !== undefined ? config.EnableRandomSnowflakesMobile : false; // enable random Snowflakes on mobile devices
|
const snowflakeCountMobile = config.SnowflakeCountMobile !== undefined ? config.SnowflakeCountMobile : 10; // count of snowflakes on mobile
|
||||||
const enableColoredSnowflakes = config.EnableColoredSnowflakes !== undefined ? config.EnableColoredSnowflakes : true; // enable colored snowflakes
|
const enableColoredSnowflakes = config.EnableColoredSnowflakes !== undefined ? config.EnableColoredSnowflakes : true; // enable/disable colored snowflakes
|
||||||
const enableDiffrentDuration = config.EnableDifferentDuration !== undefined ? config.EnableDifferentDuration : true; // enable different animation duration
|
const enableDiffrentDuration = config.EnableDifferentDuration !== undefined ? config.EnableDifferentDuration : true; // enable different durations
|
||||||
const snowflakeCount = config.SnowflakeCount || 25; // count of random extra snowflakes
|
|
||||||
|
|
||||||
const snowflakeSymbols = ['❅', '❆']; // some snowflake symbols
|
const snowflakeSymbols = ['❅', '❆']; // some snowflake symbols
|
||||||
const snowflakeSymbolsMobile = ['❅', '❆', '❄']; // some snowflake symbols mobile version
|
const snowflakeSymbolsMobile = ['❅', '❆', '❄']; // some snowflake symbols mobile version
|
||||||
@@ -46,11 +45,16 @@ observer.observe(document.body, {
|
|||||||
attributes: true
|
attributes: true
|
||||||
});
|
});
|
||||||
|
|
||||||
function addRandomSnowflakes(count) {
|
function initSnowflakes(count) {
|
||||||
const snowflakeContainer = document.querySelector('.snowflakes'); // get the snowflake container
|
let snowflakeContainer = document.querySelector('.snowflakes'); // get the snowflake container
|
||||||
if (!snowflakeContainer) return; // exit if snowflake container is not found
|
if (!snowflakeContainer) {
|
||||||
|
snowflakeContainer = document.createElement("div");
|
||||||
|
snowflakeContainer.className = "snowflakes";
|
||||||
|
snowflakeContainer.setAttribute("aria-hidden", "true");
|
||||||
|
document.body.appendChild(snowflakeContainer);
|
||||||
|
}
|
||||||
|
|
||||||
console.log('Adding random snowflakes');
|
console.log('Adding snowflakes');
|
||||||
|
|
||||||
for (let i = 0; i < count; i++) {
|
for (let i = 0; i < count; i++) {
|
||||||
// create a new snowflake element
|
// create a new snowflake element
|
||||||
@@ -66,7 +70,7 @@ function addRandomSnowflakes(count) {
|
|||||||
|
|
||||||
// set random horizontal position, animation delay and size(uncomment lines to enable)
|
// set random horizontal position, animation delay and size(uncomment lines to enable)
|
||||||
const randomLeft = Math.random() * 100; // position (0% to 100%)
|
const randomLeft = Math.random() * 100; // position (0% to 100%)
|
||||||
const randomAnimationDelay = Math.random() * 8; // delay (0s to 8s)
|
const randomAnimationDelay = -(Math.random() * 14); // delay (-14s to 0s)
|
||||||
const randomAnimationDelay2 = -(Math.random() * 5); // delay (-5s to 0s)
|
const randomAnimationDelay2 = -(Math.random() * 5); // delay (-5s to 0s)
|
||||||
|
|
||||||
// apply styles
|
// apply styles
|
||||||
@@ -83,49 +87,18 @@ function addRandomSnowflakes(count) {
|
|||||||
// add the snowflake to the container
|
// add the snowflake to the container
|
||||||
snowflakeContainer.appendChild(snowflake);
|
snowflakeContainer.appendChild(snowflake);
|
||||||
}
|
}
|
||||||
console.log('Random snowflakes added');
|
console.log('Snowflakes added');
|
||||||
}
|
}
|
||||||
|
|
||||||
// initialize standard snowflakes
|
// initialize snowflakes
|
||||||
function initSnowflakes() {
|
|
||||||
const snowflakesContainer = document.querySelector('.snowflakes') || document.createElement("div");
|
|
||||||
|
|
||||||
if (!document.querySelector('.snowflakes')) {
|
|
||||||
snowflakesContainer.className = "snowflakes";
|
|
||||||
snowflakesContainer.setAttribute("aria-hidden", "true");
|
|
||||||
document.body.appendChild(snowflakesContainer);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Array of snowflake characters
|
|
||||||
const snowflakeSymbols = ['❅', '❆'];
|
|
||||||
|
|
||||||
// create the 12 standard snowflakes
|
|
||||||
for (let i = 0; i < 12; i++) {
|
|
||||||
const snowflake = document.createElement('div');
|
|
||||||
snowflake.className = 'snowflake';
|
|
||||||
snowflake.textContent = snowflakeSymbols[i % 2]; // change between ❅ and ❆
|
|
||||||
|
|
||||||
// set random animation duration
|
|
||||||
if (enableDiffrentDuration) {
|
|
||||||
const randomAnimationDuration = Math.random() * 14 + 10; // delay (10s to 14s)
|
|
||||||
const randomAnimationDuration2 = Math.random() * 5 + 3; // delay (3s to 5s)
|
|
||||||
snowflake.style.animationDuration = `${randomAnimationDuration}s, ${randomAnimationDuration2}s`;
|
|
||||||
}
|
|
||||||
|
|
||||||
snowflakesContainer.appendChild(snowflake);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// initialize snowflakes and add random snowflakes
|
|
||||||
function initializeSnowflakes() {
|
function initializeSnowflakes() {
|
||||||
if (!snowflakes) return; // exit if snowflakes are disabled
|
if (!snowflakes) return; // exit if snowflakes are disabled
|
||||||
initSnowflakes();
|
|
||||||
toggleSnowflakes();
|
|
||||||
|
|
||||||
const screenWidth = window.innerWidth; // get the screen width to detect mobile devices
|
const isMobile = window.matchMedia("only screen and (max-width: 768px)").matches;
|
||||||
if (randomSnowflakes && (screenWidth > 768 || randomSnowflakesMobile)) { // add random snowflakes only on larger screens, unless enabled for mobile devices
|
const count = !isMobile ? snowflakeCount : snowflakeCountMobile;
|
||||||
addRandomSnowflakes(snowflakeCount);
|
|
||||||
}
|
initSnowflakes(count);
|
||||||
|
toggleSnowflakes();
|
||||||
}
|
}
|
||||||
|
|
||||||
initializeSnowflakes();
|
initializeSnowflakes();
|
||||||
@@ -1,11 +1,11 @@
|
|||||||
const config = window.SeasonalsPluginConfig?.Snowstorm || {};
|
const config = window.SeasonalsPluginConfig?.Snowstorm || {};
|
||||||
|
|
||||||
const snowstorm = config.EnableSnowstorm !== undefined ? config.EnableSnowstorm : true; // enable/disable snowstorm
|
const snowstorm = config.EnableSnowstorm !== undefined ? config.EnableSnowstorm : true; // enable/disable snowstorm
|
||||||
let snowflakesCount = config.SnowflakesCount || 500; // count of snowflakes (recommended values: 300-600)
|
let snowflakesCount = config.SnowflakesCount !== undefined ? config.SnowflakesCount : 500; // count of snowflakes
|
||||||
const snowflakesCountMobile = config.SnowflakesCountMobile || 250; // count of snowflakes on mobile devices (Warning: High values may affect performance)
|
const snowflakesCountMobile = config.SnowflakesCountMobile !== undefined ? config.SnowflakesCountMobile : 250; // count of snowflakes on mobile
|
||||||
const snowFallSpeed = config.Speed || 6; // speed of snowfall (recommended values: 4-8)
|
const snowFallSpeed = config.Speed !== undefined ? config.Speed : 6; // speed of snowstorm
|
||||||
const horizontalWind = config.HorizontalWind || 4; // horizontal wind speed (recommended value: 4)
|
const horizontalWind = config.HorizontalWind !== undefined ? config.HorizontalWind : 4; // horizontal wind strength
|
||||||
const verticalVariation = config.VerticalVariation || 2; // vertical variation (recommended value: 2)
|
const verticalVariation = config.VerticalVariation !== undefined ? config.VerticalVariation : 2; // vertical variation
|
||||||
|
|
||||||
let msgPrinted = false; // flag to prevent multiple console messages
|
let msgPrinted = false; // flag to prevent multiple console messages
|
||||||
|
|
||||||
@@ -184,8 +184,8 @@ function initializeSnowstorm() {
|
|||||||
}
|
}
|
||||||
const container = document.querySelector('.snowstorm-container');
|
const container = document.querySelector('.snowstorm-container');
|
||||||
if (container) {
|
if (container) {
|
||||||
const screenWidth = window.innerWidth; // get the screen width to detect mobile devices
|
const isMobile = window.matchMedia("only screen and (max-width: 768px)").matches;
|
||||||
if (screenWidth < 768) { // lower count of snowflakes on mobile devices
|
if (isMobile) { // lower count of snowflakes on mobile devices
|
||||||
console.log('Mobile device detected. Reducing snowflakes count.');
|
console.log('Mobile device detected. Reducing snowflakes count.');
|
||||||
snowflakesCount = snowflakesCountMobile;
|
snowflakesCount = snowflakesCountMobile;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,18 +1,20 @@
|
|||||||
const config = window.SeasonalsPluginConfig?.Space || {};
|
const config = window.SeasonalsPluginConfig?.Space || {};
|
||||||
|
|
||||||
const space = config.EnableSpace !== undefined ? config.EnableSpace : true;
|
const space = config.EnableSpace !== undefined ? config.EnableSpace : true; // enable/disable space
|
||||||
const planetCountConf = config.PlanetCount !== undefined ? config.PlanetCount : 6;
|
const planetCountConf = config.PlanetCount !== undefined ? config.PlanetCount : 6; // count of planets
|
||||||
const astronautCountConf = config.AstronautCount !== undefined ? config.AstronautCount : 1;
|
const astronautCountConf = config.AstronautCount !== undefined ? config.AstronautCount : 1; // count of astronaut
|
||||||
const satelliteCountConf = config.SatelliteCount !== undefined ? config.SatelliteCount : 4;
|
const satelliteCountConf = config.SatelliteCount !== undefined ? config.SatelliteCount : 4; // count of satellite
|
||||||
const issCountConf = config.IssCount !== undefined ? config.IssCount : 1;
|
const issCountConf = config.IssCount !== undefined ? config.IssCount : 1; // count of iss
|
||||||
const rocketCountConf = config.RocketCount !== undefined ? config.RocketCount : 1;
|
const rocketCountConf = config.RocketCount !== undefined ? config.RocketCount : 1; // count of rocket/space shuttle
|
||||||
const useRandomSymbols = config.EnableRandomSymbols !== undefined ? config.EnableRandomSymbols : true;
|
const enableDifferentDuration = config.EnableDifferentDuration !== undefined ? config.EnableDifferentDuration : true; // enable different durations
|
||||||
const enableRandomMobile = config.EnableRandomSymbolsMobile !== undefined ? config.EnableRandomSymbolsMobile : false;
|
const symbolCountMobile = config.SymbolCountMobile !== undefined ? config.SymbolCountMobile : 2; // Devisor to reduce number of objects on mobile
|
||||||
const enableDifferentDuration = config.EnableDifferentDuration !== undefined ? config.EnableDifferentDuration : true;
|
|
||||||
|
|
||||||
|
// Credit: https://lottiefiles.com/free-animation/astronaut-63lcWG4Xnh
|
||||||
const astronautImages = [
|
const astronautImages = [
|
||||||
"../Seasonals/Resources/space_assets/astronaut_1.gif"
|
"../Seasonals/Resources/space_assets/astronaut_1.gif"
|
||||||
];
|
];
|
||||||
|
|
||||||
|
// Credits: https://flaticon.com
|
||||||
const planetImages = [
|
const planetImages = [
|
||||||
"../Seasonals/Resources/space_assets/planet_1.png",
|
"../Seasonals/Resources/space_assets/planet_1.png",
|
||||||
"../Seasonals/Resources/space_assets/planet_2.png",
|
"../Seasonals/Resources/space_assets/planet_2.png",
|
||||||
@@ -24,13 +26,21 @@ const planetImages = [
|
|||||||
"../Seasonals/Resources/space_assets/planet_8.png",
|
"../Seasonals/Resources/space_assets/planet_8.png",
|
||||||
"../Seasonals/Resources/space_assets/planet_9.png"
|
"../Seasonals/Resources/space_assets/planet_9.png"
|
||||||
];
|
];
|
||||||
|
|
||||||
|
// Credits: https://lottiefiles.com/free-animation/s-satellite-vfnNE8AALo
|
||||||
const satelliteImages = [
|
const satelliteImages = [
|
||||||
"../Seasonals/Resources/space_assets/Satellite_1.gif",
|
"../Seasonals/Resources/space_assets/Satellite_1.gif",
|
||||||
"../Seasonals/Resources/space_assets/Satellite_2.gif"
|
"../Seasonals/Resources/space_assets/Satellite_2.gif"
|
||||||
];
|
];
|
||||||
|
|
||||||
|
// Credit: https://pixabay.com/de/illustrations/raumstation-raum-struktur-8023777/
|
||||||
const issImage = "../Seasonals/Resources/space_assets/iss.png";
|
const issImage = "../Seasonals/Resources/space_assets/iss.png";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Credits:
|
||||||
|
* https://lottiefiles.com/free-animation/rocket-MYUQ3UFq3k
|
||||||
|
* https://pixabay.com/de/vectors/space-shuttle-atlantis-nasa-156012/
|
||||||
|
*/
|
||||||
const rocketImages = [
|
const rocketImages = [
|
||||||
"../Seasonals/Resources/space_assets/rocket.gif",
|
"../Seasonals/Resources/space_assets/rocket.gif",
|
||||||
"../Seasonals/Resources/space_assets/space-shuttle.png"
|
"../Seasonals/Resources/space_assets/space-shuttle.png"
|
||||||
@@ -78,26 +88,19 @@ function createSpace() {
|
|||||||
document.body.appendChild(container);
|
document.body.appendChild(container);
|
||||||
}
|
}
|
||||||
|
|
||||||
const standardPlanetCount = 4;
|
// const standardPlanetCount = 4;
|
||||||
const standardAstronautCount = 1;
|
// const standardAstronautCount = 1;
|
||||||
const standardSatelliteCount = 2;
|
// const standardSatelliteCount = 2;
|
||||||
const standardIssCount = 1;
|
// const standardIssCount = 1;
|
||||||
const standardRocketCount = 1;
|
// const standardRocketCount = 1;
|
||||||
|
|
||||||
let isMobile = window.matchMedia("only screen and (max-width: 768px)").matches;
|
let isMobile = window.matchMedia("only screen and (max-width: 768px)").matches;
|
||||||
let pCount = planetCountConf;
|
let divisor = isMobile ? Math.max(1, symbolCountMobile) : 1;
|
||||||
let aCount = astronautCountConf;
|
let pCount = Math.floor(planetCountConf / divisor);
|
||||||
let sCount = satelliteCountConf;
|
let aCount = Math.floor(astronautCountConf / divisor);
|
||||||
let iCount = issCountConf;
|
let sCount = Math.floor(satelliteCountConf / divisor);
|
||||||
let rCount = rocketCountConf;
|
let iCount = Math.floor(issCountConf / divisor);
|
||||||
|
let rCount = Math.floor(rocketCountConf / divisor);
|
||||||
if (isMobile && !enableRandomMobile) {
|
|
||||||
pCount = standardPlanetCount;
|
|
||||||
aCount = standardAstronautCount;
|
|
||||||
sCount = standardSatelliteCount;
|
|
||||||
iCount = standardIssCount;
|
|
||||||
rCount = standardRocketCount;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Add Nebula Glow
|
// Add Nebula Glow
|
||||||
const bgGlow = document.createElement('div');
|
const bgGlow = document.createElement('div');
|
||||||
|
|||||||
@@ -1,11 +1,17 @@
|
|||||||
const config = window.SeasonalsPluginConfig?.Spooky || {};
|
const config = window.SeasonalsPluginConfig?.Spooky || {};
|
||||||
|
|
||||||
const spooky = config.EnableSpooky !== undefined ? config.EnableSpooky : true; // enable/disable
|
const spooky = config.EnableSpooky !== undefined ? config.EnableSpooky : true; // enable/disable spooky
|
||||||
const spookyCount = config.SymbolCount || 25; // count of random extra symbols
|
const spookyCount = config.SymbolCount !== undefined ? config.SymbolCount : 25; // count of symbols
|
||||||
const enableDifferentDuration = config.EnableDifferentDuration !== undefined ? config.EnableDifferentDuration : true;
|
const enableDifferentDuration = config.EnableDifferentDuration !== undefined ? config.EnableDifferentDuration : true; // enable different durations
|
||||||
const enableSpookySway = config.EnableSpookySway !== undefined ? config.EnableSpookySway : true;
|
const enableSpookySway = config.EnableSpookySway !== undefined ? config.EnableSpookySway : true; // enable/disable spooky sway
|
||||||
const spookySize = config.SpookySize || 20;
|
const spookySize = config.SpookySize !== undefined ? config.SpookySize : 20; // size of elements
|
||||||
const spookyGlowSize = config.SpookyGlowSize !== undefined ? config.SpookyGlowSize : 2;
|
const spookyGlowSize = config.SpookyGlowSize !== undefined ? config.SpookyGlowSize : 2; // size of element glow
|
||||||
|
|
||||||
|
const spookyImages = [
|
||||||
|
"../Seasonals/Resources/halloween_images/ghost_20x20.png",
|
||||||
|
"../Seasonals/Resources/halloween_images/bat_20x20.png",
|
||||||
|
"../Seasonals/Resources/halloween_images/pumpkin_20x20.png",
|
||||||
|
];
|
||||||
|
|
||||||
let msgPrinted = false;
|
let msgPrinted = false;
|
||||||
|
|
||||||
@@ -20,13 +26,13 @@ function toggleSpooky() {
|
|||||||
const hasUserMenu = document.querySelector('#app-user-menu');
|
const hasUserMenu = document.querySelector('#app-user-menu');
|
||||||
|
|
||||||
if (videoPlayer || trailerPlayer || isDashboard || hasUserMenu) {
|
if (videoPlayer || trailerPlayer || isDashboard || hasUserMenu) {
|
||||||
spookyContainer.style.display = 'none'; // hide spooky
|
spookyContainer.style.display = 'none';
|
||||||
if (!msgPrinted) {
|
if (!msgPrinted) {
|
||||||
console.log('Spooky Theme hidden');
|
console.log('Spooky Theme hidden');
|
||||||
msgPrinted = true;
|
msgPrinted = true;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
spookyContainer.style.display = 'block'; // show spooky
|
spookyContainer.style.display = 'block';
|
||||||
if (msgPrinted) {
|
if (msgPrinted) {
|
||||||
console.log('Spooky Theme visible');
|
console.log('Spooky Theme visible');
|
||||||
msgPrinted = false;
|
msgPrinted = false;
|
||||||
@@ -34,7 +40,6 @@ function toggleSpooky() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// observe changes in the DOM
|
|
||||||
const observer = new MutationObserver(toggleSpooky);
|
const observer = new MutationObserver(toggleSpooky);
|
||||||
observer.observe(document.body, {
|
observer.observe(document.body, {
|
||||||
childList: true,
|
childList: true,
|
||||||
@@ -42,13 +47,7 @@ observer.observe(document.body, {
|
|||||||
attributes: true
|
attributes: true
|
||||||
});
|
});
|
||||||
|
|
||||||
const spookyImages = [
|
|
||||||
"../Seasonals/Resources/halloween_images/ghost_20x20.png",
|
|
||||||
"../Seasonals/Resources/halloween_images/bat_20x20.png",
|
|
||||||
"../Seasonals/Resources/halloween_images/pumpkin_20x20.png",
|
|
||||||
];
|
|
||||||
|
|
||||||
// create spooky objects
|
|
||||||
function createSpooky() {
|
function createSpooky() {
|
||||||
const container = document.querySelector('.spooky-container') || document.createElement("div");
|
const container = document.querySelector('.spooky-container') || document.createElement("div");
|
||||||
|
|
||||||
@@ -95,7 +94,6 @@ function createSpooky() {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
// Add configured extra symbols
|
|
||||||
for (let i = 0; i < spookyCount; i++) {
|
for (let i = 0; i < spookyCount; i++) {
|
||||||
const spookyOuter = document.createElement("div");
|
const spookyOuter = document.createElement("div");
|
||||||
spookyOuter.className = "spooky";
|
spookyOuter.className = "spooky";
|
||||||
|
|||||||
@@ -1,29 +1,30 @@
|
|||||||
const config = window.SeasonalsPluginConfig?.Sports || {};
|
const config = window.SeasonalsPluginConfig?.Sports || {};
|
||||||
|
|
||||||
const sports = config.EnableSports !== undefined ? config.EnableSports : true;
|
const sports = config.EnableSports !== undefined ? config.EnableSports : true; // enable/disable sports
|
||||||
const symbolCount = config.SymbolCount || 5;
|
const symbolCount = config.SymbolCount !== undefined ? config.SymbolCount : 5; // count of balls per category
|
||||||
const useRandomSymbols = config.EnableRandomSymbols !== undefined ? config.EnableRandomSymbols : true;
|
const enableDifferentDuration = config.EnableDifferentDuration !== undefined ? config.EnableDifferentDuration : true; // enable different durations
|
||||||
const enableRandomMobile = config.EnableRandomSymbolsMobile !== undefined ? config.EnableRandomSymbolsMobile : false;
|
const enableTrophy = config.EnableTrophy !== undefined ? config.EnableTrophy : false; // enable/disable trophy
|
||||||
const enableDifferentDuration = config.EnableDifferentDuration !== undefined ? config.EnableDifferentDuration : true;
|
const rawSportsBalls = config.SportsBalls !== undefined ? config.SportsBalls : 'football,basketball,tennis,volleyball'; // set sports categories to spawn
|
||||||
const enableTrophy = config.EnableTrophy !== undefined ? config.EnableTrophy : false;
|
const turfColorHex = config.TurfColor !== undefined ? config.TurfColor : '#228b22'; // color of turf
|
||||||
|
const confettiColors = config.ConfettiColors ? config.ConfettiColors.split(',') : ['#000000', '#FF0000', '#FFCC00']; // Add Country Colored confetti
|
||||||
|
|
||||||
// Pre-declare and manage image assets
|
// Pre-declare and manage image assets
|
||||||
|
// Credits: https://flaticon.com
|
||||||
const SPORTS_ASSETS = {
|
const SPORTS_ASSETS = {
|
||||||
badminton: ['badminton_1', 'badminton_2'],
|
badminton: ['badminton_1', 'badminton_2'],
|
||||||
baseball: ['baseball_1', 'baseball_2'],
|
baseball: ['baseball_1', 'baseball_2'],
|
||||||
basketball: ['basketball_1', 'basketball_2'],
|
basketball: ['basketball_1', 'basketball_2'],
|
||||||
billiard: Array.from({length: 14}, (_, i) => `billiard_ball_${i + 1}`),
|
billiard: Array.from({length: 14}, (_, i) => `billiard_ball_${i + 1}`),
|
||||||
bowling: ['bowling_1', 'bowling_2'],
|
bowling: ['bowling_1', 'bowling_2'],
|
||||||
football: Array.from({length: 5}, (_, i) => `football_${i + 1}`),
|
football: Array.from({length: 5}, (_, i) => `football_${i + 1}`),
|
||||||
golf: ['golf_ball_1', 'golf_ball_2'],
|
golf: ['golf_ball_1', 'golf_ball_2'],
|
||||||
rugby: ['rugby_ball_1', 'rugby_ball_2'],
|
rugby: ['rugby_ball_1', 'rugby_ball_2'],
|
||||||
table_tennis: ['table_tennis_ball_1', 'table_tennis_ball_2'],
|
table_tennis: ['table_tennis_ball_1', 'table_tennis_ball_2'],
|
||||||
tennis: ['tennis_ball_1', 'tennis_ball_2'],
|
tennis: ['tennis_ball_1', 'tennis_ball_2'],
|
||||||
volleyball: ['volleyball_1', 'volleyball_2'],
|
volleyball: ['volleyball_1', 'volleyball_2'],
|
||||||
waterball: ['waterball_1', 'waterball_2']
|
waterball: ['waterball_1', 'waterball_2']
|
||||||
};
|
};
|
||||||
|
|
||||||
const turfColorHex = config.TurfColor || '#228b22';
|
|
||||||
|
|
||||||
let msgPrinted = false;
|
let msgPrinted = false;
|
||||||
|
|
||||||
@@ -67,11 +68,10 @@ function createSports() {
|
|||||||
document.body.appendChild(container);
|
document.body.appendChild(container);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Parse turf color config
|
|
||||||
// Create a turf/grass overlay at the bottom using the provided hex
|
// Create a turf/grass overlay at the bottom using the provided hex
|
||||||
const turf = document.createElement('div');
|
const turf = document.createElement('div');
|
||||||
turf.className = 'sports-turf';
|
turf.className = 'sports-turf';
|
||||||
// Using hex with transparency (e.g., 4D = 30%, CC = 80%)
|
// Using hex with transparency
|
||||||
turf.style.background = `linear-gradient(180deg, transparent 0%, ${turfColorHex}4D 30%, ${turfColorHex}CC 100%)`;
|
turf.style.background = `linear-gradient(180deg, transparent 0%, ${turfColorHex}4D 30%, ${turfColorHex}CC 100%)`;
|
||||||
container.appendChild(turf);
|
container.appendChild(turf);
|
||||||
|
|
||||||
@@ -85,7 +85,6 @@ function createSports() {
|
|||||||
const useRandomDuration = enableDifferentDuration !== false;
|
const useRandomDuration = enableDifferentDuration !== false;
|
||||||
|
|
||||||
// Map standard sports balls to spawn based on category configuration
|
// Map standard sports balls to spawn based on category configuration
|
||||||
const rawSportsBalls = config.SportsBalls || 'football,basketball,tennis,volleyball';
|
|
||||||
const chosenCategories = rawSportsBalls.split(',').map(s => s.trim()).filter(s => s !== '');
|
const chosenCategories = rawSportsBalls.split(',').map(s => s.trim()).filter(s => s !== '');
|
||||||
|
|
||||||
const createBall = (randomItem) => {
|
const createBall = (randomItem) => {
|
||||||
@@ -140,7 +139,7 @@ function createSports() {
|
|||||||
// Create falling sports balls
|
// Create falling sports balls
|
||||||
chosenCategories.forEach(category => {
|
chosenCategories.forEach(category => {
|
||||||
let variants = SPORTS_ASSETS[category];
|
let variants = SPORTS_ASSETS[category];
|
||||||
if (!variants) variants = [category]; // Legacy fallback
|
if (!variants) variants = [category];
|
||||||
|
|
||||||
for (let i = 0; i < ballsPerCategory; i++) {
|
for (let i = 0; i < ballsPerCategory; i++) {
|
||||||
// Pick a random variant
|
// Pick a random variant
|
||||||
@@ -162,7 +161,6 @@ function createSports() {
|
|||||||
|
|
||||||
let trophyImg = document.createElement('img');
|
let trophyImg = document.createElement('img');
|
||||||
trophyImg.src = `../Seasonals/Resources/sport_assets/trophy.gif`;
|
trophyImg.src = `../Seasonals/Resources/sport_assets/trophy.gif`;
|
||||||
// Randomly scale trophy slightly larger
|
|
||||||
trophyImg.style.transform = `scale(${Math.random() * 0.5 + 0.8})`;
|
trophyImg.style.transform = `scale(${Math.random() * 0.5 + 0.8})`;
|
||||||
trophyImg.onerror = function() {
|
trophyImg.onerror = function() {
|
||||||
this.style.display = 'none';
|
this.style.display = 'none';
|
||||||
@@ -211,8 +209,6 @@ function createSports() {
|
|||||||
setTimeout(() => { if (document.body.contains(container)) launchTrophy(); }, Math.random() * 5000 + 2000);
|
setTimeout(() => { if (document.body.contains(container)) launchTrophy(); }, Math.random() * 5000 + 2000);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Add Germany Colored confetti (Black, Red, Gold)
|
|
||||||
const confettiColors = ['#000000', '#FF0000', '#FFCC00'];
|
|
||||||
const confettiCount = isMobile ? 30 : 60;
|
const confettiCount = isMobile ? 30 : 60;
|
||||||
|
|
||||||
for (let i = 0; i < confettiCount; i++) {
|
for (let i = 0; i < confettiCount; i++) {
|
||||||
@@ -257,8 +253,6 @@ function createSports() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Removed legacy fallback logic */
|
|
||||||
|
|
||||||
function initializeSports() {
|
function initializeSports() {
|
||||||
if (!sports) return;
|
if (!sports) return;
|
||||||
createSports();
|
createSports();
|
||||||
|
|||||||
@@ -1,14 +1,14 @@
|
|||||||
const config = window.SeasonalsPluginConfig?.Spring || {};
|
const config = window.SeasonalsPluginConfig?.Spring || {};
|
||||||
|
|
||||||
const spring = config.EnableSpring !== undefined ? config.EnableSpring : true; // Enable/disable spring
|
const spring = config.EnableSpring !== undefined ? config.EnableSpring : true; // enable/disable spring
|
||||||
const pollenCount = config.PollenCount || 30; // Number of pollen particles
|
const pollenCount = config.PollenCount !== undefined ? config.PollenCount : 30; // count of pollen
|
||||||
const sunbeamCount = config.SunbeamCount || 5; // Number of sunbeams
|
const enableSunbeams = config.EnableSpringSunbeams !== undefined ? config.EnableSpringSunbeams : true; // enable/disable sunbeams
|
||||||
const enableSunbeams = config.EnableSpringSunbeams !== undefined ? config.EnableSpringSunbeams : true; // Enable/disable sunbeams
|
const sunbeamCount = config.SunbeamCount !== undefined ? config.SunbeamCount : 5; // count of sunbeams
|
||||||
const birdCount = config.BirdCount !== undefined ? config.BirdCount : 3; // Number of birds
|
const birdCount = config.BirdCount !== undefined ? config.BirdCount : 3; // count of birds
|
||||||
const butterflyCount = config.ButterflyCount !== undefined ? config.ButterflyCount : 4; // Number of butterflies
|
const butterflyCount = config.ButterflyCount !== undefined ? config.ButterflyCount : 4; // count of butterflies
|
||||||
const beeCount = config.BeeCount !== undefined ? config.BeeCount : 2; // Number of bees
|
const beeCount = config.BeeCount !== undefined ? config.BeeCount : 2; // count of bees
|
||||||
const ladybugCount = config.LadybugCount !== undefined ? config.LadybugCount : 2; // Number of ladybugs
|
const ladybugCount = config.LadybugCount !== undefined ? config.LadybugCount : 2; // count of ladybugs
|
||||||
const randomSpring = config.EnableRandomSpring !== undefined ? config.EnableRandomSpring : true; // Enable random spring objects
|
const symbolCountMobile = config.SymbolCountMobile !== undefined ? config.SymbolCountMobile : 2; // Devisor to reduce number of objects on mobile
|
||||||
|
|
||||||
// Credit: https://lottiefiles.com/free-animation/birds-flying-V7O0L8jkOg
|
// Credit: https://lottiefiles.com/free-animation/birds-flying-V7O0L8jkOg
|
||||||
const birdImages = [
|
const birdImages = [
|
||||||
@@ -23,7 +23,10 @@ const butterflyImages = [
|
|||||||
'../Seasonals/Resources/spring_assets/Butterfly_2.gif'
|
'../Seasonals/Resources/spring_assets/Butterfly_2.gif'
|
||||||
];
|
];
|
||||||
|
|
||||||
|
// Credit: https://lottiefiles.com/free-animation/loading-flying-beee-WcTfIccdJZ
|
||||||
const beeImage = '../Seasonals/Resources/spring_assets/Bee.gif';
|
const beeImage = '../Seasonals/Resources/spring_assets/Bee.gif';
|
||||||
|
|
||||||
|
// Credit: https://pixabay.com/gifs/ladybug-insect-nature-fly-wings-5068/
|
||||||
const ladybugImage = '../Seasonals/Resources/spring_assets/ladybug.gif';
|
const ladybugImage = '../Seasonals/Resources/spring_assets/ladybug.gif';
|
||||||
|
|
||||||
let msgPrinted = false;
|
let msgPrinted = false;
|
||||||
@@ -230,28 +233,35 @@ function initializeSpring() {
|
|||||||
|
|
||||||
const container = document.querySelector('.spring-container');
|
const container = document.querySelector('.spring-container');
|
||||||
if (container) {
|
if (container) {
|
||||||
if (randomSpring) {
|
let isMobile = window.matchMedia("only screen and (max-width: 768px)").matches;
|
||||||
// Add Pollen
|
let divisor = isMobile ? Math.max(1, symbolCountMobile) : 1;
|
||||||
for (let i = 0; i < pollenCount; i++) {
|
|
||||||
createPollen(container);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Add Birds
|
let adjPollen = Math.floor(pollenCount / divisor);
|
||||||
for (let i = 0; i < birdCount; i++) {
|
let adjBird = Math.floor(birdCount / divisor);
|
||||||
setTimeout(() => createBird(container), Math.random() * 1000); // 0-1s desync
|
let adjButterfly = Math.floor(butterflyCount / divisor);
|
||||||
}
|
let adjBee = Math.floor(beeCount / divisor);
|
||||||
// Add Butterflies
|
let adjLadybug = Math.floor(ladybugCount / divisor);
|
||||||
for (let i = 0; i < butterflyCount; i++) {
|
|
||||||
setTimeout(() => createButterfly(container), Math.random() * 1000); // 0-1s desync
|
// Add Pollen
|
||||||
}
|
for (let i = 0; i < adjPollen; i++) {
|
||||||
// Add Bees
|
createPollen(container);
|
||||||
for (let i = 0; i < beeCount; i++) {
|
}
|
||||||
setTimeout(() => createBee(container), Math.random() * 1000); // 0-1s desync
|
|
||||||
}
|
// Add Birds
|
||||||
// Add Ladybugs
|
for (let i = 0; i < adjBird; i++) {
|
||||||
for (let i = 0; i < ladybugCount; i++) {
|
setTimeout(() => createBird(container), Math.random() * 1000); // 0-1s desync
|
||||||
setTimeout(() => createLadybugGif(container), Math.random() * 1000); // 0-1s desync
|
}
|
||||||
}
|
// Add Butterflies
|
||||||
|
for (let i = 0; i < adjButterfly; i++) {
|
||||||
|
setTimeout(() => createButterfly(container), Math.random() * 1000); // 0-1s desync
|
||||||
|
}
|
||||||
|
// Add Bees
|
||||||
|
for (let i = 0; i < adjBee; i++) {
|
||||||
|
setTimeout(() => createBee(container), Math.random() * 1000); // 0-1s desync
|
||||||
|
}
|
||||||
|
// Add Ladybugs
|
||||||
|
for (let i = 0; i < adjLadybug; i++) {
|
||||||
|
setTimeout(() => createLadybugGif(container), Math.random() * 1000); // 0-1s desync
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
const config = window.SeasonalsPluginConfig?.StarWars || {};
|
const config = window.SeasonalsPluginConfig?.StarWars || {};
|
||||||
const starwars = config.EnableStarWars !== undefined ? config.EnableStarWars : true;
|
const starwars = config.EnableStarWars !== undefined ? config.EnableStarWars : true; // enable/disable starwars
|
||||||
|
|
||||||
let msgPrinted = false;
|
let msgPrinted = false;
|
||||||
|
|
||||||
|
|||||||
@@ -1,10 +1,10 @@
|
|||||||
const config = window.SeasonalsPluginConfig?.Storm || {};
|
const config = window.SeasonalsPluginConfig?.Storm || {};
|
||||||
|
|
||||||
const enabled = config.EnableStorm !== undefined ? config.EnableStorm : true;
|
const enabled = config.EnableStorm !== undefined ? config.EnableStorm : true; // enable/disable storm
|
||||||
const isMobile = window.innerWidth <= 768;
|
const isMobile = window.matchMedia("only screen and (max-width: 768px)").matches;
|
||||||
const elementCount = isMobile ? (config.RaindropCountMobile || 150) : (config.RaindropCount || 300);
|
const elementCount = isMobile ? (config.RaindropCountMobile || 150) : (config.RaindropCount || 300); // count of raindrops
|
||||||
const enableLightning = config.EnableLightning !== undefined ? config.EnableLightning : true;
|
const enableLightning = config.EnableLightning !== undefined ? config.EnableLightning : true; // enable/disable lightning
|
||||||
const rainSpeed = config.RainSpeed || 1.0;
|
const rainSpeed = config.RainSpeed !== undefined ? config.RainSpeed : 1.0; // speed of rain
|
||||||
|
|
||||||
let msgPrinted = false;
|
let msgPrinted = false;
|
||||||
|
|
||||||
|
|||||||
@@ -1,11 +1,10 @@
|
|||||||
const config = window.SeasonalsPluginConfig?.Summer || {};
|
const config = window.SeasonalsPluginConfig?.Summer || {};
|
||||||
|
|
||||||
const summer = config.EnableSummer !== undefined ? config.EnableSummer : true; // Enable/disable summer theme
|
const summer = config.EnableSummer !== undefined ? config.EnableSummer : true; // enable/disable summer
|
||||||
const bubbleCount = config.BubbleCount || 30; // Number of bubbles
|
const bubbleCount = config.BubbleCount !== undefined ? config.BubbleCount : 30; // count of bubbles
|
||||||
const dustCount = config.DustCount || 50; // Number of dust particles
|
const dustCount = config.DustCount !== undefined ? config.DustCount : 50; // count of dust particles
|
||||||
const randomSummer = config.EnableRandomSummer !== undefined ? config.EnableRandomSummer : true; // Enable random generating objects
|
const symbolCountMobile = config.SymbolCountMobile !== undefined ? config.SymbolCountMobile : 2; // Devisor to reduce number of objects on mobile
|
||||||
const randomSummerMobile = config.EnableRandomSummerMobile !== undefined ? config.EnableRandomSummerMobile : false; // Enable random generating objects on mobile
|
const enableDifferentDuration = config.EnableDifferentDuration !== undefined ? config.EnableDifferentDuration : true; // enable different durations
|
||||||
const enableDifferentDuration = config.EnableDifferentDuration !== undefined ? config.EnableDifferentDuration : true; // Randomize animation duration of bubbles and dust
|
|
||||||
|
|
||||||
let msgPrinted = false;
|
let msgPrinted = false;
|
||||||
|
|
||||||
@@ -39,34 +38,23 @@ observer.observe(document.body, {
|
|||||||
subtree: true,
|
subtree: true,
|
||||||
attributes: true
|
attributes: true
|
||||||
});
|
});
|
||||||
function createBubble(container, isDust = false) {
|
|
||||||
|
function createBubble(container) {
|
||||||
const bubble = document.createElement('div');
|
const bubble = document.createElement('div');
|
||||||
|
|
||||||
if (isDust) {
|
bubble.classList.add('summer-bubble');
|
||||||
bubble.classList.add('summer-dust');
|
|
||||||
} else {
|
|
||||||
bubble.classList.add('summer-bubble');
|
|
||||||
}
|
|
||||||
|
|
||||||
// Random horizontal position
|
// Random horizontal position
|
||||||
const randomLeft = Math.random() * 100;
|
const randomLeft = Math.random() * 100;
|
||||||
bubble.style.left = `${randomLeft}%`;
|
bubble.style.left = `${randomLeft}%`;
|
||||||
|
|
||||||
// Random size
|
// MARK: BUBBLE SIZE
|
||||||
if (!isDust) {
|
const size = Math.random() * 20 + 10; // 10-30px bubbles
|
||||||
// MARK: BUBBLE SIZE
|
bubble.style.width = `${size}px`;
|
||||||
const size = Math.random() * 20 + 10; // 10-30px bubbles
|
bubble.style.height = `${size}px`;
|
||||||
bubble.style.width = `${size}px`;
|
|
||||||
bubble.style.height = `${size}px`;
|
|
||||||
} else {
|
|
||||||
// MARK: DUST SIZE
|
|
||||||
const size = Math.random() * 3 + 1; // 1-4px dust
|
|
||||||
bubble.style.width = `${size}px`;
|
|
||||||
bubble.style.height = `${size}px`;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Animation properties
|
// Animation properties
|
||||||
const duration = isDust ? (Math.random() * 20 + 10) : (Math.random() * 10 + 5); // Dust is slower
|
const duration = (Math.random() * 10 + 5);
|
||||||
const delay = Math.random() * 10;
|
const delay = Math.random() * 10;
|
||||||
|
|
||||||
if (enableDifferentDuration) {
|
if (enableDifferentDuration) {
|
||||||
@@ -77,19 +65,30 @@ function createBubble(container, isDust = false) {
|
|||||||
container.appendChild(bubble);
|
container.appendChild(bubble);
|
||||||
}
|
}
|
||||||
|
|
||||||
function addRandomSummerObjects() {
|
function createDust(container) {
|
||||||
const container = document.querySelector('.summer-container');
|
const dust = document.createElement('div');
|
||||||
if (!container) return;
|
|
||||||
|
|
||||||
// Add bubbles
|
dust.classList.add('summer-dust');
|
||||||
for (let i = 0; i < bubbleCount; i++) {
|
|
||||||
createBubble(container, false);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Add some dust particles
|
// Random horizontal position
|
||||||
for (let i = 0; i < dustCount; i++) {
|
const randomLeft = Math.random() * 100;
|
||||||
createBubble(container, true);
|
dust.style.left = `${randomLeft}%`;
|
||||||
|
|
||||||
|
// MARK: DUST SIZE
|
||||||
|
const size = Math.random() * 3 + 1; // 1-4px dust
|
||||||
|
dust.style.width = `${size}px`;
|
||||||
|
dust.style.height = `${size}px`;
|
||||||
|
|
||||||
|
// Animation properties
|
||||||
|
const duration = (Math.random() * 20 + 10); // Dust is slower
|
||||||
|
const delay = Math.random() * 10;
|
||||||
|
|
||||||
|
if (enableDifferentDuration) {
|
||||||
|
dust.style.animationDuration = `${duration}s`;
|
||||||
}
|
}
|
||||||
|
dust.style.animationDelay = `${delay}s`;
|
||||||
|
|
||||||
|
container.appendChild(dust);
|
||||||
}
|
}
|
||||||
|
|
||||||
function initSummerObjects() {
|
function initSummerObjects() {
|
||||||
@@ -101,38 +100,18 @@ function initSummerObjects() {
|
|||||||
document.body.appendChild(container);
|
document.body.appendChild(container);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Initial bubbles/dust
|
let isMobile = window.matchMedia("only screen and (max-width: 768px)").matches;
|
||||||
for (let i = 0; i < 10; i++) {
|
let limitBubbles = isMobile ? Math.floor(bubbleCount / Math.max(1, symbolCountMobile)) : bubbleCount;
|
||||||
const bubble = document.createElement('div');
|
let limitDust = isMobile ? Math.floor(dustCount / Math.max(1, symbolCountMobile)) : dustCount;
|
||||||
const isDust = Math.random() > 0.5;
|
|
||||||
if (isDust) {
|
|
||||||
bubble.classList.add('summer-dust');
|
|
||||||
} else {
|
|
||||||
bubble.classList.add('summer-bubble');
|
|
||||||
}
|
|
||||||
|
|
||||||
const randomLeft = Math.random() * 100;
|
// Initial bubbles
|
||||||
bubble.style.left = `${randomLeft}%`;
|
for (let i = 0; i < limitBubbles; i++) {
|
||||||
|
createBubble(container);
|
||||||
|
}
|
||||||
|
|
||||||
if (!isDust) {
|
// Initial dust
|
||||||
// MARK: BUBBLE SIZE
|
for (let i = 0; i < limitDust; i++) {
|
||||||
const size = Math.random() * 20 + 10;
|
createDust(container);
|
||||||
bubble.style.width = `${size}px`;
|
|
||||||
bubble.style.height = `${size}px`;
|
|
||||||
} else {
|
|
||||||
// MARK: DUST SIZE
|
|
||||||
const size = Math.random() * 3 + 1;
|
|
||||||
bubble.style.width = `${size}px`;
|
|
||||||
bubble.style.height = `${size}px`;
|
|
||||||
}
|
|
||||||
|
|
||||||
const duration = isDust ? (Math.random() * 20 + 10) : (Math.random() * 10 + 5);
|
|
||||||
if (enableDifferentDuration) {
|
|
||||||
bubble.style.animationDuration = `${duration}s`;
|
|
||||||
}
|
|
||||||
|
|
||||||
bubble.style.animationDelay = `-${Math.random() * 10}s`;
|
|
||||||
container.appendChild(bubble);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -140,11 +119,6 @@ function initializeSummer() {
|
|||||||
if (!summer) return;
|
if (!summer) return;
|
||||||
initSummerObjects();
|
initSummerObjects();
|
||||||
toggleSummer();
|
toggleSummer();
|
||||||
|
|
||||||
const screenWidth = window.innerWidth;
|
|
||||||
if (randomSummer && (screenWidth > 768 || randomSummerMobile)) {
|
|
||||||
addRandomSummerObjects();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
initializeSummer();
|
initializeSummer();
|
||||||
|
|||||||
@@ -235,41 +235,41 @@
|
|||||||
<label for="theme-select">Theme:</label>
|
<label for="theme-select">Theme:</label>
|
||||||
<select id="theme-select">
|
<select id="theme-select">
|
||||||
<option value="" selected disabled>— Select a theme —</option>
|
<option value="" selected disabled>— Select a theme —</option>
|
||||||
|
<option value="autumn">Autumn</option>
|
||||||
|
<option value="birthday">Birthday</option>
|
||||||
|
<option value="carnival">Carnival (Confetti)</option>
|
||||||
|
<option value="cherryblossom">Cherryblossom</option>
|
||||||
|
<option value="christmas">Christmas</option>
|
||||||
|
<option value="earthday">Earth Day</option>
|
||||||
|
<option value="easter">Easter</option>
|
||||||
|
<option value="eid">Eid al-Fitr</option>
|
||||||
|
<option value="eurovision">Eurovision</option>
|
||||||
|
<option value="filmnoir">Film-Noir</option>
|
||||||
|
<option value="fireworks">Fireworks</option>
|
||||||
|
<option value="frost">Frost / Ice</option>
|
||||||
|
<option value="friday13">Friday the 13th</option>
|
||||||
|
<option value="halloween">Halloween</option>
|
||||||
|
<option value="hearts">Hearts</option>
|
||||||
|
<option value="marioday">Mario Day</option>
|
||||||
|
<option value="matrix">Matrix</option>
|
||||||
|
<option value="oktoberfest">Oktoberfest</option>
|
||||||
|
<option value="olympia">Olympia</option>
|
||||||
|
<option value="oscar">Oscar Awards</option>
|
||||||
|
<option value="pride">Pride</option>
|
||||||
|
<option value="rain">Rain</option>
|
||||||
|
<option value="resurrection">Resurrection</option>
|
||||||
|
<option value="santa">Santa</option>
|
||||||
<option value="snowfall">Snowfall</option>
|
<option value="snowfall">Snowfall</option>
|
||||||
<option value="snowflakes">Snowflakes</option>
|
<option value="snowflakes">Snowflakes</option>
|
||||||
<option value="snowstorm">Snowstorm</option>
|
<option value="snowstorm">Snowstorm</option>
|
||||||
<option value="fireworks">Fireworks</option>
|
|
||||||
<option value="halloween">Halloween</option>
|
|
||||||
<option value="spooky">Spooky</option>
|
|
||||||
<option value="hearts">Hearts</option>
|
|
||||||
<option value="christmas">Christmas</option>
|
|
||||||
<option value="santa">Santa</option>
|
|
||||||
<option value="autumn">Autumn</option>
|
|
||||||
<option value="easter">Easter</option>
|
|
||||||
<option value="resurrection">Resurrection</option>
|
|
||||||
<option value="spring">Spring</option>
|
|
||||||
<option value="summer">Summer (Bubbles)</option>
|
|
||||||
<option value="carnival">Carnival (Confetti)</option>
|
|
||||||
<option value="cherryblossom">Cherryblossom</option>
|
|
||||||
<option value="earthday">Earth Day</option>
|
|
||||||
<option value="eurovision">Eurovision</option>
|
|
||||||
<option value="matrix">Matrix</option>
|
|
||||||
<option value="pride">Pride</option>
|
|
||||||
<option value="rain">Rain</option>
|
|
||||||
<option value="storm">Storm (⚠️Epilepsy Warning⚠️)</option>
|
|
||||||
<option value="frost">Frost / Ice</option>
|
|
||||||
<option value="filmnoir">Film-Noir</option>
|
|
||||||
<option value="oscar">Oscar Awards</option>
|
|
||||||
<option value="marioday">Mario Day</option>
|
|
||||||
<option value="starwars">Star Wars Day</option>
|
|
||||||
<option value="oktoberfest">Oktoberfest</option>
|
|
||||||
<option value="friday13">Friday the 13th</option>
|
|
||||||
<option value="eid">Eid al-Fitr</option>
|
|
||||||
<option value="sports">Sports</option>
|
|
||||||
<option value="olympia">Olympia</option>
|
|
||||||
<option value="space">Space / Sci-Fi</option>
|
<option value="space">Space / Sci-Fi</option>
|
||||||
|
<option value="spooky">Spooky</option>
|
||||||
|
<option value="sports">Sports</option>
|
||||||
|
<option value="spring">Spring</option>
|
||||||
|
<option value="starwars">Star Wars Day</option>
|
||||||
|
<option value="storm">Storm (⚠️Epilepsy Warning⚠️)</option>
|
||||||
|
<option value="summer">Summer (Bubbles)</option>
|
||||||
<option value="underwater">Underwater</option>
|
<option value="underwater">Underwater</option>
|
||||||
<option value="birthday">Birthday</option>
|
|
||||||
<option value="custom">⚙ Custom (Local Files)</option>
|
<option value="custom">⚙ Custom (Local Files)</option>
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
@@ -341,41 +341,41 @@
|
|||||||
|
|
||||||
// ── Built-in theme map (local file paths for testing) ──
|
// ── Built-in theme map (local file paths for testing) ──
|
||||||
const themes = {
|
const themes = {
|
||||||
snowfall: { css: 'snowfall.css', js: 'snowfall.js', container: 'snowfall-container' },
|
|
||||||
snowflakes: { css: 'snowflakes.css', js: 'snowflakes.js', container: 'snowflakes' },
|
|
||||||
snowstorm: { css: 'snowstorm.css', js: 'snowstorm.js', container: 'snowstorm-container' },
|
|
||||||
fireworks: { css: 'fireworks.css', js: 'fireworks.js', container: 'fireworks' },
|
|
||||||
halloween: { css: 'halloween.css', js: 'halloween.js', container: 'halloween-container' },
|
|
||||||
spooky: { css: 'spooky.css', js: 'spooky.js', container: 'spooky-container' },
|
|
||||||
hearts: { css: 'hearts.css', js: 'hearts.js', container: 'hearts-container' },
|
|
||||||
christmas: { css: 'christmas.css', js: 'christmas.js', container: 'christmas-container' },
|
|
||||||
santa: { css: 'santa.css', js: 'santa.js', container: 'santa-container' },
|
|
||||||
autumn: { css: 'autumn.css', js: 'autumn.js', container: 'autumn-container' },
|
autumn: { css: 'autumn.css', js: 'autumn.js', container: 'autumn-container' },
|
||||||
easter: { css: 'easter.css', js: 'easter.js', container: 'easter-container' },
|
birthday: { css: 'birthday.css', js: 'birthday.js', container: 'birthday-container' },
|
||||||
resurrection: { css: 'resurrection.css', js: 'resurrection.js', container: 'resurrection-container' },
|
|
||||||
spring: { css: 'spring.css', js: 'spring.js', container: 'spring-container' },
|
|
||||||
summer: { css: 'summer.css', js: 'summer.js', container: 'summer-container' },
|
|
||||||
carnival: { css: 'carnival.css', js: 'carnival.js', container: 'carnival-container' },
|
carnival: { css: 'carnival.css', js: 'carnival.js', container: 'carnival-container' },
|
||||||
cherryblossom: { css: 'cherryblossom.css', js: 'cherryblossom.js', container: 'cherryblossom-container' },
|
cherryblossom:{ css: 'cherryblossom.css', js: 'cherryblossom.js',container: 'cherryblossom-container' },
|
||||||
|
christmas: { css: 'christmas.css', js: 'christmas.js', container: 'christmas-container' },
|
||||||
earthday: { css: 'earthday.css', js: 'earthday.js', container: 'earthday-container' },
|
earthday: { css: 'earthday.css', js: 'earthday.js', container: 'earthday-container' },
|
||||||
|
easter: { css: 'easter.css', js: 'easter.js', container: 'easter-container' },
|
||||||
|
eid: { css: 'eid.css', js: 'eid.js', container: 'eid-container' },
|
||||||
eurovision: { css: 'eurovision.css', js: 'eurovision.js', container: 'eurovision-container' },
|
eurovision: { css: 'eurovision.css', js: 'eurovision.js', container: 'eurovision-container' },
|
||||||
matrix: { css: 'matrix.css', js: 'matrix.js', container: 'matrix-container' },
|
filmnoir: { css: 'filmnoir.css', js: 'filmnoir.js', container: 'filmnoir-container' },
|
||||||
|
fireworks: { css: 'fireworks.css', js: 'fireworks.js', container: 'fireworks' },
|
||||||
|
frost: { css: 'frost.css', js: 'frost.js', container: 'frost-container' },
|
||||||
|
friday13: { css: 'friday13.css', js: 'friday13.js', container: 'friday13-container' },
|
||||||
|
halloween: { css: 'halloween.css', js: 'halloween.js', container: 'halloween-container' },
|
||||||
|
hearts: { css: 'hearts.css', js: 'hearts.js', container: 'hearts-container' },
|
||||||
|
marioday: { css: 'marioday.css', js: 'marioday.js', container: 'marioday-container' },
|
||||||
|
matrix: { css: 'matrix.css', js: 'matrix.js', container: 'matrix-container' },
|
||||||
|
oktoberfest: { css: 'oktoberfest.css', js: 'oktoberfest.js', container: 'oktoberfest-container' },
|
||||||
|
olympia: { css: 'olympia.css', js: 'olympia.js', container: 'olympia-container' },
|
||||||
|
oscar: { css: 'oscar.css', js: 'oscar.js', container: 'oscar-container' },
|
||||||
pride: { css: 'pride.css', js: 'pride.js', container: 'pride-container' },
|
pride: { css: 'pride.css', js: 'pride.js', container: 'pride-container' },
|
||||||
rain: { css: 'rain.css', js: 'rain.js', container: 'rain-container' },
|
rain: { css: 'rain.css', js: 'rain.js', container: 'rain-container' },
|
||||||
storm: { css: 'storm.css', js: 'storm.js', container: 'storm-container' },
|
resurrection: { css: 'resurrection.css', js: 'resurrection.js', container: 'resurrection-container' },
|
||||||
frost: { css: 'frost.css', js: 'frost.js', container: 'frost-container' },
|
santa: { css: 'santa.css', js: 'santa.js', container: 'santa-container' },
|
||||||
filmnoir: { css: 'filmnoir.css', js: 'filmnoir.js', container: 'filmnoir-container' },
|
snowfall: { css: 'snowfall.css', js: 'snowfall.js', container: 'snowfall-container' },
|
||||||
oscar: { css: 'oscar.css', js: 'oscar.js', container: 'oscar-container' },
|
snowflakes: { css: 'snowflakes.css', js: 'snowflakes.js', container: 'snowflakes' },
|
||||||
marioday: { css: 'marioday.css', js: 'marioday.js', container: 'marioday-container' },
|
snowstorm: { css: 'snowstorm.css', js: 'snowstorm.js', container: 'snowstorm-container' },
|
||||||
starwars: { css: 'starwars.css', js: 'starwars.js', container: 'starwars-container' },
|
|
||||||
oktoberfest: { css: 'oktoberfest.css', js: 'oktoberfest.js', container: 'oktoberfest-container' },
|
|
||||||
friday13: { css: 'friday13.css', js: 'friday13.js', container: 'friday13-container' },
|
|
||||||
eid: { css: 'eid.css', js: 'eid.js', container: 'eid-container' },
|
|
||||||
sports: { css: 'sports.css', js: 'sports.js', container: 'sports-container' },
|
|
||||||
olympia: { css: 'olympia.css', js: 'olympia.js', container: 'olympia-container' },
|
|
||||||
space: { css: 'space.css', js: 'space.js', container: 'space-container' },
|
space: { css: 'space.css', js: 'space.js', container: 'space-container' },
|
||||||
underwater: { css: 'underwater.css', js: 'underwater.js', container: 'underwater-container' },
|
spooky: { css: 'spooky.css', js: 'spooky.js', container: 'spooky-container' },
|
||||||
birthday: { css: 'birthday.css', js: 'birthday.js', container: 'birthday-container' }
|
sports: { css: 'sports.css', js: 'sports.js', container: 'sports-container' },
|
||||||
|
spring: { css: 'spring.css', js: 'spring.js', container: 'spring-container' },
|
||||||
|
starwars: { css: 'starwars.css', js: 'starwars.js', container: 'starwars-container' },
|
||||||
|
storm: { css: 'storm.css', js: 'storm.js', container: 'storm-container' },
|
||||||
|
summer: { css: 'summer.css', js: 'summer.js', container: 'summer-container' },
|
||||||
|
underwater: { css: 'underwater.css', js: 'underwater.js', container: 'underwater-container' }
|
||||||
};
|
};
|
||||||
|
|
||||||
const select = document.getElementById('theme-select');
|
const select = document.getElementById('theme-select');
|
||||||
|
|||||||
@@ -1,43 +1,63 @@
|
|||||||
const config = window.SeasonalsPluginConfig?.Underwater || {};
|
const config = window.SeasonalsPluginConfig?.Underwater || {};
|
||||||
|
|
||||||
const underwater = config.EnableUnderwater !== undefined ? config.EnableUnderwater : true;
|
const underwater = config.EnableUnderwater !== undefined ? config.EnableUnderwater : true; // enable/disable underwater
|
||||||
const symbolCount = config.SymbolCount || 15;
|
const symbolCountMobile = config.SymbolCountMobile !== undefined ? config.SymbolCountMobile : 2; // Devisor to reduce number of objects on mobile
|
||||||
const useRandomSymbols = config.EnableRandomSymbols !== undefined ? config.EnableRandomSymbols : true;
|
const enableDifferentDuration = config.EnableDifferentDuration !== undefined ? config.EnableDifferentDuration : true; // enable different durations
|
||||||
const enableRandomMobile = config.EnableRandomSymbolsMobile !== undefined ? config.EnableRandomSymbolsMobile : false;
|
const enableLightRays = config.EnableLightRays !== undefined ? config.EnableLightRays : true; // enable/disable lightrays
|
||||||
const enableDifferentDuration = config.EnableDifferentDuration !== undefined ? config.EnableDifferentDuration : true;
|
const seaweedCount = config.SeaweedCount !== undefined ? config.SeaweedCount : 50; // count of seaweed
|
||||||
const enableLightRays = config.EnableLightRays !== undefined ? config.EnableLightRays : true;
|
|
||||||
const seaweedCount = config.SeaweedCount !== undefined ? config.SeaweedCount : 50;
|
|
||||||
|
|
||||||
// Entity counts configured
|
// Entity counts configured
|
||||||
const fishCount = config.FishCount !== undefined ? config.FishCount : 15;
|
const fishCount = config.FishCount !== undefined ? config.FishCount : 15; // count of fish
|
||||||
const seahorseCount = config.SeahorseCount !== undefined ? config.SeahorseCount : 3;
|
const seahorseCount = config.SeahorseCount !== undefined ? config.SeahorseCount : 3; // count of seahorse
|
||||||
const jellyfishCount = config.JellyfishCount !== undefined ? config.JellyfishCount : 3;
|
const jellyfishCount = config.JellyfishCount !== undefined ? config.JellyfishCount : 3; // count of jellyfish
|
||||||
const turtleCount = config.TurtleCount !== undefined ? config.TurtleCount : 1;
|
const turtleCount = config.TurtleCount !== undefined ? config.TurtleCount : 1; // count of turtle
|
||||||
const crabCount = config.CrabCount !== undefined ? config.CrabCount : 2;
|
const crabCount = config.CrabCount !== undefined ? config.CrabCount : 2; // count of crab
|
||||||
const starfishCount = config.StarfishCount !== undefined ? config.StarfishCount : 2;
|
const starfishCount = config.StarfishCount !== undefined ? config.StarfishCount : 2; // count of starfish
|
||||||
const shellCount = config.ShellCount !== undefined ? config.ShellCount : 2;
|
const shellCount = config.ShellCount !== undefined ? config.ShellCount : 2; // count of shell
|
||||||
|
|
||||||
|
// credits: https://lottiefiles.com/free-animation/seaweed-E6Go0HdkqY
|
||||||
const seaweeds = [
|
const seaweeds = [
|
||||||
"../Seasonals/Resources/underwater_assets/seaweed_1.gif",
|
"../Seasonals/Resources/underwater_assets/seaweed_1.gif",
|
||||||
"../Seasonals/Resources/underwater_assets/seaweed_2.gif"
|
"../Seasonals/Resources/underwater_assets/seaweed_2.gif"
|
||||||
];
|
];
|
||||||
|
|
||||||
// Statics for bottom
|
/**
|
||||||
|
* Credits:
|
||||||
|
* https://www.animierte-gifs.net/img-animiertes-krebs-bild-0041-59970.htm
|
||||||
|
* https://www.animierte-gifs.net/img-animiertes-krebs-bild-0002-59931.htm
|
||||||
|
*
|
||||||
|
*/
|
||||||
const crabImages = [
|
const crabImages = [
|
||||||
"../Seasonals/Resources/underwater_assets/crab_1.gif",
|
"../Seasonals/Resources/underwater_assets/crab_1.gif",
|
||||||
"../Seasonals/Resources/underwater_assets/crab_2.gif",
|
"../Seasonals/Resources/underwater_assets/crab_2.gif",
|
||||||
"../Seasonals/Resources/underwater_assets/crab_3.gif"
|
"../Seasonals/Resources/underwater_assets/crab_3.gif"
|
||||||
];
|
];
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Credits:
|
||||||
|
* https://lottiefiles.com/free-animation/dancing-starfish-tJ9ZFu9Zq0
|
||||||
|
* https://www.animierte-gifs.net/img-animiertes-fische-bild-0003-50003.htm
|
||||||
|
*/
|
||||||
const starfishImages = [
|
const starfishImages = [
|
||||||
"../Seasonals/Resources/underwater_assets/starfish_1.gif",
|
"../Seasonals/Resources/underwater_assets/starfish_1.gif",
|
||||||
"../Seasonals/Resources/underwater_assets/starfish_2.gif"
|
"../Seasonals/Resources/underwater_assets/starfish_2.gif"
|
||||||
];
|
];
|
||||||
|
|
||||||
|
// Credit: https://www.animierte-gifs.net/img-animiertes-muschel-bild-0021-108539.htm
|
||||||
const shellImages = [
|
const shellImages = [
|
||||||
"../Seasonals/Resources/underwater_assets/shell_1.gif"
|
"../Seasonals/Resources/underwater_assets/shell_1.gif"
|
||||||
];
|
];
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Credits:
|
||||||
|
* https://lottiefiles.com/free-animation/0101uwt-tt-01-4fA4Lm9gtN
|
||||||
|
* https://www.animierte-gifs.net/img-animiertes-fische-bild-0473-50473.htm
|
||||||
|
* https://www.animierte-gifs.net/img-animiertes-fische-bild-0290-50290.htm
|
||||||
|
* https://www.animierte-gifs.net/img-animiertes-fische-bild-0049-50049.htm
|
||||||
|
* https://www.animierte-gifs.net/img-animiertes-fische-bild-0403-50403.htm
|
||||||
|
*
|
||||||
|
* https://flaticon.com
|
||||||
|
*/
|
||||||
const fishImages = [
|
const fishImages = [
|
||||||
"../Seasonals/Resources/underwater_assets/fish_1.gif",
|
"../Seasonals/Resources/underwater_assets/fish_1.gif",
|
||||||
"../Seasonals/Resources/underwater_assets/fish_2.gif",
|
"../Seasonals/Resources/underwater_assets/fish_2.gif",
|
||||||
@@ -55,15 +75,22 @@ const fishImages = [
|
|||||||
"../Seasonals/Resources/underwater_assets/fish_15.png"
|
"../Seasonals/Resources/underwater_assets/fish_15.png"
|
||||||
];
|
];
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Credits:
|
||||||
|
* https://www.animierte-gifs.net/img-animiertes-fische-bild-0221-50221.htm
|
||||||
|
* https://www.animierte-gifs.net/img-animiertes-fische-bild-0217-50217.htm
|
||||||
|
*/
|
||||||
const seahorsesImages = [
|
const seahorsesImages = [
|
||||||
"../Seasonals/Resources/underwater_assets/seahorse_1.gif",
|
"../Seasonals/Resources/underwater_assets/seahorse_1.gif",
|
||||||
"../Seasonals/Resources/underwater_assets/seahorse_2.gif"
|
"../Seasonals/Resources/underwater_assets/seahorse_2.gif"
|
||||||
];
|
];
|
||||||
|
|
||||||
|
// credit: https://lottiefiles.com/free-animation/sea-turtle-s0sbHIWS2F
|
||||||
const turtleImages = [
|
const turtleImages = [
|
||||||
"../Seasonals/Resources/underwater_assets/turtle.gif"
|
"../Seasonals/Resources/underwater_assets/turtle.gif"
|
||||||
];
|
];
|
||||||
|
|
||||||
|
// credits: https://lottiefiles.com/free-animation/jellyfish-wPwyF8EeSQ
|
||||||
const jellyfishImages = [
|
const jellyfishImages = [
|
||||||
"../Seasonals/Resources/underwater_assets/jellyfish_1.gif",
|
"../Seasonals/Resources/underwater_assets/jellyfish_1.gif",
|
||||||
"../Seasonals/Resources/underwater_assets/jellyfish_2.gif"
|
"../Seasonals/Resources/underwater_assets/jellyfish_2.gif"
|
||||||
@@ -137,16 +164,15 @@ function createUnderwater() {
|
|||||||
const useRandomDuration = enableDifferentDuration !== false;
|
const useRandomDuration = enableDifferentDuration !== false;
|
||||||
let isMobile = window.matchMedia("only screen and (max-width: 768px)").matches;
|
let isMobile = window.matchMedia("only screen and (max-width: 768px)").matches;
|
||||||
|
|
||||||
|
|
||||||
// Seaweed swaying at the bottom (evenly distributed based on count)
|
// Seaweed swaying at the bottom (evenly distributed based on count)
|
||||||
const activeSeaweedCount = Math.max(1, seaweedCount);
|
const activeSeaweedCount = isMobile ? Math.max(1, Math.floor(seaweedCount / Math.max(1, symbolCountMobile))) : Math.max(1, seaweedCount);
|
||||||
const seaweedSpacing = 95 / activeSeaweedCount;
|
const seaweedSpacing = 95 / activeSeaweedCount;
|
||||||
for (let i = 0; i < seaweedCount; i++) {
|
for (let i = 0; i < activeSeaweedCount; i++) {
|
||||||
let seaweed = document.createElement('div');
|
let seaweed = document.createElement('div');
|
||||||
seaweed.className = 'underwater-seaweed';
|
seaweed.className = 'underwater-seaweed';
|
||||||
seaweed.style.position = 'absolute';
|
seaweed.style.position = 'absolute';
|
||||||
|
|
||||||
// MARK: Distance from the bottom edge for the seaweed
|
// Distance from the bottom edge for the seaweed
|
||||||
seaweed.style.bottom = '-18px';
|
seaweed.style.bottom = '-18px';
|
||||||
|
|
||||||
let offset = (Math.random() * seaweedSpacing) - (seaweedSpacing / 2);
|
let offset = (Math.random() * seaweedSpacing) - (seaweedSpacing / 2);
|
||||||
@@ -163,7 +189,7 @@ function createUnderwater() {
|
|||||||
seaweed.style.transform = `scale(${scale}) ${flip}`;
|
seaweed.style.transform = `scale(${scale}) ${flip}`;
|
||||||
seaweed.style.zIndex = depth < 0.5 ? '15' : '30';
|
seaweed.style.zIndex = depth < 0.5 ? '15' : '30';
|
||||||
|
|
||||||
// Mix Emojis and GIFs
|
// Mix Emojis and GIFs for seaweed
|
||||||
if (Math.random() > 0.4) {
|
if (Math.random() > 0.4) {
|
||||||
let img = document.createElement('img');
|
let img = document.createElement('img');
|
||||||
img.src = seaweeds[Math.floor(Math.random() * seaweeds.length)];
|
img.src = seaweeds[Math.floor(Math.random() * seaweeds.length)];
|
||||||
@@ -182,9 +208,8 @@ function createUnderwater() {
|
|||||||
|
|
||||||
// Static Bottom Creatures logic
|
// Static Bottom Creatures logic
|
||||||
function spawnStatic(imageArray, maxCount, baseSize) {
|
function spawnStatic(imageArray, maxCount, baseSize) {
|
||||||
// Evaluate an actual count between 1 and maxCount if random symbols are enabled
|
let spawnLimit = isMobile ? Math.floor(maxCount / Math.max(1, symbolCountMobile)) : maxCount;
|
||||||
const actualCount = (useRandomSymbols && maxCount > 0) ? Math.floor(Math.random() * maxCount) + 1 : maxCount;
|
for (let i = 0; i < spawnLimit; i++) {
|
||||||
for (let i = 0; i < actualCount; i++) {
|
|
||||||
let creature = document.createElement('div');
|
let creature = document.createElement('div');
|
||||||
creature.className = 'underwater-static-bottom';
|
creature.className = 'underwater-static-bottom';
|
||||||
creature.style.position = 'absolute';
|
creature.style.position = 'absolute';
|
||||||
@@ -216,13 +241,9 @@ function createUnderwater() {
|
|||||||
// Swimmers logic
|
// Swimmers logic
|
||||||
function spawnSwimmerLoop(imageArray, maxCount, baseSize, typeName) {
|
function spawnSwimmerLoop(imageArray, maxCount, baseSize, typeName) {
|
||||||
if (maxCount <= 0) return;
|
if (maxCount <= 0) return;
|
||||||
let spawnLimit = isMobile ? (enableRandomMobile ? maxCount : Math.floor(maxCount / 2)) : maxCount;
|
let spawnLimit = isMobile ? Math.floor(maxCount / Math.max(1, symbolCountMobile)) : maxCount;
|
||||||
|
|
||||||
// Randomize the actual amount spawned up to the limit
|
for (let i = 0; i < spawnLimit; i++) {
|
||||||
const actualCount = (useRandomSymbols && spawnLimit > 0) ? Math.floor(Math.random() * spawnLimit) + 1 : spawnLimit;
|
|
||||||
|
|
||||||
for (let i = 0; i < actualCount; i++) {
|
|
||||||
// Spawn immediately but use negative delay to distribute them across the screen!
|
|
||||||
spawnSingleSwimmer(imageArray, baseSize, typeName);
|
spawnSingleSwimmer(imageArray, baseSize, typeName);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -9,12 +9,12 @@
|
|||||||
"imageUrl": "https://git.mahom03-spacecloud.de/CodeDevMLH/Jellyfin-Seasonals-Plugin/raw/branch/main/logo.png",
|
"imageUrl": "https://git.mahom03-spacecloud.de/CodeDevMLH/Jellyfin-Seasonals-Plugin/raw/branch/main/logo.png",
|
||||||
"versions": [
|
"versions": [
|
||||||
{
|
{
|
||||||
"version": "2.0.0.1",
|
"version": "2.0.0.5",
|
||||||
"changelog": "- feat: add many themes\n- fix: improve performance",
|
"changelog": "- feat: add new themes:\n- birthday (ballons, computer mouse interactive)\n- earthday\n- Eid al-Fitr (sugar feast/ramadan)\n- eurovision\n- Film Noir filter\n- Friday the 13\n- frost\n- Mario Day\n- Matrix\n- Oktoberfest\n- Olympia\n- Oscar Awards\n- Pride\n- Rain\n- Spooky\n- Sports (many selectable balls of ball games like handball, football (soccer) or tennis)\n- StarWars Day\n- Storm (Epilepsy Warning!!!, Thunderstorm)\n- refactored spring (new lawn with flowers), easter (new easter bunny, new lawn with flowers and ester eggs), halloween (add spiders (computer mouse sensitive), add mice, add fog) \n- fix: many improvements and bug fixes e.g. changed top to translate/transform for performance reasons",
|
||||||
"targetAbi": "10.11.0.0",
|
"targetAbi": "10.11.0.0",
|
||||||
"sourceUrl": "https://git.mahom03-spacecloud.de/CodeDevMLH/Jellyfin-Seasonals-Plugin/releases/download/v2.0.0.1/Jellyfin.Plugin.Seasonals.zip",
|
"sourceUrl": "https://git.mahom03-spacecloud.de/CodeDevMLH/Jellyfin-Seasonals-Plugin/releases/download/v2.0.0.5/Jellyfin.Plugin.Seasonals.zip",
|
||||||
"checksum": "2eb9ce92f3aa89d133ad09cd874b7c85",
|
"checksum": "71bbc8ba96f99c15e567998809647b2e",
|
||||||
"timestamp": "2026-02-27T03:27:02Z"
|
"timestamp": "2026-02-28T02:29:29Z"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"version": "1.7.2.0",
|
"version": "1.7.2.0",
|
||||||
|
|||||||
Reference in New Issue
Block a user