iobroker.mywebui 1.38.3 → 1.38.5
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
package/package.json
CHANGED
|
@@ -58,6 +58,13 @@ function svgShapeToPathData(el) {
|
|
|
58
58
|
const h = parseFloat(el.getAttribute('height') || 0);
|
|
59
59
|
return `M ${x},${y} H ${x+w} V ${y+h} H ${x} Z`;
|
|
60
60
|
}
|
|
61
|
+
if (tag === 'line') {
|
|
62
|
+
const x1 = el.getAttribute('x1') || 0;
|
|
63
|
+
const y1 = el.getAttribute('y1') || 0;
|
|
64
|
+
const x2 = el.getAttribute('x2') || 0;
|
|
65
|
+
const y2 = el.getAttribute('y2') || 0;
|
|
66
|
+
return `M ${x1},${y1} L ${x2},${y2}`;
|
|
67
|
+
}
|
|
61
68
|
if (tag === 'polyline' || tag === 'polygon') {
|
|
62
69
|
const pts = (el.getAttribute('points') || '').trim().split(/[\s,]+/);
|
|
63
70
|
if (pts.length < 2) return null;
|
|
@@ -668,9 +675,13 @@ async function _applyEffect(el, cfg) {
|
|
|
668
675
|
const gapLen = parseFloat(cfg.gapLen) || 20;
|
|
669
676
|
const flowColor = cfg.color || null;
|
|
670
677
|
const flowDir = cfg.direction === 'reverse' ? 'reverse' : 'normal';
|
|
671
|
-
el
|
|
672
|
-
|
|
673
|
-
|
|
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(
|
|
674
685
|
[{ strokeDashoffset: dashLen + gapLen }, { strokeDashoffset: 0 }],
|
|
675
686
|
{ duration: dur * 1000, iterations: Infinity, easing: 'linear', direction: flowDir, delay: delay * 1000 }
|
|
676
687
|
);
|
|
@@ -681,8 +692,15 @@ async function _applyEffect(el, cfg) {
|
|
|
681
692
|
const shapeType = cfg.shape || 'triangle';
|
|
682
693
|
const flowColor = cfg.color || '#0066ff';
|
|
683
694
|
const size = parseFloat(cfg.size) || 8;
|
|
684
|
-
|
|
695
|
+
// if el is <svg>, find the inner stroke element to follow
|
|
696
|
+
const pathTarget = el.tagName.toLowerCase() === 'svg'
|
|
697
|
+
? (el.querySelector('path,line,polyline,polygon,rect,circle,ellipse') || el)
|
|
698
|
+
: el;
|
|
699
|
+
const svg = pathTarget.ownerSVGElement || pathTarget.closest('svg') || el;
|
|
685
700
|
if (!svg) break;
|
|
701
|
+
// Convert line/polyline/circle/rect → <path> so GSAP MotionPath works
|
|
702
|
+
const { pathEl: motionPathEl, tempEl: tempMotionEl } = ensurePathEl(pathTarget);
|
|
703
|
+
if (tempMotionEl) _pathFlowEls.push(tempMotionEl);
|
|
686
704
|
const svgNS = 'http://www.w3.org/2000/svg';
|
|
687
705
|
const makeShape = () => {
|
|
688
706
|
let s;
|
|
@@ -729,7 +747,7 @@ async function _applyEffect(el, cfg) {
|
|
|
729
747
|
for (let i = 0; i < count; i++) {
|
|
730
748
|
const shape = makeShape();
|
|
731
749
|
gsap.to(shape, {
|
|
732
|
-
motionPath: { path:
|
|
750
|
+
motionPath: { path: motionPathEl, align: motionPathEl, autoRotate: true, alignOrigin: [0.5, 0.5], start: i / count, end: (i / count) + 1 },
|
|
733
751
|
duration: dur, repeat: -1, ease: 'none', delay: delay
|
|
734
752
|
});
|
|
735
753
|
}
|