nodality 1.0.0-beta.1
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/dist/animator.cjs.js +1 -0
- package/dist/animator.esm.js +1 -0
- package/dist/audionew.cjs.js +1 -0
- package/dist/audionew.esm.js +1 -0
- package/dist/base.cjs.js +1 -0
- package/dist/base.esm.js +1 -0
- package/dist/betaDesktopBar.esm.js +1 -0
- package/dist/betaMobileBar.esm.js +1 -0
- package/dist/bundle.umd.js +1 -0
- package/dist/button.cjs.js +1 -0
- package/dist/button.esm.js +1 -0
- package/dist/cardGetter.cjs.js +1 -0
- package/dist/cardGetter.esm.js +1 -0
- package/dist/center.cjs.js +1 -0
- package/dist/center.esm.js +1 -0
- package/dist/checkbox.cjs.js +1 -0
- package/dist/checkbox.esm.js +1 -0
- package/dist/code.cjs.js +1 -0
- package/dist/code.esm.js +1 -0
- package/dist/container.cjs.js +1 -0
- package/dist/container.esm.js +1 -0
- package/dist/datalist.cjs.js +1 -0
- package/dist/datalist.esm.js +1 -0
- package/dist/designer.cjs.js +1 -0
- package/dist/designer.esm.js +1 -0
- package/dist/dropdown.cjs.js +1 -0
- package/dist/dropdown.esm.js +1 -0
- package/dist/elementMapper.cjs.js +1 -0
- package/dist/elementMapper.esm.js +1 -0
- package/dist/finalresult.esm.js +1 -0
- package/dist/flexCard.cjs.js +1 -0
- package/dist/flexCard.esm.js +1 -0
- package/dist/flexGrid.cjs.js +1 -0
- package/dist/flexGrid.esm.js +1 -0
- package/dist/flexRow.cjs.js +1 -0
- package/dist/flexRow.esm.js +1 -0
- package/dist/floatingInput.cjs.js +1 -0
- package/dist/floatingInput.esm.js +1 -0
- package/dist/free.cjs.js +1 -0
- package/dist/free.esm.js +1 -0
- package/dist/horizontalScroller.esm.js +1 -0
- package/dist/image.cjs.js +1 -0
- package/dist/image.esm.js +1 -0
- package/dist/imagePicker.cjs.js +1 -0
- package/dist/imagePicker.esm.js +1 -0
- package/dist/index.cjs.js +1 -0
- package/dist/index.esm.js +1 -0
- package/dist/link.cjs.js +1 -0
- package/dist/link.esm.js +1 -0
- package/dist/linkGetter.cjs.js +1 -0
- package/dist/linkGetter.esm.js +1 -0
- package/dist/metaAdder.cjs.js +1 -0
- package/dist/metaAdder.esm.js +1 -0
- package/dist/modal2025.cjs.js +1 -0
- package/dist/modal2025.esm.js +1 -0
- package/dist/multiswitchers.esm.js +1 -0
- package/dist/newNavBar.cjs.js +1 -0
- package/dist/newNavBar.esm.js +1 -0
- package/dist/picker.cjs.js +1 -0
- package/dist/picker.esm.js +1 -0
- package/dist/progress.cjs.js +1 -0
- package/dist/progress.esm.js +1 -0
- package/dist/radio.cjs.js +1 -0
- package/dist/radio.esm.js +1 -0
- package/dist/range.cjs.js +1 -0
- package/dist/range.esm.js +1 -0
- package/dist/sideBar.cjs.js +1 -0
- package/dist/sideBar.esm.js +1 -0
- package/dist/sideNavBar.cjs.js +1 -0
- package/dist/sideNavBar.esm.js +1 -0
- package/dist/simpleBar.cjs.js +1 -0
- package/dist/simpleBar.esm.js +1 -0
- package/dist/stack.cjs.js +1 -0
- package/dist/stack.esm.js +1 -0
- package/dist/table.cjs.js +1 -0
- package/dist/table.esm.js +1 -0
- package/dist/text.cjs.js +1 -0
- package/dist/text.esm.js +1 -0
- package/dist/textField.cjs.js +1 -0
- package/dist/textField.esm.js +1 -0
- package/dist/wrap.cjs.js +1 -0
- package/dist/wrap.esm.js +1 -0
- package/dist/zoomCard.cjs.js +1 -0
- package/dist/zoomCard.esm.js +1 -0
- package/layout/<head> +59 -0
- package/layout/DEADJOE +49 -0
- package/layout/DEPRECATED-PARAGRAPH.js +103 -0
- package/layout/animator.js +1915 -0
- package/layout/audio.js +145 -0
- package/layout/audionew.js +70 -0
- package/layout/base-2.js +92 -0
- package/layout/base.js +161 -0
- package/layout/betaDesktopBar.js +126 -0
- package/layout/betaMobileBar.js +293 -0
- package/layout/box.js +29 -0
- package/layout/button.js +516 -0
- package/layout/cards.js +136 -0
- package/layout/center.js +143 -0
- package/layout/checkbox.js +183 -0
- package/layout/cleanRow.js +775 -0
- package/layout/code.js +60 -0
- package/layout/container.js +1005 -0
- package/layout/custom.js +289 -0
- package/layout/divImage.js +209 -0
- package/layout/dropdown.js +154 -0
- package/layout/dropdown2025.js +152 -0
- package/layout/edit.sh +39 -0
- package/layout/emptyElement.js +21 -0
- package/layout/externalStylesheet.js +19 -0
- package/layout/flexCard.js +220 -0
- package/layout/flexGrid.js +192 -0
- package/layout/flexrow.js +866 -0
- package/layout/footer.js +83 -0
- package/layout/formComponents/custom.js +0 -0
- package/layout/formComponents/dataList.js +183 -0
- package/layout/formComponents/edit.sh +39 -0
- package/layout/formComponents/floatingInput.js +163 -0
- package/layout/formComponents/form-all.js +161 -0
- package/layout/formComponents/form.js +76 -0
- package/layout/formComponents/imagePicker.js +266 -0
- package/layout/formComponents/picker.js +208 -0
- package/layout/formComponents/radio.js +231 -0
- package/layout/formComponents/radiogroup.js +231 -0
- package/layout/formComponents/range.js +158 -0
- package/layout/free.js +232 -0
- package/layout/grid-new.js +299 -0
- package/layout/grid.js +190 -0
- package/layout/gridSwitcher.js +188 -0
- package/layout/group.js +163 -0
- package/layout/header.js +175 -0
- package/layout/hello.html +126 -0
- package/layout/horizontalScroller.js +222 -0
- package/layout/image-old.js +487 -0
- package/layout/image.js +1039 -0
- package/layout/index.js +183 -0
- package/layout/label.js +50 -0
- package/layout/link.js +1085 -0
- package/layout/list-OLD.js +0 -0
- package/layout/list.js +127 -0
- package/layout/metaAdder.js +17 -0
- package/layout/modal2025.js +142 -0
- package/layout/modernwrap.js +92 -0
- package/layout/multiswitcher.js +224 -0
- package/layout/multiswitcherBeta.js +63 -0
- package/layout/navBar-OLD.js +261 -0
- package/layout/navBar.js +371 -0
- package/layout/navFactor/customDiv.js +60 -0
- package/layout/navFactor/edit.sh +39 -0
- package/layout/newFlatAdder.js +41 -0
- package/layout/newNavBar copy 2.js +915 -0
- package/layout/newNavBar copy.js +774 -0
- package/layout/newNavBar.js +925 -0
- package/layout/offsetContainer.js +395 -0
- package/layout/progress.js +111 -0
- package/layout/remWin.sh +20 -0
- package/layout/row.js +208 -0
- package/layout/savedNewNavBar.js +437 -0
- package/layout/scrollvideo.js +120 -0
- package/layout/sideBar.js +183 -0
- package/layout/sideNavBar.js +313 -0
- package/layout/simpleBar.js +25 -0
- package/layout/slider2025.js +198 -0
- package/layout/spacer.js +44 -0
- package/layout/stack.js +76 -0
- package/layout/styler.js +113 -0
- package/layout/switcher.js +102 -0
- package/layout/table.js +155 -0
- package/layout/text.js +1685 -0
- package/layout/textField.js +282 -0
- package/layout/ulist.js +147 -0
- package/layout/video.js +70 -0
- package/layout/withoutNew.js +60 -0
- package/layout/wrap.js +140 -0
- package/layout/zoomCard.js +219 -0
- package/lib/cardGetter.js +80 -0
- package/lib/designer.js +875 -0
- package/lib/elementMapper.js +1428 -0
- package/lib/linkGetter.js +202 -0
- package/package.json +33 -0
|
@@ -0,0 +1,395 @@
|
|
|
1
|
+
import {Animator} from "./animator.js";
|
|
2
|
+
|
|
3
|
+
class OffsetContainer extends Animator{
|
|
4
|
+
constructor() {
|
|
5
|
+
super();
|
|
6
|
+
this.res = null;
|
|
7
|
+
this.code = [];
|
|
8
|
+
//this.setup();
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
toCode(){
|
|
12
|
+
return this.code;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
resetColumns(){
|
|
17
|
+
this.res.style.gridTemplateColumns = "";
|
|
18
|
+
this.res.style.gridTemplateRows = "";
|
|
19
|
+
return this;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
set(obj){
|
|
23
|
+
obj.align && this.flexAlign(obj.align);
|
|
24
|
+
obj.toStart && this.toStart(obj.toStart);
|
|
25
|
+
obj.columns && this.columns(obj.columns);
|
|
26
|
+
obj.width && (this.res.style.width = obj.width);
|
|
27
|
+
obj.border && (this.res.style.border = obj.border);
|
|
28
|
+
obj.simpleCenter && this.simpleCenter();
|
|
29
|
+
// obj.simpleCenter && (stra += `center: "${obj.simpleCenter}",`);
|
|
30
|
+
|
|
31
|
+
if (obj.field) {
|
|
32
|
+
this.res.style.gridTemplateRows = obj.field.rows;
|
|
33
|
+
this.res.style.gridTemplateColumns = obj.field.columns;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
return this;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
simpleCenter(){
|
|
42
|
+
this.res.style.justifyContent = "center";
|
|
43
|
+
this.res.style.justifyItems = "center";
|
|
44
|
+
this.res.style.alignContent = "center";
|
|
45
|
+
this.res.style.alignItems = "center";
|
|
46
|
+
return this;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
// https://youtube.com/shorts/u7q1Qj1uuD8?feature=share
|
|
50
|
+
|
|
51
|
+
|
|
52
|
+
columns(cols){
|
|
53
|
+
this.res.style.gridTemplateColumns = `repeat(${cols}, 1fr)`;
|
|
54
|
+
return this;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
toStart(perc){
|
|
58
|
+
/*this.res.style.display = "flex";
|
|
59
|
+
this.res.style.justifyContent = "flex-start";
|
|
60
|
+
this.res.style.alignItems = "flex-start";*/
|
|
61
|
+
this.res.style.display = "grid";
|
|
62
|
+
this.res.style.placeItems = "flex-start";
|
|
63
|
+
this.res.style.justifyContent = "flex-start";
|
|
64
|
+
return this; // 224505 15/03 Nice
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
flexAlign(perc){
|
|
68
|
+
/*this.res.style.display = "flex";
|
|
69
|
+
this.res.style.justifyContent = "flex-start";
|
|
70
|
+
this.res.style.alignItems = "flex-start";*/
|
|
71
|
+
this.res.style.display = "grid";
|
|
72
|
+
this.res.style.placeItems = "flex-start";
|
|
73
|
+
this.res.style.alignItems = "center";
|
|
74
|
+
return this; // 224505 15/03 Nice
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
// https://youtube.com/shorts/u7q1Qj1uuD8?feature=share
|
|
78
|
+
add(els){
|
|
79
|
+
|
|
80
|
+
this.code.push("new OffsetContainer() \n");
|
|
81
|
+
this.code.push(".setup({ class: 'wow', center: true, reset: true }) \n");
|
|
82
|
+
// this.code.push(".margin('auto', 0, 'auto', 0) \n");
|
|
83
|
+
this.code.push(".add([ \n");
|
|
84
|
+
// 155732 I can drag
|
|
85
|
+
|
|
86
|
+
/* new OffsetContainer()
|
|
87
|
+
.setup({ class: "wow", center: true, reset: true })
|
|
88
|
+
.margin("auto", 0, "auto", 0)*/
|
|
89
|
+
|
|
90
|
+
|
|
91
|
+
|
|
92
|
+
for (var i = 0; i < els.length; i++){
|
|
93
|
+
|
|
94
|
+
if (els[i] === undefined){
|
|
95
|
+
continue;
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
let item = els[i].render();//.render();
|
|
99
|
+
|
|
100
|
+
if (this.options.reset){
|
|
101
|
+
item.style.gridArea = "1/1";
|
|
102
|
+
}
|
|
103
|
+
this.res.appendChild(item);
|
|
104
|
+
|
|
105
|
+
if (els[i].toCode()){
|
|
106
|
+
// console.log("EMO");
|
|
107
|
+
|
|
108
|
+
if (els[i].toCode() instanceof Array){ // 114341
|
|
109
|
+
|
|
110
|
+
if (i === 0){
|
|
111
|
+
|
|
112
|
+
//console.log(els[i].toCode());
|
|
113
|
+
if (els[i].toCode()[0].startsWith(" ,new")){
|
|
114
|
+
//console.log("---");
|
|
115
|
+
els[i].toCode()[0] = els[i].toCode()[0].replace(" ,new", "new");
|
|
116
|
+
|
|
117
|
+
|
|
118
|
+
const joined = els[i].toCode().flatMap(l => l).join("");
|
|
119
|
+
//console.log(joined);
|
|
120
|
+
this.code.push(`${joined}`);
|
|
121
|
+
}
|
|
122
|
+
} else {
|
|
123
|
+
const joined = els[i].toCode().flatMap(l => l).join("");
|
|
124
|
+
this.code.push(`${joined}`);
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
|
|
128
|
+
} else {
|
|
129
|
+
this.code.push(`${els[i].toCode()}`);
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
|
|
133
|
+
|
|
134
|
+
if (i == els.length - 1){
|
|
135
|
+
if (this.code[this.code.length - 1].endsWith(",")){
|
|
136
|
+
// alert("IJ")
|
|
137
|
+
this.code[this.code.length - 1] = this.code[this.code.length - 1].replace(/(^[,\s]+)|([,\s]+$)/g, '')
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
// 15:05:18 06/03/2023
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
|
|
147
|
+
this.code.push("]),");
|
|
148
|
+
|
|
149
|
+
|
|
150
|
+
|
|
151
|
+
|
|
152
|
+
|
|
153
|
+
|
|
154
|
+
return this;
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
|
|
158
|
+
setWidth(w){
|
|
159
|
+
|
|
160
|
+
this.res.style.width = "100vw";
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
setHeight(w){
|
|
164
|
+
|
|
165
|
+
this.res.style.height = `${w}`;
|
|
166
|
+
return this;
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
|
|
170
|
+
|
|
171
|
+
/*toZStack(){
|
|
172
|
+
this.res.style.display = "grid";
|
|
173
|
+
let st = this.res.style;
|
|
174
|
+
|
|
175
|
+
this.res.style.display = "flex";
|
|
176
|
+
st.justifyContent = "center";
|
|
177
|
+
st.alignItems = "center";
|
|
178
|
+
}*/
|
|
179
|
+
|
|
180
|
+
setup(options) {
|
|
181
|
+
this.options = options;
|
|
182
|
+
let container = document.createElement("div");
|
|
183
|
+
this.res = container;
|
|
184
|
+
this.res.style.margin = 0;
|
|
185
|
+
this.res.style.padding = 0;
|
|
186
|
+
|
|
187
|
+
|
|
188
|
+
// this.res.setAttribute("class", options.id);
|
|
189
|
+
|
|
190
|
+
this.res.setAttribute("class", options.class);
|
|
191
|
+
|
|
192
|
+
if (options.hideOverflow === true){
|
|
193
|
+
this.res.style.overflow = "hidden";
|
|
194
|
+
this.res.style.overflowY = "scroll";
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
|
|
198
|
+
|
|
199
|
+
this.res.style.display = "grid";
|
|
200
|
+
this.res.style.flexDirection = "column";
|
|
201
|
+
this.res.style.justifyContent = "center";
|
|
202
|
+
this.res.style.alignItems = "center";
|
|
203
|
+
|
|
204
|
+
this.res.style.gridColumnStart = 1;
|
|
205
|
+
this.res.style.gridRowStart = 1;
|
|
206
|
+
|
|
207
|
+
|
|
208
|
+
|
|
209
|
+
this.res.style.gridTemplateColumns = "1fr 1fr 1fr 1fr 1fr 1fr";
|
|
210
|
+
this.res.style.gridTemplateRows = "1fr 1fr 1fr";
|
|
211
|
+
|
|
212
|
+
|
|
213
|
+
if (options.height){
|
|
214
|
+
this.res.style.height = options.height;
|
|
215
|
+
}
|
|
216
|
+
|
|
217
|
+
|
|
218
|
+
if (options.width){
|
|
219
|
+
this.res.style.width = options.width;
|
|
220
|
+
this.res.style.marginLeft = "auto";
|
|
221
|
+
this.res.style.marginRight = "auto";
|
|
222
|
+
|
|
223
|
+
let phone = window.matchMedia("(max-device-width: 415px)");
|
|
224
|
+
|
|
225
|
+
|
|
226
|
+
if (phone.matches){
|
|
227
|
+
this.res.style.width = "95%";
|
|
228
|
+
}
|
|
229
|
+
}
|
|
230
|
+
|
|
231
|
+
|
|
232
|
+
|
|
233
|
+
|
|
234
|
+
|
|
235
|
+
if (options.reset){
|
|
236
|
+
this.res.style.gridTemplateColumns = "";
|
|
237
|
+
this.res.style.gridTemplateRows = "";
|
|
238
|
+
// this.res.style.placeItems = "center";
|
|
239
|
+
}
|
|
240
|
+
|
|
241
|
+
|
|
242
|
+
return this;
|
|
243
|
+
}
|
|
244
|
+
|
|
245
|
+
|
|
246
|
+
|
|
247
|
+
|
|
248
|
+
setTemplate(rows, cols){
|
|
249
|
+
this.res.style.gridTemplateRows = rows;
|
|
250
|
+
this.res.style.gridTemplateColumns = cols;
|
|
251
|
+
return this;
|
|
252
|
+
}
|
|
253
|
+
|
|
254
|
+
height(h){
|
|
255
|
+
this.res.style.width = "auto";
|
|
256
|
+
this.res.style.height = `${h}`;
|
|
257
|
+
return this;
|
|
258
|
+
}
|
|
259
|
+
|
|
260
|
+
size(w, h){
|
|
261
|
+
this.w = w;
|
|
262
|
+
this.h = h;
|
|
263
|
+
|
|
264
|
+
if (this.w){
|
|
265
|
+
this.res.style.width = this.w;
|
|
266
|
+
} else {
|
|
267
|
+
this.res.style.width = window.innerWidth;
|
|
268
|
+
}
|
|
269
|
+
|
|
270
|
+
if (this.h){
|
|
271
|
+
this.res.style.height = this.h;
|
|
272
|
+
} else {
|
|
273
|
+
this.res.style.height = window.innerHeight;
|
|
274
|
+
}
|
|
275
|
+
|
|
276
|
+
|
|
277
|
+
return this;
|
|
278
|
+
}
|
|
279
|
+
|
|
280
|
+
background(color) {
|
|
281
|
+
this.res.style.background = color;
|
|
282
|
+
return this;
|
|
283
|
+
}
|
|
284
|
+
|
|
285
|
+
corner(corner) {
|
|
286
|
+
this.res.style.borderRadius = corner;
|
|
287
|
+
return this;
|
|
288
|
+
}
|
|
289
|
+
|
|
290
|
+
padding(L, T, R, B){
|
|
291
|
+
this.res.style.paddingLeft = L;
|
|
292
|
+
this.res.style.paddingTop = T;
|
|
293
|
+
this.res.style.paddingRight = R;
|
|
294
|
+
this.res.style.paddingBottom = B;
|
|
295
|
+
return this;
|
|
296
|
+
}
|
|
297
|
+
|
|
298
|
+
margin(L, T, R, B){
|
|
299
|
+
this.res.style.marginLeft = L;
|
|
300
|
+
this.res.style.marginTop = T;
|
|
301
|
+
this.res.style.marginRight = R;
|
|
302
|
+
this.res.style.marginBottom = B;
|
|
303
|
+
return this;
|
|
304
|
+
}
|
|
305
|
+
|
|
306
|
+
itemWidth(w){
|
|
307
|
+
for (var i = 0; i < this.res.childNodes.length; i++){
|
|
308
|
+
let el = this.res.childNodes[i];
|
|
309
|
+
el.style.width = w;
|
|
310
|
+
}
|
|
311
|
+
|
|
312
|
+
return this;
|
|
313
|
+
}
|
|
314
|
+
|
|
315
|
+
|
|
316
|
+
apply(arr) {
|
|
317
|
+
const goThroughStyles = () => {
|
|
318
|
+
for (var i = 0; i < arr.length; i++) {
|
|
319
|
+
let el = arr[i];
|
|
320
|
+
|
|
321
|
+
|
|
322
|
+
|
|
323
|
+
let query = window.matchMedia(`(max-width: ${el.width}px)`);
|
|
324
|
+
if (el.device){
|
|
325
|
+
query = window.matchMedia(`(max-device-width: ${el.width}px)`);
|
|
326
|
+
alert(el.device);
|
|
327
|
+
}
|
|
328
|
+
|
|
329
|
+
|
|
330
|
+
|
|
331
|
+
if (query.matches) {
|
|
332
|
+
Object.assign(this.res.style, el.styles);
|
|
333
|
+
// alert(el.style.styles.color);
|
|
334
|
+
} else {
|
|
335
|
+
//Object.assign(this.res.style, arr[0].styles);
|
|
336
|
+
}
|
|
337
|
+
}
|
|
338
|
+
}
|
|
339
|
+
|
|
340
|
+
// setFirst
|
|
341
|
+
let query = window.matchMedia(`(max-width: ${arr[0].width}px)`);
|
|
342
|
+
|
|
343
|
+
if (arr[0].device){
|
|
344
|
+
query = window.matchMedia(`(max-device-width: ${arr[0].width}px)`);
|
|
345
|
+
|
|
346
|
+
}
|
|
347
|
+
|
|
348
|
+
if (!query.matches){
|
|
349
|
+
Object.assign(this.res.style, arr[0].styles);
|
|
350
|
+
}
|
|
351
|
+
|
|
352
|
+
goThroughStyles();
|
|
353
|
+
window.addEventListener("resize", goThroughStyles);
|
|
354
|
+
return this;
|
|
355
|
+
}
|
|
356
|
+
|
|
357
|
+
|
|
358
|
+
|
|
359
|
+
|
|
360
|
+
|
|
361
|
+
|
|
362
|
+
|
|
363
|
+
|
|
364
|
+
|
|
365
|
+
/*intoJSXO(obj){
|
|
366
|
+
return <div ref={ref => {
|
|
367
|
+
ref && ref.appendChild(obj)
|
|
368
|
+
}} />;
|
|
369
|
+
return this;
|
|
370
|
+
}*/
|
|
371
|
+
|
|
372
|
+
|
|
373
|
+
render(el) {
|
|
374
|
+
if (el) {
|
|
375
|
+
document.querySelector("body").style.margin = 0;
|
|
376
|
+
document.querySelector("body").style.padding = 0;
|
|
377
|
+
document.querySelector(el).appendChild(this.res);
|
|
378
|
+
} else {
|
|
379
|
+
return this.res;
|
|
380
|
+
}
|
|
381
|
+
}
|
|
382
|
+
}
|
|
383
|
+
|
|
384
|
+
|
|
385
|
+
|
|
386
|
+
|
|
387
|
+
|
|
388
|
+
|
|
389
|
+
|
|
390
|
+
|
|
391
|
+
|
|
392
|
+
|
|
393
|
+
|
|
394
|
+
|
|
395
|
+
export { OffsetContainer };
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
import {Animator} from "./animator.js";
|
|
2
|
+
|
|
3
|
+
// changed on 26/12/2020
|
|
4
|
+
|
|
5
|
+
class Progress {
|
|
6
|
+
constructor(value){
|
|
7
|
+
this.res = null;
|
|
8
|
+
this.value = value;
|
|
9
|
+
this.setup();
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
setup(){
|
|
13
|
+
let wrap = document.createElement("div");
|
|
14
|
+
let bottom = document.createElement("div");
|
|
15
|
+
let top = document.createElement("div");
|
|
16
|
+
bottom.style.position = "absolute";
|
|
17
|
+
top.style.position = "relative";
|
|
18
|
+
wrap.appendChild(bottom);
|
|
19
|
+
wrap.appendChild(top);
|
|
20
|
+
this.res = wrap;
|
|
21
|
+
return this;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
padding(L, T, R, B) {
|
|
25
|
+
if (L || T || R || B){ // CAUGHT MYSELF
|
|
26
|
+
this.res.style.paddingLeft = L;
|
|
27
|
+
this.res.style.paddingTop = T;
|
|
28
|
+
this.res.style.paddingRight = R;
|
|
29
|
+
this.res.style.paddingBottom = B;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
if (!T && !R && !B){
|
|
33
|
+
//alert("j")
|
|
34
|
+
this.res.style.padding = L;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
return this;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
arrayPadding(arr, value) {
|
|
42
|
+
if (arr.includes("left")){
|
|
43
|
+
this.res.style.paddingLeft = value;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
if (arr.includes("right")){
|
|
47
|
+
this.res.style.paddingRight = value;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
if (arr.includes("top")){
|
|
51
|
+
this.res.style.paddingTop = value;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
if (arr.includes("bottom")){
|
|
55
|
+
this.res.style.paddingBottom = value;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
|
|
59
|
+
return this;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
size(obj){
|
|
63
|
+
let width = obj.width.split("%")[0];
|
|
64
|
+
let h = obj.height;
|
|
65
|
+
|
|
66
|
+
this.res.children[0].style.width = (width / 100) * window.innerWidth;
|
|
67
|
+
this.res.children[0].style.height = h;
|
|
68
|
+
this.res.children[1].style.width = (width / 100) * window.innerWidth * this.value;
|
|
69
|
+
this.res.children[1].style.height = h;
|
|
70
|
+
|
|
71
|
+
|
|
72
|
+
const adjust = () => {
|
|
73
|
+
this.res.children[0].style.width = (width / 100) * window.innerWidth;
|
|
74
|
+
this.res.children[0].style.height = h;
|
|
75
|
+
this.res.children[1].style.width = (width / 100) * window.innerWidth * this.value;
|
|
76
|
+
this.res.children[1].style.height = h;
|
|
77
|
+
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
|
|
81
|
+
window.addEventListener("resize", adjust);
|
|
82
|
+
adjust();
|
|
83
|
+
return this;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
|
|
87
|
+
colors(front, back){
|
|
88
|
+
this.res.children[0].style.background = front;
|
|
89
|
+
this.res.children[1].style.background = back;
|
|
90
|
+
return this;
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
round(val){
|
|
94
|
+
this.res.children[0].style.borderRadius = `${val}px`;
|
|
95
|
+
this.res.children[1].style.borderRadius = `${val}px`;
|
|
96
|
+
return this;
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
render(el) {
|
|
100
|
+
Array.from(this.res.children).forEach(e => e.style.padding = 0);
|
|
101
|
+
Array.from(this.res.children).forEach(e => e.style.margin = 0);
|
|
102
|
+
|
|
103
|
+
if (el) {
|
|
104
|
+
document.querySelector(el).appendChild(this.res);
|
|
105
|
+
} else {
|
|
106
|
+
return this.res;
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
export { Progress };
|
package/layout/remWin.sh
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
#!/bin/bash
|
|
2
|
+
|
|
3
|
+
# Loop through all .js files in the current directory
|
|
4
|
+
for file in ./*.js; do
|
|
5
|
+
# Skip if no .js files are found
|
|
6
|
+
[ -e "$file" ] || continue
|
|
7
|
+
|
|
8
|
+
# Use a temporary file to store the modified content
|
|
9
|
+
temp_file=$(mktemp)
|
|
10
|
+
|
|
11
|
+
# Remove lines containing "window.<ClassName> = <ClassName>;"
|
|
12
|
+
grep -vE 'window\.[a-zA-Z_][a-zA-Z0-9_]* = [a-zA-Z_][a-zA-Z0-9_]*;' "$file" > "$temp_file"
|
|
13
|
+
|
|
14
|
+
# Replace the original file with the updated content
|
|
15
|
+
mv "$temp_file" "$file"
|
|
16
|
+
|
|
17
|
+
echo "Processed: $file"
|
|
18
|
+
done
|
|
19
|
+
|
|
20
|
+
echo "All .js files in the current folder have been processed to remove window assignments."
|
package/layout/row.js
ADDED
|
@@ -0,0 +1,208 @@
|
|
|
1
|
+
import {Animator} from "./animator.js";
|
|
2
|
+
|
|
3
|
+
class Row {
|
|
4
|
+
constructor(frs, saveEl) {
|
|
5
|
+
this.saveEl = saveEl;
|
|
6
|
+
this.frs = frs;
|
|
7
|
+
this.res = null;
|
|
8
|
+
this.setup();
|
|
9
|
+
this.responsive();
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
center() {
|
|
13
|
+
// this.res.style.justifyItems = "center";
|
|
14
|
+
return this;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
toCode(){
|
|
19
|
+
return this.code;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
toColumn(at){
|
|
23
|
+
|
|
24
|
+
const toCol = () => {
|
|
25
|
+
let media = window.matchMedia(`(max-width: ${at})`);
|
|
26
|
+
// let mobileMedia = window.matchMedia(`(max-device-width: 415px)`);
|
|
27
|
+
|
|
28
|
+
if (media.matches){
|
|
29
|
+
this.res.style.gridTemplateColumns = "1fr";
|
|
30
|
+
} else {
|
|
31
|
+
this.res.style.gridTemplateColumns = "1fr 1fr";
|
|
32
|
+
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
toCol();
|
|
37
|
+
window.addEventListener("resize", toCol);
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
return this;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
|
|
47
|
+
|
|
48
|
+
|
|
49
|
+
|
|
50
|
+
|
|
51
|
+
styled(obj){
|
|
52
|
+
obj.gap && this.gap(obj.gap);
|
|
53
|
+
return this;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
gap(val){
|
|
57
|
+
this.res.style.gap = val;
|
|
58
|
+
return this;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
|
|
62
|
+
static test(){
|
|
63
|
+
alert("Wow")
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
setup(obj) {
|
|
67
|
+
//let parent = document.createElement("div");
|
|
68
|
+
//this.parent = parent;
|
|
69
|
+
|
|
70
|
+
let flex = document.createElement("div");
|
|
71
|
+
flex.setAttribute("class", "someClass");
|
|
72
|
+
flex.style.display = "grid";
|
|
73
|
+
flex.style.gridTemplateColumns = "1fr 1fr";
|
|
74
|
+
flex.style.alignItems = "center";
|
|
75
|
+
flex.style.margin = 0;
|
|
76
|
+
flex.style.padding = "1em";
|
|
77
|
+
//flex.style.width = "100%";
|
|
78
|
+
|
|
79
|
+
//flex.style.display = "flex";
|
|
80
|
+
|
|
81
|
+
this.res = flex;
|
|
82
|
+
return this;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
set(options){
|
|
86
|
+
if (options.width){
|
|
87
|
+
this.setWidth(options.width);
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
if (options.align){
|
|
91
|
+
//alert("K")
|
|
92
|
+
//this.makeAlign(options.align);
|
|
93
|
+
this.setAlign(options.align);
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
if (options.centered){
|
|
97
|
+
this.res.style.marginRight = "auto";
|
|
98
|
+
this.res.style.marginLeft = "auto";
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
|
|
102
|
+
if (options.toCol){
|
|
103
|
+
this.toColumn(options.toCol);
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
|
|
107
|
+
|
|
108
|
+
|
|
109
|
+
|
|
110
|
+
|
|
111
|
+
return this;
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
|
|
115
|
+
|
|
116
|
+
setAlign(){
|
|
117
|
+
this.res.style.justifyItems = "center";
|
|
118
|
+
return this;
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
|
|
122
|
+
|
|
123
|
+
|
|
124
|
+
setWidth(w){
|
|
125
|
+
this.res.style.width = w;
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
background(color){
|
|
129
|
+
this.res.style.background = color;
|
|
130
|
+
return this;
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
radius(val){
|
|
134
|
+
this.res.style.borderRadius = `${val}px`;
|
|
135
|
+
return this;
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
|
|
139
|
+
items(arr) {
|
|
140
|
+
|
|
141
|
+
var frString = "";
|
|
142
|
+
|
|
143
|
+
|
|
144
|
+
//// console.warn(this.res);
|
|
145
|
+
for (var i = 0; i < arr.length; i++) {
|
|
146
|
+
|
|
147
|
+
|
|
148
|
+
frString += "1fr ";
|
|
149
|
+
|
|
150
|
+
|
|
151
|
+
|
|
152
|
+
let r = arr[i].render();
|
|
153
|
+
// r.style.width = "100%";
|
|
154
|
+
//r.style.flex = 1;
|
|
155
|
+
this.res.appendChild(r);
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
|
|
159
|
+
this.res.style.gridTemplateColumns = frString;
|
|
160
|
+
return this;
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
|
|
164
|
+
responsive(h){
|
|
165
|
+
let media = window.matchMedia(`(max-device-width: 415px)`);
|
|
166
|
+
|
|
167
|
+
const adjust = () => {
|
|
168
|
+
if (window.innerWidth < h || media.matches){
|
|
169
|
+
this.res.style.gridTemplateColumns = "1fr";
|
|
170
|
+
} else {
|
|
171
|
+
this.res.style.gridTemplateColumns = "1fr 1fr";
|
|
172
|
+
}
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
|
|
176
|
+
if (window.innerWidth < h || media.matches){
|
|
177
|
+
this.res.style.gridTemplateColumns = "1fr";
|
|
178
|
+
} else {
|
|
179
|
+
this.res.style.gridTemplateColumns = "1fr 1fr";
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
|
|
183
|
+
window.addEventListener("resize", adjust);
|
|
184
|
+
|
|
185
|
+
|
|
186
|
+
|
|
187
|
+
|
|
188
|
+
|
|
189
|
+
return this;
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
frame(obj){
|
|
193
|
+
this.res.style.width = obj.width;
|
|
194
|
+
this.res.style.height = obj.height;
|
|
195
|
+
return this;
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
|
|
199
|
+
render(el) {
|
|
200
|
+
if (el){
|
|
201
|
+
document.querySelector(el).appendChild(this.res);
|
|
202
|
+
} else {
|
|
203
|
+
return this.res;
|
|
204
|
+
}
|
|
205
|
+
}
|
|
206
|
+
}
|
|
207
|
+
|
|
208
|
+
export { Row };
|