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,289 @@
1
+ import {Animator} from "./animator.js";
2
+
3
+ class TopBar extends Base {
4
+ constructor(){
5
+ super();
6
+ }
7
+
8
+ render(){
9
+ return FlexRow().items([
10
+ Text("Newsroom"),
11
+ Spacer(true),
12
+ Text("Contact us")
13
+ ]).arrayPadding(["left", "right"], "20px")
14
+ }
15
+ }
16
+
17
+
18
+
19
+
20
+ new TopBar()
21
+ .mount("#res");
22
+
23
+
24
+
25
+ class NewsHeader extends Base {
26
+
27
+ constructor(data){
28
+ super();
29
+ this.data = data;
30
+ }
31
+
32
+ render(){
33
+ return new Group().items([
34
+ Text(this.data.type)
35
+ .fluidCopy("S6")
36
+ .font("SF Pro Text")
37
+ .bold()
38
+ .margin("top", 40),
39
+
40
+ Text(this.data.date)
41
+ .color("gray")
42
+ .font("Arial")
43
+ .em(0.8)
44
+ .margin("top", 10),
45
+
46
+ Text(this.data.title)
47
+ .font("Arial")
48
+ .fluidCopy("S5")
49
+ //.em(2.10)
50
+ .bold()
51
+ .margin("bottom", 10),
52
+
53
+ Text(this.data.subtitle)
54
+ .fluidCopy("S6")
55
+ .font("Arial")
56
+ ])
57
+ .width("80%", "center");
58
+ //.render("#res");
59
+ }
60
+ }
61
+
62
+
63
+ new NewsHeader({
64
+ title: "All-new iMac features stunning design in a spectrum of vibrant colors, the breakthrough M1 chip, and a brilliant 4.5K Retina display",
65
+ subtitle: "iMac offers the best camera, mics, and speakers ever in a Mac, and Touch ID for the first time",
66
+ date: "April 20th, 2021",
67
+ type: "PRESS RELEASE"
68
+ }).mount("#res");
69
+
70
+
71
+
72
+
73
+
74
+ class ImageRow extends Base {
75
+ constructor(){
76
+ super();
77
+ }
78
+
79
+ render(){
80
+ // can use Spacer()
81
+ return new FlexGrid(3).items([
82
+ new Image("https://cdn3.iconfinder.com/data/icons/capsocial-round/500/facebook-512.png").RSize(30, 30, 1.4).padding(10),
83
+ new Image("https://cdn3.iconfinder.com/data/icons/capsocial-round/500/facebook-512.png").RSize(30, 30, 1.4).padding(10),
84
+ new Image("https://cdn3.iconfinder.com/data/icons/capsocial-round/500/facebook-512.png").RSize(30, 30, 1.4).padding(10),
85
+ ])
86
+ .width("80%")
87
+ .center();
88
+ }
89
+ }
90
+
91
+
92
+
93
+
94
+ new ImageRow()
95
+ .mount("#res");
96
+
97
+
98
+
99
+
100
+
101
+
102
+
103
+ class CenterRow extends Base {
104
+ constructor(){
105
+ super();
106
+ }
107
+
108
+
109
+ render(){
110
+
111
+
112
+
113
+
114
+
115
+
116
+
117
+
118
+
119
+
120
+ // 2 classes
121
+ // Wrap with no formatting options for custom Components
122
+ // Container() for all other elements
123
+
124
+
125
+ // return new Center()
126
+ return new Center().items([
127
+ new Image("https://www.apple.com/newsroom/images/product/imac/standard/apple_new-imac-spring21_hero_04202021_Full-Bleed-Image.jpg.large_2x.jpg"),
128
+ new Text("New MacBook Pro delivers up to 80% graphics performance and thinner bezels")
129
+ .caption()
130
+ .align("center")
131
+
132
+ ])//.itemWidth("90%")
133
+ }
134
+ }
135
+
136
+
137
+
138
+ new CenterRow().mount("#res");
139
+
140
+ /*------------------------HEADER------------------------
141
+ new Group().items([
142
+ new Text("PRESS RELEASE")
143
+ .em(0.9)
144
+ .color("red")
145
+ .font("SF Pro Text")
146
+ .bold()
147
+ .margin("top", 40),
148
+
149
+ new Text("June 1, 2020")
150
+ .color("gray")
151
+ .font("Arial")
152
+ .em(0.8)
153
+ .margin("top", 10),
154
+
155
+ new Text("Apple announces MacBook Pro 14")
156
+ .font("Arial")
157
+ .em(2.10)
158
+ .bold()
159
+ .margin("bottom", 10)
160
+ ])
161
+ .width("80%", "center")
162
+ .render("#res");*/
163
+
164
+ /*------------------------SOCIAL------------------------*/
165
+
166
+
167
+ /*------------------------IMAGE------------------------
168
+ new Center().items([
169
+ new Image("https://www.apple.com/newsroom/images/product/mac/standard/Apple_macbookpro-13-inch_screen_05042020_big.jpg.medium_2x.jpg"),
170
+ new Text("New MacBook Pro delivers up to 80% graphics performance and thinner bezels").caption().align("center")
171
+
172
+ ]).itemWidth("90%")
173
+ .render("#res")*/
174
+
175
+ /*------------------------HEADERS------------------------*/
176
+ new Center().items([
177
+ new Text("Like Apple.").font("SF Pro Display").bold().em(6),
178
+ new Text("Big bold font.").font("SF Pro Display").bold().em(2)
179
+ ]).margin("top", 40)
180
+ .margin("bottom", 40)
181
+ .itemWidth("80%")
182
+ .render("#res");
183
+
184
+ /*------------------------TEXT------------------------*/
185
+ new Text("Cupertino, California — Apple today updated the 13-inch MacBook Pro with the new Magic Keyboard for the best typing experience ever on a Mac notebook and doubled the storage across all standard configurations, delivering even more value to the most popular MacBook Pro. The new lineup also offers 10th-generation processors for up to 80 percent faster graphics performance1 and makes 16GB of faster 3733MHz memory standard on select configurations. With powerful quad-core processors, the brilliant 13-inch Retina display, Touch Bar and Touch ID, immersive stereo speakers, all-day battery life, and the power of macOS, all in an incredibly portable design, the new 13-inch MacBook Pro is available to order today, starting at $1,299, and $1,199 for education.")
186
+ .em(1)
187
+ /*.margin("top", 20)
188
+ .margin("bottom", 30)*/
189
+
190
+ .arrayPadding(["top", "bottom"], 40)
191
+ .width("80%", "center")
192
+ /*.sizes([
193
+ {w: 800, size: 1.2},
194
+ {w: 900, size: 1.34},
195
+ {mobile: 4}
196
+ ])*/
197
+ .render("#res");
198
+
199
+
200
+
201
+
202
+ new Center()
203
+ .items([
204
+ /*new Progress(0.80)
205
+ .size("80%", 20)
206
+ .colors("#ecf0f3", "#3498db")
207
+ .round(23),*/
208
+
209
+ new Text("80% faster graphics performance.")
210
+ .align("center")
211
+ .font("SF Pro Display")
212
+ .color("gray")
213
+ .padding("top", 10)
214
+ .bold()
215
+
216
+ ]).itemWidth("80%")
217
+ .arrayPadding(["top", "bottom"], 30)
218
+ .render("#res");
219
+
220
+
221
+
222
+ let cards = [
223
+ new Card().items([
224
+ new Spacer(true),
225
+ new Text("Fast")
226
+ .bold()
227
+ .em(2),
228
+ //.large().bold(),//.padding(20, 20, 0, 3),
229
+ new Spacer(true),
230
+ new Text("The 13-inch MacBook Pro includes a solid-state drive that’s blazing fast, with sequential read speeds up to 3.0GB/s.10 The standard configurations have twice the capacity of the previous generation (256GB, 512GB, or 1TB), and with up to 4TB of storage, you can take all your photos and videos with you no matter where you go. And with the Apple T2 Security Chip, everything is automatically encrypted on the fly.").padding(20),
231
+
232
+
233
+
234
+
235
+
236
+ Image("https://store.storeimages.cdn-apple.com/4982/as-images.apple.com/is/MBP13GT-201807?wid=1200&hei=630&fmt=jpeg&qlt=95&op_usm=0.5,0.5&.v=1531249596119", "exact")
237
+
238
+ //new ExactImage("https://store.storeimages.cdn-apple.com/4982/as-images.apple.com/is/MBP13GT-201807?wid=1200&hei=630&fmt=jpeg&qlt=95&op_usm=0.5,0.5&.v=1531249596119")
239
+ ])
240
+ .shadow(),
241
+
242
+ new Card().items([
243
+ new Spacer(),
244
+ new Text("Efficient")
245
+ .bold()
246
+ .em(2),
247
+ //.large().bold().padding(20, 20, 0, 3),
248
+ new Spacer(),
249
+ new Text("The 13-inch MacBook Pro includes a solid-state drive that’s blazing fast, with sequential read speeds up to 3.0GB/s.10 The standard configurations have twice the capacity of the previous generation (256GB, 512GB, or 1TB), and with up to 4TB of storage, you can take all your photos and videos with you no matter where you go. And with the Apple T2 Security Chip, everything is automatically encrypted on the fly.").padding(20),
250
+
251
+ Image("https://store.storeimages.cdn-apple.com/4982/as-images.apple.com/is/MBP13GT-201807?wid=1200&hei=630&fmt=jpeg&qlt=95&op_usm=0.5,0.5&.v=1531249596119", "exact")
252
+ ])
253
+ .shadow(),
254
+
255
+ new Card().items([
256
+ new Spacer(),
257
+ new Text("Durable")
258
+ .bold()
259
+ .em(2),
260
+ //.large().bold().padding(20, 20, 0, 3),
261
+ new Spacer(),
262
+ new Text("The 13-inch MacBook Pro includes a solid-state drive that’s blazing fast, with sequential read speeds up to 3.0GB/s.10 The standard configurations have twice the capacity of the previous generation (256GB, 512GB, or 1TB), and with up to 4TB of storage, you can take all your photos and videos with you no matter where you go. And with the Apple T2 Security Chip, everything is automatically encrypted on the fly.").padding(20),
263
+
264
+ Image("https://store.storeimages.cdn-apple.com/4982/as-images.apple.com/is/MBP13GT-201807?wid=1200&hei=630&fmt=jpeg&qlt=95&op_usm=0.5,0.5&.v=1531249596119", "exact")
265
+ ])
266
+ .shadow(),
267
+ ];
268
+
269
+ new Grid(3)
270
+ .items(cards)
271
+ .center()
272
+ .gap(20)
273
+ .setColumns(1, 600)
274
+ .padding(20)
275
+ .render("#res");
276
+
277
+
278
+ new Footer("2020").font("Arial").render("#res");
279
+ window.TopBar
280
+ NewsHeader
281
+ ImageRow
282
+ CenterRow = TopBar
283
+ NewsHeader
284
+ ImageRow
285
+ CenterRow;
286
+ export { TopBar
287
+ NewsHeader
288
+ ImageRow
289
+ CenterRow };
@@ -0,0 +1,209 @@
1
+ import {Animator} from "./animator.js";
2
+
3
+ class AspectImage extends Animator {
4
+ constructor(url, animation) {
5
+ super();
6
+ this.url = url;
7
+ this.res = null;
8
+ this.animation = animation;
9
+ // this.setup();
10
+ }
11
+
12
+ overlayColor(colour){
13
+ this.overlayColor = colour;
14
+ this.res.children[1].style.background = colour;
15
+ return this;
16
+ }
17
+
18
+ setup(obj) {
19
+ let wrap = document.createElement("div");
20
+ wrap.style.overflow = "hidden";
21
+ wrap.style.display = "flex";
22
+ wrap.style.justifyContent = "center";
23
+ wrap.style.alignItems = "center";
24
+
25
+ /* let text = document.createElement("p");
26
+ let node = document.createTextNode("Big Ben");
27
+ text.appendChild(node);
28
+ text.style.position = "absolute";
29
+ text.style.transform = "scale(0.0)";
30
+ text.style.font = "Arial";
31
+ text.style.fontSize = "2rem";
32
+ text.style.fontWeight = "bold";
33
+ text.style.pointerEvents = "none";
34
+ */
35
+ let text = obj.view.render();
36
+ text.style.position = "absolute";
37
+ text.style.transform = "scale(0.0)";
38
+ text.style.font = "Arial";
39
+ text.style.fontSize = "2rem";
40
+ text.style.fontWeight = "bold";
41
+ text.style.pointerEvents = "none";
42
+
43
+
44
+
45
+
46
+
47
+
48
+ let overlay = document.createElement("div");
49
+ overlay.style.position = "absolute";
50
+ overlay.style.opacity = "0.33";
51
+ overlay.style.width = "250px";
52
+ overlay.style.height = "250px";
53
+ overlay.style.opacity = "0.0"; // 0.0
54
+
55
+ overlay.style.pointerEvents = "none";
56
+
57
+
58
+ let div = document.createElement("div");
59
+ div.style.width = "250px";
60
+
61
+
62
+ let query = window.matchMedia("(max-device-width: 415px)");
63
+ div.style.height = "250";
64
+
65
+ // wrap.style.transition = "0.6s";
66
+ text.style.transition = "0.6s";
67
+ div.style.transition = "0.6s";
68
+ overlay.style.transition = "0.6s";
69
+
70
+
71
+ /* if (query.matches){
72
+ div.style.height = "450";
73
+ } */
74
+
75
+
76
+
77
+ div.style.backgroundImage = `url("${this.url}")`;
78
+ div.style.backgroundSize = "cover";
79
+ div.style.backgroundPosition = "center center";
80
+
81
+
82
+
83
+
84
+ if (this.animation === "scale"){
85
+ div.addEventListener("mouseover", (e) => {
86
+ e.stopImmediatePropagation();
87
+ //wrap.style.transform = "scale(1.25)";
88
+ div.style.transform = "scale(1.25)";
89
+ text.style.transform = "scale(1.0)";
90
+ div.style.filter = "blur(1.5px)";
91
+ overlay.style.opacity = "0.45";
92
+ });
93
+
94
+ div.addEventListener("mouseout", (e) => {
95
+ e.stopImmediatePropagation();
96
+ // wrap.style.transform = "scale(1.0)";
97
+ div.style.transform = "scale(1.0)";
98
+ text.style.transform = "scale(0.0)";
99
+ overlay.style.opacity = "0.0";
100
+ div.style.filter = "blur(0px)";
101
+ });
102
+ }
103
+
104
+
105
+
106
+
107
+
108
+ wrap.appendChild(div);
109
+ wrap.appendChild(overlay);
110
+ wrap.appendChild(text);
111
+ this.res = wrap;
112
+
113
+
114
+ return this;
115
+ }
116
+
117
+
118
+ arrayPadding(arr, value) {
119
+ if (arr.includes("left")){
120
+ this.res.style.paddingLeft = value;
121
+ }
122
+
123
+ if (arr.includes("right")){
124
+ this.res.style.paddingRight = value;
125
+ }
126
+
127
+ if (arr.includes("top")){
128
+ this.res.style.paddingTop = value;
129
+ }
130
+
131
+ if (arr.includes("bottom")){
132
+ this.res.style.paddingBottom = value;
133
+ }
134
+
135
+ if (!value){
136
+ this.res.style.paddingBottom = arr;
137
+ }
138
+
139
+
140
+ return this;
141
+ }
142
+
143
+
144
+
145
+ arrayMargin(arr, value) {
146
+ if (arr.includes("left")){
147
+ this.res.style.marginLeft = value;
148
+ }
149
+
150
+ if (arr.includes("right")){
151
+ this.res.style.marginRight = value;
152
+ }
153
+
154
+ if (arr.includes("top")){
155
+ this.res.style.marginTop = value;
156
+ }
157
+
158
+ if (arr.includes("bottom")){
159
+ this.res.style.marginBottom = value;
160
+ }
161
+
162
+ if (!value){
163
+ this.res.style.margin = arr;
164
+ }
165
+
166
+
167
+ return this;
168
+ }
169
+
170
+ onTap(e) {
171
+ this.res.addEventListener("click", e);
172
+ return this;
173
+ }
174
+
175
+
176
+ grayscale(amount){
177
+ if (amount){
178
+ this.res.style.filter = `grayscale(${amount})`;
179
+ } else {
180
+ this.res.style.filter = "grayscale(100%)";
181
+ }
182
+
183
+ return this;
184
+ }
185
+
186
+ sepia(amount){
187
+ if (amount){
188
+ this.res.style.filter = `sepia(${amount})`;
189
+ } else {
190
+ this.res.style.filter = "sepia(100%)";
191
+ }
192
+
193
+ return this;
194
+ }
195
+
196
+
197
+ render(el) {
198
+ if (el) {
199
+ document.querySelector(el).appendChild(this.res);
200
+ } else {
201
+ return this.res;
202
+ }
203
+ }
204
+ }
205
+
206
+
207
+
208
+
209
+ export { AspectImage };
@@ -0,0 +1,154 @@
1
+ import {Animator} from "./animator.js";
2
+
3
+
4
+
5
+ // 1st internal class
6
+ class DropdownOld extends Animator { // 232811
7
+ constructor(items, title){
8
+ super();
9
+ this.setup(items, title);
10
+ this.adjustSubmenu();
11
+ window.addEventListener("resize", () => {
12
+ this.adjustSubmenu();
13
+
14
+ });
15
+
16
+
17
+
18
+ }
19
+
20
+ adjustSubmenu = () => {
21
+
22
+
23
+ if (window.matchMedia("(max-width: 600px").matches){
24
+ //alert("K")
25
+ console.log("TORELATIVE");
26
+ this.res.children[1].style.position = "relative";
27
+
28
+ } else {
29
+ console.log("TOABSOLUTE");
30
+ this.res.children[1].style.position = "absolute"; // WOW !!!
31
+ }
32
+ }
33
+
34
+ setup(items, title) {
35
+ let el = document.createElement("div");
36
+ el.style.display = "flex";
37
+
38
+ let span = document.createElement("span");
39
+ let nodes = document.createTextNode(title);
40
+ span.appendChild(nodes);
41
+ el.appendChild(span);
42
+
43
+ let content = document.createElement("div");
44
+ content.style.width = "200px";
45
+ content.style.marginTop = "30px"
46
+ //content.style.right = "initial"; // was 0 to fit 175642
47
+ // content.style.left = "auto"
48
+ content.style.background = "white";
49
+ content.style.padding = "0.4rem";
50
+ content.style.borderRadius = "0.4rem";
51
+
52
+
53
+
54
+ content.style.display = "none" //"none";
55
+ content.style.flexDirection = "column";
56
+ content.style.position = "absolute"; // WOW !!!
57
+
58
+
59
+
60
+
61
+ /*
62
+ var rect = dropDownDiv.getBoundingClientRect();
63
+ if (rect.x + rect.width > window.innerWidth){
64
+ // top: 0;
65
+ // left: "auto";
66
+ }*/
67
+
68
+
69
+
70
+
71
+ /*let covid = document.querySelector("#covid");
72
+ if (covid.style.flexDirection === "column"){
73
+ content.style.position = "relative"; // WOW !!!
74
+ }*/
75
+
76
+ if (window.matchMedia("(max-width: 70em").matches){
77
+ //alert("K")
78
+ content.style.position = "relative";
79
+ //content.style.right = 0; // was 0 to fit 175642
80
+ content.style.left = "initial";
81
+
82
+ el.style.display = "flex";
83
+ el.style.flexDirection = "column";
84
+ el.style.alignItems = "center";
85
+
86
+ } else {
87
+ //content.style.right = 6; // was 0 to fit 175642
88
+ content.style.left = "auto";
89
+ content.style.position = "absolute"; // WOW !!!
90
+ }
91
+
92
+
93
+
94
+ for (var i = 0; i < items.length;i++){
95
+ /*let contentP = document.createElement("p");
96
+ contentP.style.whiteSpace = "normal"; // 234855
97
+ contentP.style.background = "green";
98
+ //contentP.style.maxWidth = `50px`;
99
+ contentP.style.wordBreak = "break-all"
100
+ let nodesa = document.createTextNode(items[i].name);
101
+ contentP.appendChild(nodesa);
102
+ content.appendChild(contentP);*/
103
+
104
+ let link = new Link(items[i].name,items[i].url).toBlock().render();
105
+ link.style.textAlign = "left";
106
+ // link.style.backgroundColor = "green";
107
+ link.style.wordBreak = "break-all"
108
+ content.appendChild(link);
109
+
110
+ }
111
+
112
+ el.appendChild(content);
113
+
114
+
115
+
116
+
117
+
118
+
119
+ this.res = el;
120
+ this.behavior();
121
+ }
122
+
123
+ behavior(){
124
+ this.res.addEventListener("mouseover", () => {
125
+
126
+ this.res.children[1].style.display = "flex";
127
+
128
+ const rect = this.res.children[1].getBoundingClientRect()
129
+ if (rect.x + rect.width > window.innerWidth){ // WOW !!!
130
+ // 22:14:26 28/07/22 WOW HAPPY NOW !!!
131
+ this.res.children[1].style.right = 0;
132
+ this.res.children[1].style.left = "initial";
133
+ }
134
+ });
135
+
136
+ this.res.children[1].addEventListener("mouseout", () => {
137
+ this.res.children[1].style.display = "none";
138
+ });
139
+ }
140
+
141
+
142
+ items(arr){
143
+
144
+ }
145
+
146
+
147
+ render(){
148
+ return this.res; // only internaly
149
+ }
150
+
151
+
152
+
153
+ }
154
+ export { DropdownOld };