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.
Files changed (179) hide show
  1. package/dist/animator.cjs.js +1 -0
  2. package/dist/animator.esm.js +1 -0
  3. package/dist/audionew.cjs.js +1 -0
  4. package/dist/audionew.esm.js +1 -0
  5. package/dist/base.cjs.js +1 -0
  6. package/dist/base.esm.js +1 -0
  7. package/dist/betaDesktopBar.esm.js +1 -0
  8. package/dist/betaMobileBar.esm.js +1 -0
  9. package/dist/bundle.umd.js +1 -0
  10. package/dist/button.cjs.js +1 -0
  11. package/dist/button.esm.js +1 -0
  12. package/dist/cardGetter.cjs.js +1 -0
  13. package/dist/cardGetter.esm.js +1 -0
  14. package/dist/center.cjs.js +1 -0
  15. package/dist/center.esm.js +1 -0
  16. package/dist/checkbox.cjs.js +1 -0
  17. package/dist/checkbox.esm.js +1 -0
  18. package/dist/code.cjs.js +1 -0
  19. package/dist/code.esm.js +1 -0
  20. package/dist/container.cjs.js +1 -0
  21. package/dist/container.esm.js +1 -0
  22. package/dist/datalist.cjs.js +1 -0
  23. package/dist/datalist.esm.js +1 -0
  24. package/dist/designer.cjs.js +1 -0
  25. package/dist/designer.esm.js +1 -0
  26. package/dist/dropdown.cjs.js +1 -0
  27. package/dist/dropdown.esm.js +1 -0
  28. package/dist/elementMapper.cjs.js +1 -0
  29. package/dist/elementMapper.esm.js +1 -0
  30. package/dist/finalresult.esm.js +1 -0
  31. package/dist/flexCard.cjs.js +1 -0
  32. package/dist/flexCard.esm.js +1 -0
  33. package/dist/flexGrid.cjs.js +1 -0
  34. package/dist/flexGrid.esm.js +1 -0
  35. package/dist/flexRow.cjs.js +1 -0
  36. package/dist/flexRow.esm.js +1 -0
  37. package/dist/floatingInput.cjs.js +1 -0
  38. package/dist/floatingInput.esm.js +1 -0
  39. package/dist/free.cjs.js +1 -0
  40. package/dist/free.esm.js +1 -0
  41. package/dist/horizontalScroller.esm.js +1 -0
  42. package/dist/image.cjs.js +1 -0
  43. package/dist/image.esm.js +1 -0
  44. package/dist/imagePicker.cjs.js +1 -0
  45. package/dist/imagePicker.esm.js +1 -0
  46. package/dist/index.cjs.js +1 -0
  47. package/dist/index.esm.js +1 -0
  48. package/dist/link.cjs.js +1 -0
  49. package/dist/link.esm.js +1 -0
  50. package/dist/linkGetter.cjs.js +1 -0
  51. package/dist/linkGetter.esm.js +1 -0
  52. package/dist/metaAdder.cjs.js +1 -0
  53. package/dist/metaAdder.esm.js +1 -0
  54. package/dist/modal2025.cjs.js +1 -0
  55. package/dist/modal2025.esm.js +1 -0
  56. package/dist/multiswitchers.esm.js +1 -0
  57. package/dist/newNavBar.cjs.js +1 -0
  58. package/dist/newNavBar.esm.js +1 -0
  59. package/dist/picker.cjs.js +1 -0
  60. package/dist/picker.esm.js +1 -0
  61. package/dist/progress.cjs.js +1 -0
  62. package/dist/progress.esm.js +1 -0
  63. package/dist/radio.cjs.js +1 -0
  64. package/dist/radio.esm.js +1 -0
  65. package/dist/range.cjs.js +1 -0
  66. package/dist/range.esm.js +1 -0
  67. package/dist/sideBar.cjs.js +1 -0
  68. package/dist/sideBar.esm.js +1 -0
  69. package/dist/sideNavBar.cjs.js +1 -0
  70. package/dist/sideNavBar.esm.js +1 -0
  71. package/dist/simpleBar.cjs.js +1 -0
  72. package/dist/simpleBar.esm.js +1 -0
  73. package/dist/stack.cjs.js +1 -0
  74. package/dist/stack.esm.js +1 -0
  75. package/dist/table.cjs.js +1 -0
  76. package/dist/table.esm.js +1 -0
  77. package/dist/text.cjs.js +1 -0
  78. package/dist/text.esm.js +1 -0
  79. package/dist/textField.cjs.js +1 -0
  80. package/dist/textField.esm.js +1 -0
  81. package/dist/wrap.cjs.js +1 -0
  82. package/dist/wrap.esm.js +1 -0
  83. package/dist/zoomCard.cjs.js +1 -0
  84. package/dist/zoomCard.esm.js +1 -0
  85. package/layout/<head> +59 -0
  86. package/layout/DEADJOE +49 -0
  87. package/layout/DEPRECATED-PARAGRAPH.js +103 -0
  88. package/layout/animator.js +1915 -0
  89. package/layout/audio.js +145 -0
  90. package/layout/audionew.js +70 -0
  91. package/layout/base-2.js +92 -0
  92. package/layout/base.js +161 -0
  93. package/layout/betaDesktopBar.js +126 -0
  94. package/layout/betaMobileBar.js +293 -0
  95. package/layout/box.js +29 -0
  96. package/layout/button.js +516 -0
  97. package/layout/cards.js +136 -0
  98. package/layout/center.js +143 -0
  99. package/layout/checkbox.js +183 -0
  100. package/layout/cleanRow.js +775 -0
  101. package/layout/code.js +60 -0
  102. package/layout/container.js +1005 -0
  103. package/layout/custom.js +289 -0
  104. package/layout/divImage.js +209 -0
  105. package/layout/dropdown.js +154 -0
  106. package/layout/dropdown2025.js +152 -0
  107. package/layout/edit.sh +39 -0
  108. package/layout/emptyElement.js +21 -0
  109. package/layout/externalStylesheet.js +19 -0
  110. package/layout/flexCard.js +220 -0
  111. package/layout/flexGrid.js +192 -0
  112. package/layout/flexrow.js +866 -0
  113. package/layout/footer.js +83 -0
  114. package/layout/formComponents/custom.js +0 -0
  115. package/layout/formComponents/dataList.js +183 -0
  116. package/layout/formComponents/edit.sh +39 -0
  117. package/layout/formComponents/floatingInput.js +163 -0
  118. package/layout/formComponents/form-all.js +161 -0
  119. package/layout/formComponents/form.js +76 -0
  120. package/layout/formComponents/imagePicker.js +266 -0
  121. package/layout/formComponents/picker.js +208 -0
  122. package/layout/formComponents/radio.js +231 -0
  123. package/layout/formComponents/radiogroup.js +231 -0
  124. package/layout/formComponents/range.js +158 -0
  125. package/layout/free.js +232 -0
  126. package/layout/grid-new.js +299 -0
  127. package/layout/grid.js +190 -0
  128. package/layout/gridSwitcher.js +188 -0
  129. package/layout/group.js +163 -0
  130. package/layout/header.js +175 -0
  131. package/layout/hello.html +126 -0
  132. package/layout/horizontalScroller.js +222 -0
  133. package/layout/image-old.js +487 -0
  134. package/layout/image.js +1039 -0
  135. package/layout/index.js +183 -0
  136. package/layout/label.js +50 -0
  137. package/layout/link.js +1085 -0
  138. package/layout/list-OLD.js +0 -0
  139. package/layout/list.js +127 -0
  140. package/layout/metaAdder.js +17 -0
  141. package/layout/modal2025.js +142 -0
  142. package/layout/modernwrap.js +92 -0
  143. package/layout/multiswitcher.js +224 -0
  144. package/layout/multiswitcherBeta.js +63 -0
  145. package/layout/navBar-OLD.js +261 -0
  146. package/layout/navBar.js +371 -0
  147. package/layout/navFactor/customDiv.js +60 -0
  148. package/layout/navFactor/edit.sh +39 -0
  149. package/layout/newFlatAdder.js +41 -0
  150. package/layout/newNavBar copy 2.js +915 -0
  151. package/layout/newNavBar copy.js +774 -0
  152. package/layout/newNavBar.js +925 -0
  153. package/layout/offsetContainer.js +395 -0
  154. package/layout/progress.js +111 -0
  155. package/layout/remWin.sh +20 -0
  156. package/layout/row.js +208 -0
  157. package/layout/savedNewNavBar.js +437 -0
  158. package/layout/scrollvideo.js +120 -0
  159. package/layout/sideBar.js +183 -0
  160. package/layout/sideNavBar.js +313 -0
  161. package/layout/simpleBar.js +25 -0
  162. package/layout/slider2025.js +198 -0
  163. package/layout/spacer.js +44 -0
  164. package/layout/stack.js +76 -0
  165. package/layout/styler.js +113 -0
  166. package/layout/switcher.js +102 -0
  167. package/layout/table.js +155 -0
  168. package/layout/text.js +1685 -0
  169. package/layout/textField.js +282 -0
  170. package/layout/ulist.js +147 -0
  171. package/layout/video.js +70 -0
  172. package/layout/withoutNew.js +60 -0
  173. package/layout/wrap.js +140 -0
  174. package/layout/zoomCard.js +219 -0
  175. package/lib/cardGetter.js +80 -0
  176. package/lib/designer.js +875 -0
  177. package/lib/elementMapper.js +1428 -0
  178. package/lib/linkGetter.js +202 -0
  179. package/package.json +33 -0
@@ -0,0 +1,1428 @@
1
+ import {Animator} from "../layout/animator.js";
2
+ import {Text} from "../layout/text.js";
3
+ import {Image} from "../layout/image.js";
4
+ import {Link} from "../layout/link.js";
5
+ import {FlexRow} from "../layout/flexRow.js";
6
+ import {UINavBar} from "../layout/newNavBar.js";
7
+ import { /*Beta*/DesktopBar } from "../layout/betaDesktopBar.js";
8
+ import { /*Beta*/MobileBar } from "../layout/betaMobileBar.js";
9
+ import { /*Multi*/Switcher } from "../layout/multiswitcher.js";
10
+ import { Dropdown } from "../layout/dropdown2025.js";
11
+ import { Wrapper } from "../layout/container.js";
12
+ import { SideNav } from "../layout/sideNavBar.js";
13
+ import { Spacer } from "../layout/spacer.js";
14
+ //22:58:29 I won!!!
15
+
16
+ // 16/04/25 18:39:40 Nice!!!
17
+ // FORM COMPONENTS
18
+ import { FloatingInput } from "../layout/formComponents/floatingInput.js";
19
+ import { Range } from "../layout/formComponents/range.js";
20
+ import { RadioGroup } from "../layout/formComponents/radio.js";
21
+ import { Picker } from "../layout/formComponents/picker.js";
22
+ import { FilePickera } from "../layout/formComponents/imagePicker.js";
23
+ import { DataList } from "../layout/formComponents/dataList.js";
24
+ import { Base } from "../layout/base.js";
25
+ import { Form } from "../layout/formComponents/form.js";
26
+ import { Button } from "../layout/button.js";
27
+ import { Slider } from "../layout/slider2025.js";
28
+ import { Audio } from "../layout/audionew.js";
29
+ import { Video } from "../layout/video.js";
30
+ import { Table } from "../layout/table.js";
31
+ import { Modal } from "../layout/modal2025.js";
32
+ import { Code } from "../layout/code.js";
33
+ import { Free } from "../layout/free.js";
34
+ import { Checkbox } from "../layout/checkbox.js";
35
+ import { Stack } from "../layout/stack.js";
36
+ import { LinkStyler } from "../lib/linkGetter.js";
37
+ import { CardGen } from "../lib/cardGetter.js";
38
+ import {Simple} from "../layout/gridSwitcher.js";
39
+
40
+ class ElementMapper { // 22:09:58 04/11/2024
41
+ static mapType(obj) {
42
+ // console.log("LOBJ");
43
+ // console.log(obj);
44
+ let headings = ["h1", "h2", "h3", "h4", "h5", "h6"];
45
+ if (headings.includes(obj.el.type)) {
46
+ return this.mapText(obj);
47
+ } else if (obj.el.type === "img"){
48
+ return this.mapImage(obj);
49
+ } else if (obj.el.type === "a"){
50
+ return this.mapLink(obj);
51
+ } else if (obj.el.type === "cards"){
52
+ return this.mapGrid(obj);
53
+ } /*else if (obj.el.type === "cdiv"){
54
+ return this.mapCDiv(obj);
55
+ } */else if (obj.el.type === "free"){
56
+ return this.mapFree(obj);
57
+ } else if (obj.el.type === "nav"){ // protoNav
58
+ return this.protoNav(obj);
59
+ } else if (obj.el.type === "sideNav"){
60
+ return this.sideNav(obj);
61
+ } else if (obj.el.type === "row"){
62
+ return this.row(obj);
63
+ } else if (obj.el.type === "dropdown"){
64
+ return this.dropdown(obj);
65
+ } else if (obj.el.type === "modal"){
66
+ return this.modal(obj);
67
+ } else if (obj.el.type === "slider"){
68
+ return this.slider(obj);
69
+ } else if (obj.el.type === "table"){
70
+ return this.table(obj);
71
+ } else if (obj.el.type === "radio"){ // FORM ELEMENTS
72
+ // alert("PP")
73
+ return this.radio(obj);
74
+ } else if (obj.el.type === "input"){
75
+ // alert("PP")
76
+ return this.input(obj);
77
+ } else if (obj.el.type === "labelInput"){
78
+ // alert("PP")
79
+ return this.floatInput(obj);
80
+ } else if (obj.el.type === "filePicker"){
81
+ // alert("PP")
82
+ return this.filePicker(obj);
83
+ } else if (obj.el.type === "picker"){
84
+ // alert("PP")
85
+ return this.picker(obj);
86
+ } else if (obj.el.type === "video"){
87
+ // alert("PP")
88
+ return this.video(obj);
89
+ } else if (obj.el.type === "audio"){
90
+ // alert("PP")
91
+ return this.audio(obj);
92
+ } else if (obj.el.type === "multiswitcher"){
93
+ // alert("PP")
94
+ return this.multiswitcher(obj);
95
+ } else if (obj.el.type === "button"){
96
+ // alert("PP")
97
+ return this.button(obj);
98
+ } else if (obj.el.type === "form"){
99
+ return this.form(obj);
100
+ } else if (obj.el.type === "checkbox"){
101
+ return this.checkbox(obj);
102
+ } else if (obj.el.type === "stack"){
103
+ return this.stack(obj);
104
+ } else if (obj.el.type === "simple"){
105
+ return this.simple(obj);
106
+ }
107
+ }
108
+
109
+
110
+ static button(){
111
+ return new Button("Submit")
112
+ .set({
113
+ fluidc: "S6",
114
+ color: "white",
115
+ background: "#1abc9c",
116
+ arrpad: {sides: ["all"], value: ".3rem"},
117
+ radius: ".3rem",
118
+ onTap: () => {alert("Nice")},
119
+ keySet: {key: "border", value: "3px solid green"}
120
+ });
121
+ }
122
+
123
+ static multiswitcher(){
124
+
125
+
126
+ let r = new Switcher()
127
+ .set({breakpoints:[
128
+ { at: "0px", view: new Text("First").set({}) },
129
+
130
+ { at: "700px", view: new Text("Nice").set({}) },
131
+
132
+ { at: "800px", view: new Text("Best").set({}) },
133
+ ]}); // undefined must be passed to render method
134
+
135
+ // console.log("ROD");
136
+ // console.log(r.toCode().join(""));
137
+
138
+ // return new Text("MS").set({});
139
+
140
+ return r;
141
+ }
142
+
143
+
144
+ static video(){
145
+ return new Video("https://www.w3schools.com/html/mov_bbb.mp4").set({});
146
+ }
147
+
148
+ static audio(){
149
+ return new Audio("rouska.mp3").set({background: "#1abc9c"});
150
+ }
151
+
152
+ static radio(obj){
153
+ // alert("PP")
154
+ return new RadioGroup()
155
+ .set({
156
+ items: ["Male", "Female", "Third shit"],
157
+ multiple: true // wrnóng
158
+ });
159
+ }
160
+
161
+ static input(obj){
162
+ // alert("PP")
163
+ return new TextField().set({
164
+ type: "text",
165
+ placeholder: "Enter swimming time",
166
+ arrayMargin: {sides: ["all"], value: "1rem"}
167
+ });
168
+ }
169
+
170
+ static floatInput(obj){
171
+ // alert("PP")
172
+ return new FloatingInput()
173
+ .set({
174
+ title: "Your name",
175
+ type: "input"
176
+ });
177
+ }
178
+
179
+ static filePicker(obj){
180
+ // alert("PP")
181
+ return new FilePickera()
182
+ .set({
183
+ id: "A",
184
+ title: "Add profile picture",
185
+ background: "#3498DB",
186
+ color: "white",
187
+ font: "Arial",
188
+ radius: "3rem",
189
+ accept: "application/pdf"
190
+ });
191
+ }
192
+
193
+ static picker(obj){
194
+
195
+ let items = [["none", "select a car---"], ["tesla", "Tesla"], ["audi", "Audi"]];
196
+
197
+
198
+ return new Picker()
199
+ .set({
200
+ items: items,
201
+ font: "Arial",
202
+ arrayPadding: ({sides: ["all"], value: "0.5rem"}),
203
+ rounded: true
204
+ })
205
+ }
206
+
207
+ static modal(obj){
208
+
209
+ /* return new Code()
210
+ .set({
211
+ pad: [
212
+ { l: 30 },
213
+ ],
214
+ mar: [
215
+ { a: 30 },
216
+ ],
217
+ class: "language-js",
218
+ code: 'new Text("Modality").set({ font: "Arial" })'
219
+ });*/
220
+
221
+
222
+
223
+ /*new Text("Please refer here on how to create modal. http://localhost:8080/library/elements/modal.html").set({
224
+ font: "Arial",
225
+ color: "orangered",
226
+ weight: "bold",
227
+ breakWord: true,
228
+ arrpad: {sides: ["top", "left"], value: "1rem"}
229
+ });*/
230
+ }
231
+
232
+ static slider(obj){
233
+ let texts = [
234
+ new Wrapper().set({}).add([
235
+ new Text("One").set({ fluidc: "S1", color: "#1abc9c", font: "Arial" }),
236
+ new Text("First time").set({ font: "Arial" })
237
+ ]),
238
+
239
+ new Text("Two").set({ fluidc: "S1", color: "#1abc9c", font: "Arial" }),
240
+ new Text("Three").set({ fluidc: "S1", color: "#1abc9c", font: "Arial" }),
241
+ new Text("Four").set({ fluidc: "S1", color: "#1abc9c", font: "Arial" })
242
+ ];
243
+
244
+ return new Slider(texts, null);//.render("#mount");
245
+ }
246
+
247
+ static table(obj){
248
+ return new Table()
249
+ .add([
250
+ { abbr: "AUIUI/AK9PT", name: "Pokročilé mobilní technologie", grade: "A", date: "09.01.2024" },
251
+ { abbr: "AUIUI/AK9PT", name: "Pokročilé mobilní technologie", grade: "A", date: "09.01.2024" },
252
+ { abbr: "AUIUI/AK9PT", name: "Pokročilé mobilní technologie", grade: "A", date: "09.01.2024" }
253
+ ])
254
+ .set({
255
+ cellPadding: "0.3em",
256
+ cellAlign: "center",
257
+ style: {
258
+ font: "Arial"
259
+ },
260
+ headStyle: {
261
+ color: "white",
262
+ background: "#ff6d22"
263
+ },
264
+ border: "2px solid black",
265
+ center: true,
266
+ borderRadius: 2.2
267
+ })
268
+ }
269
+
270
+ static dropdown(obj){
271
+ if (!obj.el.items){
272
+ obj.el.items = ["Flower", "Car", "Maseratti"];
273
+ }
274
+
275
+ let items = obj.el.items.map(el => new Link().set({
276
+ pad: [{
277
+ a: 10
278
+ }],
279
+ font: "Arial",
280
+ bold: true,
281
+ link: "https://www.apple.com",
282
+ text: el,
283
+ icon: {padding: 30, url: "https://cdn-icons-png.flaticon.com/512/32/32339.png"},
284
+ hover: {
285
+ color: "wheat",
286
+ animation: 0.3
287
+ },
288
+
289
+ }));
290
+
291
+ return new Dropdown()
292
+ .set({
293
+ behaviour: "mouseover", // click otherwise
294
+ //width: "120px",
295
+
296
+ // socenter: true,
297
+ // background: "green",
298
+ // padding: "30px",
299
+ pad: [{"a": "1rem"}],
300
+ mar: [{"a": "1rem"}],
301
+ border: "1px solid black",
302
+ width: "180px",
303
+ radius: "1rem"
304
+ })
305
+ .add([
306
+ /*new Text("Click me"),
307
+ new Text("Option 1"),
308
+ new Text("Option 2"),
309
+ new Text("Option 3"),*/
310
+
311
+
312
+ new Text(obj.el.items[0]).set({
313
+ font: "Arial",
314
+ fluidc: "S6",
315
+ weight: "bold",
316
+ align: "center",
317
+ cursor: "hand",
318
+ icon: {
319
+ padding: 30,
320
+ url: "https://cdn-icons-png.flaticon.com/512/60/60995.png"
321
+ },
322
+ pad: [{l: 10, r: 10}],
323
+
324
+ }),
325
+
326
+ new Wrapper().set({border: "1px solid green", background: "#1abc9c", radius: "0.7rem", socenter: true})
327
+ .add(items.slice(1)
328
+
329
+ /* new Text("Option 1o").set({font: "Arial", pad: [{a: 10}],}),
330
+ new Text("Option 2").set({font: "Arial", pad: [{a: 10}],}),
331
+ new Text("Option 3").set({font: "Arial", pad: [{a: 10}],}),
332
+ */
333
+ )
334
+ ])
335
+ }
336
+
337
+ static row(obj){
338
+ const customOptions = obj.customOptions;
339
+
340
+ let ret = new FlexRow()
341
+ .set({
342
+ borderObj: {
343
+ width: "3px",
344
+ color: "orange"
345
+ },
346
+ colat: "600px"
347
+ })
348
+ .items([
349
+
350
+ new Text("Firsta").set({
351
+ border: "3px solid green",
352
+ width: "100%"
353
+ }),
354
+
355
+ new Text("Second").set({
356
+ border: "3px solid green",
357
+ width: "100%"
358
+ }),
359
+
360
+ new Text("Third").set({
361
+ border: "3px solid green",
362
+ width: "100%"
363
+ })
364
+ ])
365
+
366
+
367
+ return ret;
368
+
369
+ }
370
+
371
+ static protoNav(obj){
372
+
373
+ const customOptions = obj.customOptions;
374
+
375
+ // console.log("ONA");
376
+ // console.log(obj);
377
+ // get slayout now
378
+ // let ft = customOptions.filter(l => l.op.name === "navStyle")[0].op;
379
+ // console.log("HOHJM");
380
+ // console.log(ft);
381
+
382
+
383
+ let items = [
384
+ {title: "Fire", link: "@e"},
385
+ {title: "and", link: "@e"},
386
+ {title: "smoke", link: "@e"}
387
+ ];
388
+
389
+ let links = items.map((i, o) => new Link(`"${i.title}"`)
390
+ .set({
391
+ fluidc: "S6",
392
+ text: i.title,
393
+ link: i.link,
394
+
395
+ font: "Arial",
396
+ // pad: [{a:20}],
397
+ pad: [{ "a": 40 }],
398
+ bold: true,
399
+ hover: { color: "wheat", animation: 0.3 },
400
+
401
+
402
+ }));
403
+
404
+
405
+ let animatedLinks = items.map((i, o) => new Link(`"${i.title}"`)
406
+ .set({
407
+ fluidc: "S6",
408
+ text: i.title,
409
+ link: i.link,
410
+
411
+ font: "Arial",
412
+ // pad: [{a:20}],
413
+ pad: [{ "a": 40 }],
414
+ bold: true,
415
+ hover: { color: "wheat", animation: 0.3 },
416
+
417
+ animation: { // also works without animation block
418
+ range: ["0px", "1900px"],
419
+ op: {
420
+ name: "animation",
421
+ color: "green", // 102410 19/11/24 staggered
422
+ width: "1px",
423
+ keyframesOpen: [ // staggered effect
424
+ { transform: `translate(100%, ${o*10}%)`, opacity: 0 },
425
+ { transform: `translate(0%)`, opacity: 1 }
426
+ ],
427
+ keyframesClose: [ // put where approprriate
428
+ { transform: 'translate(0%)', opacity: 1 },
429
+ { transform: `translate(100%, ${o*10}%)`, opacity: 0 }
430
+ ],
431
+ openOptions: {
432
+ duration: 300,
433
+ fill: 'forwards',
434
+ delay: 1000 // 1000
435
+ },
436
+ closeOptions:{
437
+ duration: 1, // 1 should be acceptable here when I close
438
+ fill: 'forwards',
439
+ delay: 1000 // 1000 why does 3000 work during open but not during close??
440
+ },
441
+ },
442
+ },
443
+ }));
444
+
445
+
446
+ if (obj.el.dropdown){
447
+
448
+
449
+ const dropdown = new Dropdown().set({
450
+ behaviour: "mouseover",
451
+ pad: [{"a":40}],
452
+ // socenter: true,
453
+ padding: "10px",
454
+ border: "1px solid black"
455
+ }).add([
456
+ new Text("First")
457
+ .set({
458
+ cursor: "hand",
459
+ icon: {padding:30,url:"https://cdn-icons-png.flaticon.com/512/60/60995.png"},
460
+ fluidc: "S6",
461
+ pad: [{l:20,r:10}],
462
+ font: "Arial",
463
+ align: "center",
464
+ weight: "bold",
465
+
466
+ })
467
+
468
+ ,
469
+ new Wrapper()
470
+ .set({socenter: true,
471
+ radius: "0.7rem",background: "#1abc9c",
472
+ makeResponsiveBehaviour: "undefined",})
473
+ .add([
474
+
475
+ new Link()
476
+ .set({
477
+ pad: [{a:10}],
478
+ font: "Arial",
479
+ hover: {color:"wheat",animation:0.3},
480
+ bold: true,
481
+ link: "https://www.apple.com",
482
+ text: "Second",
483
+ icon: {padding:30,url:"https://cdn-icons-png.flaticon.com/512/32/32339.png"},})
484
+ ,
485
+ new Link()
486
+ .set({
487
+ pad: [{a:10}],
488
+ font: "Arial",
489
+ hover: {color:"wheat",animation:0.3},
490
+ bold: true,
491
+ link: "https://www.apple.com",
492
+ text: "Third",
493
+ icon: {padding:30,url:"https://cdn-icons-png.flaticon.com/512/32/32339.png"},})
494
+ ])]);
495
+
496
+ animatedLinks.push(dropdown);
497
+ links.push(dropdown);
498
+ }
499
+
500
+
501
+
502
+
503
+
504
+
505
+
506
+
507
+ //console.log("ANA");
508
+ //console.log(animatedLinks);
509
+
510
+
511
+ /* const removeKeyFromArray = (arr, keyToRemove) => {
512
+ return arr.map(obj => {
513
+ const { [keyToRemove]: _, ...rest } = obj;
514
+ return rest;
515
+ });
516
+ }
517
+
518
+ const updatedLinks = removeKeyFromArray(links, "");
519
+ console.log(updatedLinks);
520
+ */
521
+
522
+ let shouldAnim = obj.el.animation;
523
+
524
+ /* let rt = new UINavBar()
525
+ .setup({
526
+ animate: true,
527
+ radius: "1rem",
528
+ background: "#1abc9c",
529
+ hamColour: {opened: "#1abc9c", closed: "white"},
530
+ mobileSize: "1.2em"
531
+ }).items(shouldAnim ? animatedLinks : links);
532
+
533
+ */
534
+
535
+ // console.log("PPPP");
536
+ // console.log(rt.toCode());
537
+ // return rt;
538
+
539
+
540
+
541
+ return new Switcher()
542
+ .set({
543
+ breakpoints: [ // 172800 almost
544
+ {
545
+ at: "0px", view: new MobileBar().set({
546
+ background: "green",
547
+ mar: [{ "a": 21 }],
548
+ brand: new Text("A").set({size: "S1"}),
549
+ hamburgerColour: "#3498db",
550
+ radius: "1rem",
551
+ }).add([
552
+ new Link("A").set({text: "A", url: "#a"}),//.render()
553
+
554
+
555
+
556
+ new Dropdown()
557
+ .set({
558
+ behaviour: "mouseover",
559
+ pad: [{ "a": 40 }],
560
+ mar: [{ "lr": "auto" }],
561
+ breakpoint: "1200px",
562
+ // socenter: true,
563
+ padding: "10px",
564
+ border: "1px solid black",
565
+ // background: "orange",
566
+ height: "auto",
567
+
568
+ }).add([
569
+ new Text("First")
570
+ .set({
571
+ cursor: "hand",
572
+ icon: { padding: 30, url: "https://cdn-icons-png.flaticon.com/512/60/60995.png" },
573
+ fluidc: "S6",
574
+ pad: [{ l: 10, r: 10 }],
575
+ font: "Arial",
576
+ align: "center",
577
+ weight: "bold",
578
+
579
+ }),
580
+
581
+ new Text("Firsti")
582
+ .set({
583
+ cursor: "hand",
584
+ // icon: { padding: 30, url: "https://cdn-icons-png.flaticon.com/512/60/60995.png" },
585
+ fluidc: "S6",
586
+ pad: [{ l: 10, r: 10 }],
587
+ font: "Arial",
588
+ align: "center",
589
+ weight: "bold",
590
+
591
+ }),
592
+
593
+ new Text("Firstiuu")
594
+ .set({
595
+ cursor: "hand",
596
+ // icon: { padding: 30, url: "https://cdn-icons-png.flaticon.com/512/60/60995.png" },
597
+ fluidc: "S6",
598
+ pad: [{ l: 10, r: 10 }],
599
+ font: "Arial",
600
+ align: "center",
601
+ weight: "bold"
602
+ })
603
+
604
+ ]),
605
+
606
+
607
+
608
+
609
+ new Link("B").set({text: "B", url: "#b"}),//.render()
610
+ new Link("C").set({text: "C", url: "https://www.abcnews.com"})//.render()
611
+ ])//.addNavItem(new Link("C").set({}).render())
612
+ },
613
+
614
+ {
615
+ at: "1200px", view: new DesktopBar().set({
616
+ background: "green",
617
+ mar: [{ "a": 21 }],
618
+ maxHeight: "100px",
619
+ radius: "1rem"
620
+
621
+ // brand: new Text("A").set({}).render()
622
+ })
623
+ // .setBrand(new Text("A").set({}).render())
624
+ .add([
625
+ new Text("A").set({size: "S1"}),
626
+ new Spacer(true),
627
+
628
+ // new Link("O").set({text: "O", url: "#a"}),
629
+
630
+
631
+ // 161311 vnuk
632
+
633
+ new Dropdown().set({
634
+ behaviour: "mouseover",
635
+ pad: [{ "a": 40 }],
636
+ // socenter: true,
637
+ padding: "10px",
638
+ border: "1px solid black",
639
+ radius: "30px",
640
+ width: "130px"
641
+ }).add([
642
+ new Text("First")
643
+ .set({
644
+ cursor: "hand",
645
+ icon: { padding: 30, url: "https://cdn-icons-png.flaticon.com/512/60/60995.png" },
646
+ fluidc: "S6",
647
+ pad: [{ l: 10, r: 10 }],
648
+ font: "Arial",
649
+ align: "center",
650
+ weight: "bold",
651
+
652
+ }),
653
+
654
+
655
+ new Wrapper().set({
656
+ flexDir: "column",
657
+ background: "orange",
658
+ mar: [{"t": "10px"}],
659
+ radius: ".3rem"}).add([
660
+
661
+
662
+
663
+ new Link("")
664
+ .set({
665
+ text: "A", // BEWARE
666
+ url: "jk",
667
+ cursor: "hand",
668
+ // icon: { padding: 30, url: "https://cdn-icons-png.flaticon.com/512/60/60995.png" },
669
+ fluidc: "S6",
670
+ pad: [{ l: 10, r: 10 }],
671
+ font: "Arial",
672
+ align: "center",
673
+ weight: "bold"
674
+ }),
675
+
676
+ new Link("")
677
+ .set({
678
+ text: "Kivi new TV",
679
+ url: "#u",
680
+ cursor: "hand",
681
+ // icon: { padding: 30, url: "https://cdn-icons-png.flaticon.com/512/60/60995.png" },
682
+ fluidc: "S6",
683
+ pad: [{ l: 10, r: 10 }],
684
+ font: "Arial",
685
+ align: "center",
686
+ weight: "bold",
687
+
688
+ }),
689
+
690
+ new Link("")
691
+ .set({
692
+ text: "Thanks GPT",
693
+ url: "#u",
694
+ cursor: "hand",
695
+ // icon: { padding: 30, url: "https://cdn-icons-png.flaticon.com/512/60/60995.png" },
696
+ fluidc: "S6",
697
+ pad: [{ l: 10, r: 10 }],
698
+ font: "Arial",
699
+ align: "center",
700
+ weight: "bold",
701
+
702
+ }),
703
+ ])
704
+
705
+
706
+
707
+
708
+
709
+ ]),
710
+
711
+
712
+
713
+
714
+
715
+
716
+
717
+
718
+
719
+
720
+
721
+ new Link("Desktop bar").set({text: "Desktop bar", url: "#a"}),//.render()
722
+ new Link("B").set({text: "B", url: "#a"}),//.render()
723
+ new Link("C").set({text: "C", url: "#a"})//.render()
724
+ // new Link("C").set({})//.render()
725
+ ])
726
+ /*.addNavItem(
727
+ new Link("C").set({}).render()
728
+ )*/
729
+
730
+ },
731
+ // { at: "800px", view: new Link("C").set({}) },
732
+ // { at: "700px", view: Object.assign(document.createElement("h1"), { textContent: "Medium View" }) },
733
+ // { at: "800px", view: Object.assign(document.createElement("h1"), { textContent: "Large View" }) },
734
+ ],
735
+ })
736
+
737
+ // return new Text("A").set({})
738
+ }
739
+
740
+
741
+
742
+
743
+ static sideNav(obj){
744
+
745
+ const customOptions = obj.customOptions;
746
+
747
+ // get slayout now
748
+ let ft =[];// customOptions.filter(l => l.op.name === "navStyle")[0].op;
749
+ // let arr = [];
750
+ // console.log("HOHJM");
751
+ // console.log(ft);
752
+
753
+
754
+
755
+
756
+
757
+
758
+ let items = [
759
+ {title: "Home", link: "@e"},
760
+ {title: "Projects", link: "@e"},
761
+ {title: "Services", link: "@e"}
762
+ ];
763
+
764
+
765
+ /* child.animate([
766
+ { transform: 'translateY(0%)', opacity: 1 },
767
+ { transform: 'translateY(100%)', opacity: 0 }
768
+ ],
769
+ {
770
+ duration: 1,
771
+ fill: 'forwards',
772
+ delay: 1000
773
+ });*/
774
+
775
+ const links = items.map((i, o) => new Link(`"${i.title}"`)
776
+ .set({
777
+ fluidc: "S4",
778
+ text: i.title,
779
+ link: i.link,
780
+ isNavA: true,
781
+ url: "#e",
782
+ id: "#" + i.title.toLowerCase(),
783
+ font: "Arial",
784
+ pad: [{a:20}],
785
+ bold: true,
786
+ align: "left" // 21:04:58
787
+ }));
788
+
789
+
790
+ const dropdown = new Dropdown().set({
791
+ behaviour: "mouseover",
792
+ pad: [{"a":40}],
793
+ //socenter: true,
794
+ padding: "10px",
795
+ border: "1px solid black",
796
+ animation: { // also works without animation block
797
+ range: ["0px", "1900px"],
798
+ op: {
799
+ name: "animation",
800
+ color: "green", // 102410 19/11/24 staggered
801
+ width: "1px",
802
+ keyframesOpen: [ // staggered effect
803
+ { transform: `translate(100%, ${1*10}%)`, opacity: 0 },
804
+ { transform: `translate(0%)`, opacity: 1 }
805
+ ],
806
+ keyframesClose: [ // put where approprriate
807
+ { transform: 'translate(0%)', opacity: 1 },
808
+ { transform: `translate(100%, ${1*10}%)`, opacity: 0 }
809
+ ],
810
+ openOptions: {
811
+ duration: 300,
812
+ fill: 'forwards',
813
+ delay: 1000 // 1000
814
+ },
815
+ closeOptions:{
816
+ duration: 1, // 1 should be acceptable here when I close
817
+ fill: 'forwards',
818
+ delay: 1000 // 1000 why does 3000 work during open but not during close??
819
+ },
820
+ },
821
+ },
822
+ }).add([
823
+ new Text("First")
824
+ .set({
825
+ cursor: "hand",
826
+ icon: {padding:30,url:"https://cdn-icons-png.flaticon.com/512/60/60995.png"},
827
+ fluidc: "S6",
828
+ pad: [{l:10,r:10}],
829
+ font: "Arial",
830
+ align: "center",
831
+ weight: "bold",
832
+
833
+ })
834
+
835
+ ,
836
+ new Wrapper()
837
+ .set({socenter: true,
838
+ radius: "0.7rem",background: "#1abc9c",
839
+ makeResponsiveBehaviour: "undefined",})
840
+ .add([
841
+
842
+ new Link()
843
+ .set({
844
+ pad: [{a:10}],
845
+ font: "Arial",
846
+ hover: {color:"wheat",animation:0.3},
847
+ bold: true,
848
+ link: "https://www.apple.com",
849
+ text: "Second",
850
+ icon: {padding:30,url:"https://cdn-icons-png.flaticon.com/512/32/32339.png"},})
851
+ ,
852
+ new Link()
853
+ .set({
854
+ pad: [{a:10}],
855
+ font: "Arial",
856
+ hover: {color:"wheat",animation:0.3},
857
+ bold: true,
858
+ link: "https://www.apple.com",
859
+ text: "Third",
860
+ icon: {padding:30,url:"https://cdn-icons-png.flaticon.com/512/32/32339.png"},})
861
+ ])]);
862
+
863
+
864
+
865
+
866
+
867
+ let animatedLinks = items.map((i, o) => new Link(`"${i.title}"`)
868
+ .set({
869
+ fluidc: "S4",
870
+ text: i.title,
871
+ link: i.link,
872
+ isNavA: true,
873
+ url: "#e",
874
+ id: "#" + i.title.toLowerCase(),
875
+ font: "Arial",
876
+ pad: [{a:20}],
877
+ bold: true,
878
+ align: "left", // 21:04:58
879
+ animation: { // also works without animation block
880
+ range: ["0px", "1900px"],
881
+ op: {
882
+ name: "animation",
883
+ color: "green", // 102410 19/11/24 staggered
884
+ width: "1px",
885
+ keyframesOpen: [ // staggered effect
886
+ { transform: `translate(100%, ${o*10}%)`, opacity: 0 },
887
+ { transform: `translate(0%)`, opacity: 1 }
888
+ ],
889
+ keyframesClose: [ // put where approprriate
890
+ { transform: 'translate(0%)', opacity: 1 },
891
+ { transform: `translate(100%, ${o*10}%)`, opacity: 0 }
892
+ ],
893
+ openOptions: {
894
+ duration: 300,
895
+ fill: 'forwards',
896
+ delay: 1000 // 1000
897
+ },
898
+ closeOptions:{
899
+ duration: 1, // 1 should be acceptable here when I close
900
+ fill: 'forwards',
901
+ delay: 1000 // 1000 why does 3000 work during open but not during close??
902
+ },
903
+ },
904
+ },
905
+ }));
906
+
907
+ //console.log("OBJ EL DROPDOWN");
908
+ //console.log(obj);
909
+
910
+ if (obj.el.dropdown){
911
+ animatedLinks.push(dropdown);
912
+ links.push(dropdown);
913
+ }
914
+
915
+ // Always require link wrapper
916
+ const linkWrapper = new Wrapper().set({column: true}).add([
917
+ new Text("Ultra Reckoning")
918
+ .set({
919
+ fluidc: "S6",
920
+ font: "Arial",
921
+ id: "#olod",
922
+ italic: true,
923
+ animation: {range:["0px","1900px"],op:{name:"animation",color:"green",width:"1px"}},
924
+ pad: [{l:40}, {t:20}], // Insert in the right plce
925
+ // pad: {sides: ["all"], value: "1rem"}
926
+ }),
927
+
928
+ obj.el.animation ? animatedLinks[0] : links[0],
929
+ obj.el.animation ? animatedLinks[1] : links[1],
930
+ obj.el.animation ? animatedLinks[2] : links[2],
931
+ (obj.el.animation && obj.el.dropdown) ? animatedLinks[3] : new Text("").set({}).excludeFromCode(),
932
+
933
+ new Text("Paramount, 2024")
934
+ .set({ // no ID, no animation
935
+ pad: [{a: 20}],
936
+ animation: {range:["0px","1900px"],op:{name:"animation",color:"green",width:"1px"}},
937
+ })
938
+ ]);
939
+
940
+ const offCanvas = new Wrapper().set({column: true}).add([
941
+ new Text("Off canvas")
942
+ .set({
943
+ fluidc: "S6",
944
+ font: "Arial",
945
+ id: "#olod",
946
+ italic: true,
947
+ animation: obj.el.animation ? {range:["0px","1900px"],op:{name:"animation",color:"green",width:"1px"}} : null,
948
+ pad: [{l:40}, {t:20}], // Insert in the right plce
949
+ // pad: {sides: ["all"], value: "1rem"}
950
+ }),
951
+
952
+ // obj.el.animation ? animatedLinks[0] : links[0],
953
+ ])
954
+
955
+
956
+ // Show more than links in sideNav...
957
+ // Supply entire view with links instead of just links
958
+ // https://www.rabenrifaie.com/
959
+
960
+
961
+
962
+ let rt = new SideNav()
963
+ .setup({
964
+ animate: true, // 193608 works
965
+ radius: "1rem",
966
+ isSide: true,
967
+ background: "#ecf0f1",
968
+ hamColour: {opened: "#1abc9c", closed: "#e67e22"},
969
+ mobileSize: "1.2em",
970
+ }).items(obj.el.offcanvas ? offCanvas : linkWrapper );
971
+
972
+
973
+
974
+ // console.log("PPPP");
975
+ // console.log(obj.el.offcanvas);
976
+ // console.log(rt.toCode());
977
+ return rt;
978
+
979
+ // return new Text("A").set({})
980
+ }
981
+
982
+ static mapFree(obj){
983
+ const customOptions = obj.customOptions;
984
+
985
+ // get slayout now
986
+ let ft = customOptions.filter(l => (l.op.name === "slayout" || l.op.name === "layout"))[0];
987
+ let spanObjects = null;
988
+ let templateCols = {cols: 6, rows: 6};
989
+
990
+ // console.log("FT----");
991
+ // console.log(ft.op.value)
992
+
993
+ if (ft.op.value === "text-above-image" || ft.op.value === "image-above-text"){
994
+ spanObjects = null;
995
+ templateCols = null;
996
+ }
997
+ 5
998
+ if (ft.op.value === "image-overlay-text"){ // 17:43:03
999
+ spanObjects = {
1000
+ text: {row: "1 / span 2", col: "3 / span 2"},
1001
+ image: {row: "2 / span 3", col: "3 / 3"}
1002
+ }
1003
+ }
1004
+
1005
+ // react on by value to control amount
1006
+ if (ft.op.value === "image-leftof-text") { // no 3-6
1007
+ spanObjects = {
1008
+ text: {row: "1", col: "1 / 3"},
1009
+ image: {row: "1", col: "3 / 4"}
1010
+ }
1011
+ }
1012
+
1013
+ /* if (ft.op.value === "text-center-img" || ft.op.value === "img-center-text") { // no 3-6
1014
+ spanObjects = {
1015
+ text: {row: "1", col: "1"},
1016
+ image: {row: "1", col: "1"}
1017
+ }
1018
+ }*/
1019
+
1020
+ // probably dont use obj.el.els here, bit can access
1021
+ let ela = new Free()
1022
+ .set({id: "#3", templateCols: templateCols, height: "600px", })
1023
+ .add([
1024
+ new Text("I am free")
1025
+ .set({
1026
+ border: "3px solid green",
1027
+ "font": "Arial", // 23:11:24 08/11/24 "font" works also?
1028
+ fluidc: "S1",
1029
+ color: "#1abc9c",
1030
+ gpos: spanObjects != null ? (spanObjects.text) : null, // "span 2" can also work here as string
1031
+ zIndex: 1
1032
+ }),
1033
+
1034
+ new Image("https://www.cruisemapper.com/images/ships/2183-e9681865a61.jpg")
1035
+ .set({
1036
+ url: "https://www.cruisemapper.com/images/ships/2183-e9681865a61.jpg",
1037
+ width: "400px",
1038
+ height: "auto",
1039
+ gpos: spanObjects != null ? (spanObjects.image) : null,
1040
+ //zIndex: -3
1041
+ })
1042
+ ]);
1043
+
1044
+ return ela;
1045
+ // console.log("ETC");
1046
+ // console.log(ela.toCode());
1047
+ }
1048
+
1049
+ static mapText(obj) {
1050
+ // console.log(obj.el.type);
1051
+
1052
+ let el = obj.el;
1053
+
1054
+ // console.log("ANIMEA");
1055
+ // console.log(this.filtero("animation", el.id, obj.customOptions));
1056
+ // console.log(obj.customOptions);
1057
+
1058
+ // console.log("TRANSAX");
1059
+ // console.log(this.filtero("transform", el.id, obj.customOptions));
1060
+ // console.log(obj.customOptions);
1061
+ // console.log("MATRAX");
1062
+ // console.log(obj.customOptions[10].op.transform.values);
1063
+ //alert("/")
1064
+
1065
+
1066
+
1067
+
1068
+ return new Text(el.text || el.value)
1069
+ .set({
1070
+ id: el.id,
1071
+ class: el.class,
1072
+ color: el.color,
1073
+ fluidc: this.getElType(el.type),
1074
+ font: el.font ?? "Arial",
1075
+ // index: obj.i + "",
1076
+ // keySet: {key: "border", value: "3px solid green"},
1077
+ stroke: this.filtero("blast", el.id, obj.customOptions),
1078
+ gradient: this.filtero("gradient", el.id, obj.customOptions),
1079
+ animation: this.filtero("animation", el.id, obj.customOptions),
1080
+ shadow: this.filtero("shadow", el.id, obj.customOptions),
1081
+ span: this.filtero("span", el.id, obj.customOptions),
1082
+ backgroundOp: this.filtero("background", el.id, obj.customOptions),
1083
+ marginOp: this.filtero("margin", el.id, obj.customOptions),
1084
+ transform: this.filtero("transform", el.id, obj.customOptions),
1085
+ });
1086
+ }
1087
+
1088
+
1089
+ static mapImage(obj){
1090
+ let el = obj.el;
1091
+
1092
+ return new Image(el.url)
1093
+ .set({
1094
+ ...el,
1095
+ isFull:el.isFull,
1096
+ // index: obj.i + "",
1097
+ animation: this.filtero("animation", el.id, obj.customOptions),
1098
+ shadow: this.filtero("shadow", el.id, obj.customOptions),//customOptions.filter(l => l.op.name === "shadow")[0],
1099
+ marginOp: this.filtero("margin", el.id, obj.customOptions),//customOptions.filter(l => l.op.name === "margin")[0],
1100
+ filtera: this.filtero("filter", el.id, obj.customOptions),//customOptions.filter(l => l.op.name === "filter")[0]
1101
+ // zIndex: -1
1102
+ });
1103
+ }
1104
+
1105
+ static mapLink(obj){
1106
+ let bst = obj.customOptions.filter(l => l.op.name === "link-style");//[0];
1107
+
1108
+ let ela = null;
1109
+
1110
+
1111
+ // console.log("Link object");
1112
+ // console.log(obj);
1113
+
1114
+ let re = obj.el;
1115
+ if (obj.el.id) {
1116
+ re["id"] = obj.el.id;
1117
+ }
1118
+
1119
+
1120
+ // re["url"] = "https://www.nasa.gov";
1121
+
1122
+ if (obj.el.link && obj.el.text){
1123
+ re["url"] = obj.el.link;
1124
+ re["text"] = obj.el.text;
1125
+ }
1126
+
1127
+
1128
+ re["keySet"] = {key: "background", value: "shadow: 3px 3px solid green"};
1129
+
1130
+ // 10:42:18 Nice!!! 24/11/24
1131
+ re["animation"] = this.filtero("animation", obj.el.id, obj.customOptions),
1132
+ re["class"] = obj.el.class,
1133
+ re["width"] = obj.el.width,
1134
+
1135
+
1136
+
1137
+
1138
+ re["font"] = "Arial";
1139
+ re["fluidc"] = obj.el.fluidc;
1140
+ re["index"] = obj.i + "", // add other options here
1141
+ re["shadow"] = this.filtero("shadow", obj.el.id, obj.customOptions),//customOptions.filter(l => l.op.name === "shadow")[0],
1142
+ re["backgroundOp"] = this.filtero("background", obj.el.id, obj.customOptions),//customOptions.filter(l => l.op.name === "background")[0];
1143
+ re["pad"] = [{ "a": 10 }];
1144
+
1145
+ if (bst.length > 0) {
1146
+ ela = LinkStyler.style({
1147
+ el: obj.el,
1148
+ re: re,
1149
+ bst: bst,
1150
+ options: obj.customOptions
1151
+ })[bst.length - 1]; // zero idea how this works but okay 00:30:32 09/05/24
1152
+
1153
+ } else {
1154
+ ela = new Link().set(re);
1155
+ }
1156
+
1157
+ /* if (ela != undefined) {
1158
+ this.code.push(ela.toCode().join(""));
1159
+ this.ready2Render.push(ela);
1160
+ this.css.push(ela.toCSS());
1161
+ this.elCSS.push(ela.toElCSS());
1162
+ this.elHTML.push(ela.toHTMLA());
1163
+ ela = ela.render();
1164
+ }*/
1165
+
1166
+
1167
+ return ela;
1168
+ }
1169
+
1170
+
1171
+ static mapGrid(obj){
1172
+ console.log("OBJ IS");
1173
+ console.log(obj.storage);
1174
+
1175
+
1176
+ let childStrings = [];
1177
+ let cardOption = obj.customOptions.filter(l => l.op.name === "card-style")[0] ?? {};
1178
+
1179
+ childStrings = CardGen.cards(obj.el, cardOption, obj.storage);
1180
+
1181
+ let card = `new Card()
1182
+ .set({
1183
+ width: "300px", radius: "0.7rem", mar: { sides: ["all"], value: "0.8rem" }})
1184
+ .items([${childStrings.join(",")} \n ])`;
1185
+
1186
+ // console.log("STATS");
1187
+ // console.log(childStrings[0]);
1188
+
1189
+ if (obj.el.backgroundCard) {
1190
+ card = `new ZoomCard().set({url: "https://img.freepik.com/free-photo/seascape-texture-waves-water-generative-ai_169016-30500.jpg", font: "Arial", mar: { sides: ["all"], value: "0.8rem" }, inpad: "1rem", useBrightness: true})
1191
+ .items([
1192
+ ${childStrings.join(",")},
1193
+ ]), \n`;
1194
+ }
1195
+
1196
+ let cards = Array(3).fill(card);
1197
+
1198
+ return `\n
1199
+ new FlexGrid()
1200
+ .set({colat: "700px", wrap: true, align: "center"})
1201
+ .items([${cards}])
1202
+ \n`;
1203
+ }
1204
+
1205
+
1206
+ static mapCDiv(obj){
1207
+
1208
+ let customOptions = obj.customOptions;
1209
+
1210
+
1211
+
1212
+ if (rta) {
1213
+
1214
+ let re = el;
1215
+ re["makeResponsiveBehaviour"] = rta.op.hash[0].l;
1216
+ re["index"] = i;
1217
+
1218
+ let childRe = {};
1219
+ childRe["width"] = "200px";
1220
+ childRe["height"] = "100px";
1221
+
1222
+ ela = new Wrapper().set(re)
1223
+ if (rta.op.hash[0].child) {
1224
+
1225
+ childRe["makeResponsiveBehaviour"] = rta.op.hash[0].child.l;
1226
+
1227
+ let child = new Wrapper().set(childRe).add([
1228
+ new Text("Hello")
1229
+ ]);
1230
+
1231
+ ela = new Wrapper().set(re).add([child]);
1232
+ }
1233
+ }
1234
+ }
1235
+
1236
+ static checkbox(obj){
1237
+ return new Checkbox().set({
1238
+ name: "acceptTerms",
1239
+ label: new Text("Check it out!").set({size: "S6", color: "#1abc9c", font: "Arial"}),
1240
+ mar: "10px",
1241
+ // size: "100px",
1242
+ // customStyle: true,
1243
+ // checkedBackgroundColor: "#1abc9c",
1244
+ // clipPath: "polygon(50% 0%, 61% 35%, 98% 35%, 68% 57%, 79% 91%, 50% 70%, 21% 91%, 32% 57%, 2% 35%, 39% 35%)"
1245
+ });
1246
+
1247
+ }
1248
+
1249
+ static stack(obj){
1250
+ return new Stack()
1251
+ .set({})
1252
+ // .setup({})
1253
+ .add([
1254
+ new Image().set({url: "https://pbs.twimg.com/media/DwYvbCBVAAEKY_R.jpg"}),
1255
+
1256
+
1257
+
1258
+ new Text("Samuel Suresh")
1259
+ .set({
1260
+ color: "#00ae56",
1261
+ font: "SF Pro Display",
1262
+ fluidc: "S2",
1263
+ pad: {sides: ["top", "left"], value: 20}
1264
+ }),
1265
+ ]);
1266
+
1267
+ }
1268
+
1269
+ static form(obj){
1270
+
1271
+ // php -S localhost:8000
1272
+ // open http://localhost:8000/designertest/1-pagesample.html
1273
+ return new Form()
1274
+ .set({action:"file.php"}) // 12:45:53 Nice! 21/04/2025
1275
+ .add([
1276
+ new FloatingInput().set({
1277
+ title: "Your name",
1278
+ type: "input",
1279
+ name: "name"
1280
+ }),
1281
+
1282
+ new FloatingInput().set({
1283
+ title: "Your email",
1284
+ type: "input",
1285
+ name: "email",
1286
+ color: "#3498db",
1287
+ font: "Arial",
1288
+ mar: [{"a": "1rem"}]
1289
+ }),
1290
+
1291
+ new RadioGroup()
1292
+ .set({
1293
+ name: "gender",
1294
+ items: ["Male", "Female", "Third shit"],
1295
+ multiple: false,
1296
+ tint: "#1abc9c",
1297
+ font: "Arial",
1298
+ exact: "3rem"
1299
+ }),
1300
+
1301
+ new Picker()
1302
+ .set({
1303
+ name: "car",
1304
+ items: [
1305
+ ["none", "select a car---"], // Placeholder option
1306
+ ["tesla", "Tesla"], // Tesla as a selectable option
1307
+ ["audi", "Audi"] // Audi as a selectable option
1308
+ ],
1309
+ font: "Arial",
1310
+ arrayPadding: ({sides: ["all"], value: "0.5rem"}),
1311
+ radius: "1rem",
1312
+ background: "#1abc9c"
1313
+ }),
1314
+
1315
+ new FilePickera()
1316
+ .set({
1317
+ id: "A",
1318
+ name: "image",
1319
+ title: "Add profile picture",
1320
+ background: "#3498DB",
1321
+ color: "white",
1322
+ font: "Arial",
1323
+ radius: "3rem",
1324
+ // accept: "application/pdf"
1325
+ }),
1326
+
1327
+ // datalist, range, filepicker, picker
1328
+
1329
+ // add radio and read it in PHP
1330
+
1331
+ new Button("Submit form").set({ // 174915 If I dont serve it, it downloads the php file
1332
+ type: "submit",
1333
+ background: "#3498db",
1334
+ color: "white",
1335
+ weight: "bold",
1336
+ radius: "1rem",
1337
+ pad: [{"a": "1rem"}], // add
1338
+ mar: [{"b": "1rem"}] // add
1339
+ })
1340
+ ]);
1341
+ }
1342
+
1343
+ static simple(obj){
1344
+ // Chain the methods of the Simple class
1345
+ return `new Simple()
1346
+ .set({ gap: "10px", height: "700px" })
1347
+ .react([
1348
+ {
1349
+ at: "0", // Default size
1350
+ color: "red",
1351
+ template: [
1352
+ "aaaaaa",
1353
+ "bbbbbb",
1354
+ "cccccc",
1355
+ "dddddd",
1356
+ "eeeeee",
1357
+ ],
1358
+ },
1359
+ {
1360
+ at: "768", // Medium screen size
1361
+ color: "blue",
1362
+ template: [
1363
+ "aa bbb",
1364
+ "aa bbb",
1365
+ "cc ddd",
1366
+ "ee ddd",
1367
+ ],
1368
+ },
1369
+ {
1370
+ at: "1024", // Large screen size
1371
+ color: "green",
1372
+ template: [
1373
+ "aaa bbb",
1374
+ "ccc ddd",
1375
+ "eee ddd",
1376
+ ],
1377
+ },
1378
+ ])
1379
+ .add([
1380
+ new Text("Hello A").set({size: "S1"}),
1381
+ new Text("Hello B").set({size: "S1"}),
1382
+ new Text("Hello C").set({size: "S1"}),
1383
+ new Text("Hello D").set({size: "S1"}),
1384
+ new Text("Hello E").set({size: "S1"})
1385
+ ])`;
1386
+
1387
+
1388
+ // return new Simple().set({}).react([]);
1389
+ }
1390
+
1391
+ /*static base(){
1392
+ let res = class Appa extends Base {
1393
+ constructor(){
1394
+ super();
1395
+ }
1396
+
1397
+ render(){
1398
+ return new Text("Q")
1399
+ }
1400
+ }
1401
+
1402
+ return res;
1403
+ }*/
1404
+
1405
+
1406
+ static getElType(type) {
1407
+ return `S${type.substr(1)}`;
1408
+ }
1409
+
1410
+ static filtero(name, id, customOptions) {
1411
+ // console.warn(customOptions
1412
+ // .filter(l => l.op.name === name));
1413
+ let aro = customOptions
1414
+ .filter(l => l.op.name === name)
1415
+ .filter(l => {
1416
+ if (l.target) {
1417
+ return l.target.includes(id)
1418
+ } else {
1419
+ return true;
1420
+ }
1421
+ });
1422
+
1423
+ return aro[0];
1424
+ }
1425
+ }
1426
+
1427
+
1428
+ export {ElementMapper};