iobroker.mywebui 1.37.67 → 1.37.68
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
|
@@ -906,7 +906,8 @@ export class IobrokerWebuiAppShell extends BaseCustomWebComponentConstructorAppe
|
|
|
906
906
|
|
|
907
907
|
const effectSel = sel([
|
|
908
908
|
['','— none —'],['opacity','Opacity'],['rotation','Rotation'],['scale','Scale'],
|
|
909
|
-
['
|
|
909
|
+
['translateX','Move X (relative)'],['translateY','Move Y (relative)'],['translate','Move XY (relative)'],
|
|
910
|
+
['left','Move Left (absolute)'],['top','Move Top (absolute)'],
|
|
910
911
|
['skew','Skew'],['fill','Fill Color'],['transform','Transform (CSS)'],
|
|
911
912
|
['svg','SVG Attribute'],['morphSVG','MorphSVG'],['motionPath','Motion Path']
|
|
912
913
|
], cfg.effect || '');
|
|
@@ -95,17 +95,39 @@ function buildTweenConfig(cfg, value) {
|
|
|
95
95
|
case 'translateX':
|
|
96
96
|
config.x = cfg.valueTo != null ? parseFloat(cfg.valueTo)
|
|
97
97
|
: (typeof normalVal === 'boolean' ? (normalVal ? 100 : 0) : numVal);
|
|
98
|
+
if (cfg.valueFrom != null) config.startAt = { x: parseFloat(cfg.valueFrom) };
|
|
98
99
|
break;
|
|
99
100
|
case 'translateY':
|
|
100
101
|
config.y = cfg.valueTo != null ? parseFloat(cfg.valueTo)
|
|
101
102
|
: (typeof normalVal === 'boolean' ? (normalVal ? 100 : 0) : numVal);
|
|
103
|
+
if (cfg.valueFrom != null) config.startAt = { y: parseFloat(cfg.valueFrom) };
|
|
102
104
|
break;
|
|
103
105
|
case 'translate': {
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
106
|
+
// valueTo / valueFrom: "x,y" or single number (used for x, y=0)
|
|
107
|
+
const parseXY = (v, defVal) => {
|
|
108
|
+
if (v == null) return { x: defVal, y: 0 };
|
|
109
|
+
const s = String(v);
|
|
110
|
+
const parts = s.split(',');
|
|
111
|
+
return { x: parseFloat(parts[0]) || 0, y: parts.length > 1 ? parseFloat(parts[1]) || 0 : 0 };
|
|
112
|
+
};
|
|
113
|
+
const to = parseXY(cfg.valueTo, typeof normalVal === 'boolean' ? (normalVal ? 100 : 0) : numVal);
|
|
114
|
+
config.x = to.x; config.y = to.y;
|
|
115
|
+
if (cfg.valueFrom != null) {
|
|
116
|
+
const from = parseXY(cfg.valueFrom, 0);
|
|
117
|
+
config.startAt = { x: from.x, y: from.y };
|
|
118
|
+
}
|
|
107
119
|
break;
|
|
108
120
|
}
|
|
121
|
+
case 'left':
|
|
122
|
+
config.left = cfg.valueTo != null ? cfg.valueTo
|
|
123
|
+
: (typeof normalVal === 'boolean' ? (normalVal ? '100px' : '0px') : (numVal + 'px'));
|
|
124
|
+
if (cfg.valueFrom != null) config.startAt = { left: isNaN(cfg.valueFrom) ? cfg.valueFrom : cfg.valueFrom + 'px' };
|
|
125
|
+
break;
|
|
126
|
+
case 'top':
|
|
127
|
+
config.top = cfg.valueTo != null ? cfg.valueTo
|
|
128
|
+
: (typeof normalVal === 'boolean' ? (normalVal ? '100px' : '0px') : (numVal + 'px'));
|
|
129
|
+
if (cfg.valueFrom != null) config.startAt = { top: isNaN(cfg.valueFrom) ? cfg.valueFrom : cfg.valueFrom + 'px' };
|
|
130
|
+
break;
|
|
109
131
|
case 'skew': {
|
|
110
132
|
const sv = cfg.valueTo != null ? parseFloat(cfg.valueTo)
|
|
111
133
|
: (typeof normalVal === 'boolean' ? (normalVal ? 45 : 0) : numVal);
|