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,261 @@
1
+ import {Animator} from "./animator.js";
2
+
3
+ class NavBar {
4
+ constructor(){
5
+ this.ele = null;
6
+ this.titleText = "";
7
+ this.hasHamburger = false;
8
+ this.setup();
9
+ }
10
+
11
+
12
+ setup(){
13
+ let el = document.createElement("div");
14
+ el.style.backgroundColor = "#fff";
15
+
16
+ el.style.display = "flex";
17
+ el.style.justifyContent = "space-around";
18
+ el.style.alignItems = "center";
19
+ el.style.margin = 0;
20
+ el.style.padding = 0;
21
+ el.style.width = "100%";
22
+ //-------------DEFAULT STYLING----------
23
+ el.style.margin = 0;
24
+ el.style.paddingTop = "1em";
25
+ el.style.paddingBottom = "1em";
26
+ this.ele = el;
27
+
28
+ window.addEventListener("resize", this.adjust.bind(this));
29
+ return this;
30
+ }
31
+
32
+
33
+
34
+ title(text){
35
+ this.titleText = text;
36
+ let h = document.createElement("h2");
37
+ let node = document.createTextNode(text);
38
+ h.style.margin = 0;
39
+ h.style.padding = 0;
40
+ h.style.fontFamily = "Arial";
41
+ h.style.fontSize = "2em";
42
+ h.appendChild(node);
43
+ this.ele.appendChild(h);
44
+ return this;
45
+ }
46
+
47
+
48
+ image(url){
49
+ let h = document.createElement("img");
50
+ h.setAttribute("src", url);
51
+ h.style.margin = 0;
52
+ h.style.padding = 0;
53
+ h.style.width = 50;
54
+ this.ele.appendChild(h);
55
+ return this;
56
+ }
57
+
58
+ items(items){
59
+ this.itemCount = items.length;
60
+ for (var i = 0; i < items.length; i++){
61
+ this.ele.appendChild(items[i].render());
62
+ }
63
+
64
+ this.adjust();
65
+ return this;
66
+ }
67
+
68
+
69
+ font(family){
70
+
71
+ for (var i = 0; i < this.ele.children; i++){
72
+ this.ele.children[i].style.fontFamily = family;
73
+ }
74
+
75
+ return this;
76
+ }
77
+
78
+
79
+
80
+ openSymbol(symbol){
81
+ this.symbol = symbol;
82
+ return this;
83
+ }
84
+
85
+
86
+ /*--------------------------------------------------ADJUST--------------------------------------------------*/
87
+ // set habmurger icon
88
+ adjust(w) {
89
+ let media = window.matchMedia(`(max-width: 600px)`);
90
+ let media2 = window.matchMedia(`(max-device-width: 415px)`);
91
+
92
+ if (media.matches || media2.matches) {
93
+ this.ele.style.flexDirection = "column";
94
+ } else {
95
+ this.ele.style.flexDirection = "row";
96
+ this.ele.style.marginLeft = 0;
97
+ }
98
+
99
+ const addHamburger = () => {
100
+ var btn = document.createElement("button");
101
+ var node = document.createTextNode(this.symbol ? this.symbol : "☰");
102
+ btn.style.border = "none";
103
+ btn.style.fontWeight = "bold";
104
+ btn.style.color = "#3498db";
105
+ btn.style.backgroundColor = "#fff";
106
+ btn.style.fontSize = media2.matches ? "4em" : "2em";
107
+ btn.appendChild(node);
108
+ btn.style.marginLeft = "auto";
109
+
110
+ // alert("ADDED HABURGER!");
111
+ return btn;
112
+ }
113
+
114
+
115
+ const adjustFontSize = () => {
116
+ for (var i = 0; i < this.ele.children.length; i++) {
117
+ let el = this.ele.children[i];
118
+ el.style.fontSize = media2.matches ? "2.4em" : "1em";
119
+
120
+ if (el.textContent === "☰") {
121
+ el.style.fontSize = "2em";
122
+ }
123
+ }
124
+ }
125
+
126
+ const toWideScreen = () => {
127
+ for (var i = 0; i < this.ele.children.length; i++) {
128
+
129
+ let child = this.ele.children[i];
130
+
131
+ child.style.marginTop = "0em";
132
+ child.style.display = "block";
133
+
134
+ if (child.textContent === this.titleText) {
135
+ child.style.fontSize = "2em";
136
+ }
137
+ }
138
+
139
+ if (this.ele.childNodes[0].textContent == "☰") {
140
+ this.ele.removeChild(this.ele.childNodes[0]);
141
+ }
142
+
143
+ this.ele.style.flexDirection = "row";
144
+ }
145
+
146
+
147
+
148
+ var added = false;
149
+
150
+ const doInAdjust = () => {
151
+
152
+
153
+
154
+ adjustFontSize();
155
+
156
+ var closed = false;
157
+
158
+
159
+ if (!this.hasHamburger){
160
+
161
+
162
+ var btn = addHamburger();
163
+
164
+
165
+
166
+ /*console.warn("LENA");
167
+ console.log(this.ele.children.length);
168
+ console.log(this.itemCount);*/
169
+
170
+
171
+
172
+
173
+ if (((this.ele.children.length == this.itemCount + 1) || (this.ele.children.length == this.itemCount))) {
174
+ this.ele.insertBefore(btn, this.ele.firstChild);
175
+ this.hasHamburger = true;
176
+ }
177
+
178
+ this.ele.style.flexDirection = "column";
179
+ for (var i = 0; i < this.ele.children.length; i++) {
180
+ if (this.ele.children[i].textContent == "☰"){
181
+ this.ele.children[i].style.display = "block";
182
+
183
+
184
+ // MYCHANGE
185
+ }/* else if (this.ele.children[i].textContent == "London tours"){
186
+ this.ele.children[i].style.display = "block";
187
+ this.ele.children[i].style.paddingTop = "0";
188
+ this.ele.children[i].style.position = "absolute";
189
+ } */else {
190
+ this.ele.children[i].style.display = "none";
191
+ }
192
+ }
193
+
194
+ btn.addEventListener("click", () => {
195
+ // alert
196
+ closed = !closed;
197
+
198
+ for (var i = 0; i < this.ele.children.length; i++) {
199
+ if (i != 0) {
200
+
201
+ if (!closed) {
202
+ this.ele.children[i].style.display = "none";
203
+ this.ele.children[i].style.marginTop = "0em";
204
+ } else {
205
+ this.ele.children[i].style.display = "block";
206
+ this.ele.children[i].style.marginTop = "3em";
207
+ }
208
+ }
209
+ }
210
+ });
211
+ }
212
+
213
+
214
+
215
+ this.hasHamburger = true;
216
+ }
217
+
218
+ const adjust = () => {
219
+ if (media.matches || media2.matches) {
220
+ doInAdjust();
221
+ } else {
222
+ toWideScreen();
223
+ }
224
+ }
225
+
226
+ if (media.matches || media2.matches) {
227
+ doInAdjust();
228
+ } else {
229
+ toWideScreen();
230
+ }
231
+
232
+
233
+
234
+ window.addEventListener("resize", adjust);
235
+ return this;
236
+ }
237
+
238
+ /*--------------------------------------------------ADJUST--------------------------------------------------*/
239
+
240
+
241
+
242
+
243
+
244
+
245
+
246
+
247
+
248
+
249
+ render(div){
250
+ if (div){
251
+ document.querySelector(div).style.padding = 0;
252
+ document.querySelector(div).style.margin = 0;
253
+ document.querySelector(div).appendChild(this.ele);
254
+ } else {
255
+ return this.ele;
256
+ }
257
+ return this.ele;
258
+ }
259
+ }
260
+
261
+ export { NavBar };
@@ -0,0 +1,371 @@
1
+ import {Animator} from "./animator.js";
2
+
3
+ class NavBar {
4
+ constructor(els){
5
+ this.ele = null;
6
+ this.titleText = "";
7
+ this.hasHamburger = false;
8
+ this.setup(); // should nt be eited 2024
9
+
10
+ if (els){
11
+ this.items(els);
12
+ }
13
+ }
14
+
15
+ hamburger(colour) {
16
+ this.hamburgerColour = colour;
17
+ return this;
18
+ }
19
+
20
+ setup(){
21
+ let el = document.createElement("div");
22
+ el.style.backgroundColor = "#fff";
23
+
24
+ el.style.display = "flex";
25
+ el.style.justifyContent = "space-around";
26
+ el.style.alignItems = "center";
27
+ el.style.margin = 0;
28
+ el.style.padding = 0;
29
+ //el.style.width = "100%";
30
+ //-------------DEFAULT STYLING----------
31
+ el.style.margin = 0;
32
+ el.style.paddingTop = "1em";
33
+ el.style.paddingBottom = "1em";
34
+ this.ele = el;
35
+ // EVIL LINE
36
+ // window.addEventListener("resize", this.adjust.bind(this));
37
+
38
+ return this;
39
+ }
40
+
41
+ set(styles) {
42
+ for (let prop in styles) {
43
+ if (prop === 'margin') {
44
+ let paddingValues = styles[prop];
45
+ if (Array.isArray(paddingValues) && paddingValues.length > 0) {
46
+
47
+ for (let pado of paddingValues){
48
+
49
+
50
+ let paddingObject = pado;// paddingValues[0]; // Assuming only one object in the array
51
+ if (paddingObject.hasOwnProperty('top')) {
52
+ this.ele.style.marginTop = paddingObject['top'];
53
+ }
54
+ if (paddingObject.hasOwnProperty('right')) {
55
+ //alert("P")
56
+ this.ele.style.marginRight = paddingObject['right'];
57
+ }
58
+ if (paddingObject.hasOwnProperty('bottom')) {
59
+ this.ele.style.marginBottom = paddingObject['bottom'];
60
+ }
61
+ if (paddingObject.hasOwnProperty('left')) {
62
+ this.ele.style.marginLeft = paddingObject['left'];
63
+ }
64
+ }
65
+
66
+
67
+
68
+ }
69
+ }
70
+ }
71
+
72
+ return this;
73
+ }
74
+
75
+ radius(rad){
76
+ this.ele.style.borderRadius = rad;
77
+ return this;
78
+ }
79
+
80
+
81
+
82
+ items(items){
83
+
84
+
85
+
86
+ /* var itemsa = items.filter(item => item.__proto__
87
+ .constructor
88
+ .toString()
89
+ .startsWith("class Spacer") === false);
90
+
91
+ this.itemCount = itemsa.length;
92
+ */
93
+
94
+
95
+
96
+ this.itemCount = items.length;
97
+
98
+
99
+ for (var i = 0; i < items.length; i++){
100
+
101
+ var item = items[i];
102
+ var isSpacer = item.__proto__
103
+ .constructor
104
+ .toString()
105
+ .startsWith("class Spacer");
106
+
107
+
108
+
109
+
110
+ this.ele.appendChild(item.render());
111
+
112
+
113
+
114
+ }
115
+
116
+
117
+
118
+
119
+
120
+
121
+
122
+ this.adjust();
123
+
124
+
125
+
126
+
127
+ }
128
+
129
+
130
+ /*items(items){
131
+ this.itemCount = items.length;
132
+ for (var i = 0; i < items.length; i++){
133
+ this.ele.appendChild(items[i].render());
134
+ }
135
+
136
+ this.adjust();
137
+ return this;
138
+ }*/
139
+
140
+
141
+
142
+ sticky(){
143
+ this.ele.style.position = "fixed";
144
+ return this;
145
+ }
146
+
147
+ font(family){
148
+
149
+ for (var i = 0; i < this.ele.children; i++){
150
+ this.ele.children[i].style.fontFamily = family;
151
+ }
152
+
153
+ return this;
154
+ }
155
+
156
+
157
+
158
+ openSymbol(symbol){
159
+ this.symbol = symbol;
160
+ return this;
161
+ }
162
+
163
+
164
+ background(obj){
165
+ this.ele.style.backgroundColor = obj.color;
166
+ this.ele.style.opacity = obj.opacity;
167
+ return this;
168
+ }
169
+
170
+ transluescent(){
171
+ this.ele.style.backgroundColor = "rgba(255,255,255,0.72)";
172
+ return this;
173
+ //background-color: rgba(255,255,255,0.72);
174
+ }
175
+
176
+
177
+ keepItem(item){
178
+ console.log("Wow");
179
+ this.keepItem = item;
180
+ return this;
181
+ }
182
+
183
+ /*--------------------------------------------------ADJUST--------------------------------------------------*/
184
+ // set habmurger icon
185
+ adjust(w) {
186
+ let media = window.matchMedia(`(max-width: 731px)`); // 600
187
+ let media2 = window.matchMedia(`(max-device-width: 415px)`);
188
+
189
+ if (media.matches || media2.matches) {
190
+ this.ele.style.flexDirection = "column";
191
+ } else {
192
+ this.ele.style.flexDirection = "row";
193
+ this.ele.style.marginLeft = 0;
194
+ }
195
+
196
+ const addHamburger = () => {
197
+ var btn = document.createElement("button");
198
+ var node = document.createTextNode(this.symbol ? this.symbol : "☰");
199
+ btn.style.border = "none";
200
+ btn.style.fontWeight = "bold";
201
+
202
+ // alert(this.hamburgerColour);
203
+ btn.style.color = this.hamburgerColour ?? "#3498db";
204
+ // btn.style.backgroundColor = "#fff"; nostalgia covid
205
+ btn.style.fontSize = media2.matches ? "2.2em" : "2em";
206
+ btn.appendChild(node);
207
+ btn.style.marginLeft = "auto";
208
+
209
+
210
+ return btn;
211
+ }
212
+
213
+
214
+ const adjustFontSize = () => {
215
+ // alert("NOT USED IN VIEWPORT")
216
+ for (var i = 0; i < this.ele.children.length; i++) {
217
+ let el = this.ele.children[i];
218
+ el.style.fontSize = media2.matches ? "1.2em" : "1em";
219
+ // el.style.fontSize = media2.matches ? "2.4em" : "1em";
220
+
221
+
222
+ var isSpacer = el.__proto__
223
+ .constructor
224
+ .toString()
225
+ .startsWith("class Spacer");
226
+
227
+ // console.error("---------ERROR---------");
228
+ console.warn(el.style.flexGrow == "1");
229
+ console.log(el.style.getPropertyValue("flex-grow"));
230
+ console.log(el.style.getPropertyValue("flex-grow") == 1);
231
+ console.warn(isSpacer);
232
+
233
+
234
+ if (el.style.getPropertyValue("flex-grow") == 1){
235
+ // alert("A")
236
+ // el.style.setProperty("display", "none");
237
+ // el.style.marginTop = "0em";
238
+ // el.style.flex = "none";
239
+
240
+ // console.log(el.style)
241
+
242
+ }
243
+
244
+
245
+
246
+ if (el.textContent === "☰") {
247
+ el.style.fontSize = "2em";
248
+ }
249
+ }
250
+ }
251
+
252
+ const toWideScreen = () => {
253
+ for (var i = 0; i < this.ele.children.length; i++) {
254
+
255
+ let child = this.ele.children[i];
256
+
257
+ child.style.marginTop = "0em";
258
+ child.style.display = "block";
259
+
260
+ if (child.textContent === this.titleText && this.titleText.length > 0) {
261
+ alert(child.textContent)
262
+ child.style.fontSize = "2em";
263
+ }
264
+
265
+ if (this.ele.childNodes[i].textContent == "☰") {
266
+ this.ele.removeChild(this.ele.childNodes[i]);
267
+ }
268
+
269
+ }
270
+
271
+
272
+ this.ele.style.flexDirection = "row";
273
+ }
274
+
275
+
276
+
277
+ var added = false;
278
+
279
+ const doInAdjust = () => {
280
+ adjustFontSize();
281
+ var closed = false;
282
+ var btn = addHamburger();
283
+
284
+ /*(((this.ele.children.length == this.itemCount + 1)||*/
285
+ if (this.ele.children.length == this.itemCount) {
286
+ this.ele.insertBefore(btn, this.ele.firstChild);
287
+ console.log("ADDA");
288
+ }
289
+
290
+ this.ele.style.flexDirection = "column";
291
+ for (var i = 0; i < this.ele.children.length; i++) {
292
+ if (this.ele.children[i].textContent == "☰" || this.ele.children[i].textContent == /*"Lands"*/ this.keepItem){
293
+ this.ele.children[i].style.display = "block";
294
+ } else {
295
+ this.ele.children[i].style.display = "none";
296
+ }
297
+ }
298
+
299
+ btn.addEventListener("click", () => {
300
+ // alert
301
+ closed = !closed;
302
+
303
+ for (var i = 0; i < this.ele.children.length; i++) {
304
+ if (i != 0 && this.ele.children[i].textContent != /*"Lands"*/ this.keepItem) {
305
+
306
+ if (!closed) {
307
+ this.ele.children[i].style.display = "none";
308
+ this.ele.children[i].style.marginTop = "0em";
309
+ } else {
310
+
311
+
312
+ if (this.ele.children[i].getAttribute("class") === "innerHider"){
313
+ // alert("WOW");
314
+ this.ele.children[i].style.display = "none";
315
+ } else {
316
+ this.ele.children[i].style.display = "block";
317
+ this.ele.children[i].style.marginTop = "3em";
318
+ }
319
+
320
+
321
+
322
+ }
323
+ }
324
+ }
325
+ });
326
+ }
327
+
328
+ const adjust = () => {
329
+ if (media.matches || media2.matches) {
330
+ doInAdjust();
331
+ } else {
332
+ toWideScreen();
333
+ }
334
+ }
335
+
336
+ if (media.matches || media2.matches) {
337
+ doInAdjust();
338
+ } else {
339
+ toWideScreen();
340
+ }
341
+
342
+
343
+
344
+ window.addEventListener("resize", adjust);
345
+ return this;
346
+ }
347
+
348
+ /*--------------------------------------------------ADJUST--------------------------------------------------*/
349
+ render(div){
350
+ if (div){
351
+ document.querySelector(div).style.padding = 0;
352
+ document.querySelector(div).style.margin = 0;
353
+ document.querySelector(div).appendChild(this.ele);
354
+ } else {
355
+ return this.ele;
356
+ }
357
+ return this.ele;
358
+ }
359
+ }
360
+
361
+ window.NavBar
362
+ Spacer
363
+ Spacer
364
+ Spacer = NavBar
365
+ Spacer
366
+ Spacer
367
+ Spacer;
368
+ export { NavBar
369
+ Spacer
370
+ Spacer
371
+ Spacer };
@@ -0,0 +1,60 @@
1
+
2
+
3
+ class CustomDivRenderer {
4
+ constructor(obj, items) {
5
+ this.obj = obj || {};
6
+ this.items = items || [];
7
+ }
8
+
9
+ render() {
10
+ // Create inner div with flex display
11
+ let tempDiv = document.createElement("div");
12
+ tempDiv.style.display = "flex";
13
+ tempDiv.style.width = "100%";
14
+ tempDiv.style.justifyContent = "space-around";
15
+ tempDiv.setAttribute("id", "innerItemsWrapper");
16
+
17
+ let mobileMedia = window.matchMedia(`(max-device-width: 415px)`);
18
+ let media = window.matchMedia(`(max-width: 600px)`);
19
+
20
+ if (mobileMedia.matches || media.matches){
21
+ tempDiv.style.marginTop = "3rem";
22
+ }
23
+
24
+ // console.log("ITEMS ARE ORDERED");
25
+ // console.log(this.items);
26
+
27
+ // Append rendered items to inner div
28
+ for (let i = 0; i < this.items.length; i++) {
29
+ const item = this.items[i];
30
+ tempDiv.appendChild(item.render());
31
+ }
32
+
33
+ // Create outer div and apply styling based on obj properties
34
+ let outerDiv = document.createElement("div");
35
+ outerDiv.style.width = this.obj.isSide ? "333px" : "100%";
36
+ outerDiv.style.background = this.obj.background || "white";
37
+ outerDiv.style.display = "flex";
38
+ outerDiv.style.justifyContent = "center";
39
+ outerDiv.style.alignItems = "center";
40
+ outerDiv.style.height = "100%";
41
+ outerDiv.setAttribute("id", "outerItemsWrapper");
42
+ outerDiv.appendChild(tempDiv);
43
+
44
+ // Apply custom styles if specified in obj
45
+ if (this.obj.customStyle) {
46
+ tempDiv.style.width = "auto";
47
+ tempDiv.style.top = "0rem";
48
+ tempDiv.style.borderRadius = "1rem";
49
+ tempDiv.style.background = this.obj.background || "white";
50
+ tempDiv.style.margin = "1rem";
51
+ tempDiv.style.position = "absolute";
52
+ tempDiv.style.opacity = 0.8;
53
+ }
54
+
55
+ return outerDiv;
56
+ }
57
+ }
58
+
59
+ window.CustomDivRenderer = CustomDivRenderer;
60
+ export { CustomDivRenderer };