iobroker.mywebui 1.37.71 → 1.37.73
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
|
@@ -866,18 +866,39 @@ export class IobrokerWebuiAppShell extends BaseCustomWebComponentConstructorAppe
|
|
|
866
866
|
const block = document.createElement('div');
|
|
867
867
|
block.style.cssText = 'border:2px solid #c8d6e0;border-radius:5px;padding:8px;margin-bottom:10px;background:#f7fafc;';
|
|
868
868
|
|
|
869
|
-
//
|
|
869
|
+
// Collapsible body — collapsed by default
|
|
870
|
+
const body = document.createElement('div');
|
|
871
|
+
body.style.display = 'none';
|
|
872
|
+
|
|
873
|
+
// Header: toggle arrow + "Animation #N (effect)" + delete button
|
|
870
874
|
const hdr = document.createElement('div');
|
|
871
|
-
hdr.style.cssText = 'display:flex;justify-content:space-between;align-items:center;
|
|
875
|
+
hdr.style.cssText = 'display:flex;justify-content:space-between;align-items:center;cursor:pointer;user-select:none;';
|
|
876
|
+
const hdrLeft = document.createElement('div');
|
|
877
|
+
hdrLeft.style.cssText = 'display:flex;align-items:center;gap:5px;';
|
|
878
|
+
const arrow = document.createElement('span');
|
|
879
|
+
arrow.textContent = '▶';
|
|
880
|
+
arrow.style.cssText = 'font-size:9px;color:#3a6a8a;transition:transform 0.15s;';
|
|
872
881
|
const hdrTitle = document.createElement('span');
|
|
873
|
-
|
|
882
|
+
const effectLabel = cfg.effect || 'none';
|
|
883
|
+
hdrTitle.textContent = `#${index + 1} — ${effectLabel}`;
|
|
874
884
|
hdrTitle.style.cssText = 'font-size:12px;font-weight:700;color:#3a6a8a;';
|
|
885
|
+
hdrLeft.appendChild(arrow); hdrLeft.appendChild(hdrTitle);
|
|
875
886
|
const delBtn = document.createElement('button');
|
|
876
|
-
delBtn.textContent = '✕
|
|
877
|
-
delBtn.
|
|
878
|
-
delBtn.
|
|
879
|
-
|
|
887
|
+
delBtn.textContent = '✕';
|
|
888
|
+
delBtn.title = 'Remove animation';
|
|
889
|
+
delBtn.style.cssText = 'font-size:10px;padding:1px 5px;cursor:pointer;border:1px solid #c66;border-radius:3px;background:#fff;color:#c33;';
|
|
890
|
+
delBtn.onclick = (e) => { e.stopPropagation(); cfgList.splice(index, 1); saveAndRefresh(); };
|
|
891
|
+
hdr.appendChild(hdrLeft); hdr.appendChild(delBtn);
|
|
892
|
+
|
|
893
|
+
hdr.onclick = () => {
|
|
894
|
+
const collapsed = body.style.display === 'none';
|
|
895
|
+
body.style.display = collapsed ? '' : 'none';
|
|
896
|
+
arrow.style.transform = collapsed ? 'rotate(90deg)' : '';
|
|
897
|
+
hdr.style.marginBottom = collapsed ? '8px' : '0';
|
|
898
|
+
};
|
|
899
|
+
|
|
880
900
|
block.appendChild(hdr);
|
|
901
|
+
block.appendChild(body);
|
|
881
902
|
|
|
882
903
|
const sec = (title) => {
|
|
883
904
|
const d = document.createElement('div');
|
|
@@ -889,8 +910,8 @@ export class IobrokerWebuiAppShell extends BaseCustomWebComponentConstructorAppe
|
|
|
889
910
|
['','— none —'],['opacity','Opacity'],['rotation','Rotation'],['scale','Scale'],
|
|
890
911
|
['translateX','Move X (relative)'],['translateY','Move Y (relative)'],['translate','Move XY (relative)'],
|
|
891
912
|
['left','Move Left (absolute)'],['top','Move Top (absolute)'],
|
|
892
|
-
['skew','Skew'],['fill','Fill Color'],['
|
|
893
|
-
['svg','SVG Attribute'],['morphSVG','MorphSVG'],['motionPath','Motion Path']
|
|
913
|
+
['skew','Skew'],['fill','Fill (SVG)'],['color','Color (HTML text)'],['backgroundColor','Background Color (HTML)'],
|
|
914
|
+
['transform','Transform (CSS)'],['svg','SVG Attribute'],['morphSVG','MorphSVG'],['motionPath','Motion Path']
|
|
894
915
|
], cfg.effect || '', save);
|
|
895
916
|
|
|
896
917
|
const svgAttrSel = mkSel([
|
|
@@ -950,7 +971,7 @@ export class IobrokerWebuiAppShell extends BaseCustomWebComponentConstructorAppe
|
|
|
950
971
|
out.transformOriginX = originXInp.value;
|
|
951
972
|
out.transformOriginY = originYInp.value;
|
|
952
973
|
}
|
|
953
|
-
if (e === 'fill' || e === 'svg') {
|
|
974
|
+
if (e === 'fill' || e === 'color' || e === 'backgroundColor' || e === 'svg') {
|
|
954
975
|
if (fillFromInp.value) out.fillColorFrom = fillFromInp.value;
|
|
955
976
|
if (fillToInp.value) out.fillColorTo = fillToInp.value;
|
|
956
977
|
}
|
|
@@ -966,51 +987,52 @@ export class IobrokerWebuiAppShell extends BaseCustomWebComponentConstructorAppe
|
|
|
966
987
|
return out;
|
|
967
988
|
};
|
|
968
989
|
|
|
969
|
-
//
|
|
970
|
-
|
|
971
|
-
|
|
990
|
+
// ── All content goes into collapsible body ──
|
|
991
|
+
body.appendChild(sec('Effect'));
|
|
992
|
+
body.appendChild(mkField('Type', 'effect', effectSel, cfg));
|
|
972
993
|
|
|
973
994
|
const svgAttrRow = mkField('SVG Attr', 'svgAttr', svgAttrSel, cfg);
|
|
974
995
|
svgAttrRow.style.display = cfg.effect === 'svg' ? '' : 'none';
|
|
975
|
-
|
|
996
|
+
body.appendChild(svgAttrRow);
|
|
976
997
|
effectSel.addEventListener('change', () => { svgAttrRow.style.display = effectSel.value === 'svg' ? '' : 'none'; });
|
|
977
998
|
|
|
978
|
-
|
|
979
|
-
|
|
999
|
+
body.appendChild(mkField('Value From', 'valueFrom', valueFromInp, cfg));
|
|
1000
|
+
body.appendChild(mkField('Value To', 'valueTo', valueToInp, cfg));
|
|
980
1001
|
|
|
981
1002
|
const colorRows = document.createElement('div');
|
|
982
|
-
|
|
1003
|
+
const isColorEffect = e => ['fill','color','backgroundColor','svg'].includes(e);
|
|
1004
|
+
colorRows.style.display = isColorEffect(cfg.effect) ? '' : 'none';
|
|
983
1005
|
colorRows.appendChild(mkField('Color From', 'fillColorFrom', fillFromInp, cfg));
|
|
984
1006
|
colorRows.appendChild(mkField('Color To', 'fillColorTo', fillToInp, cfg));
|
|
985
|
-
|
|
986
|
-
effectSel.addEventListener('change', () => { colorRows.style.display = (effectSel.value
|
|
1007
|
+
body.appendChild(colorRows);
|
|
1008
|
+
effectSel.addEventListener('change', () => { colorRows.style.display = isColorEffect(effectSel.value) ? '' : 'none'; });
|
|
987
1009
|
|
|
988
1010
|
const motionRows = document.createElement('div');
|
|
989
1011
|
motionRows.style.display = cfg.effect === 'motionPath' ? '' : 'none';
|
|
990
1012
|
motionRows.appendChild(mkField('Path ID', 'pathId', pathIdInp, cfg));
|
|
991
1013
|
motionRows.appendChild(alignToPathChk);
|
|
992
1014
|
motionRows.appendChild(orientToPathChk);
|
|
993
|
-
|
|
1015
|
+
body.appendChild(motionRows);
|
|
994
1016
|
effectSel.addEventListener('change', () => { motionRows.style.display = effectSel.value === 'motionPath' ? '' : 'none'; });
|
|
995
1017
|
|
|
996
|
-
|
|
997
|
-
|
|
998
|
-
|
|
999
|
-
|
|
1000
|
-
|
|
1018
|
+
body.appendChild(sec('Timing'));
|
|
1019
|
+
body.appendChild(mkField('Duration (s)', 'duration', durationInp, cfg));
|
|
1020
|
+
body.appendChild(mkField('Ease', 'ease', easeSel, cfg));
|
|
1021
|
+
body.appendChild(mkField('Repeat', 'repeat', repeatInp, cfg));
|
|
1022
|
+
body.appendChild(yoyoChk);
|
|
1001
1023
|
|
|
1002
1024
|
const originRows = document.createElement('div');
|
|
1003
1025
|
originRows.style.display = (cfg.effect === 'rotation' || cfg.effect === 'scale') ? '' : 'none';
|
|
1004
1026
|
originRows.appendChild(sec('Transform Origin'));
|
|
1005
1027
|
originRows.appendChild(mkField('Origin X (%)', 'transformOriginX', originXInp, cfg));
|
|
1006
1028
|
originRows.appendChild(mkField('Origin Y (%)', 'transformOriginY', originYInp, cfg));
|
|
1007
|
-
|
|
1029
|
+
body.appendChild(originRows);
|
|
1008
1030
|
effectSel.addEventListener('change', () => { originRows.style.display = (effectSel.value === 'rotation' || effectSel.value === 'scale') ? '' : 'none'; });
|
|
1009
1031
|
|
|
1010
|
-
|
|
1011
|
-
|
|
1012
|
-
|
|
1013
|
-
|
|
1032
|
+
body.appendChild(sec('Controls (OID triggers)'));
|
|
1033
|
+
body.appendChild(playCtrl); body.appendChild(pauseCtrl);
|
|
1034
|
+
body.appendChild(resumeCtrl); body.appendChild(stopCtrl);
|
|
1035
|
+
body.appendChild(reverseCtrl);
|
|
1014
1036
|
|
|
1015
1037
|
return block;
|
|
1016
1038
|
};
|
|
@@ -137,9 +137,16 @@ function buildTweenConfig(cfg, value) {
|
|
|
137
137
|
break;
|
|
138
138
|
}
|
|
139
139
|
case 'fill':
|
|
140
|
-
config.fill =
|
|
141
|
-
|
|
142
|
-
|
|
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 };
|
|
143
150
|
break;
|
|
144
151
|
case 'transform':
|
|
145
152
|
config.transform = cfg.valueTo || String(value);
|