iobroker.mywebui 1.38.4 → 1.38.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/io-package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "common": {
3
3
  "name": "mywebui",
4
- "version": "1.38.04",
4
+ "version": "1.38.06",
5
5
  "titleLang": {
6
6
  "en": "mywebui",
7
7
  "de": "mywebui",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "iobroker.mywebui",
3
- "version": "1.38.04",
3
+ "version": "1.38.06",
4
4
  "description": "ioBroker mywebui - Custom edited mywebui by gokturk413",
5
5
  "type": "module",
6
6
  "main": "dist/backend/main.js",
@@ -1267,6 +1267,7 @@ export class IobrokerWebuiAppShell extends BaseCustomWebComponentConstructorAppe
1267
1267
  const pathFlowCountInp = inp(cfg.count ?? 5, 'number');
1268
1268
  const pathFlowSizeInp = inp(cfg.size ?? 8, 'number');
1269
1269
  const pathFlowColorInp = inp(cfg.color || '#0066ff', 'color');
1270
+ const pathFlowDirSel = sel([['normal','Forward'],['reverse','Reverse']], cfg.direction || 'normal');
1270
1271
 
1271
1272
  body.appendChild(field('Type', 'type', typeSel));
1272
1273
  body.appendChild(field('Trigger', null, triggerSel));
@@ -1332,6 +1333,7 @@ export class IobrokerWebuiAppShell extends BaseCustomWebComponentConstructorAppe
1332
1333
  pathFlowSection.appendChild(field('Count', 'count', pathFlowCountInp));
1333
1334
  pathFlowSection.appendChild(field('Size', 'size', pathFlowSizeInp));
1334
1335
  pathFlowSection.appendChild(field('Color', 'color', pathFlowColorInp));
1336
+ pathFlowSection.appendChild(field('Direction', 'direction', pathFlowDirSel));
1335
1337
  body.appendChild(pathFlowSection);
1336
1338
  typeSel.addEventListener('change', () => { pathFlowSection.style.display = typeSel.value === 'pathFlow' ? '' : 'none'; });
1337
1339
 
@@ -1349,7 +1351,7 @@ export class IobrokerWebuiAppShell extends BaseCustomWebComponentConstructorAppe
1349
1351
  if (typeSel.value === 'blur') out.blurAmount = parseInt(blurInp.value) || 5;
1350
1352
  if (typeSel.value === 'pulseRing') { out.scale = parseFloat(pulseScaleInp.value) || 2.5; out.opacityFrom = parseFloat(pulseOpacityInp.value) ?? 1; }
1351
1353
  if (typeSel.value === 'flowDash') { out.dashLen = parseFloat(flowDashLenInp.value) || 10; out.gapLen = parseFloat(flowGapLenInp.value) || 20; out.color = flowColorInp.value; out.direction = flowDirSel.value; }
1352
- if (typeSel.value === 'pathFlow') { out.shape = pathFlowShapeSel.value; out.count = parseInt(pathFlowCountInp.value) || 5; out.size = parseFloat(pathFlowSizeInp.value) || 8; out.color = pathFlowColorInp.value; }
1354
+ if (typeSel.value === 'pathFlow') { out.shape = pathFlowShapeSel.value; out.count = parseInt(pathFlowCountInp.value) || 5; out.size = parseFloat(pathFlowSizeInp.value) || 8; out.color = pathFlowColorInp.value; out.direction = pathFlowDirSel.value; }
1353
1355
  for (const [k, v] of Object.entries(cfg)) { if (k.endsWith('_bind') && v) out[k] = v; }
1354
1356
  return out;
1355
1357
  };
@@ -675,9 +675,13 @@ async function _applyEffect(el, cfg) {
675
675
  const gapLen = parseFloat(cfg.gapLen) || 20;
676
676
  const flowColor = cfg.color || null;
677
677
  const flowDir = cfg.direction === 'reverse' ? 'reverse' : 'normal';
678
- el.style.strokeDasharray = `${dashLen} ${gapLen}`;
679
- if (flowColor) el.style.stroke = flowColor;
680
- _flowDashAnim = el.animate(
678
+ // if el is <svg>, animate the inner stroke element
679
+ const dashTarget = el.tagName.toLowerCase() === 'svg'
680
+ ? (el.querySelector('path,line,polyline,polygon,rect,circle,ellipse') || el)
681
+ : el;
682
+ dashTarget.style.strokeDasharray = `${dashLen} ${gapLen}`;
683
+ if (flowColor) dashTarget.style.stroke = flowColor;
684
+ _flowDashAnim = dashTarget.animate(
681
685
  [{ strokeDashoffset: dashLen + gapLen }, { strokeDashoffset: 0 }],
682
686
  { duration: dur * 1000, iterations: Infinity, easing: 'linear', direction: flowDir, delay: delay * 1000 }
683
687
  );
@@ -688,10 +692,15 @@ async function _applyEffect(el, cfg) {
688
692
  const shapeType = cfg.shape || 'triangle';
689
693
  const flowColor = cfg.color || '#0066ff';
690
694
  const size = parseFloat(cfg.size) || 8;
691
- const svg = el.ownerSVGElement || el.closest('svg');
695
+ const isReverse = cfg.direction === 'reverse';
696
+ // if el is <svg>, find the inner stroke element to follow
697
+ const pathTarget = el.tagName.toLowerCase() === 'svg'
698
+ ? (el.querySelector('path,line,polyline,polygon,rect,circle,ellipse') || el)
699
+ : el;
700
+ const svg = pathTarget.ownerSVGElement || pathTarget.closest('svg') || el;
692
701
  if (!svg) break;
693
702
  // Convert line/polyline/circle/rect → <path> so GSAP MotionPath works
694
- const { pathEl: motionPathEl, tempEl: tempMotionEl } = ensurePathEl(el);
703
+ const { pathEl: motionPathEl, tempEl: tempMotionEl } = ensurePathEl(pathTarget);
695
704
  if (tempMotionEl) _pathFlowEls.push(tempMotionEl);
696
705
  const svgNS = 'http://www.w3.org/2000/svg';
697
706
  const makeShape = () => {
@@ -738,8 +747,10 @@ async function _applyEffect(el, cfg) {
738
747
  };
739
748
  for (let i = 0; i < count; i++) {
740
749
  const shape = makeShape();
750
+ const startPos = isReverse ? (1 - i / count) : (i / count);
751
+ const endPos = isReverse ? (-(i / count)) : (i / count + 1);
741
752
  gsap.to(shape, {
742
- motionPath: { path: motionPathEl, align: motionPathEl, autoRotate: true, alignOrigin: [0.5, 0.5], start: i / count, end: (i / count) + 1 },
753
+ motionPath: { path: motionPathEl, align: motionPathEl, autoRotate: true, alignOrigin: [0.5, 0.5], start: startPos, end: endPos },
743
754
  duration: dur, repeat: -1, ease: 'none', delay: delay
744
755
  });
745
756
  }