Refactor storm animation: update final keyframe values for improved visual effect

This commit is contained in:
CodeDevMLH
2026-02-24 19:24:57 +01:00
parent b17c2a6efe
commit c24abcbd59
2 changed files with 2 additions and 6 deletions

View File

@@ -22,7 +22,7 @@
0% { transform: translateY(-30vh) translateX(0) rotate(20deg); opacity: 0; } 0% { transform: translateY(-30vh) translateX(0) rotate(20deg); opacity: 0; }
5% { opacity: 1; } 5% { opacity: 1; }
95% { opacity: 1; } 95% { opacity: 1; }
100% { transform: translateY(110vh) translateX(-40vh) rotate(20deg); opacity: 0; } 100% { transform: translateY(180vh) translateX(-60vh) rotate(20deg); opacity: 0; }
} }
.lightning-flash { .lightning-flash {

View File

@@ -1,4 +1,3 @@
// 1. Read Configuration
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;
@@ -9,7 +8,7 @@ const rainSpeed = config.RainSpeed || 1.0;
let msgPrinted = false; let msgPrinted = false;
// 2. Toggle Function // Toggle Function
function toggleStorm() { function toggleStorm() {
const container = document.querySelector('.storm-container'); const container = document.querySelector('.storm-container');
if (!container) return; if (!container) return;
@@ -34,7 +33,6 @@ function toggleStorm() {
} }
} }
// 3. MutationObserver
const observer = new MutationObserver(toggleStorm); const observer = new MutationObserver(toggleStorm);
observer.observe(document.body, { observer.observe(document.body, {
childList: true, childList: true,
@@ -42,7 +40,6 @@ observer.observe(document.body, {
attributes: true attributes: true
}); });
// 4. Element Creation
function createElements() { function createElements() {
const container = document.querySelector('.storm-container') || document.createElement('div'); const container = document.querySelector('.storm-container') || document.createElement('div');
@@ -89,7 +86,6 @@ function createElements() {
} }
} }
// 5. Initialization
function initializeStorm() { function initializeStorm() {
if (!enabled) return; if (!enabled) return;
createElements(); createElements();