Refactor seasonal scripts to enhance mobile detection using matchMedia for responsive behavior
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
const config = window.SeasonalsPluginConfig?.Storm || {};
|
||||
|
||||
const enabled = config.EnableStorm !== undefined ? config.EnableStorm : true; // enable/disable storm
|
||||
const isMobile = window.innerWidth <= 768;
|
||||
const isMobile = window.matchMedia("only screen and (max-width: 768px)").matches;
|
||||
const elementCount = isMobile ? (config.RaindropCountMobile || 150) : (config.RaindropCount || 300); // count of raindrops
|
||||
const enableLightning = config.EnableLightning !== undefined ? config.EnableLightning : true; // enable/disable lightning
|
||||
const rainSpeed = config.RainSpeed !== undefined ? config.RainSpeed : 1.0; // speed of rain
|
||||
|
||||
Reference in New Issue
Block a user