Refactor eurovision.js and eurovision.css: remove commented code for clarity
This commit is contained in:
@@ -13,7 +13,6 @@
|
|||||||
.music-note-wrapper {
|
.music-note-wrapper {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
left: 0;
|
left: 0;
|
||||||
/* initial top will be set via JS */
|
|
||||||
opacity: 0;
|
opacity: 0;
|
||||||
animation: move-right linear infinite;
|
animation: move-right linear infinite;
|
||||||
will-change: transform, opacity;
|
will-change: transform, opacity;
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
// 1. Read Configuration
|
|
||||||
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;
|
||||||
@@ -10,7 +9,7 @@ const glowSize = config.EurovisionGlowSize !== undefined ? config.EurovisionGlow
|
|||||||
|
|
||||||
let msgPrinted = false;
|
let msgPrinted = false;
|
||||||
|
|
||||||
// 2. Toggle Function
|
// Toggle Function
|
||||||
function toggleEurovision() {
|
function toggleEurovision() {
|
||||||
const container = document.querySelector('.eurovision-container');
|
const container = document.querySelector('.eurovision-container');
|
||||||
if (!container) return;
|
if (!container) return;
|
||||||
@@ -35,7 +34,6 @@ function toggleEurovision() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// 3. MutationObserver
|
|
||||||
const observer = new MutationObserver(toggleEurovision);
|
const observer = new MutationObserver(toggleEurovision);
|
||||||
observer.observe(document.body, {
|
observer.observe(document.body, {
|
||||||
childList: true,
|
childList: true,
|
||||||
@@ -43,7 +41,6 @@ observer.observe(document.body, {
|
|||||||
attributes: true
|
attributes: true
|
||||||
});
|
});
|
||||||
|
|
||||||
// 4. Element Creation
|
|
||||||
function createElements() {
|
function createElements() {
|
||||||
const container = document.querySelector('.eurovision-container') || document.createElement('div');
|
const container = document.querySelector('.eurovision-container') || document.createElement('div');
|
||||||
|
|
||||||
@@ -95,7 +92,6 @@ function createElements() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// 5. Initialization
|
|
||||||
function initializeEurovision() {
|
function initializeEurovision() {
|
||||||
if (!enabled) return;
|
if (!enabled) return;
|
||||||
createElements();
|
createElements();
|
||||||
|
|||||||
Reference in New Issue
Block a user