iobroker.mywebui 1.37.70 → 1.37.72
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
|
@@ -889,8 +889,8 @@ export class IobrokerWebuiAppShell extends BaseCustomWebComponentConstructorAppe
|
|
|
889
889
|
['','— none —'],['opacity','Opacity'],['rotation','Rotation'],['scale','Scale'],
|
|
890
890
|
['translateX','Move X (relative)'],['translateY','Move Y (relative)'],['translate','Move XY (relative)'],
|
|
891
891
|
['left','Move Left (absolute)'],['top','Move Top (absolute)'],
|
|
892
|
-
['skew','Skew'],['fill','Fill Color'],['
|
|
893
|
-
['svg','SVG Attribute'],['morphSVG','MorphSVG'],['motionPath','Motion Path']
|
|
892
|
+
['skew','Skew'],['fill','Fill (SVG)'],['color','Color (HTML text)'],['backgroundColor','Background Color (HTML)'],
|
|
893
|
+
['transform','Transform (CSS)'],['svg','SVG Attribute'],['morphSVG','MorphSVG'],['motionPath','Motion Path']
|
|
894
894
|
], cfg.effect || '', save);
|
|
895
895
|
|
|
896
896
|
const svgAttrSel = mkSel([
|
|
@@ -950,7 +950,7 @@ export class IobrokerWebuiAppShell extends BaseCustomWebComponentConstructorAppe
|
|
|
950
950
|
out.transformOriginX = originXInp.value;
|
|
951
951
|
out.transformOriginY = originYInp.value;
|
|
952
952
|
}
|
|
953
|
-
if (e === 'fill' || e === 'svg') {
|
|
953
|
+
if (e === 'fill' || e === 'color' || e === 'backgroundColor' || e === 'svg') {
|
|
954
954
|
if (fillFromInp.value) out.fillColorFrom = fillFromInp.value;
|
|
955
955
|
if (fillToInp.value) out.fillColorTo = fillToInp.value;
|
|
956
956
|
}
|
|
@@ -979,11 +979,12 @@ export class IobrokerWebuiAppShell extends BaseCustomWebComponentConstructorAppe
|
|
|
979
979
|
block.appendChild(mkField('Value To', 'valueTo', valueToInp, cfg));
|
|
980
980
|
|
|
981
981
|
const colorRows = document.createElement('div');
|
|
982
|
-
|
|
982
|
+
const isColorEffect = e => ['fill','color','backgroundColor','svg'].includes(e);
|
|
983
|
+
colorRows.style.display = isColorEffect(cfg.effect) ? '' : 'none';
|
|
983
984
|
colorRows.appendChild(mkField('Color From', 'fillColorFrom', fillFromInp, cfg));
|
|
984
985
|
colorRows.appendChild(mkField('Color To', 'fillColorTo', fillToInp, cfg));
|
|
985
986
|
block.appendChild(colorRows);
|
|
986
|
-
effectSel.addEventListener('change', () => { colorRows.style.display = (effectSel.value
|
|
987
|
+
effectSel.addEventListener('change', () => { colorRows.style.display = isColorEffect(effectSel.value) ? '' : 'none'; });
|
|
987
988
|
|
|
988
989
|
const motionRows = document.createElement('div');
|
|
989
990
|
motionRows.style.display = cfg.effect === 'motionPath' ? '' : 'none';
|
|
@@ -87,10 +87,12 @@ function buildTweenConfig(cfg, value) {
|
|
|
87
87
|
case 'scale':
|
|
88
88
|
config.scale = cfg.valueTo != null ? parseFloat(cfg.valueTo)
|
|
89
89
|
: (typeof normalVal === 'boolean' ? (normalVal ? 1.5 : 1) : numVal);
|
|
90
|
+
if (cfg.valueFrom != null) config.startAt = { scale: parseFloat(cfg.valueFrom) };
|
|
90
91
|
break;
|
|
91
92
|
case 'opacity':
|
|
92
93
|
config.opacity = cfg.valueTo != null ? parseFloat(cfg.valueTo)
|
|
93
94
|
: (typeof normalVal === 'boolean' ? (normalVal ? 1 : 0) : numVal);
|
|
95
|
+
if (cfg.valueFrom != null) config.startAt = { opacity: parseFloat(cfg.valueFrom) };
|
|
94
96
|
break;
|
|
95
97
|
case 'translateX':
|
|
96
98
|
config.x = cfg.valueTo != null ? parseFloat(cfg.valueTo)
|
|
@@ -135,9 +137,16 @@ function buildTweenConfig(cfg, value) {
|
|
|
135
137
|
break;
|
|
136
138
|
}
|
|
137
139
|
case 'fill':
|
|
138
|
-
config.fill =
|
|
139
|
-
|
|
140
|
-
|
|
140
|
+
config.fill = cfg.fillColorTo || '#ff0000';
|
|
141
|
+
if (cfg.fillColorFrom) config.startAt = { fill: cfg.fillColorFrom };
|
|
142
|
+
break;
|
|
143
|
+
case 'color':
|
|
144
|
+
config.color = cfg.fillColorTo || '#ff0000';
|
|
145
|
+
if (cfg.fillColorFrom) config.startAt = { color: cfg.fillColorFrom };
|
|
146
|
+
break;
|
|
147
|
+
case 'backgroundColor':
|
|
148
|
+
config.backgroundColor = cfg.fillColorTo || '#ff0000';
|
|
149
|
+
if (cfg.fillColorFrom) config.startAt = { backgroundColor: cfg.fillColorFrom };
|
|
141
150
|
break;
|
|
142
151
|
case 'transform':
|
|
143
152
|
config.transform = cfg.valueTo || String(value);
|
|
@@ -265,6 +274,8 @@ class AnimationInstance {
|
|
|
265
274
|
_play() {
|
|
266
275
|
const gsap = window.gsap;
|
|
267
276
|
if (!gsap) return;
|
|
277
|
+
// If element is display:none, make it visible so GSAP can animate it
|
|
278
|
+
if (this.element.style.display === 'none') this.element.style.display = '';
|
|
268
279
|
if (this.tween) this.tween.kill();
|
|
269
280
|
const effect = this.cfg.effect;
|
|
270
281
|
|