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,875 @@
1
+ /* Classes:
2
+ ElementMapper
3
+ */
4
+
5
+ // NEXT STEPS = FreeLayout
6
+ import {ElementMapper} from "../lib/elementMapper.js";
7
+ import {Animator} from "../layout/animator.js";
8
+ import {Text} from "../layout/text.js";
9
+ import {Image} from "../layout/image.js";
10
+ import {Link} from "../layout/link.js";
11
+ import {FlexRow} from "../layout/flexRow.js"; // Yes! 00:50:30 14/04 add them all here
12
+ import { UINavBar } from "../layout/newNavBar.js";
13
+ import { Free } from "../layout/free.js";
14
+ import { Audio } from "../layout/audionew.js";
15
+ import { Progress } from "../layout/progress.js";
16
+ import { Center } from "../layout/center.js";
17
+ import { Code } from "../layout/code.js";
18
+ //import { Link } from "../layout/link.js";
19
+ import { Stack } from "../layout/stack.js";
20
+ import { Wrapper } from "../layout/container.js";
21
+ import { MetaAdder } from "../layout/metaAdder.js";
22
+ import { Table } from "../layout/table.js";
23
+ import { Dropdown } from "../layout/dropdown2025.js";
24
+ import { Modal } from "../layout/modal2025.js";
25
+ import { TextField } from "../layout/textField.js";
26
+ import { Card } from "../layout/flexCard.js";
27
+ //import { NavBar } from "../layout/navBar.js";
28
+ import { Wrap } from "../layout/wrap.js";
29
+ import { FlexGrid } from "../layout/flexGrid.js";
30
+ import { ZoomCard } from "../layout/zoomCard.js";
31
+ import { /*Multi*/Switcher } from "../layout/multiswitcher.js";
32
+ import { /*Beta*/MobileBar } from "../layout/betaMobileBar.js";
33
+ import { /*Beta*/DesktopBar } from "../layout/betaDesktopBar.js";
34
+ import { SideNav } from "../layout/sideNavBar.js";
35
+ import { Spacer } from "../layout/spacer.js";
36
+
37
+
38
+ // FORM COMPONENTS
39
+ import { FloatingInput } from "../layout/formComponents/floatingInput.js";
40
+ import { Range } from "../layout/formComponents/range.js";
41
+ import { RadioGroup } from "../layout/formComponents/radio.js";
42
+ import { Picker } from "../layout/formComponents/picker.js";
43
+ import { FilePickera } from "../layout/formComponents/imagePicker.js";
44
+ import { DataList } from "../layout/formComponents/dataList.js";
45
+ import { Base } from "../layout/base.js";
46
+ import { Form } from "../layout/formComponents/form.js";
47
+ import { Button } from "../layout/button.js";
48
+ import { Slider } from "../layout/slider2025.js";
49
+ import { Video } from "../layout/video.js";
50
+ import { Checkbox } from "../layout/checkbox.js";
51
+ import { LinkStyler } from "../lib/linkGetter.js";
52
+ import { CardGen } from "../lib/cardGetter.js";
53
+ import {Simple} from "../layout/gridSwitcher.js";
54
+
55
+ // Audio, progress, TextField, import navFactor
56
+ class Des {
57
+ constructor() {
58
+ this.items = [];
59
+ this.options = [];
60
+ this.code = [];
61
+ this.ready2Render = [];
62
+ this.stor = {
63
+ text:
64
+ {
65
+ miami: {
66
+ code: `new Text("Hello").set({fluidc: "S3", color: "orange"})`,
67
+ },
68
+ base: {
69
+ code: `new Text("Hello").set({fluidc: "S3", color: "orange"})`,
70
+ },
71
+ nepal: {
72
+ code: `new Text("Hello").set({fluidc: "S3", color: "#2ECC71", font: "Helvetica Neue"})`,
73
+ },
74
+ patagonia: {
75
+ code: `new Text("Hello").set({fluidc: "S3", color: "#3498DB", font: "DIN Alternate"})`,
76
+ },
77
+ },
78
+
79
+ complexa: {
80
+ code: `new Wrapper()
81
+ .set({...}) // Rest of the code omitted for brevity`
82
+ },
83
+
84
+ complex: {
85
+ code: `new Wrapper()
86
+ .set({...}) // Rest of the code omitted for brevity`
87
+ }, ops: {
88
+ miami: {
89
+ blast: {
90
+ code: `stroke: {range:["0px","3000px"], op:{name:"blast",color:"orange",width:"3px"}}`,
91
+ },
92
+ blastFun: (val) => {
93
+ return `stroke: {range:["0px","3000px"], op:{name:"blast",color:"orange",width:"${val}px"}}`;
94
+ },
95
+ },
96
+ nepal: {
97
+ blast: {
98
+ code: `stroke: {range:["0px","3000px"], op:{name:"blast",color:"#2ECC71",width:"3px"}}`,
99
+ },
100
+ blastFun: (val) => {
101
+ return `stroke: {range:["0px","3000px"], op:{name:"blast",color:"#2ECC71",width:"${val}px"}}`;
102
+ },
103
+ },
104
+ patagonia: {
105
+ blast: {
106
+ code: `stroke: {range:["0px","3000px"], op:{name:"blast",color:"#1abc9c",width:"3px"}}`,
107
+ },
108
+ blastFun: (val) => {
109
+ return `stroke: {range:["0px","3000px"], op:{name:"blast",color:"#1abc9c",width:"${val}px"}}`;
110
+ },
111
+ },
112
+ },
113
+
114
+ link: {
115
+ miami: {
116
+ code: `new Link("Link").set({text: "Hello", url: "#a", background: "", color: "orange", hover: {color: "white", background: "orange", animation: 0.6}, borderObj: {color: "orange", width: "3px", radius: "0.7rem"}, pad: { sides: ["all"], value: "0.6rem" }, arrayMargin: { sides: ["top", "bottom"], value: "0.8rem" }, radius: "0.4rem"})`,
117
+ },
118
+ base: {
119
+ code: `new Link("Link").set({text: "Hello", url: "#ai", background: "#3498db", pad: [{lr: "0.5rem", tb: "1rem"}], radius: "0.4rem", color: "white"})`,
120
+ },
121
+ nepal: {
122
+ code: `new Link("Link").set({text: "Hello", url: "#a", background: "#2ECC71", pad: { sides: ["all"], value: "0.6rem" }, mar: { sides: ["top", "bottom"], value: "0.8rem" }, hover: {color: "#2ECC71", background: "white", border: true, animation: 0.3}, color: "white"})`,
123
+ },
124
+ patagonia: {
125
+ code: `new Link("Link", "#a").set({text: "Hello", url: "#a", background: "#1ABC9C", pad: { sides: ["all"], value: "0.6rem" }, mar: { sides: ["top", "bottom"], value: "0.8rem" }, hover: {color: "#2ECC71", background: "white", border: true, animation: 0.3}, color: "white"})`,
126
+ },
127
+ },
128
+
129
+ grid: {
130
+ code: `new Simple().set({...}).react([...]).add([...])`, // Rest omitted for brevity
131
+ },
132
+
133
+ flexRow: (colat) => ({
134
+ image: {
135
+ code: `new FlexRow().set({border: ["all", "3px"], colat: "600px"}).items([new Image(...), new Image(...), new Image(...)])`,
136
+ },
137
+ text: {
138
+ code: `new FlexRow().set({...}).items([new Text(...), new Text(...), new Text(...)])`,
139
+ },
140
+ }),
141
+
142
+ tabSpace : (len) => {
143
+ return ' '.repeat(len);
144
+ }
145
+ }
146
+ }
147
+
148
+
149
+
150
+
151
+
152
+ at(opts) {
153
+ this.options.push(opts);
154
+ return this;
155
+ }
156
+
157
+ nodes(arr) {
158
+ this.options = arr;
159
+ this.protoOptions = [...arr];
160
+ console.log(this.options);
161
+ console.log(this.protoOptions);
162
+ return this;
163
+ }
164
+
165
+ getElType(type) {
166
+ return `S${type.substr(1)}`;
167
+ }
168
+
169
+ // What if there is multiple objects?
170
+ filtero(name, id, customOptions) {
171
+ // console.warn(customOptions
172
+ // .filter(l => l.op.name === name));
173
+ let aro = customOptions
174
+ .filter(l => l.op.name === name)
175
+ .filter(l => {
176
+ if (l.target) {
177
+ return l.target.includes(id)
178
+ } else {
179
+ return true;
180
+ }
181
+ });
182
+
183
+ return aro[0];
184
+ }
185
+
186
+ add(arr) {
187
+
188
+ this.css = [];
189
+ this.elCSS = [];
190
+ this.elHTML = [];
191
+
192
+ let customOptions = this.options;
193
+ //console.log("COO");
194
+ //console.log(customOptions);
195
+ for (var i = 0; i < arr.length; i++) {
196
+ let el = arr[i];
197
+ let ela = null;
198
+
199
+ let ops = ["blast", "gradient", "shadow", "filter", "animationSimple", "transform"];
200
+ let replacementObjects = [
201
+ {
202
+ // range: ["0px", "1900px"],
203
+ op: {
204
+ name: "blast",
205
+ color: "green",
206
+ width: "1px"
207
+ },
208
+ },
209
+
210
+ { // 18:00:08 OK!!! 25/04/2025
211
+
212
+ op: {
213
+ name: "gradient",
214
+ // gradient: "linear-gradient(#3498db,#1abc9c)"
215
+ gradient: "linear-gradient(orange, green)"
216
+ },
217
+
218
+ },
219
+
220
+ {
221
+
222
+ op: {
223
+ name: "shadow",
224
+ color: "#1abc9c",
225
+ steps: 3
226
+ },
227
+ },
228
+
229
+ {
230
+ // range: ["0px", "2000px"],
231
+ op: {
232
+ name: "filter",
233
+ filter: "grayscale(0.7)"
234
+ }, // shadow resets filter so that's okay
235
+ //target: ["#imga", "#eimga"]
236
+ },
237
+
238
+ {
239
+ op: {
240
+ name: "animation",
241
+ color: "green",
242
+ width: "1px",
243
+ fireAt: "inview",
244
+ keyframesOpen: [{
245
+ transform: "translate(100%, 0%)",
246
+ opacity: 0
247
+ }, {
248
+ transform: "translate(0%)",
249
+ opacity: 1
250
+ }],
251
+ keyframesClose: [{
252
+ transform: "translate(0%)",
253
+ opacity: 1
254
+ }, {
255
+ transform: "translate(100%, 0%)",
256
+ opacity: 0
257
+ }],
258
+ openOptions: {
259
+ duration: 300,
260
+ fill: "forwards",
261
+ delay: 1000
262
+ },
263
+ closeOptions: {
264
+ duration: 1,
265
+ fill: "forwards",
266
+ delay: 1000
267
+ }
268
+ }
269
+ },
270
+
271
+ {
272
+ op: {
273
+ name: "transform",
274
+ values: [ // This can be empty or have any order of values
275
+ "ty:-20px",
276
+ "scale(3)",
277
+ "rotate(30deg)",
278
+ "skew(40deg, 0deg)",
279
+ "perspective(500px)",
280
+ "matrix(1, 0, 0, 1, 50, 50)"
281
+ ],
282
+ }
283
+ }
284
+ ];
285
+
286
+ /*console.log("OPS");
287
+ console.log(ops);
288
+
289
+ console.log("CUSTOM OPTIONS");
290
+ console.log(customOptions);
291
+ */
292
+
293
+
294
+ for (var q = 0; q < ops.length; q++) {
295
+ let blastIDs = customOptions.map(l => l.op)
296
+ .map((value, index) => value === ops[q] ? index : '').filter(String);
297
+
298
+ if (blastIDs.length > 0) {
299
+ for (var d = 0; d < blastIDs.length; d++) {
300
+ let index = blastIDs[d];
301
+ // should run only once once but the next should not disappear
302
+ let target = customOptions[index].target;
303
+ let range = customOptions[index].range;
304
+ let filter = customOptions[index].filter;
305
+ let gradient = customOptions[index].gradient;
306
+
307
+ let as = replacementObjects[q];
308
+ as.target = target;
309
+
310
+ if (range != null) {
311
+ as.range = range;
312
+ }
313
+
314
+ // Do this for all
315
+ if (filter != null) { // This works!!!
316
+ as.op.filter = filter;
317
+ }
318
+
319
+ if (gradient != null) {
320
+ as.op.gradient = gradient;
321
+ }
322
+
323
+ customOptions[index] = as;
324
+ }
325
+ }
326
+ }
327
+
328
+ console.warn(customOptions);
329
+
330
+
331
+
332
+ for (var q = 0; q < customOptions.length; q++) {
333
+ let option = customOptions[q].op.name;
334
+
335
+ let cool = this.protoOptions[q].style || "default";
336
+ let duration = this.protoOptions[q].duration || "default";
337
+
338
+ if (option === "transform") {
339
+ let opts = [];
340
+
341
+ if (cool === "SOLARIUM") {
342
+
343
+ opts = [ // This can be empty or have any order of values
344
+ "scale(3)"
345
+ ];
346
+
347
+ } else if (cool === "WAVE") {
348
+ opts = [
349
+ "skew(15deg, 0deg)",
350
+ "tx:50px",
351
+ "rotate(10deg)",
352
+ "scale(1.1)"
353
+ ];
354
+ } else if (cool === "CUBE-SPIN") { // works
355
+ opts = [
356
+ // "rotate(90deg, 90deg)", TWO VALUES ROTATE PROBLEM
357
+ "perspective(700px)",
358
+ "scale(0.9)"
359
+ ];
360
+ } else if (cool === "TORNADO-SWITCH") { // not working
361
+ opts = [
362
+ "rotate(720deg)",
363
+ "scale(0.8)",
364
+ "tx:30px",
365
+ "ty:-50px",// NOT WORKINg WITH TY
366
+ "tz:-80px"
367
+ // "skew(10deg, 0deg)"
368
+ ];
369
+ } else if (cool === "LASER-SWEEP") {
370
+ // alert("P")
371
+ opts = [
372
+
373
+ "tx:100px",
374
+ "opacity:0.2",
375
+ "scale(1.2, 1.0)"
376
+
377
+ ];
378
+ } else if (cool === "TORNADO-TWIST") {
379
+ opts = [
380
+ "rotate(720deg)",
381
+ "scale(0.8)",
382
+ "tx:30px",
383
+ "ty:-50px",
384
+ "skew(10deg, 0deg)"
385
+ ];
386
+ }
387
+ else if (cool === "JELLY-WOBBLE") {
388
+ opts = [
389
+ "scale(1.2, 0.8)",
390
+ "rotate(5deg)",
391
+ "ty:-10px",
392
+ "skew(5deg, 0deg)"
393
+ ];
394
+ }
395
+ else if (cool === "DRUNKEN-SWAY") {
396
+ opts = [
397
+ "rotate(15deg)",
398
+ "tx:20px",
399
+ "ty:-10px",
400
+ "skew(10deg, 5deg)"
401
+ ];
402
+ }
403
+ else if (cool === "FLAME-FLICKER") {
404
+ opts = [
405
+ "scale(1.1, 0.9)",
406
+ "rotate(-5deg)",
407
+ "ty:5px",
408
+ "opacity:0.7"
409
+ ];
410
+ }
411
+ else if (cool === "PHANTOM-SHIFT") {
412
+ opts = [
413
+ "tx:15px",
414
+ "ty:-5px",
415
+ "opacity:0.5",
416
+ "skew(5deg, 5deg)"
417
+ ];
418
+ }
419
+ else if (cool === "RUBBER-BOUNCE") {
420
+ opts = [
421
+ "scale(1.3, 0.8)",
422
+ "skew(10deg, 0deg)",
423
+ "ty:-20px"
424
+ ];
425
+ }
426
+ else if (cool === "ASTEROID-CRASH") {
427
+ opts = [
428
+ "tx:-80px",
429
+ "ty:100px",
430
+ "rotate(45deg)",
431
+ "scale(0.7)",
432
+ "opacity:0.5"
433
+ ];
434
+ }
435
+ else if (cool === "CYBER-GLITCH") {
436
+ opts = [
437
+ "tx:5px",
438
+ "ty:-5px",
439
+ "rotate(3deg)",
440
+ "opacity:0.6",
441
+ "scale(1.05)"
442
+ ];
443
+ }
444
+ else if (cool === "BUBBLE-POP") {
445
+ opts = [
446
+ "scale(1.5)",
447
+ "opacity:0.3",
448
+ "ty:-20px"
449
+ ];
450
+ }
451
+ else if (cool === "SUPERNOVA-BURST") {
452
+ opts = [
453
+ "scale(2)",
454
+ "opacity:0",
455
+ "tx:50px",
456
+ "ty:-50px"
457
+ ];
458
+ }
459
+ else if (cool === "GRAVITY-DROP") {
460
+ opts = [
461
+ "ty:100px",
462
+ "scale(0.8)",
463
+ "rotate(10deg)",
464
+ "skew(0deg, 10deg)"
465
+ ];
466
+ }
467
+ else if (cool === "LASER-SWEEP") {
468
+ opts = [
469
+ "tx:100px",
470
+ "opacity:0.2",
471
+ "scale(1.2, 1.0)"
472
+ ];
473
+ }
474
+ else if (cool === "VORTEX-SINK") {
475
+ opts = [
476
+ "rotate(-360deg)",
477
+ "scale(0.5)",
478
+ "ty:50px"
479
+ ];
480
+ }
481
+ else if (cool === "SHOCKWAVE") {
482
+ opts = [
483
+ "scale(1.7)",
484
+ "opacity:0.4",
485
+ "skew(5deg, 5deg)"
486
+ ];
487
+ }
488
+
489
+ else {
490
+ opts = [ // This can be empty or have any order of values
491
+ "ty:-20px",
492
+ "scale(3)",
493
+ "rotate(30deg)",
494
+ "skew(40deg, 0deg)",
495
+ "perspective(500px)",
496
+ "matrix(1, 0, 0, 1, 50, 50)"
497
+ ];
498
+ }
499
+
500
+ if (duration === "default"){
501
+ duration = "MEDIUM";
502
+ }
503
+ if (duration === "FAST") {
504
+ duration = "3s-ease-in-out"; // divide entered value by two
505
+ // 6s is for both leaving and entering
506
+ } else if (duration === "MEDIUM"){
507
+ duration = "6s-ease-in-out";
508
+ } else if (duration === "SLOW"){
509
+ duration = "10s-ease-in-out";
510
+ }
511
+
512
+
513
+ if (q == i){ // 23:07.20 Nice!!!! 23:04 bef
514
+
515
+ console.log("DURA");
516
+ console.log(duration);
517
+
518
+ customOptions[q].op.transform = {
519
+ values: opts,
520
+ duration: duration
521
+ }
522
+
523
+ let key = "style"; // The key you want to remove
524
+
525
+ let dur = "duration"; // The key you want to remove
526
+
527
+
528
+ // 15:07:47 Nice 02/04/25
529
+ if (customOptions[q]?.op && key in customOptions[q].op) {
530
+ delete customOptions[q].op[key]; // remove in both logs, weird
531
+ }
532
+
533
+ if (customOptions[q]?.op && dur in customOptions[q].op) {
534
+ delete customOptions[q].op[dur]; // remove in both logs, weird
535
+ }
536
+
537
+ console.log("COQ");
538
+ console.log(customOptions[q].op.values);
539
+ if (customOptions[q]?.op.values){
540
+
541
+ // alert("P")
542
+
543
+ let values = "values";
544
+
545
+ if (customOptions[q]?.op.values) {
546
+ delete customOptions[q].op[values]; // remove in both logs, weird
547
+ }
548
+ }
549
+
550
+
551
+
552
+
553
+ }
554
+
555
+
556
+
557
+
558
+ }
559
+ } // for q = cycle end
560
+
561
+ console.log(`----------------------------LLL ${i} ${customOptions.length}`);
562
+
563
+
564
+ const matchEls = ["h1", "h2", "h3", "h4", "h5", "h6"].includes(el.type) || el.type === "img" || el.type === "a" || /*el.type == "modal" ||*/ el.type == "slider" || el.type == "table";
565
+
566
+ if (matchEls) {
567
+
568
+ ela = ElementMapper.mapType({
569
+ el: el,
570
+ customOptions: customOptions,
571
+ i: i
572
+ });
573
+
574
+ if (ela.toCode){
575
+ this.code.push(ela.toCode().join(""));
576
+ } else {
577
+ this.code.push(ela);
578
+ }
579
+
580
+ this.ready2Render.push(ela);
581
+ ela = ela.render();
582
+
583
+ } else if (el.type === "grid") {
584
+ this.code.push(
585
+ this.stor.grid.code
586
+ );
587
+ } else if (el.type === "modal"){
588
+ this.code.push(`new Code()
589
+ .set({
590
+ pad: [
591
+ { l: 30 },
592
+ ],
593
+ mar: [
594
+ { a: 30 },
595
+ ],
596
+ class: "language-js",
597
+ code: \`
598
+ // You need to copy and paste this example
599
+
600
+
601
+ import {Animator} from "../layout/animator.js";
602
+ import {Text} from "../layout/text.js";
603
+ import {Modal} from "../layout/modal2025.js";
604
+ import {Stack} from "../layout/stack.js";
605
+ import {Image} from "../layout/image.js";
606
+ import {FlexRow} from "../layout/flexrow.js";
607
+ import {Button} from "../layout/button.js";
608
+ import {Spacer} from "../layout/spacer.js";
609
+ import {Wrapper} from "../layout/container.js";
610
+
611
+
612
+ let firstLong = "Apple today announced that the company has surpassed a 60 percent reduction in its global greenhouse gas emissions compared to 2015 levels, as part of its Apple 2030 goal to become carbon neutral across its entire footprint in the next five years. The company achieved several other major environmental milestones, including the use of 99 percent recycled rare earth elements in all magnets and 99 percent recycled cobalt in all Apple-designed batteries.1 Apple shared this and other progress in its annual Environmental Progress Report, published today.
613
+ “We’re incredibly proud of the progress we’re making toward Apple 2030, which touches every part of our business,” said Lisa Jackson, Apple’s vice president of Environment, Policy, and Social Initiatives. “Today, we’re using more clean energy and recycled materials to make our products than ever before, we’re preserving water and preventing waste around the world, and we’re investing big in nature. As we get closer to 2030, the work gets even harder — and we’re meeting the challenge with innovation, collaboration, and urgency.
614
+ Apple’s 2030 strategy prioritizes cutting greenhouse gas emissions by 75 percent compared with its 2015 baseline year, before applying high-quality carbon credits to balance the remaining emissions. Last year, Apple’s comprehensive efforts to reduce its carbon footprint — including the continued transition of its supply chain to renewable electricity and designing products with more recycled materials — avoided an estimated 41 million metric tons of greenhouse gas emissions.";
615
+
616
+ let elements = [
617
+ new Stack()
618
+ .setup({})
619
+ .add([
620
+ new Image("https://pbs.twimg.com/media/DwYvbCBVAAEKY_R.jpg").set({}),
621
+
622
+ new FlexRow().set({aligns: "start"}).items([
623
+
624
+ new Button("×")
625
+
626
+ .set({
627
+ fluidc: "S3",
628
+ onTap: () => modal.close(),
629
+ frame: { width: 80, height: 80 },
630
+ color: "white",
631
+ background: "none"
632
+ }),
633
+
634
+ new Spacer(true),
635
+ ])
636
+ ]),
637
+
638
+
639
+ new Text("Samuel Suresh")
640
+ .set({
641
+ color: "#00ae56",
642
+ font: "SF Pro Display",
643
+ fluidc: "S2",
644
+ pad: [{"tl": 20}]
645
+ }),
646
+
647
+
648
+ new Text("Studying Science and Business, Western Sydney University, class of 2022")
649
+ .set({
650
+ font: "Arial",
651
+ fluidc: "S6",
652
+ pad: [{"l": 20}]
653
+ }),
654
+
655
+
656
+ new Text(firstLong)
657
+ .set({
658
+ font: "Arial",
659
+ fluidc: "S6",
660
+ pad: [{"l": 20}]
661
+ }),
662
+ ];
663
+
664
+
665
+ let wrapper = new Wrapper()
666
+ .set({})
667
+ .add(elements);
668
+
669
+
670
+ let modal = new Modal();
671
+ modal
672
+ .set({
673
+ width: "600px",
674
+ background: "#469d73cc",
675
+ close: true
676
+ })
677
+ .add([wrapper])
678
+ .render("#res");
679
+
680
+
681
+ new Button("Wow")
682
+ .set({
683
+ fluidc: "S3",
684
+ onTap: () => modal.show()
685
+ })
686
+ .render("#res");
687
+
688
+ \`
689
+ })`
690
+ );
691
+
692
+ }
693
+
694
+ /*else if (el.type === "nav") {
695
+
696
+ if (el.isSide) {
697
+ this.code.push(
698
+ storage.sideNav({ items: el.items, animate: el.animate }).code
699
+ );
700
+ } else {
701
+ this.code.push(
702
+ storage.nav({ items: el.items, animate: el.animate }).code
703
+ );
704
+ }
705
+
706
+ }*/ else if (el.type === "row") {
707
+
708
+ if (el.child === "img") {
709
+ this.code.push(this.stor.flexRow(el.colat).image.code);
710
+ } else {
711
+ this.code.push(this.stor.flexRow(el.colat).text.code);
712
+ }
713
+
714
+ } else if (el.type === "cards") {
715
+ console.log("STORO");
716
+ console.log(this.stor);
717
+ ela = ElementMapper.mapType({
718
+ el: el,
719
+ customOptions: customOptions,
720
+ i: i,
721
+ storage: this.stor
722
+ });
723
+
724
+ this.code.push(ela);
725
+ } else if (el.type === "wrap") {
726
+ this.code.push(`new Wrapper().set({}).add([
727
+ new Text("Hello").set({}),
728
+ new Text("Hello").set({}),
729
+ new Text("Hello").set({})
730
+ ]) \n`);
731
+
732
+ } else if (el.type === "responsive") { // cdiv
733
+ this.code.push(this.stor.complex.code);
734
+ } else if (el.type === "free") {
735
+ ela = ElementMapper.mapType({
736
+ el: el,
737
+ customOptions: customOptions,
738
+ i: i,
739
+ storage: this.stor
740
+ });
741
+
742
+ this.code.push(ela.toCode()); //.join("") is important :)
743
+ this.ready2Render.push(ela);
744
+ ela = ela.render();
745
+ } else if (el.type === "nav") { // protoNav
746
+ ela = ElementMapper.mapType({
747
+ el: el,
748
+ customOptions: customOptions,
749
+ i: i,
750
+ storage: this.stor
751
+ });
752
+
753
+ this.code.push(ela.toCode()); //.join("") is important :)
754
+ this.ready2Render.push(ela);
755
+ ela = ela.render();
756
+ } // 20:20:26
757
+
758
+ else if (el.type === "sideNav") {
759
+ ela = ElementMapper.mapType({
760
+ el: el,
761
+ customOptions: customOptions,
762
+ i: i,
763
+ storage: this.stor
764
+ });
765
+
766
+ this.code.push(ela.toCode()); //.join("") is important :)
767
+ this.ready2Render.push(ela);
768
+ ela = ela.render();
769
+ } // 20:20:26
770
+
771
+ else if (el.type === "dropdown") {
772
+ ela = ElementMapper.mapType({
773
+ el: el,
774
+ customOptions: customOptions,
775
+ i: i,
776
+ storage: this.stor
777
+ });
778
+
779
+
780
+ this.code.push(ela.toCode()); //.join("") is important :)
781
+ this.ready2Render.push(ela);
782
+ ela = ela.render();
783
+ } else if (el.type == "code") {
784
+ this.code.push(`new Code()
785
+ .set({
786
+ pad: [
787
+ { l: 30 },
788
+ ],
789
+ mar: [
790
+ { a: 30 },
791
+ ],
792
+ class: "language-js",
793
+ code: 'new Text("Modality").set({ font: "Arial" })'
794
+ })
795
+ `);
796
+
797
+ } else {
798
+
799
+ // keep this simpel else will work for everytign
800
+ ela = ElementMapper.mapType({
801
+ el: el,
802
+ customOptions: customOptions,
803
+ i: i,
804
+ storage: this.stor
805
+ });
806
+
807
+ if (ela.toCode){
808
+ this.code.push(ela.toCode());
809
+ } else {
810
+ this.code.push(ela);
811
+ }
812
+ //.join("") is important :)
813
+ this.ready2Render.push(ela);
814
+ ela = eval(ela).render();
815
+ } // 20:20:26
816
+ } // LARGE FOR I = 0 CYCLE END
817
+
818
+ return this;
819
+ }
820
+
821
+ toTextArea() {
822
+ let code = document.createElement("textarea");
823
+ // It is necessary to have it to generate UI
824
+ code.style.width = 300;
825
+ code.style.height = 300; // both work
826
+ code.setAttribute("id", "elements");
827
+ code.value = this.code.join("");
828
+ this.target = "#elements";
829
+
830
+ let pre = document.createElement("pre");
831
+ let codea = document.createElement("code");
832
+
833
+
834
+ const prepare = this.code.map(c => `${c}.render("#mount"); \n \n`);
835
+ this.code = prepare;
836
+
837
+ codea.textContent = this.code;//.replaceAll(",.", ".").replaceAll(",, new", "new").replaceAll(/\[\s*\n*,\s*\n*/g, "["); // replace with your code
838
+ pre.appendChild(codea);
839
+ pre.setAttribute("class", "nonLayout");
840
+ document.body.appendChild(pre); // append to the body or any other container
841
+ document.body.appendChild(code);
842
+
843
+ let preo = document.createElement("pre");
844
+ preo.style.marginTop = "100px";
845
+ return this;
846
+ }
847
+
848
+ set(obj) {
849
+ this.toTextArea();
850
+
851
+ document.querySelector("#elements").style.display = "none";
852
+ document.querySelector("pre").style.display = "block";
853
+
854
+ if (obj.elements === false) {
855
+ document.querySelector(".nonLayout").style.display = "none";
856
+ }
857
+
858
+ if (obj.layout === false) {
859
+ // document.querySelector("textarea").value = "";
860
+ if (document.querySelector("#layoutPre") != null) {
861
+ document.querySelector("#layoutPre").style.display = "none";
862
+ }
863
+ }
864
+
865
+ for (var i = 0; i < this.code.length; i++) {
866
+ let sub = this.code[i];
867
+ console.log("SUBO");
868
+ console.log(sub);
869
+ eval(`${sub}`);
870
+ }
871
+ }
872
+ }
873
+
874
+
875
+ export {Des};