Fix home screen snowflake overlay performance issue...for real this time?

This commit is contained in:
HighImKevin committed 2025-12-10 06:09:08 -05:00
1 parent 9df4dabdc2
commit bf7e8ca6ce
2 files changed
+16 -5

No files matched your search

+10 -5
View File
@@ -168,11 +168,16 @@
} }
if (enableSeasonalAnimations) { if (enableSeasonalAnimations) {
// Use the snowverlay.js script to add snowflakes to the background // Check if snowverlay script is already added
const snowverlayScriptSrc = (window.KefinTweaksConfig.kefinTweaksRoot || '') + 'scripts/snowverlay.js'; const snowverlayScript = document.querySelector('script[src*="snowverlay.js"]');
const snowverlayScript = document.createElement('script');
snowverlayScript.src = snowverlayScriptSrc; if (!snowverlayScript) {
document.head.appendChild(snowverlayScript); // Use the snowverlay.js script to add snowflakes to the background
const snowverlayScriptSrc = (window.KefinTweaksConfig.kefinTweaksRoot || '') + 'scripts/snowverlay.js';
const snowverlayScript = document.createElement('script');
snowverlayScript.src = snowverlayScriptSrc;
document.head.appendChild(snowverlayScript);
}
} }
} else if (isValentinesPeriod()) { } else if (isValentinesPeriod()) {
+6
View File
@@ -1,4 +1,10 @@
function addSnowverlay() { function addSnowverlay() {
// Check if snowverlay canvas is already added
const snowverlayCanvas = document.querySelector('.snowverlay');
if (snowverlayCanvas) {
return;
}
// Configuration constants // Configuration constants
const CANVAS_HEIGHT_PX = 160; const CANVAS_HEIGHT_PX = 160;
const SNOWFLAKE_AMOUNT = 15; const SNOWFLAKE_AMOUNT = 15;