Refactor storm animation: update final keyframe values for improved visual effect
This commit is contained in:
@@ -22,7 +22,7 @@
|
||||
0% { transform: translateY(-30vh) translateX(0) rotate(20deg); opacity: 0; }
|
||||
5% { 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 {
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
// 1. Read Configuration
|
||||
const config = window.SeasonalsPluginConfig?.Storm || {};
|
||||
|
||||
const enabled = config.EnableStorm !== undefined ? config.EnableStorm : true;
|
||||
@@ -9,7 +8,7 @@ const rainSpeed = config.RainSpeed || 1.0;
|
||||
|
||||
let msgPrinted = false;
|
||||
|
||||
// 2. Toggle Function
|
||||
// Toggle Function
|
||||
function toggleStorm() {
|
||||
const container = document.querySelector('.storm-container');
|
||||
if (!container) return;
|
||||
@@ -34,7 +33,6 @@ function toggleStorm() {
|
||||
}
|
||||
}
|
||||
|
||||
// 3. MutationObserver
|
||||
const observer = new MutationObserver(toggleStorm);
|
||||
observer.observe(document.body, {
|
||||
childList: true,
|
||||
@@ -42,7 +40,6 @@ observer.observe(document.body, {
|
||||
attributes: true
|
||||
});
|
||||
|
||||
// 4. Element Creation
|
||||
function createElements() {
|
||||
const container = document.querySelector('.storm-container') || document.createElement('div');
|
||||
|
||||
@@ -89,7 +86,6 @@ function createElements() {
|
||||
}
|
||||
}
|
||||
|
||||
// 5. Initialization
|
||||
function initializeStorm() {
|
||||
if (!enabled) return;
|
||||
createElements();
|
||||
|
||||
Reference in New Issue
Block a user