From b4f91a7f47d81248b8779dba8673440d625fb189 Mon Sep 17 00:00:00 2001 From: helgispbru Date: Wed, 3 Dec 2025 16:27:56 +0300 Subject: [PATCH 1/3] add plugin config --- assets/plugins/snowfall/snow-fall.js | 29 +------------------- install/assets/plugins/snowFall.tpl | 41 ++++++++++++++++++++-------- 2 files changed, 31 insertions(+), 39 deletions(-) diff --git a/assets/plugins/snowfall/snow-fall.js b/assets/plugins/snowfall/snow-fall.js index a44a90e..669038b 100644 --- a/assets/plugins/snowfall/snow-fall.js +++ b/assets/plugins/snowfall/snow-fall.js @@ -1,31 +1,4 @@ -(function() { - // --- КОНФИГУРАЦИЯ --- - - // Количество снежинок - const snowMax = 60; - - // Цвета снежинок - const snowColor = ["#b9dff5", "#7fc7ff", "#7fb0ff", "#7fc7ff", "#b9dff5"]; - - // Шрифты - const snowType = ["Times", "Arial", "Verdana"]; - - // Символ - const snowLetter = "❅"; - - // Скорость падения (теперь 0.5 - это очень медленно, 1 - нормально) - // Я поставил 0.6 для плавного падения - const sinkSpeed = 0.6; - - // Размеры - const snowMaxSize = 22; - const snowMinSize = 8; - - // Зоны: 1 - везде, 2 - слева, 3 - центр, 4 - справа - const snowingZone = 1; - - // --- КОНЕЦ КОНФИГУРАЦИИ --- - +(function () { let snowflakes = []; let browserWidth; let browserHeight; diff --git a/install/assets/plugins/snowFall.tpl b/install/assets/plugins/snowFall.tpl index 52f8260..33e9e47 100644 --- a/install/assets/plugins/snowFall.tpl +++ b/install/assets/plugins/snowFall.tpl @@ -1,32 +1,51 @@ //'; -$cur_tpl = $modx->getDocument($modx->documentIdentifier)['template']; +$src = ' +'; +$cur_tpl = $modx->getDocument($modx->documentIdentifier)['template']; + +if(!empty($snow_templates)) { + $tpls = explode(',', $snow_templates); if (in_array($cur_tpl, $tpls)) { $modx->regClientScript($src, true); } - -} -else { +} else { $modx->regClientScript($src, true); } \ No newline at end of file From cec7eae8c5e3ebe4b080339b3c606bbda6b40721 Mon Sep 17 00:00:00 2001 From: helgispbru Date: Wed, 3 Dec 2025 16:36:09 +0300 Subject: [PATCH 2/3] fixes --- install/assets/plugins/snowFall.tpl | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/install/assets/plugins/snowFall.tpl b/install/assets/plugins/snowFall.tpl index 33e9e47..01d391e 100644 --- a/install/assets/plugins/snowFall.tpl +++ b/install/assets/plugins/snowFall.tpl @@ -14,15 +14,15 @@ * @lastupdate 03/12/2025 */ -$src = ' -'; +'; + $cur_tpl = $modx->getDocument($modx->documentIdentifier)['template']; if(!empty($snow_templates)) {