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

This commit is contained in:
HighImKevin
2025-12-10 06:09:08 -05:00
parent 9df4dabdc2
commit bf7e8ca6ce
2 changed files with 16 additions and 5 deletions
+10 -5
View File
@@ -168,11 +168,16 @@
}
if (enableSeasonalAnimations) {
// 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);
// Check if snowverlay script is already added
const snowverlayScript = document.querySelector('script[src*="snowverlay.js"]');
if (!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()) {
+6
View File
@@ -1,4 +1,10 @@
function addSnowverlay() {
// Check if snowverlay canvas is already added
const snowverlayCanvas = document.querySelector('.snowverlay');
if (snowverlayCanvas) {
return;
}
// Configuration constants
const CANVAS_HEIGHT_PX = 160;
const SNOWFLAKE_AMOUNT = 15;