mirror of
https://github.com/ranaldsgift/KefinTweaks.git
synced 2026-11-05 15:52:47 +01:00
Fix home screen snowflake overlay performance issue...for real this time?
This commit is contained in:
1 parent
9df4dabdc2
commit
bf7e8ca6ce
2 files changed
+16
-5
No files matched your search
+10
-5
@@ -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()) {
|
||||||
|
|||||||
@@ -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;
|
||||||
|
|||||||
Reference in new issue
Block a user