nodality 1.0.84 → 1.0.104

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 (335) hide show
  1. package/dist/animator.cjs.js +1 -2
  2. package/dist/animator.esm.js +1 -2
  3. package/dist/appleanim.cjs.js +1 -1
  4. package/dist/appleanim.esm.js +1 -1
  5. package/dist/audionew.cjs.js +1 -2
  6. package/dist/audionew.esm.js +1 -2
  7. package/dist/base.cjs.js +0 -1
  8. package/dist/base.esm.js +1 -2
  9. package/dist/beta-desktop-bar.cjs.js +1 -0
  10. package/dist/beta-desktop-bar.esm.js +1 -0
  11. package/dist/beta-mobile-bar.cjs.js +1 -0
  12. package/dist/beta-mobile-bar.esm.js +1 -0
  13. package/dist/betaDesktopBar.esm.js +1 -1
  14. package/dist/betaMobileBar.esm.js +1 -1
  15. package/dist/bundle.umd.js +1 -2
  16. package/dist/button.cjs.js +1 -2
  17. package/dist/button.esm.js +1 -2
  18. package/dist/card-getter.cjs.js +1 -0
  19. package/dist/card-getter.esm.js +1 -0
  20. package/dist/cardGetter.esm.js +1 -1
  21. package/dist/center.cjs.js +1 -2
  22. package/dist/center.esm.js +1 -2
  23. package/dist/checkbox.cjs.js +1 -2
  24. package/dist/checkbox.esm.js +1 -2
  25. package/dist/code.cjs.js +1 -2
  26. package/dist/code.esm.js +1 -2
  27. package/dist/container.cjs.js +1 -2
  28. package/dist/container.esm.js +1 -2
  29. package/dist/data-list.cjs.js +1 -0
  30. package/dist/data-list.esm.js +1 -0
  31. package/dist/designer.cjs.js +1 -2
  32. package/dist/designer.esm.js +1 -2
  33. package/dist/dropdown.cjs.js +1 -2
  34. package/dist/dropdown.esm.js +1 -2
  35. package/dist/element-mapper.cjs.js +1 -0
  36. package/dist/element-mapper.esm.js +1 -0
  37. package/dist/elementMapper.cjs.js +1 -1
  38. package/dist/elementMapper.esm.js +1 -1
  39. package/dist/finalresult.esm.js +1 -2
  40. package/dist/flex-card.cjs.js +1 -0
  41. package/dist/flex-card.esm.js +1 -0
  42. package/dist/flex-grid.cjs.js +1 -0
  43. package/dist/flex-grid.esm.js +1 -0
  44. package/dist/flex-row.cjs.js +1 -0
  45. package/dist/flex-row.esm.js +1 -0
  46. package/dist/flexCard.cjs.js +1 -1
  47. package/dist/flexCard.esm.js +1 -1
  48. package/dist/floating-input.cjs.js +1 -0
  49. package/dist/floating-input.esm.js +1 -0
  50. package/dist/free.cjs.js +1 -2
  51. package/dist/free.esm.js +1 -2
  52. package/dist/horizontal-scroller.cjs.js +1 -0
  53. package/dist/horizontal-scroller.esm.js +1 -0
  54. package/dist/image-picker.cjs.js +1 -0
  55. package/dist/image-picker.esm.js +1 -0
  56. package/dist/image.cjs.js +1 -2
  57. package/dist/image.esm.js +1 -2
  58. package/dist/index.cjs.js +1 -2
  59. package/dist/index.esm.js +1 -2
  60. package/dist/keyframe-animation.cjs.js +1 -0
  61. package/dist/keyframe-animation.esm.js +1 -0
  62. package/dist/link-getter.cjs.js +1 -0
  63. package/dist/link-getter.esm.js +1 -0
  64. package/dist/link.cjs.js +1 -2
  65. package/dist/link.esm.js +1 -2
  66. package/dist/linkGetter.cjs.js +1 -1
  67. package/dist/linkGetter.esm.js +1 -1
  68. package/dist/meta-adder.cjs.js +1 -0
  69. package/dist/meta-adder.esm.js +1 -0
  70. package/dist/modal-2025.cjs.js +1 -0
  71. package/dist/modal-2025.esm.js +1 -0
  72. package/dist/multiswitcher.cjs.js +1 -0
  73. package/dist/multiswitcher.esm.js +1 -0
  74. package/dist/new-nav-bar.cjs.js +1 -0
  75. package/dist/new-nav-bar.esm.js +1 -0
  76. package/dist/picker.cjs.js +1 -2
  77. package/dist/picker.esm.js +1 -2
  78. package/dist/progress.cjs.js +1 -2
  79. package/dist/progress.esm.js +1 -2
  80. package/dist/radio.cjs.js +1 -2
  81. package/dist/radio.esm.js +1 -2
  82. package/dist/range.cjs.js +1 -2
  83. package/dist/range.esm.js +1 -2
  84. package/dist/scroll-video.cjs.js +1 -0
  85. package/dist/scroll-video.esm.js +1 -0
  86. package/dist/scrollvideo.cjs.js +1 -1
  87. package/dist/scrollvideo.esm.js +1 -1
  88. package/dist/side-bar.cjs.js +1 -0
  89. package/dist/side-bar.esm.js +1 -0
  90. package/dist/side-nav-bar.cjs.js +1 -0
  91. package/dist/side-nav-bar.esm.js +1 -0
  92. package/dist/simple-bar.cjs.js +1 -0
  93. package/dist/simple-bar.esm.js +1 -0
  94. package/dist/slider-2025.cjs.js +1 -0
  95. package/dist/slider-2025.esm.js +1 -0
  96. package/dist/spacer.cjs.js +0 -1
  97. package/dist/spacer.esm.js +1 -0
  98. package/dist/stack.cjs.js +1 -2
  99. package/dist/stack.esm.js +1 -2
  100. package/dist/stacker.cjs.js +1 -2
  101. package/dist/stacker.esm.js +1 -2
  102. package/dist/table.cjs.js +1 -2
  103. package/dist/table.esm.js +1 -2
  104. package/dist/text-field.cjs.js +1 -0
  105. package/dist/text-field.esm.js +1 -0
  106. package/dist/text.cjs.js +1 -2
  107. package/dist/text.esm.js +1 -2
  108. package/dist/transform-anim.cjs.js +1 -0
  109. package/dist/transform-anim.esm.js +1 -0
  110. package/dist/transformanim.cjs.js +1 -1
  111. package/dist/transformanim.esm.js +1 -1
  112. package/dist/ulist.cjs.js +1 -2
  113. package/dist/ulist.esm.js +1 -2
  114. package/dist/video.cjs.js +1 -0
  115. package/dist/video.esm.js +1 -2
  116. package/dist/wrap.cjs.js +0 -1
  117. package/dist/wrap.esm.js +1 -2
  118. package/dist/zoom-card.cjs.js +1 -0
  119. package/dist/zoom-card.esm.js +1 -0
  120. package/layout/animator.js +1 -1
  121. package/layout/audio.js +1 -1
  122. package/layout/audionew.js +1 -1
  123. package/layout/base-2.js +1 -1
  124. package/layout/base.js +1 -1
  125. package/layout/{betaDesktopBar.js → beta-desktop-bar.js} +1 -1
  126. package/layout/{betaMobileBar.js → beta-mobile-bar.js} +1 -1
  127. package/layout/box.js +1 -1
  128. package/layout/button.js +1 -1
  129. package/layout/cards.js +2 -1
  130. package/layout/center.js +1 -1
  131. package/layout/checkbox.js +1 -1
  132. package/layout/circle.js +1 -1
  133. package/layout/{cleanRow.js → clean-row.js} +1 -1
  134. package/layout/code.js +1 -1
  135. package/layout/container.js +1 -1
  136. package/layout/custom.js +1 -1
  137. package/layout/{divImage.js → div-image.js} +1 -1
  138. package/layout/{dropdown2025.js → dropdown-2025.js} +6 -1
  139. package/layout/dropdown.js +1 -1
  140. package/layout/{emptyElement.js → empty-element.js} +1 -1
  141. package/layout/{externalStylesheet.js → external-stylesheet.js} +1 -1
  142. package/layout/{flexCard.js → flex-card.js} +3 -1
  143. package/layout/{flexGrid.js → flex-grid.js} +1 -1
  144. package/layout/{flexrow.js → flex-row.js} +1 -1
  145. package/layout/footer.js +1 -1
  146. package/layout/{formComponents → form-components}/custom.js +1 -1
  147. package/layout/{formComponents/dataList.js → form-components/data-list.js} +1 -1
  148. package/layout/{formComponents/floatingInput.js → form-components/floating-input.js} +1 -1
  149. package/layout/{formComponents → form-components}/form-all.js +1 -1
  150. package/layout/{formComponents → form-components}/form.js +1 -1
  151. package/layout/{formComponents/imagePicker.js → form-components/image-picker.js} +1 -1
  152. package/layout/{formComponents → form-components}/picker.js +1 -1
  153. package/layout/{formComponents → form-components}/radio.js +1 -1
  154. package/layout/{formComponents → form-components}/radiogroup.js +1 -1
  155. package/layout/{formComponents → form-components}/range.js +1 -1
  156. package/layout/free.js +1 -1
  157. package/layout/grid-new.js +1 -1
  158. package/layout/{gridSwitcher.js → grid-switcher.js} +1 -1
  159. package/layout/grid.js +1 -1
  160. package/layout/group.js +1 -1
  161. package/layout/header.js +1 -1
  162. package/layout/{horizontalScroller.js → horizontal-scroller.js} +1 -1
  163. package/layout/image-old.js +1 -1
  164. package/layout/image.js +1 -1
  165. package/layout/index.js +49 -37
  166. package/layout/label.js +1 -1
  167. package/layout/link.js +1 -1
  168. package/layout/list-OLD.js +1 -1
  169. package/layout/list.js +1 -1
  170. package/layout/{metaAdder.js → meta-adder.js} +1 -1
  171. package/layout/{modal2025.js → modal-2025.js} +1 -1
  172. package/layout/modernwrap.js +1 -1
  173. package/layout/multiswitcher.js +1 -1
  174. package/layout/multiswitcherBeta.js +1 -1
  175. package/layout/{navBar.js → nav-bar.js} +1 -1
  176. package/layout/{navFactor/customDiv.js → nav-factor/custom-div.js} +1 -1
  177. package/layout/navBar-OLD.js +1 -1
  178. package/layout/{newFlatAdder.js → new-flat-adder.js} +1 -1
  179. package/layout/{newNavBar.js → new-nav-bar.js} +1 -1
  180. package/layout/{offsetContainer.js → offset-container.js} +1 -1
  181. package/layout/polygon.js +1 -1
  182. package/layout/progress.js +1 -1
  183. package/layout/row.js +1 -1
  184. package/layout/{savedNewNavBar.js → saved-new-nav-bar.js} +1 -1
  185. package/layout/{scrollvideo.js → scroll-video.js} +1 -1
  186. package/layout/{sideBar.js → side-bar.js} +1 -1
  187. package/layout/{sideNavBar.js → side-nav-bar.js} +1 -1
  188. package/layout/{simpleBar.js → simple-bar.js} +1 -1
  189. package/layout/{slider2025.js → slider-2025.js} +1 -1
  190. package/layout/spacer.js +1 -1
  191. package/layout/stack.js +1 -1
  192. package/layout/styler.js +1 -1
  193. package/layout/switcher.js +1 -1
  194. package/layout/table.js +1 -1
  195. package/layout/{textField.js → text-field.js} +1 -1
  196. package/layout/text.js +1 -1
  197. package/layout/ulist.js +1 -1
  198. package/layout/video.js +1 -1
  199. package/layout/{withoutNew.js → without-new.js} +1 -1
  200. package/layout/wrap.js +1 -1
  201. package/layout/{zoomCard.js → zoom-card.js} +1 -1
  202. package/lib/{cardGetter.js → card-getter.js} +1 -1
  203. package/lib/designer.js +49 -49
  204. package/lib/{elementMapper.js → element-mapper.js} +56 -37
  205. package/lib/{KeyframeAnimation.js → keyframe-animation.js} +1 -1
  206. package/lib/{linkGetter.js → link-getter.js} +1 -1
  207. package/lib/{scrollvideo.js → scroll-video.js} +1 -1
  208. package/lib/{Stacker.js → stacker.js} +2 -1
  209. package/lib/{TransformAnim.js → transform-anim.js} +1 -1
  210. package/package.json +4 -2
  211. package/dist/KeyframeAnimation.cjs.js +0 -2
  212. package/dist/KeyframeAnimation.cjs.js.LICENSE.txt +0 -5
  213. package/dist/KeyframeAnimation.esm.js +0 -2
  214. package/dist/KeyframeAnimation.esm.js.LICENSE.txt +0 -5
  215. package/dist/animator.cjs.js.LICENSE.txt +0 -5
  216. package/dist/animator.esm.js.LICENSE.txt +0 -5
  217. package/dist/appleanim.cjs.js.LICENSE.txt +0 -5
  218. package/dist/appleanim.esm.js.LICENSE.txt +0 -5
  219. package/dist/audionew.cjs.js.LICENSE.txt +0 -5
  220. package/dist/audionew.esm.js.LICENSE.txt +0 -5
  221. package/dist/base.cjs.js.LICENSE.txt +0 -5
  222. package/dist/base.esm.js.LICENSE.txt +0 -5
  223. package/dist/betaDesktopBar.esm.js.LICENSE.txt +0 -5
  224. package/dist/betaMobileBar.esm.js.LICENSE.txt +0 -5
  225. package/dist/bundle.umd.js.LICENSE.txt +0 -5
  226. package/dist/button.cjs.js.LICENSE.txt +0 -5
  227. package/dist/button.esm.js.LICENSE.txt +0 -5
  228. package/dist/cardGetter.cjs.js.LICENSE.txt +0 -5
  229. package/dist/cardGetter.esm.js.LICENSE.txt +0 -5
  230. package/dist/center.cjs.js.LICENSE.txt +0 -5
  231. package/dist/center.esm.js.LICENSE.txt +0 -5
  232. package/dist/checkbox.cjs.js.LICENSE.txt +0 -5
  233. package/dist/checkbox.esm.js.LICENSE.txt +0 -5
  234. package/dist/circle.cjs.js +0 -2
  235. package/dist/circle.cjs.js.LICENSE.txt +0 -5
  236. package/dist/circle.esm.js +0 -2
  237. package/dist/circle.esm.js.LICENSE.txt +0 -5
  238. package/dist/code.cjs.js.LICENSE.txt +0 -5
  239. package/dist/code.esm.js.LICENSE.txt +0 -5
  240. package/dist/container.cjs.js.LICENSE.txt +0 -5
  241. package/dist/container.esm.js.LICENSE.txt +0 -5
  242. package/dist/datalist.cjs.js.LICENSE.txt +0 -5
  243. package/dist/datalist.esm.js.LICENSE.txt +0 -5
  244. package/dist/designer.cjs.js.LICENSE.txt +0 -5
  245. package/dist/designer.esm.js.LICENSE.txt +0 -5
  246. package/dist/dropdown.cjs.js.LICENSE.txt +0 -5
  247. package/dist/dropdown.esm.js.LICENSE.txt +0 -5
  248. package/dist/elementMapper.cjs.js.LICENSE.txt +0 -5
  249. package/dist/elementMapper.esm.js.LICENSE.txt +0 -5
  250. package/dist/finalresult.esm.js.LICENSE.txt +0 -5
  251. package/dist/flexCard.cjs.js.LICENSE.txt +0 -5
  252. package/dist/flexCard.esm.js.LICENSE.txt +0 -5
  253. package/dist/flexGrid.cjs.js.LICENSE.txt +0 -5
  254. package/dist/flexGrid.esm.js.LICENSE.txt +0 -5
  255. package/dist/flexRow.cjs.js.LICENSE.txt +0 -5
  256. package/dist/flexRow.esm.js.LICENSE.txt +0 -5
  257. package/dist/floatingInput.cjs.js.LICENSE.txt +0 -5
  258. package/dist/floatingInput.esm.js.LICENSE.txt +0 -5
  259. package/dist/free.cjs.js.LICENSE.txt +0 -5
  260. package/dist/free.esm.js.LICENSE.txt +0 -5
  261. package/dist/gridSwitcher.cjs.js +0 -2
  262. package/dist/gridSwitcher.cjs.js.LICENSE.txt +0 -5
  263. package/dist/gridSwitcher.esm.js +0 -2
  264. package/dist/gridSwitcher.esm.js.LICENSE.txt +0 -5
  265. package/dist/horizontalScroller.esm.js.LICENSE.txt +0 -5
  266. package/dist/image.cjs.js.LICENSE.txt +0 -5
  267. package/dist/image.esm.js.LICENSE.txt +0 -5
  268. package/dist/imagePicker.cjs.js.LICENSE.txt +0 -5
  269. package/dist/imagePicker.esm.js.LICENSE.txt +0 -5
  270. package/dist/index.cjs.js.LICENSE.txt +0 -5
  271. package/dist/index.esm.js.LICENSE.txt +0 -5
  272. package/dist/link.cjs.js.LICENSE.txt +0 -5
  273. package/dist/link.esm.js.LICENSE.txt +0 -5
  274. package/dist/linkGetter.cjs.js.LICENSE.txt +0 -5
  275. package/dist/linkGetter.esm.js.LICENSE.txt +0 -5
  276. package/dist/metaAdder.cjs.js.LICENSE.txt +0 -5
  277. package/dist/metaAdder.esm.js.LICENSE.txt +0 -5
  278. package/dist/modal2025.cjs.js.LICENSE.txt +0 -5
  279. package/dist/modal2025.esm.js.LICENSE.txt +0 -5
  280. package/dist/multiswitchers.esm.js.LICENSE.txt +0 -5
  281. package/dist/newNavBar.cjs.js.LICENSE.txt +0 -5
  282. package/dist/newNavBar.esm.js.LICENSE.txt +0 -5
  283. package/dist/picker.cjs.js.LICENSE.txt +0 -5
  284. package/dist/picker.esm.js.LICENSE.txt +0 -5
  285. package/dist/polygon.cjs.js +0 -2
  286. package/dist/polygon.cjs.js.LICENSE.txt +0 -5
  287. package/dist/polygon.esm.js +0 -2
  288. package/dist/polygon.esm.js.LICENSE.txt +0 -5
  289. package/dist/progress.cjs.js.LICENSE.txt +0 -5
  290. package/dist/progress.esm.js.LICENSE.txt +0 -5
  291. package/dist/radio.cjs.js.LICENSE.txt +0 -5
  292. package/dist/radio.esm.js.LICENSE.txt +0 -5
  293. package/dist/range.cjs.js.LICENSE.txt +0 -5
  294. package/dist/range.esm.js.LICENSE.txt +0 -5
  295. package/dist/scrollvideo.cjs.js.LICENSE.txt +0 -5
  296. package/dist/scrollvideo.esm.js.LICENSE.txt +0 -5
  297. package/dist/sideBar.cjs.js.LICENSE.txt +0 -5
  298. package/dist/sideBar.esm.js.LICENSE.txt +0 -5
  299. package/dist/sideNavBar.cjs.js.LICENSE.txt +0 -5
  300. package/dist/sideNavBar.esm.js.LICENSE.txt +0 -5
  301. package/dist/simpleBar.cjs.js.LICENSE.txt +0 -5
  302. package/dist/simpleBar.esm.js.LICENSE.txt +0 -5
  303. package/dist/slider2025.cjs.js +0 -2
  304. package/dist/slider2025.cjs.js.LICENSE.txt +0 -5
  305. package/dist/slider2025.esm.js +0 -2
  306. package/dist/slider2025.esm.js.LICENSE.txt +0 -5
  307. package/dist/spacer.cjs.js.LICENSE.txt +0 -5
  308. package/dist/stack.cjs.js.LICENSE.txt +0 -5
  309. package/dist/stack.esm.js.LICENSE.txt +0 -5
  310. package/dist/stacker.cjs.js.LICENSE.txt +0 -5
  311. package/dist/stacker.esm.js.LICENSE.txt +0 -5
  312. package/dist/table.cjs.js.LICENSE.txt +0 -5
  313. package/dist/table.esm.js.LICENSE.txt +0 -5
  314. package/dist/text.cjs.js.LICENSE.txt +0 -5
  315. package/dist/text.esm.js.LICENSE.txt +0 -5
  316. package/dist/textField.cjs.js.LICENSE.txt +0 -5
  317. package/dist/textField.esm.js.LICENSE.txt +0 -5
  318. package/dist/transformanim.cjs.js.LICENSE.txt +0 -5
  319. package/dist/transformanim.esm.js.LICENSE.txt +0 -5
  320. package/dist/ulist.cjs.js.LICENSE.txt +0 -5
  321. package/dist/ulist.esm.js.LICENSE.txt +0 -5
  322. package/dist/video.esm.js.LICENSE.txt +0 -5
  323. package/dist/wrap.cjs.js.LICENSE.txt +0 -5
  324. package/dist/wrap.esm.js.LICENSE.txt +0 -5
  325. package/dist/zoomCard.cjs.js.LICENSE.txt +0 -5
  326. package/dist/zoomCard.esm.js.LICENSE.txt +0 -5
  327. package/layout/<head> +0 -59
  328. package/layout/DEADJOE +0 -49
  329. package/layout/DEPRECATED-PARAGRAPH.js +0 -109
  330. package/layout/edit.sh +0 -39
  331. package/layout/formComponents/edit.sh +0 -39
  332. package/layout/navFactor/edit.sh +0 -39
  333. package/layout/newNavBar copy 2.js +0 -921
  334. package/layout/newNavBar copy.js +0 -780
  335. package/lib/AppleAnim.js +0 -794
@@ -1,921 +0,0 @@
1
- /*!
2
- * nodality v1.0.84
3
- * (c) 2025 Filip Vabrousek
4
- * License: MIT
5
- */
6
-
7
- import {Animator} from "./animator.js";
8
- // import {CustomDivRenderer} from "./navFactor/customDiv.js";
9
- // CORRECT
10
- // const { TIS620_THAI_CI } = require("mysql/lib/protocol/constants/charsets");
11
- class CustomDivRenderer {
12
- constructor(obj, items) {
13
- this.obj = obj || {};
14
- this.items = items || [];
15
- }
16
-
17
- render() {
18
- // Create inner div with flex display
19
- let tempDiv = document.createElement("div");
20
- tempDiv.style.display = "flex";
21
- tempDiv.style.width = "100%";
22
- tempDiv.style.justifyContent = "space-around";
23
- tempDiv.setAttribute("id", "innerItemsWrapper");
24
-
25
- let mobileMedia = window.matchMedia(`(max-device-width: 415px)`);
26
- let media = window.matchMedia(`(max-width: 600px)`);
27
-
28
- if (mobileMedia.matches || media.matches){
29
- tempDiv.style.marginTop = "3rem";
30
- }
31
-
32
- // console.log("ITEMS ARE ORDERED");
33
- // console.log(this.items);
34
-
35
- // Append rendered items to inner div
36
- for (let i = 0; i < this.items.length; i++) {
37
- const item = this.items[i];
38
- tempDiv.appendChild(item.render());
39
- }
40
-
41
- // Create outer div and apply styling based on obj properties
42
- let outerDiv = document.createElement("div");
43
- outerDiv.style.width = this.obj.isSide ? "333px" : "100%";
44
- outerDiv.style.background = this.obj.background || "white";
45
- outerDiv.style.display = "flex";
46
- outerDiv.style.justifyContent = "center";
47
- outerDiv.style.alignItems = "center";
48
- outerDiv.style.height = "100%";
49
- outerDiv.setAttribute("id", "outerItemsWrapper");
50
- outerDiv.appendChild(tempDiv);
51
-
52
- // Apply custom styles if specified in obj
53
- if (this.obj.customStyle) {
54
- tempDiv.style.width = "auto";
55
- tempDiv.style.top = "0rem";
56
- tempDiv.style.borderRadius = "1rem";
57
- tempDiv.style.background = this.obj.background || "white";
58
- tempDiv.style.margin = "1rem";
59
- tempDiv.style.position = "absolute";
60
- tempDiv.style.opacity = 0.8;
61
- }
62
-
63
- return outerDiv;
64
- }
65
- }
66
-
67
- //window.CustomDivRenderer = CustomDivRenderer;
68
- //export { CustomDivRenderer };
69
-
70
-
71
- class UINavBar extends Animator {
72
- constructor(els) {
73
- super();
74
- this.titleText = "";
75
- this.hasHamburger = false;
76
- this.code = [];
77
- this.attributes = {};
78
- }
79
-
80
- toCode(){
81
- let codeStr = `new UINavBar()`;
82
- // 16:01:09 09/11/24 What????
83
- // Convert attributes to .set({...}) format if there are any attributes
84
- if (Object.keys(this.attributes).length > 0) {
85
- codeStr += `.setup(${JSON.stringify(this.attributes, null, 2).replace(/"([^"]+)":/g, '$1:')})`;
86
-
87
- // codeStr += `.set(${JSON.stringify(this.attributes, null, 2)})`;
88
- } else {
89
- codeStr += `.setup({})`;
90
- }
91
-
92
- codeStr += `.items([\n`;
93
-
94
- // Generate the code for each item and join with commas only between items
95
- codeStr += this.items
96
- .map(item => item.toCode().join("").trim()) // Trim any line breaks or whitespace around the item code
97
- .join(",\n"); // Insert commas only between items
98
-
99
- codeStr += `\n])`;
100
-
101
- return codeStr;
102
-
103
- }
104
-
105
- styled(obj) {
106
- this.setup(obj);
107
- this.styles = obj;
108
- return this;
109
- }
110
-
111
- setup(obj) {
112
- this.obj = obj;
113
- if (!this.obj.isSide) { // fuck that, not even Ing. can solve this
114
- this.obj.animate = false;
115
- }
116
-
117
- this.attributes = obj;
118
- let wrap = document.createElement("div");
119
- wrap.setAttribute("id", "sars");
120
- wrap.style.padding = 0;
121
- wrap.style.margin = 0;
122
-
123
- let el = document.createElement("div");
124
- el.setAttribute("id", "covid");
125
- el.style.position = "absolute"; // KEEP THIS ?? 07/01/2025
126
- el.style.width = "100%";
127
- el.style.zIndex = 1;
128
- el.style.alignItems = "flex-start";
129
- // LINE 700 FINAL STYLING !!!
130
-
131
-
132
-
133
- let back = document.createElement("div");
134
- back.style.background = "green";
135
- back.style.position = "absolute";
136
-
137
- el.style.margin = "20px";
138
- el.style.display = "flex";
139
- el.style.alignItems = "flex-end";
140
- el.style.margin = 0;
141
- el.style.padding = 0;
142
- el.style.margin = 0;
143
-
144
- wrap.appendChild(el);
145
-
146
-
147
- this.addCloseButton = false;
148
- this.res = wrap;
149
- // console.log(this.res);
150
-
151
-
152
- if (obj.background) {
153
- this.background({
154
- color: obj.background
155
- });
156
- }
157
-
158
-
159
- if (obj.openColor){
160
- this.openColor = obj.openColor;
161
- }
162
-
163
-
164
- if (obj.sticky) {
165
- this.sticky();
166
- }
167
-
168
- if (obj.pad){
169
- this.pad(obj.pad);
170
- }
171
-
172
-
173
- if (obj.hamburgerColour) {
174
- this.hamburgerColour = obj.hamburgerColour;
175
- }
176
-
177
- if (obj.mobileSize) {
178
- this.mobileSize = obj.mobileSize;
179
- }
180
-
181
- if (obj.desktopSize) {
182
- this.desktopSize = obj.desktopSize;
183
- }
184
-
185
- if (obj.height) {
186
- this.res.children[0].style.height = obj.height;
187
- }
188
-
189
- return this;
190
- }
191
-
192
-
193
- items(items) {
194
-
195
- this.items = items;
196
-
197
- let starts = ["Link", "Image", "Spacer", "Dropdown"].some(e => {
198
- return items[0].__proto__
199
- .constructor
200
- .toString()
201
- .startsWith(`class ${e}`);
202
- });
203
-
204
- // console.log(starts);
205
-
206
- if (starts) { // We are adding class instances to the Area
207
-
208
- this.itemCount = items.length; // 675 lines was
209
- let rend = new CustomDivRenderer(this.obj, this.items);
210
- let outerDiv = rend.render();
211
-
212
- this.res.children[0].appendChild(outerDiv);
213
-
214
-
215
-
216
- let child = this.res.children[0].children[0].children[0];
217
- // console.log("AHELLO");
218
- // console.log(child);
219
- // console.log(child.children);
220
-
221
-
222
- // dont solve range object
223
- // console.log("ANIMATION OBJECT ");
224
-
225
- // Read initial state from this
226
-
227
-
228
- let animationObj = this.items[0].options;
229
-
230
-
231
- if (animationObj && animationObj.animation){
232
-
233
-
234
- let animation = animationObj.animation.op;
235
- // console.log(animation);
236
-
237
-
238
-
239
- if (animation){
240
-
241
-
242
- let mobileMedia = window.matchMedia(`(max-device-width: 415px)`);
243
-
244
- let smallScreen = window.matchMedia(`(max-width: 600px)`);
245
-
246
- if (!mobileMedia.matches && !smallScreen.matches){
247
-
248
-
249
- for (var i = 0; i < child.children.length; i++){
250
- //child.children[i].style.border = "1px solid purple";
251
-
252
- // 1 - SET HIDDEN STATE BY IMMEDIATELLY FIRING ANIM
253
- // set hidden state immediatelly on the mobile
254
- let immediateAll = {
255
- duration: 1, // 1 should be acceptable here when I close
256
- fill: 'forwards',
257
- delay: 1
258
- }
259
-
260
- child.children[i].animate(animation.keyframesClose, immediateAll);
261
-
262
- // 2 - ANIMATE INTO THE VIEW
263
- // animate using opening keyframes on the mobile when user click the button
264
- // when mobile nav is in opended state an I click button to set it to closing state
265
- // animate "#innerItemsWrapper" children using closing options
266
- child.children[i].animate(animation.keyframesOpen, animation.openOptions);
267
-
268
-
269
-
270
-
271
- }
272
- } else { // We are in animated state on mobile
273
- let immediateAll = {
274
- duration: 1, // 1 should be acceptable here when I close
275
- fill: 'forwards',
276
- delay: 1
277
- }
278
-
279
- //console.log("CHILDREN");
280
- //console.log(child);
281
- //console.log(child.children);
282
-
283
- for (var i = 0; i < child.children.length; i++){
284
- child.children[i].animate(animation.keyframesClose, immediateAll);
285
- }
286
-
287
- }
288
-
289
- }
290
-
291
- }
292
-
293
- this.adjust();
294
- }
295
-
296
- if (!starts) { // User is lazy
297
-
298
- this.itemCount = items.length;
299
-
300
- let div = document.createElement("div");
301
- div.style.backgroundColor = "orange";
302
-
303
- for (var i = 0; i < items.length; i++) {
304
- let item = items[i];
305
-
306
-
307
- if (item.logo) {
308
- let logo = new Image(item.logo).width("100px");
309
- let spacer = document.createElement("div");
310
- spacer.style.flex = "1";
311
- spacer.style.height = 23;
312
-
313
- let wr = document.createElement("div");
314
- wr.setAttribute("id", "WR")
315
- wr.style.display = "flex";
316
- wr.style.flexDirection = "row";
317
- wr.appendChild(logo.render());
318
- this.res.children[0].appendChild(logo.render());
319
-
320
-
321
-
322
- // throws it
323
-
324
- if (this.obj.spacing) {
325
- this.res.children[0].appendChild(spacer);
326
- }
327
- }
328
-
329
-
330
- if (item.logo) {
331
- this.allowPad = true;
332
- }
333
-
334
- if (item.logo && this.obj.spacing) {
335
- this.res.children[0].children[0].style.marginLeft = this.obj.spacing.sides;
336
- this.res.children[0].children[0].style.marginRight = this.obj.spacing.sides;
337
- }
338
-
339
-
340
- if (item.title) {
341
-
342
- let link;
343
- if (this.allowPad) {
344
- if (item.type) {
345
- link = new Dropdown(item.items, item.title)
346
- } else {
347
- link = new Link(item.title, item.url)
348
- .arrayPadding(["left", "right"], "1em");
349
- }
350
-
351
- } else {
352
-
353
- if (item.type) {
354
- link = new Link("DRPA", item.url);
355
- } else {
356
- link = new Link(item.title, item.url);
357
- }
358
-
359
- }
360
-
361
- div.appendChild(link.render());
362
- }
363
-
364
- }
365
-
366
- this.res.children[0].appendChild(div);
367
- this.adjust();
368
- }
369
-
370
-
371
-
372
-
373
- // Insert hamburger button at the correct place
374
- var btn = this.addHamburger();
375
-
376
- let newCount = this.itemCount;
377
- if (this.obj.spacing) {
378
- newCount += 1;
379
- }
380
-
381
- btn.style.zIndex = 1;
382
-
383
- if (this.res.children[0].children.length === 1) { // Problem here
384
- this.res.children[0].insertBefore(btn, this.res.children[0].firstChild);
385
- }
386
-
387
- return this;
388
- }
389
-
390
- instance() {
391
- return this.res.children[0];
392
- }
393
-
394
- sticky() {
395
- this.res.children[0].style.position = "fixed";
396
- return this;
397
- }
398
-
399
- font(family) {
400
-
401
- for (var i = 0; i < this.res.children[0].children; i++) {
402
- this.res.children[0].children[i].style.fontFamily = family;
403
- }
404
-
405
- return this;
406
- }
407
-
408
-
409
-
410
- openSymbol(symbol) {
411
- this.symbol = symbol;
412
- return this;
413
- }
414
-
415
-
416
- background(obj) {
417
-
418
- if (!obj.background){
419
- this.res.children[0].style.backgroundColor = "transparent";
420
- return this;
421
- }
422
-
423
- this.res.children[0].style.backgroundColor = obj.color;
424
- this.res.children[0].style.opacity = obj.opacity;
425
- return this;
426
- }
427
-
428
- transluescent() {
429
- this.res.children[0].style.backgroundColor = "rgba(255,255,255,0.72)";
430
- return this;
431
- }
432
-
433
-
434
- keepItem(item) {
435
- // console.log("Wow");
436
- this.keepItem = item;
437
- return this;
438
- }
439
-
440
- addHamburger = () => {
441
-
442
-
443
-
444
- let media2 = window.matchMedia(`(max-device-width: 415px)`);
445
-
446
- var btn = document.createElement("button");
447
- btn.setAttribute("id", "hamburger");
448
- btn.style.border = "none";
449
- btn.style.fontWeight = "bold";
450
- btn.style.position = "absolute"; // NEW
451
- btn.style.color = "orange";//this.obj.hamColour.opened; //this.hamburgerColour ?? "#3498db";
452
- btn.style.backgroundColor = "transparent";
453
- btn.style.fontSize = media2.matches ? "2.1em" : "2em";
454
-
455
- var node = document.createTextNode(this.symbol ? this.symbol : "☰");
456
- btn.appendChild(node);
457
- btn.style.marginLeft = "auto";
458
-
459
- this.isShown = false;
460
-
461
- btn.addEventListener("click", () => {
462
-
463
-
464
- this.isShown = !this.isShown;
465
-
466
- this.hasAnimatedToWide = false;
467
-
468
- // alert("Hello");
469
- // alert(this.res.children[0].children[1].children[0].getAttribute("id"));
470
-
471
- // zmenším, otevřu, roztáhnu, zmenším => musím klinout 2x
472
- // zmenším => kliknu => animace se rozjede 2x
473
-
474
- // mám rotažené => zmenším, a při otevření se mi animace rozjede 2x
475
-
476
- // When onResize < 400px the nav must disappear
477
-
478
-
479
- let animationObj = this.items[0].options;
480
-
481
-
482
- if (animationObj && animationObj.animation){
483
-
484
-
485
- let animation = animationObj.animation.op;
486
- // console.log(animation);
487
-
488
-
489
-
490
-
491
-
492
- const innerItemsWrapper = this.res.children[0].children[1].children[0];
493
-
494
- if (animation){
495
-
496
-
497
-
498
- // console.log("Why not showing on 600px????");
499
- // console.log(this.isShown);
500
-
501
- if (this.isShown){
502
-
503
-
504
-
505
-
506
-
507
- for (var i = 0; i < innerItemsWrapper.children.length; i++){
508
- let inner = innerItemsWrapper.children[i];
509
- let anima = inner.animate(animation.keyframesClose, {
510
- duration: 1, // 1 should be acceptable here when I close
511
- fill: 'forwards',
512
- delay: 0
513
- });
514
-
515
-
516
- // 9:16:04 Nice! 21/11/24
517
- anima.onfinish = () => {
518
- innerItemsWrapper.parentElement.style.display = "block";
519
- }
520
- }
521
-
522
-
523
- /* window.setTimeout(() => {
524
- innerItemsWrapper.parentElement.style.display = "block";
525
- }, 50);*/
526
-
527
-
528
-
529
-
530
-
531
-
532
-
533
- } else {
534
- innerItemsWrapper.parentElement.style.display = "none";
535
- }
536
-
537
- for (var i = 0; i < innerItemsWrapper.children.length; i++){
538
- let inner = innerItemsWrapper.children[i];
539
-
540
-
541
-
542
- inner.animate(animation.keyframesClose, {
543
- duration: 1, // 1 should be acceptable here when I close
544
- fill: 'forwards',
545
- delay: 0
546
- });
547
-
548
-
549
- if (this.isShown){
550
-
551
- // if (inner.style.translateX != 0)
552
- inner.animate(animation.keyframesOpen, animation.openOptions);
553
- } else {
554
- inner.animate(animation.keyframesClose, animation.closeOptions);
555
- }
556
- }
557
-
558
-
559
-
560
- }
561
-
562
- } else {
563
- if (this.isShown){
564
- innerItemsWrapper.parentElement.style.display = "block";
565
- } else {
566
- innerItemsWrapper.parentElement.style.display = "none";
567
- }
568
- }
569
-
570
-
571
- // Hide outerItemsWrapper or animate links
572
- })
573
-
574
- // let hamb = document.querySelector("#hamburger");
575
- // alert(this.res.children[0].children[0].getAttribute("id"));
576
-
577
- return btn;
578
- }
579
-
580
- /*--------------------------------------------------ADJUST--------------------------------------------------*/
581
- // set habmurger icon
582
- adjust(w) {
583
- let media = window.matchMedia(`(max-width: 600px)`);
584
- let media2 = window.matchMedia(`(max-device-width: 415px)`);
585
-
586
- const adjustFontSize = () => {
587
- //console.log("IN VIEWPORT");
588
-
589
- // console.log(this.res);
590
- for (var i = 0; i < this.res.children[0].children.length; i++) {
591
- let el = this.res.children[0].children[i];
592
- el.style.fontSize = media2.matches ? (this.mobileSize ? this.mobileSize : "1.2em") : (this.desktopSize ? this.desktopSize : "1em");
593
-
594
-
595
- if (el.textContent === "☰") {
596
- el.style.fontSize = "2em";
597
- }
598
- }
599
-
600
-
601
- }
602
-
603
-
604
- const findNestedDivWithId = (elements, targetId) => {
605
- for (var i = 0; i < elements.length; i++) {
606
- var element = elements[i];
607
-
608
- if (element.id === targetId) {
609
- return element; // Found the target div
610
- }
611
-
612
- // Check nested children recursively
613
- var foundInChildren = findNestedDivWithId(element.children, targetId);
614
- if (foundInChildren) {
615
- return foundInChildren;
616
- }
617
- }
618
- return null; // If not found
619
- }
620
-
621
- const toWideScreen = () => {
622
-
623
-
624
- let my = this.res.children[0];
625
-
626
-
627
-
628
-
629
-
630
-
631
-
632
-
633
-
634
-
635
-
636
-
637
-
638
-
639
-
640
-
641
-
642
-
643
-
644
-
645
- for (var i = 0; i < this.res.children[0].children.length; i++) {
646
-
647
- let child = this.res.children[0].children[i];
648
-
649
- child.style.marginTop = "0em";
650
-
651
- if (child.id === "WR") {
652
- child.style.display = "flex";
653
- } else {
654
- child.style.display = "flex";
655
- }
656
-
657
- if (child.textContent === this.titleText && this.titleText.length > 0) {
658
- alert(child.textContent)
659
- child.style.fontSize = "2em";
660
- }
661
- }
662
-
663
-
664
-
665
-
666
- // animate back
667
-
668
- let animationObj = this.items[0].options;
669
-
670
-
671
- if (animationObj && animationObj.animation){
672
-
673
-
674
- let animation = animationObj.animation.op;
675
- // console.log(animation);
676
-
677
-
678
-
679
-
680
-
681
- const covid = this.res.children[0];
682
- const innerItemsWrapper = findNestedDivWithId(this.res.children, 'innerItemsWrapper');
683
- ///covid.children[0].children[1].children[0];
684
-
685
- // console.log("KINNERA");
686
- // console.log(innerItemsWrapper);
687
-
688
- // console.log("COVID");
689
- // console.log(covid);
690
- // innerItemsWrapper.style.border = "3px solid orange";
691
- innerItemsWrapper.style.marginTop = "0";
692
-
693
- if (animation){
694
- // console.log("Why not showing on 600px????")
695
- // console.log("TOWIDE");
696
-
697
-
698
- // console.log(covid);
699
- // console.log(covid.children[1].children[0]);
700
-
701
- // alert("OIJHIOHO")
702
-
703
- // close the nav an expand bad
704
-
705
- if (!this.hasAnimatedToWide){
706
- this.hasAnimatedToWide = true;
707
-
708
- for (var i = 0; i < innerItemsWrapper.children.length; i++){
709
-
710
- let link = innerItemsWrapper.children[i];
711
-
712
-
713
-
714
-
715
- link.animate(animation.keyframesOpen, animation.openOptions);
716
-
717
- }
718
- }
719
-
720
-
721
- }
722
-
723
-
724
- } else {
725
- const innerItemsWrapper = findNestedDivWithId(this.res.children, 'innerItemsWrapper');
726
- innerItemsWrapper.style.marginTop = "0";
727
- }
728
-
729
-
730
-
731
-
732
-
733
-
734
-
735
-
736
-
737
-
738
-
739
-
740
-
741
-
742
-
743
-
744
-
745
-
746
-
747
-
748
-
749
-
750
- }
751
-
752
- // nice library!
753
- const doInAdjust = () => {
754
-
755
- this.isShown = false;
756
-
757
-
758
- let my = this.res.children[0];
759
-
760
-
761
- adjustFontSize();
762
- var closed = false;
763
-
764
-
765
- this.res.children[0].style.flexDirection = "column";
766
-
767
- for (var i = 0; i < this.res.children[0].children.length; i++) {
768
- if (this.res.children[0].children[i].textContent == "☰" || this.res.children[0].children[i].textContent == /*"Lands"*/ this.keepItem) {
769
-
770
-
771
- let child = this.res.children[0].children[i];
772
- if (child.id === "WR") {
773
- this.res.children[0].children[i].style.display = "flex";
774
- } else {
775
- this.res.children[0].children[i].style.display = "flex";
776
- }
777
-
778
-
779
-
780
- } else {
781
- this.res.children[0].children[i].style.display = "none";
782
- }
783
- }
784
- }
785
-
786
- const adjust = () => {
787
- if (!this.obj.isSide) {
788
- if (media.matches || media2.matches) {
789
-
790
-
791
-
792
- doInAdjust();
793
-
794
- } else {
795
- toWideScreen();
796
- }
797
- }
798
-
799
-
800
- }
801
-
802
-
803
- if (!this.obj.isSide) {
804
-
805
- let inner = this.res.children[1]; //document.querySelector("#outerItemsWrapper")
806
- if (inner != null) {
807
- inner.style.background = "yellow";
808
- }
809
-
810
- if (media.matches || media2.matches) {
811
- doInAdjust();
812
- //alert("P")
813
- //this.res.children[0].style.opacity = 0.3;
814
- // console.log("884A");
815
- // console.warn(this.res);
816
- // console.log(this.res.children[0].children[0]);
817
- } else {
818
- toWideScreen();
819
- }
820
- } else {
821
- doInAdjust();
822
- }
823
-
824
-
825
- // was double anim once we commented this out
826
- // this.hasAnimatedToWide = false;
827
- window.addEventListener("resize", adjust);
828
- return this;
829
- }
830
-
831
- /*--------------------------------------------------ADJUST--------------------------------------------------*/
832
- render(div) {
833
-
834
-
835
- const method = () => {
836
- let media = window.matchMedia(`(max-width: 600px)`);
837
-
838
- // This gets owervwritten, column fires
839
-
840
- let myMedia = window.matchMedia(`(max-device-width: 415px)`);
841
- let outerItemsWrapper = this.res.children[0].children[1];
842
- let innerIW = outerItemsWrapper.children[0];
843
-
844
- // console.log("TEETH");
845
- // console.log(outerItemsWrapper);
846
- // console.log(innerIW);
847
-
848
-
849
- if (myMedia.matches) {
850
- innerIW.style.position = "relative";
851
- }
852
-
853
-
854
-
855
- if ((media.matches || myMedia.matches) && innerIW != undefined) {
856
- //alert("PP")
857
- innerIW.style.flexDirection = "column";
858
- } else if (innerIW != undefined && !this.obj.isSide) {
859
- innerIW.style.flexDirection = "row";
860
- }
861
-
862
- if (!this.obj.isSide && !media.matches && !myMedia.matches) {
863
- this.res.children[0].children[0].style.display = "none";
864
- }
865
-
866
-
867
- if (this.obj.isSide) {
868
- innerIW.style.flexDirection = "column";
869
- }
870
-
871
- if (!this.obj.isSide && !media.matches) {
872
- this.res.children[0].style.position = "relative";
873
- outerItemsWrapper.style.transform = "translateY(0px)";
874
- }
875
-
876
- if (!this.obj.isSide && media.matches) {
877
- // this.res.children[0].style.position = "absolute";
878
- }
879
-
880
-
881
- // my custom
882
-
883
- if (this.obj.customStyle){
884
- // this.res.children[0].children[1].children[0].style.width = "200px";
885
- this.res.children[0].style.marginTop = "1rem";
886
- this.res.children[0].style.position = "absolute";
887
- this.res.children[0].style.borderRadius = "1rem";
888
- outerItemsWrapper.style.borderRadius = "1rem";
889
-
890
- }
891
-
892
-
893
- // Add line 700
894
- if (this.obj.radius){
895
- // this.res.children[0].children[1].children[0].style.width = "200px";
896
- // alert("P")
897
-
898
- // Both need to be like this
899
- this.res.children[0].style.borderRadius = "1rem";
900
- outerItemsWrapper.style.borderRadius = "1rem";
901
-
902
- }
903
- }
904
-
905
- window.addEventListener("resize", () => method());
906
- method();
907
-
908
- if (div) {
909
- document.querySelector(div).style.padding = 0;
910
- document.querySelector(div).style.margin = 0;
911
- document.querySelector(div).appendChild(this.res);
912
- } else {
913
- return this.res; //.children[0];
914
- }
915
- return this.res; //.children[0];
916
- }
917
- }
918
-
919
- // If I shrink window and open the nav animates 2x
920
-
921
- export { UINavBar };