iobroker.mywebui 1.37.69 → 1.37.71
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
|
@@ -1036,7 +1036,18 @@ export class IobrokerWebuiAppShell extends BaseCustomWebComponentConstructorAppe
|
|
|
1036
1036
|
const addBtn = document.createElement('button');
|
|
1037
1037
|
addBtn.textContent = '+ Add Animation';
|
|
1038
1038
|
addBtn.style.cssText = 'width:100%;margin-top:6px;padding:5px;font-size:12px;cursor:pointer;border:1px solid #5a9;border-radius:4px;background:#e8f8f0;color:#2a7a5a;font-weight:600;';
|
|
1039
|
-
addBtn.onclick = () => {
|
|
1039
|
+
addBtn.onclick = () => {
|
|
1040
|
+
// Collect currently valid animations from UI
|
|
1041
|
+
const existing = cfgList
|
|
1042
|
+
.filter(c => c._collect)
|
|
1043
|
+
.map(c => c._collect())
|
|
1044
|
+
.filter(c => c.effect || Object.keys(c).some(k => k.endsWith('_bind')));
|
|
1045
|
+
// Add new empty animation with a default effect so it survives save/reload
|
|
1046
|
+
existing.push({ effect: 'opacity', duration: 1, ease: 'power1.inOut', repeat: 0 });
|
|
1047
|
+
const val = existing.length === 1 ? existing[0] : existing;
|
|
1048
|
+
designItem.setAttribute('data-animation', JSON.stringify(val));
|
|
1049
|
+
this._updateAnimationsPanel();
|
|
1050
|
+
};
|
|
1040
1051
|
content.appendChild(addBtn);
|
|
1041
1052
|
}
|
|
1042
1053
|
|
|
@@ -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)
|
|
@@ -265,6 +267,8 @@ class AnimationInstance {
|
|
|
265
267
|
_play() {
|
|
266
268
|
const gsap = window.gsap;
|
|
267
269
|
if (!gsap) return;
|
|
270
|
+
// If element is display:none, make it visible so GSAP can animate it
|
|
271
|
+
if (this.element.style.display === 'none') this.element.style.display = '';
|
|
268
272
|
if (this.tween) this.tween.kill();
|
|
269
273
|
const effect = this.cfg.effect;
|
|
270
274
|
|