Refactor spring and carnival animations, enhance configuration options, and improve asset management
This commit is contained in:
@@ -1,11 +1,11 @@
|
||||
const config = window.SeasonalsPluginConfig?.Summer || {};
|
||||
|
||||
const summer = config.EnableSummer !== undefined ? config.EnableSummer : true; // enable/disable summer
|
||||
const bubbleCount = config.BubbleCount || 20;
|
||||
const dustCount = config.DustCount || 50;
|
||||
const randomSummer = config.EnableRandomSummer !== undefined ? config.EnableRandomSummer : true; // enable random objects
|
||||
const randomSummerMobile = config.EnableRandomSummerMobile !== undefined ? config.EnableRandomSummerMobile : false; // enable random objects on mobile
|
||||
const enableDifferentDuration = config.EnableDifferentDuration !== undefined ? config.EnableDifferentDuration : true; // enable different animation duration
|
||||
const summer = config.EnableSummer !== undefined ? config.EnableSummer : true; // Enable/disable summer theme
|
||||
const bubbleCount = config.BubbleCount || 30; // Number of bubbles
|
||||
const dustCount = config.DustCount || 50; // Number of dust particles
|
||||
const randomSummer = config.EnableRandomSummer !== undefined ? config.EnableRandomSummer : true; // Enable random generating objects
|
||||
const randomSummerMobile = config.EnableRandomSummerMobile !== undefined ? config.EnableRandomSummerMobile : false; // Enable random generating objects on mobile
|
||||
const enableDifferentDuration = config.EnableDifferentDuration !== undefined ? config.EnableDifferentDuration : true; // Randomize animation duration of bubbles and dust
|
||||
|
||||
let msgPrinted = false;
|
||||
|
||||
@@ -51,10 +51,12 @@ function createBubble(container, isDust = false) {
|
||||
|
||||
// Random size
|
||||
if (!isDust) {
|
||||
// MARK: BUBBLE SIZE
|
||||
const size = Math.random() * 20 + 10; // 10-30px bubbles
|
||||
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`;
|
||||
@@ -81,7 +83,7 @@ function addRandomSummerObjects() {
|
||||
createBubble(container, false);
|
||||
}
|
||||
|
||||
// Add some dust particles (more of them, they are subtle)
|
||||
// Add some dust particles
|
||||
for (let i = 0; i < dustCount; i++) {
|
||||
createBubble(container, true);
|
||||
}
|
||||
@@ -110,10 +112,12 @@ function initSummerObjects() {
|
||||
bubble.style.left = `${randomLeft}%`;
|
||||
|
||||
if (!isDust) {
|
||||
// MARK: BUBBLE SIZE
|
||||
const size = Math.random() * 20 + 10;
|
||||
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`;
|
||||
|
||||
Reference in New Issue
Block a user