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,282 @@
1
+ import {Animator} from "./animator.js";
2
+
3
+ class TextField extends Animator {
4
+ constructor(text){
5
+ super();
6
+ this.text = text;
7
+ this.res = null;
8
+ this.valid = false;
9
+ this.setup();
10
+ }
11
+
12
+ setup(){
13
+ let el = document.createElement("input");
14
+
15
+ this.res = el;
16
+ this.res.style.padding = 0;
17
+ this.res.style.margin = 0;
18
+ this.res.style.padding = ".4rem .75rem";
19
+
20
+ this.res.style.fontSize = "1rem";
21
+
22
+ let query = window.matchMedia("(max-device-width: 415px)");
23
+ if (query.matches) {
24
+ this.res.style.width = "100%";
25
+
26
+ } else {
27
+
28
+ }
29
+
30
+
31
+ // div.style.width = "100%";
32
+ return this;
33
+ }
34
+
35
+
36
+ set(obj){
37
+ this.options = obj;
38
+ this.res.setAttribute("type", obj.type ?? "text");
39
+ obj.placeholder && (this.res.placeholder = obj.placeholder);
40
+ obj.arrayPadding && this.arrayPadding(obj.arrayPadding.sides, obj.arrayPadding.value);
41
+ obj.arrayMargin && this.arrayMargin(obj.arrayMargin.sides, obj.arrayMargin.value);
42
+ obj.pad && this.pad(obj.pad);
43
+ obj.mar && this.mar(obj.mar);
44
+ return this;
45
+ }
46
+
47
+
48
+ arrayPadding(arr, value) {
49
+ //alert("PP")
50
+ //console.log(arr);
51
+ if (arr.includes("left")){
52
+ this.res.style.paddingLeft = value;
53
+ }
54
+
55
+ // console.log("PAD");
56
+ // console.log(this.res.style.paddingLeft);
57
+ // console.log(arr);
58
+ // console.log(value);
59
+
60
+ if (arr.includes("right")){
61
+ this.res.style.paddingRight = value;
62
+ }
63
+
64
+ if (arr.includes("top")){
65
+ this.res.style.paddingTop = value;
66
+ }
67
+
68
+ if (arr.includes("bottom")){
69
+ this.res.style.paddingBottom = value;
70
+ }
71
+
72
+ if (arr.includes("all")){
73
+ this.res.style.padding = value;
74
+ }
75
+
76
+
77
+ return this;
78
+ }
79
+
80
+ toCode() {
81
+ const objString = JSON.stringify(this.options, null, 4);
82
+ return [`new TextField().set(${objString})`];
83
+ }
84
+
85
+ arrayMargin(arr, value) {
86
+ //alert("PP")
87
+ //console.log(arr);
88
+ if (arr.includes("left")){
89
+ this.res.style.marginLeft = value;
90
+ }
91
+
92
+ // console.log("PAD");
93
+ // console.log(this.res.style.paddingLeft);
94
+ // console.log(arr);
95
+ // console.log(value);
96
+
97
+ if (arr.includes("right")){
98
+ this.res.style.marginRight = value;
99
+ }
100
+
101
+ if (arr.includes("top")){
102
+ this.res.style.marginTop = value;
103
+ }
104
+
105
+ if (arr.includes("bottom")){
106
+ this.res.style.marginBottom = value;
107
+ }
108
+
109
+ if (arr.includes("all")){
110
+ this.res.style.margin = value;
111
+ }
112
+
113
+
114
+ return this;
115
+ }
116
+
117
+
118
+ setValid(valid, value){
119
+
120
+
121
+
122
+ if (valid){
123
+ this.res.style.border = "6px solid green";
124
+ } else {
125
+ this.res.style.border = "6px solid red";
126
+ }
127
+
128
+ if (value.length === 0){
129
+ this.res.style.border = "none";
130
+ }
131
+
132
+ return this;
133
+
134
+ }
135
+
136
+ auto() {
137
+ const adj = () => {
138
+ let query = window.matchMedia("(max-device-width: 415px)");
139
+ if (query.matches) {
140
+ this.res.style.fontSize = '3rem';
141
+
142
+ } else {
143
+ this.res.style.fontSize = '1rem';
144
+ }
145
+ }
146
+
147
+ adj();
148
+ window.addEventListener("resize", adj);
149
+ return this;
150
+ }
151
+
152
+ listen(value){
153
+ this.res.addEventListener("input", (e) => this.process(e) /*console.log(this.res.value)*/);
154
+ return this;
155
+ }
156
+
157
+ value(val){
158
+ this.res.setAttribute("value", val);
159
+ return this;
160
+ }
161
+
162
+ password(){
163
+ this.res.setAttribute("type", "password");
164
+ return this;
165
+ }
166
+
167
+ number(){
168
+ this.res.setAttribute("type", "number");
169
+ return this;
170
+ }
171
+
172
+ week(){
173
+ this.res.setAttribute("type", "week");
174
+ return this;
175
+ }
176
+
177
+ process(e){
178
+ //console.log(this.res.value)
179
+ return this.res.value;
180
+ }
181
+
182
+ font(font){
183
+ this.res.style.fontFamily = font;
184
+ return this;
185
+ }
186
+
187
+ size(s){
188
+ this.res.style.fontSize = s;
189
+ return this;
190
+ }
191
+
192
+ em(e){
193
+ this.res.style.fontSize = `${e}em`;
194
+ return this;
195
+ }
196
+
197
+ color(color){
198
+ this.res.style.color = color;
199
+ return this;
200
+ }
201
+
202
+ weight(weight){
203
+ this.res.style.fontWeight = weight;
204
+ return this;
205
+ }
206
+
207
+ bold(){
208
+ this.res.style.fontWeight = "bold";
209
+ return this;
210
+ }
211
+
212
+ italic(){
213
+ this.res.style.fontStyle = "italic";
214
+ return this;
215
+ }
216
+
217
+ padding(L, T, R, B){
218
+
219
+
220
+ if (L){
221
+ this.res.style.padding = `${L}px`;
222
+ }
223
+
224
+ else if (L && T && R && B){
225
+
226
+
227
+ this.res.style.paddingLeft = L;
228
+ this.res.style.paddingTop = T;
229
+ this.res.style.paddingRight = R;
230
+ this.res.style.paddingBottom = `${B}px`;
231
+ }
232
+ return this;
233
+ }
234
+
235
+ margin(L, T, R, B){
236
+ this.res.style.marginLeft = L;
237
+ this.res.style.marginTop = T;
238
+ this.res.style.marginLeft = R;
239
+ this.res.style.marginBottom = `${B}px`;
240
+ return this;
241
+ }
242
+
243
+
244
+ placeholder(text){
245
+ this.res.setAttribute("placeholder", text);
246
+ return this;
247
+ }
248
+
249
+ border(color, w){
250
+ this.res.style.border = `${w}px solid ${color}`;
251
+ return this;
252
+ }
253
+
254
+
255
+ width(w){
256
+ this.res.style.width = w;
257
+ return this;
258
+ }
259
+
260
+ round(amount){
261
+ this.res.style.borderRadius = `${amount}px`;
262
+ return this;
263
+ }
264
+
265
+ onChange(action){
266
+ var value = this.res.value;
267
+ this.res.addEventListener("input", e => { action(this.res.value); /*this.res.value = value*/ });
268
+ // this.res.value =
269
+ return this;
270
+ }
271
+
272
+ render(div){
273
+ if (div){
274
+ document.querySelector(div).appendChild(this.res);
275
+ } else {
276
+ return this.res;
277
+ }
278
+ return this.res;
279
+ }
280
+ }
281
+
282
+ export { TextField };
@@ -0,0 +1,147 @@
1
+ import {Animator} from "./animator.js";
2
+
3
+
4
+
5
+ // 13:28 07/04/2020 - BEGIN NOTHING GONNA STOP US NOW Lets go!
6
+ class UList extends Animator {
7
+ constructor(){
8
+ super();
9
+ this.res = null;
10
+ this.setup();
11
+ }
12
+
13
+
14
+ set(obj){
15
+ obj.pad && this.pad(obj.pad);
16
+ obj.mar && this.mar(obj.mar);
17
+ return this;
18
+ }
19
+
20
+ setup(){
21
+ let el = document.createElement("ul");
22
+ this.res = el;
23
+
24
+ this.res.style.padding = 0;
25
+ this.res.style.margin = 0;
26
+ return this;
27
+ }
28
+
29
+
30
+ newItems(items){
31
+ for (var i = 0; i < items.length; i++){
32
+ console.log(items[i]);
33
+ let rendered = items[i].render();
34
+ this.res.appendChild(rendered);
35
+ }
36
+
37
+ return this;
38
+ }
39
+
40
+ items(itemso){
41
+ for (var i = 0; i < itemso.length; i++){
42
+ let li = document.createElement("li");
43
+ let node = document.createTextNode(itemso[i]);
44
+ li.appendChild(node);
45
+ this.res.appendChild(li);
46
+ }
47
+
48
+ return this;
49
+ }
50
+
51
+
52
+ font(font){
53
+ this.res.style.fontFamily = font;
54
+ return this;
55
+ }
56
+
57
+
58
+ size(s){
59
+ this.res.style.fontSize = s;
60
+ return this;
61
+ }
62
+
63
+ em(e){
64
+ this.res.style.fontSize = `${e}em`;
65
+ return this;
66
+ }
67
+
68
+ color(color){
69
+ this.res.style.color = color;
70
+ return this;
71
+ }
72
+
73
+ align(direction){
74
+ this.res.style.textAlign = `${direction}`;
75
+ return this;
76
+ }
77
+
78
+ weight(weight){
79
+ this.res.style.fontWeight = weight;
80
+ return this;
81
+ }
82
+
83
+ bold(){
84
+ this.res.style.fontWeight = "bold";
85
+ return this;
86
+ }
87
+
88
+ italic(){
89
+ this.res.style.fontStyle = "italic";
90
+ return this;
91
+ }
92
+
93
+ /*padding(val){
94
+ this.res.style.padding = val;
95
+ return this;
96
+ }*/
97
+
98
+
99
+ margin(val){
100
+ this.res.style.margin = val;
101
+ return this;
102
+ }
103
+
104
+ border(w, color){
105
+ this.res.style.border = `${w}px solid ${color}`;
106
+ return this;
107
+ }
108
+
109
+
110
+
111
+
112
+ padding(T, L, R, B){
113
+ this.res.style.paddingTop = T;
114
+ this.res.style.paddingLeft = L;
115
+ this.res.style.paddingRight = R;
116
+ this.res.style.paddingBottom = B;
117
+ return this;
118
+ }
119
+
120
+
121
+
122
+
123
+ headline(){
124
+ this.em(4)
125
+ this.font("Arial")
126
+ this.bold()
127
+ return this;
128
+ }
129
+
130
+
131
+ caption(){
132
+ this.bold();
133
+ this.res.style.fontFamily = "Arial";
134
+ this.res.style.color = "#3498db";
135
+ return this;
136
+ }
137
+
138
+ render(div){
139
+ if (div){
140
+ document.querySelector(div).appendChild(this.res);
141
+ } else {
142
+ return this.res;
143
+ }
144
+ }
145
+ }
146
+
147
+ export { UList };
@@ -0,0 +1,70 @@
1
+ import {Animator} from "./animator.js";
2
+
3
+
4
+
5
+
6
+ class Video extends Animator {
7
+ constructor(url, /*obj*/) {
8
+ super();
9
+ this.url = url;
10
+ this.res = null;
11
+ //this.setup(obj);
12
+
13
+ this.setup();
14
+ }
15
+
16
+
17
+
18
+ setup(){
19
+ this.res = document.createElement("video");
20
+ this.res.setAttribute("src", this.url);
21
+ this.res.setAttribute("controls", "controls");
22
+ }
23
+
24
+
25
+ set(obj){
26
+ this.options = obj;
27
+ obj.radius && (this.res.style.borderRadius = "1rem");
28
+ obj.width && (this.res.style.width = `${obj.width}`);
29
+ obj.opacity && (this.res.style.opacity = obj.opacity);
30
+ return this;
31
+ }
32
+
33
+
34
+
35
+ size(w/*, h*/) {
36
+
37
+ this.res.style.width = w;
38
+ //this.res.style.height = w;
39
+
40
+
41
+ /*if (w && h) {
42
+ this.res.style.width = w;
43
+ this.res.style.height = h;
44
+ } else {
45
+ this.res.style.width = w;
46
+ this.res.style.height = w;
47
+ }*/
48
+
49
+ return this;
50
+ }
51
+
52
+ toCode() {
53
+ const objString = JSON.stringify(this.options, null, 4);
54
+ return [`new Video("${this.url}").set(${objString})`];
55
+ }
56
+
57
+ render(el) {
58
+ if (el) {
59
+ document.querySelector(el).appendChild(this.res);
60
+ } else {
61
+ return this.res;
62
+ }
63
+ }
64
+ }
65
+
66
+
67
+ //var _oldVideo = Video;
68
+ //Video = function(...args) { return new _oldVideo(...args) };
69
+
70
+ export { Video };
@@ -0,0 +1,60 @@
1
+ var _old = Text;
2
+ Text = function(...args) { return new _old(...args) };
3
+
4
+ var _oldLink = Link;
5
+ Link = function(...args) { return new _oldLink(...args) };
6
+
7
+ var _oldNavBar = NavBar;
8
+ NavBar = function(...args) { return new _oldNavBar(...args) };
9
+
10
+ var _oldHeader = Header;
11
+ Header = function(...args) { return new _oldHeader(...args) };
12
+
13
+ var _oldCard = Card;
14
+ Card = function(...args) { return new _oldCard(...args) };
15
+
16
+
17
+
18
+
19
+ /*
20
+ var _oldImage = ExactImage;
21
+ ExactImage = function(...args) { return new _oldImage(...args) };
22
+ */
23
+
24
+ var _oldSpacer = Spacer;
25
+ Spacer = function(...args) { return new _oldSpacer(...args) };
26
+
27
+ var _oldGrid = Grid;
28
+ Grid = function(...args) { return new _oldGrid(...args) };
29
+
30
+ var _oldCenter = Center;
31
+ Center = function(...args) { return new _oldCenter(...args) };
32
+
33
+ var _oldGroup = Group;
34
+ Group = function(...args) { return new _oldGroup(...args) };
35
+ /*
36
+ var _oldParagraph = Paragraph;
37
+ Paragraph = function(...args) { return new _oldParagraph(...args) };
38
+ */
39
+
40
+
41
+ var _oldRow = Row;
42
+ Row = function(...args) { return new _oldRow(...args) };
43
+
44
+ var _oldWrap = Wrap;
45
+ Wrap = function(...args) { return new _oldWrap(...args) };
46
+
47
+ var _oldAudio = Audio;
48
+ Audio = function(...args) { return new _oldAudio(...args) };
49
+
50
+ var _oldImage = Image;
51
+ Image = function(...args) { return new _oldImage(...args) };
52
+
53
+ var _oldFlexRow = FlexRow;
54
+ FlexRow = function(...args) { return new _oldFlexRow(...args) };
55
+
56
+ var _oldTable = Table;
57
+ Table = function(...args) { return new _oldTable(...args) };
58
+
59
+ var _oldSideBar = SideBar;
60
+ SideBar = function(...args) { return new _oldSideBar(...args) };
package/layout/wrap.js ADDED
@@ -0,0 +1,140 @@
1
+ import {Animator} from "./animator.js";
2
+
3
+ class Wrap {
4
+ constructor(els){
5
+ this.code = [];
6
+
7
+ this.setup();
8
+
9
+
10
+
11
+
12
+ for (var i = 0; i < els.length; i++){
13
+
14
+
15
+ /*var element = els[i];
16
+ var _oldEl = element;
17
+ element = function(...args) { return new _oldEl(...args) };
18
+ */
19
+
20
+
21
+ //console.log(new els[i])
22
+ this.res.appendChild(els[i].render().render());
23
+
24
+
25
+
26
+
27
+ }
28
+ }
29
+
30
+
31
+
32
+
33
+
34
+ setup(){
35
+ let gr = document.createElement("div");
36
+ gr.style.padding = 0;
37
+ gr.style.margin = 0;
38
+ this.res = gr;
39
+ }
40
+
41
+ width(w, shouldCenter){
42
+ this.res.style.width = w;
43
+
44
+ if (shouldCenter){
45
+ this.res.style.marginLeft = "auto";
46
+ this.res.style.marginRight = "auto";
47
+ }
48
+ return this;
49
+ }
50
+
51
+ padding(value){
52
+ this.res.style.padding = `${value}px`;
53
+ return this;
54
+ }
55
+
56
+ size(w, h){
57
+ this.w = w;
58
+ this.h = h;
59
+
60
+ if (this.w){
61
+ this.res.style.width = this.w;
62
+ } else {
63
+ this.res.style.width = window.innerWidth;
64
+ }
65
+
66
+ if (this.h){
67
+ this.res.style.height = this.h;
68
+ } else {
69
+ this.res.style.height = window.innerHeight;
70
+ }
71
+
72
+
73
+ return this;
74
+ }
75
+
76
+
77
+
78
+
79
+
80
+ /*items(els){
81
+ for (var i = 0; i < els.length; i++){
82
+ this.res.appendChild(els[i].render().render());
83
+ }
84
+ return this;
85
+ }*/
86
+
87
+
88
+
89
+ border(color, width){
90
+ this.res.style.border = `${width}px solid ${color}`;
91
+ return this;
92
+ }
93
+
94
+ render(el){
95
+ if (el){
96
+ document.querySelector(el).appendChild(this.res);
97
+ } else {
98
+ return this.res;
99
+ }
100
+
101
+ }
102
+ }
103
+
104
+
105
+
106
+
107
+
108
+
109
+
110
+
111
+
112
+
113
+
114
+
115
+
116
+
117
+
118
+
119
+
120
+
121
+
122
+
123
+
124
+
125
+
126
+
127
+
128
+
129
+
130
+
131
+
132
+
133
+
134
+
135
+
136
+
137
+
138
+
139
+
140
+ export { Wrap };