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,774 @@
1
+ import {Animator} from "./animator.js";
2
+
3
+ // const { TIS620_THAI_CI } = require("mysql/lib/protocol/constants/charsets");
4
+
5
+ class UINavBar extends Animator {
6
+ constructor(els) {
7
+ super();
8
+ this.titleText = "";
9
+ this.hasHamburger = false;
10
+ this.code = [];
11
+ this.attributes = {};
12
+ }
13
+
14
+ toCode(){
15
+ let codeStr = `new UINavBar()`;
16
+ // 16:01:09 09/11/24 What????
17
+ // Convert attributes to .set({...}) format if there are any attributes
18
+ if (Object.keys(this.attributes).length > 0) {
19
+ codeStr += `.setup(${JSON.stringify(this.attributes, null, 2).replace(/"([^"]+)":/g, '$1:')})`;
20
+
21
+ // codeStr += `.set(${JSON.stringify(this.attributes, null, 2)})`;
22
+ } else {
23
+ codeStr += `.setup({})`;
24
+ }
25
+
26
+ codeStr += `.items([\n`;
27
+
28
+ // Generate the code for each item and join with commas only between items
29
+ codeStr += this.items
30
+ .map(item => item.toCode().join("").trim()) // Trim any line breaks or whitespace around the item code
31
+ .join(",\n"); // Insert commas only between items
32
+
33
+ codeStr += `\n])`;
34
+
35
+ return codeStr;
36
+
37
+ }
38
+
39
+ styled(obj) {
40
+ this.setup(obj);
41
+ this.styles = obj;
42
+ return this;
43
+ }
44
+
45
+ setup(obj) {
46
+ this.obj = obj;
47
+ if (!this.obj.isSide) { // fuck that, not even Ing. can solve this
48
+ this.obj.animate = false;
49
+ }
50
+
51
+ this.attributes = obj;
52
+ let wrap = document.createElement("div");
53
+ wrap.setAttribute("id", "sars");
54
+ wrap.style.padding = 0;
55
+ wrap.style.margin = 0;
56
+
57
+ let el = document.createElement("div");
58
+ el.setAttribute("id", "covid");
59
+ el.style.position = "absolute";
60
+ el.style.width = "100%";
61
+ el.style.zIndex = 1;
62
+ el.style.alignItems = "flex-start";
63
+ // LINE 700 FINAL STYLING !!!
64
+
65
+
66
+
67
+ let back = document.createElement("div");
68
+ back.style.background = "green";
69
+ back.style.position = "absolute";
70
+
71
+ el.style.margin = "20px";
72
+ el.style.display = "flex";
73
+ el.style.alignItems = "flex-end";
74
+ el.style.margin = 0;
75
+ el.style.padding = 0;
76
+ el.style.margin = 0;
77
+
78
+ wrap.appendChild(el);
79
+
80
+
81
+ this.addCloseButton = false;
82
+ this.res = wrap;
83
+ console.log(this.res);
84
+
85
+
86
+ if (obj.background) {
87
+ this.background({
88
+ color: obj.background
89
+ });
90
+ }
91
+
92
+
93
+ if (obj.openColor){
94
+ this.openColor = obj.openColor;
95
+ }
96
+
97
+
98
+ if (obj.sticky) {
99
+ this.sticky();
100
+ }
101
+
102
+
103
+ if (obj.hamburgerColour) {
104
+ this.hamburgerColour = obj.hamburgerColour;
105
+ }
106
+
107
+ if (obj.mobileSize) {
108
+ this.mobileSize = obj.mobileSize;
109
+ }
110
+
111
+ if (obj.desktopSize) {
112
+ this.desktopSize = obj.desktopSize;
113
+ }
114
+
115
+ if (obj.height) {
116
+ this.res.children[0].style.height = obj.height;
117
+ }
118
+
119
+ return this;
120
+ }
121
+
122
+
123
+ items(items) {
124
+
125
+ this.items = items;
126
+
127
+ let starts = ["Link", "Image", "Spacer"].some(e => {
128
+ return items[0].__proto__
129
+ .constructor
130
+ .toString()
131
+ .startsWith(`class ${e}`);
132
+ });
133
+
134
+ console.log(starts);
135
+
136
+ if (starts) { // We are adding class instances to the Area
137
+
138
+ this.itemCount = items.length; // 675 lines was
139
+ let rend = new CustomDivRenderer(this.obj, this.items);
140
+ let outerDiv = rend.render();
141
+
142
+ this.res.children[0].appendChild(outerDiv);
143
+
144
+
145
+
146
+ let child = this.res.children[0].children[0].children[0];
147
+ console.log("AHELLO");
148
+ console.log(child);
149
+ console.log(child.children);
150
+
151
+
152
+ // dont solve range object
153
+ console.log("ANIMATION OBJECT ");
154
+
155
+ // Read initial state from this
156
+
157
+ let animation = this.items[0].options.animation.op;
158
+ console.log(animation);
159
+
160
+
161
+
162
+ if (animation){
163
+
164
+
165
+ let mobileMedia = window.matchMedia(`(max-device-width: 415px)`);
166
+
167
+ let smallScreen = window.matchMedia(`(max-width: 600px)`);
168
+
169
+ if (!mobileMedia.matches && !smallScreen.matches){
170
+
171
+
172
+ for (var i = 0; i < child.children.length; i++){
173
+ child.children[i].style.border = "1px solid purple";
174
+
175
+ // 1 - SET HIDDEN STATE BY IMMEDIATELLY FIRING ANIM
176
+ // set hidden state immediatelly on the mobile
177
+ let immediateAll = {
178
+ duration: 1, // 1 should be acceptable here when I close
179
+ fill: 'forwards',
180
+ delay: 1
181
+ }
182
+
183
+ child.children[i].animate(animation.keyframesClose, immediateAll);
184
+
185
+ // 2 - ANIMATE INTO THE VIEW
186
+ // animate using opening keyframes on the mobile when user click the button
187
+ // when mobile nav is in opended state an I click button to set it to closing state
188
+ // animate "#innerItemsWrapper" children using closing options
189
+ child.children[i].animate(animation.keyframesOpen, animation.openOptions);
190
+
191
+
192
+
193
+
194
+ }
195
+ } else { // We are in animated state on mobile
196
+ let immediateAll = {
197
+ duration: 1, // 1 should be acceptable here when I close
198
+ fill: 'forwards',
199
+ delay: 1
200
+ }
201
+
202
+ console.log("CHILDREN");
203
+ console.log(child);
204
+ console.log(child.children);
205
+
206
+ for (var i = 0; i < child.children.length; i++){
207
+ child.children[i].animate(animation.keyframesClose, immediateAll);
208
+ }
209
+
210
+ }
211
+
212
+ }
213
+
214
+ this.adjust();
215
+ }
216
+
217
+ if (!starts) { // User is lazy
218
+
219
+ this.itemCount = items.length;
220
+
221
+ let div = document.createElement("div");
222
+ div.style.backgroundColor = "orange";
223
+
224
+ for (var i = 0; i < items.length; i++) {
225
+ let item = items[i];
226
+
227
+
228
+ if (item.logo) {
229
+ let logo = new Image(item.logo).width("100px");
230
+ let spacer = document.createElement("div");
231
+ spacer.style.flex = "1";
232
+ spacer.style.height = 23;
233
+
234
+ let wr = document.createElement("div");
235
+ wr.setAttribute("id", "WR")
236
+ wr.style.display = "flex";
237
+ wr.style.flexDirection = "row";
238
+ wr.appendChild(logo.render());
239
+ this.res.children[0].appendChild(logo.render());
240
+
241
+
242
+
243
+ // throws it
244
+
245
+ if (this.obj.spacing) {
246
+ this.res.children[0].appendChild(spacer);
247
+ }
248
+ }
249
+
250
+
251
+ if (item.logo) {
252
+ this.allowPad = true;
253
+ }
254
+
255
+ if (item.logo && this.obj.spacing) {
256
+ this.res.children[0].children[0].style.marginLeft = this.obj.spacing.sides;
257
+ this.res.children[0].children[0].style.marginRight = this.obj.spacing.sides;
258
+ }
259
+
260
+
261
+ if (item.title) {
262
+
263
+ let link;
264
+ if (this.allowPad) {
265
+ if (item.type) {
266
+ link = new Dropdown(item.items, item.title)
267
+ } else {
268
+ link = new Link(item.title, item.url)
269
+ .arrayPadding(["left", "right"], "1em");
270
+ }
271
+
272
+ } else {
273
+
274
+ if (item.type) {
275
+ link = new Link("DRPA", item.url);
276
+ } else {
277
+ link = new Link(item.title, item.url);
278
+ }
279
+
280
+ }
281
+
282
+ div.appendChild(link.render());
283
+ }
284
+
285
+ }
286
+
287
+ this.res.children[0].appendChild(div);
288
+ this.adjust();
289
+ }
290
+
291
+
292
+
293
+
294
+ // Insert hamburger button at the correct place
295
+ var btn = this.addHamburger();
296
+
297
+ let newCount = this.itemCount;
298
+ if (this.obj.spacing) {
299
+ newCount += 1;
300
+ }
301
+
302
+ btn.style.zIndex = 1;
303
+
304
+ if (this.res.children[0].children.length === 1) { // Problem here
305
+ this.res.children[0].insertBefore(btn, this.res.children[0].firstChild);
306
+ }
307
+
308
+ return this;
309
+ }
310
+
311
+ instance() {
312
+ return this.res.children[0];
313
+ }
314
+
315
+ sticky() {
316
+ this.res.children[0].style.position = "fixed";
317
+ return this;
318
+ }
319
+
320
+ font(family) {
321
+
322
+ for (var i = 0; i < this.res.children[0].children; i++) {
323
+ this.res.children[0].children[i].style.fontFamily = family;
324
+ }
325
+
326
+ return this;
327
+ }
328
+
329
+
330
+
331
+ openSymbol(symbol) {
332
+ this.symbol = symbol;
333
+ return this;
334
+ }
335
+
336
+
337
+ background(obj) {
338
+
339
+ if (!obj.background){
340
+ this.res.children[0].style.backgroundColor = "transparent";
341
+ return this;
342
+ }
343
+
344
+ this.res.children[0].style.backgroundColor = obj.color;
345
+ this.res.children[0].style.opacity = obj.opacity;
346
+ return this;
347
+ }
348
+
349
+ transluescent() {
350
+ this.res.children[0].style.backgroundColor = "rgba(255,255,255,0.72)";
351
+ return this;
352
+ }
353
+
354
+
355
+ keepItem(item) {
356
+ console.log("Wow");
357
+ this.keepItem = item;
358
+ return this;
359
+ }
360
+
361
+ addHamburger = () => {
362
+ let media2 = window.matchMedia(`(max-device-width: 415px)`);
363
+
364
+ var btn = document.createElement("button");
365
+ btn.setAttribute("id", "hamburger");
366
+ btn.style.border = "none";
367
+ btn.style.fontWeight = "bold";
368
+ btn.style.position = "absolute"; // NEW
369
+ btn.style.color = "orange";//this.obj.hamColour.opened; //this.hamburgerColour ?? "#3498db";
370
+ btn.style.backgroundColor = "transparent";
371
+ btn.style.fontSize = media2.matches ? "2.1em" : "2em";
372
+
373
+ var node = document.createTextNode(this.symbol ? this.symbol : "☰");
374
+ btn.appendChild(node);
375
+ btn.style.marginLeft = "auto";
376
+
377
+ this.isShown = false;
378
+
379
+ btn.addEventListener("click", () => {
380
+ this.isShown = !this.isShown;
381
+
382
+ this.hasAnimatedToWide = false;
383
+
384
+ // alert("Hello");
385
+ // alert(this.res.children[0].children[1].children[0].getAttribute("id"));
386
+
387
+ // zmenším, otevřu, roztáhnu, zmenším => musím klinout 2x
388
+ // zmenším => kliknu => animace se rozjede 2x
389
+
390
+ let animation = this.items[0].options.animation.op;
391
+
392
+
393
+
394
+ const innerItemsWrapper = this.res.children[0].children[1].children[0];
395
+
396
+ if (animation){
397
+
398
+
399
+
400
+ console.log("Why not showing on 600px????");
401
+ console.log(this.isShown);
402
+
403
+ if (this.isShown){
404
+ innerItemsWrapper.parentElement.style.display = "block";
405
+ } else {
406
+ innerItemsWrapper.parentElement.style.display = "none";
407
+ }
408
+
409
+ for (var i = 0; i < innerItemsWrapper.children.length; i++){
410
+ let inner = innerItemsWrapper.children[i];
411
+
412
+ if (this.isShown){
413
+
414
+ // if (inner.style.translateX != 0)
415
+ inner.animate(animation.keyframesOpen, animation.openOptions);
416
+ } else {
417
+ inner.animate(animation.keyframesClose, animation.closeOptions);
418
+ }
419
+ }
420
+
421
+ /* if (!this.isShown){
422
+ inner.animate(animation.keyframesClose, animation.closeOptions);
423
+ }*/
424
+
425
+ }
426
+
427
+
428
+ // Hide outerItemsWrapper or animate links
429
+ })
430
+
431
+ // let hamb = document.querySelector("#hamburger");
432
+ // alert(this.res.children[0].children[0].getAttribute("id"));
433
+
434
+ return btn;
435
+ }
436
+
437
+ /*--------------------------------------------------ADJUST--------------------------------------------------*/
438
+ // set habmurger icon
439
+ adjust(w) {
440
+ let media = window.matchMedia(`(max-width: 600px)`);
441
+ let media2 = window.matchMedia(`(max-device-width: 415px)`);
442
+
443
+ const adjustFontSize = () => {
444
+ console.log("IN VIEWPORT");
445
+
446
+ console.log(this.res);
447
+ for (var i = 0; i < this.res.children[0].children.length; i++) {
448
+ let el = this.res.children[0].children[i];
449
+ el.style.fontSize = media2.matches ? (this.mobileSize ? this.mobileSize : "1.2em") : (this.desktopSize ? this.desktopSize : "1em");
450
+
451
+
452
+ if (el.textContent === "☰") {
453
+ el.style.fontSize = "2em";
454
+ }
455
+ }
456
+
457
+
458
+ }
459
+
460
+
461
+ const findNestedDivWithId = (elements, targetId) => {
462
+ for (var i = 0; i < elements.length; i++) {
463
+ var element = elements[i];
464
+
465
+ if (element.id === targetId) {
466
+ return element; // Found the target div
467
+ }
468
+
469
+ // Check nested children recursively
470
+ var foundInChildren = findNestedDivWithId(element.children, targetId);
471
+ if (foundInChildren) {
472
+ return foundInChildren;
473
+ }
474
+ }
475
+ return null; // If not found
476
+ }
477
+
478
+ const toWideScreen = () => {
479
+
480
+
481
+ let my = this.res.children[0];
482
+
483
+
484
+
485
+
486
+
487
+
488
+
489
+
490
+
491
+
492
+
493
+
494
+
495
+
496
+
497
+
498
+
499
+
500
+
501
+
502
+ for (var i = 0; i < this.res.children[0].children.length; i++) {
503
+
504
+ let child = this.res.children[0].children[i];
505
+
506
+ child.style.marginTop = "0em";
507
+
508
+ if (child.id === "WR") {
509
+ child.style.display = "flex";
510
+ } else {
511
+ child.style.display = "flex";
512
+ }
513
+
514
+ if (child.textContent === this.titleText && this.titleText.length > 0) {
515
+ alert(child.textContent)
516
+ child.style.fontSize = "2em";
517
+ }
518
+ }
519
+
520
+
521
+
522
+
523
+ // animate back
524
+
525
+
526
+ let animation = this.items[0].options.animation.op;
527
+
528
+
529
+
530
+ const covid = this.res.children[0];
531
+ const innerItemsWrapper = findNestedDivWithId(this.res.children, 'innerItemsWrapper');
532
+ ///covid.children[0].children[1].children[0];
533
+
534
+ console.log("KINNERA");
535
+ console.log(innerItemsWrapper);
536
+
537
+ console.log("COVID");
538
+ console.log(covid);
539
+ // innerItemsWrapper.style.border = "3px solid orange";
540
+ innerItemsWrapper.style.marginTop = "0";
541
+
542
+ if (animation){
543
+ console.log("Why not showing on 600px????")
544
+ console.log("TOWIDE");
545
+
546
+
547
+ console.log(covid);
548
+ // console.log(covid.children[1].children[0]);
549
+
550
+ // alert("OIJHIOHO")
551
+
552
+ // close the nav an expand bad
553
+
554
+ if (!this.hasAnimatedToWide){
555
+ this.hasAnimatedToWide = true;
556
+
557
+ for (var i = 0; i < innerItemsWrapper.children.length; i++){
558
+
559
+ let link = innerItemsWrapper.children[i];
560
+
561
+
562
+
563
+
564
+ link.animate(animation.keyframesOpen, animation.openOptions);
565
+
566
+ }
567
+ }
568
+
569
+ // after expannding and closing inner is udnefined
570
+
571
+
572
+ // inner.animate(animation.keyframesOpen, animation.openOptions);
573
+
574
+ /* if (this.isShown){
575
+ inner.animate(animation.keyframesOpen, animation.openOptions);
576
+ } else {
577
+ inner.animate(animation.keyframesClose, animation.closeOptions);
578
+ }*/
579
+ // }
580
+ }
581
+
582
+
583
+
584
+
585
+
586
+
587
+
588
+
589
+
590
+
591
+
592
+
593
+
594
+
595
+
596
+
597
+
598
+
599
+
600
+
601
+
602
+
603
+
604
+ }
605
+
606
+ // nice library!
607
+ const doInAdjust = () => {
608
+
609
+ this.isShown = false;
610
+
611
+
612
+ let my = this.res.children[0];
613
+
614
+
615
+ adjustFontSize();
616
+ var closed = false;
617
+
618
+
619
+ this.res.children[0].style.flexDirection = "column";
620
+
621
+ for (var i = 0; i < this.res.children[0].children.length; i++) {
622
+ if (this.res.children[0].children[i].textContent == "☰" || this.res.children[0].children[i].textContent == /*"Lands"*/ this.keepItem) {
623
+
624
+
625
+ let child = this.res.children[0].children[i];
626
+ if (child.id === "WR") {
627
+ this.res.children[0].children[i].style.display = "flex";
628
+ } else {
629
+ this.res.children[0].children[i].style.display = "flex";
630
+ }
631
+
632
+
633
+
634
+ } else {
635
+ this.res.children[0].children[i].style.display = "none";
636
+ }
637
+ }
638
+
639
+
640
+
641
+
642
+ }
643
+
644
+ const adjust = () => {
645
+ if (!this.obj.isSide) {
646
+ if (media.matches || media2.matches) {
647
+ doInAdjust();
648
+ } else {
649
+ toWideScreen();
650
+ }
651
+ }
652
+
653
+
654
+ }
655
+
656
+
657
+ if (!this.obj.isSide) {
658
+
659
+ let inner = this.res.children[1]; //document.querySelector("#outerItemsWrapper")
660
+ if (inner != null) {
661
+ inner.style.background = "yellow";
662
+ }
663
+
664
+ if (media.matches || media2.matches) {
665
+ doInAdjust();
666
+ //alert("P")
667
+ //this.res.children[0].style.opacity = 0.3;
668
+ console.log("884A");
669
+ console.warn(this.res);
670
+ console.log(this.res.children[0].children[0]);
671
+ } else {
672
+ toWideScreen();
673
+ }
674
+ } else {
675
+ doInAdjust();
676
+ }
677
+
678
+ this.hasAnimatedToWide = false;
679
+ window.addEventListener("resize", adjust);
680
+ return this;
681
+ }
682
+
683
+ /*--------------------------------------------------ADJUST--------------------------------------------------*/
684
+ render(div) {
685
+
686
+
687
+ const method = () => {
688
+ let media = window.matchMedia(`(max-width: 600px)`);
689
+
690
+ // This gets owervwritten, column fires
691
+
692
+ let myMedia = window.matchMedia(`(max-device-width: 415px)`);
693
+ let outerItemsWrapper = this.res.children[0].children[1];
694
+ let innerIW = outerItemsWrapper.children[0];
695
+
696
+ console.log("TEETH");
697
+ console.log(outerItemsWrapper);
698
+ console.log(innerIW);
699
+
700
+
701
+ if (myMedia.matches) {
702
+ innerIW.style.position = "relative";
703
+ }
704
+
705
+
706
+
707
+ if ((media.matches || myMedia.matches) && innerIW != undefined) {
708
+ //alert("PP")
709
+ innerIW.style.flexDirection = "column";
710
+ } else if (innerIW != undefined && !this.obj.isSide) {
711
+ innerIW.style.flexDirection = "row";
712
+ }
713
+
714
+ if (!this.obj.isSide && !media.matches && !myMedia.matches) {
715
+ this.res.children[0].children[0].style.display = "none";
716
+ }
717
+
718
+
719
+ if (this.obj.isSide) {
720
+ innerIW.style.flexDirection = "column";
721
+ }
722
+
723
+ if (!this.obj.isSide && !media.matches) {
724
+ this.res.children[0].style.position = "relative";
725
+ outerItemsWrapper.style.transform = "translateY(0px)";
726
+ }
727
+
728
+ if (!this.obj.isSide && media.matches) {
729
+ this.res.children[0].style.position = "absolute";
730
+ }
731
+
732
+
733
+ // my custom
734
+
735
+ if (this.obj.customStyle){
736
+ // this.res.children[0].children[1].children[0].style.width = "200px";
737
+ this.res.children[0].style.marginTop = "1rem";
738
+ this.res.children[0].style.position = "absolute";
739
+ this.res.children[0].style.borderRadius = "1rem";
740
+ outerItemsWrapper.style.borderRadius = "1rem";
741
+
742
+ }
743
+
744
+
745
+ // Add line 700
746
+ if (this.obj.radius){
747
+ // this.res.children[0].children[1].children[0].style.width = "200px";
748
+ // alert("P")
749
+
750
+ // Both need to be like this
751
+ this.res.children[0].style.borderRadius = "1rem";
752
+ outerItemsWrapper.style.borderRadius = "1rem";
753
+
754
+ }
755
+ }
756
+
757
+ window.addEventListener("resize", () => method());
758
+ method();
759
+
760
+ if (div) {
761
+ document.querySelector(div).style.padding = 0;
762
+ document.querySelector(div).style.margin = 0;
763
+ document.querySelector(div).appendChild(this.res);
764
+ } else {
765
+ return this.res; //.children[0];
766
+ }
767
+ return this.res; //.children[0];
768
+ }
769
+ }
770
+ window.UINavBar
771
+ instances = UINavBar
772
+ instances;
773
+ export { UINavBar
774
+ instances };