nodality 1.0.0-beta.7 → 1.0.0-beta.71

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 (278) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +108 -0
  3. package/dist/animator.cjs.js +2 -1
  4. package/dist/animator.cjs.js.LICENSE.txt +5 -0
  5. package/dist/animator.esm.js +2 -1
  6. package/dist/animator.esm.js.LICENSE.txt +5 -0
  7. package/dist/appleanim.cjs.js +2 -0
  8. package/dist/appleanim.cjs.js.LICENSE.txt +5 -0
  9. package/dist/appleanim.esm.js +2 -0
  10. package/dist/appleanim.esm.js.LICENSE.txt +5 -0
  11. package/dist/audionew.cjs.js +2 -1
  12. package/dist/audionew.cjs.js.LICENSE.txt +5 -0
  13. package/dist/audionew.esm.js +2 -1
  14. package/dist/audionew.esm.js.LICENSE.txt +5 -0
  15. package/dist/base.cjs.js +2 -1
  16. package/dist/base.cjs.js.LICENSE.txt +5 -0
  17. package/dist/base.esm.js +2 -1
  18. package/dist/base.esm.js.LICENSE.txt +5 -0
  19. package/dist/betaDesktopBar.esm.js +2 -1
  20. package/dist/betaDesktopBar.esm.js.LICENSE.txt +5 -0
  21. package/dist/betaMobileBar.esm.js +2 -1
  22. package/dist/betaMobileBar.esm.js.LICENSE.txt +5 -0
  23. package/dist/bundle.umd.js +2 -1
  24. package/dist/bundle.umd.js.LICENSE.txt +5 -0
  25. package/dist/button.cjs.js +2 -1
  26. package/dist/button.cjs.js.LICENSE.txt +5 -0
  27. package/dist/button.esm.js +2 -1
  28. package/dist/button.esm.js.LICENSE.txt +5 -0
  29. package/dist/cardGetter.cjs.js +2 -1
  30. package/dist/cardGetter.cjs.js.LICENSE.txt +5 -0
  31. package/dist/cardGetter.esm.js +2 -1
  32. package/dist/cardGetter.esm.js.LICENSE.txt +5 -0
  33. package/dist/center.cjs.js +2 -1
  34. package/dist/center.cjs.js.LICENSE.txt +5 -0
  35. package/dist/center.esm.js +2 -1
  36. package/dist/center.esm.js.LICENSE.txt +5 -0
  37. package/dist/checkbox.cjs.js +2 -1
  38. package/dist/checkbox.cjs.js.LICENSE.txt +5 -0
  39. package/dist/checkbox.esm.js +2 -1
  40. package/dist/checkbox.esm.js.LICENSE.txt +5 -0
  41. package/dist/code.cjs.js +2 -1
  42. package/dist/code.cjs.js.LICENSE.txt +5 -0
  43. package/dist/code.esm.js +2 -1
  44. package/dist/code.esm.js.LICENSE.txt +5 -0
  45. package/dist/container.cjs.js +2 -1
  46. package/dist/container.cjs.js.LICENSE.txt +5 -0
  47. package/dist/container.esm.js +2 -1
  48. package/dist/container.esm.js.LICENSE.txt +5 -0
  49. package/dist/datalist.cjs.js +2 -1
  50. package/dist/datalist.cjs.js.LICENSE.txt +5 -0
  51. package/dist/datalist.esm.js +2 -1
  52. package/dist/datalist.esm.js.LICENSE.txt +5 -0
  53. package/dist/designer.cjs.js +2 -1
  54. package/dist/designer.cjs.js.LICENSE.txt +5 -0
  55. package/dist/designer.esm.js +2 -1
  56. package/dist/designer.esm.js.LICENSE.txt +5 -0
  57. package/dist/dropdown.cjs.js +2 -1
  58. package/dist/dropdown.cjs.js.LICENSE.txt +5 -0
  59. package/dist/dropdown.esm.js +2 -1
  60. package/dist/dropdown.esm.js.LICENSE.txt +5 -0
  61. package/dist/elementMapper.cjs.js +2 -1
  62. package/dist/elementMapper.cjs.js.LICENSE.txt +5 -0
  63. package/dist/elementMapper.esm.js +2 -1
  64. package/dist/elementMapper.esm.js.LICENSE.txt +5 -0
  65. package/dist/finalresult.esm.js +2 -1
  66. package/dist/finalresult.esm.js.LICENSE.txt +5 -0
  67. package/dist/flexCard.cjs.js +2 -1
  68. package/dist/flexCard.cjs.js.LICENSE.txt +5 -0
  69. package/dist/flexCard.esm.js +2 -1
  70. package/dist/flexCard.esm.js.LICENSE.txt +5 -0
  71. package/dist/flexGrid.cjs.js +2 -1
  72. package/dist/flexGrid.cjs.js.LICENSE.txt +5 -0
  73. package/dist/flexGrid.esm.js +2 -1
  74. package/dist/flexGrid.esm.js.LICENSE.txt +5 -0
  75. package/dist/flexRow.cjs.js +2 -1
  76. package/dist/flexRow.cjs.js.LICENSE.txt +5 -0
  77. package/dist/flexRow.esm.js +2 -1
  78. package/dist/flexRow.esm.js.LICENSE.txt +5 -0
  79. package/dist/floatingInput.cjs.js +2 -1
  80. package/dist/floatingInput.cjs.js.LICENSE.txt +5 -0
  81. package/dist/floatingInput.esm.js +2 -1
  82. package/dist/floatingInput.esm.js.LICENSE.txt +5 -0
  83. package/dist/free.cjs.js +2 -1
  84. package/dist/free.cjs.js.LICENSE.txt +5 -0
  85. package/dist/free.esm.js +2 -1
  86. package/dist/free.esm.js.LICENSE.txt +5 -0
  87. package/dist/horizontalScroller.esm.js +2 -1
  88. package/dist/horizontalScroller.esm.js.LICENSE.txt +5 -0
  89. package/dist/image.cjs.js +2 -1
  90. package/dist/image.cjs.js.LICENSE.txt +5 -0
  91. package/dist/image.esm.js +2 -1
  92. package/dist/image.esm.js.LICENSE.txt +5 -0
  93. package/dist/imagePicker.cjs.js +2 -1
  94. package/dist/imagePicker.cjs.js.LICENSE.txt +5 -0
  95. package/dist/imagePicker.esm.js +2 -1
  96. package/dist/imagePicker.esm.js.LICENSE.txt +5 -0
  97. package/dist/index.cjs.js +2 -1
  98. package/dist/index.cjs.js.LICENSE.txt +5 -0
  99. package/dist/index.esm.js +2 -1
  100. package/dist/index.esm.js.LICENSE.txt +5 -0
  101. package/dist/link.cjs.js +2 -1
  102. package/dist/link.cjs.js.LICENSE.txt +5 -0
  103. package/dist/link.esm.js +2 -1
  104. package/dist/link.esm.js.LICENSE.txt +5 -0
  105. package/dist/linkGetter.cjs.js +2 -1
  106. package/dist/linkGetter.cjs.js.LICENSE.txt +5 -0
  107. package/dist/linkGetter.esm.js +2 -1
  108. package/dist/linkGetter.esm.js.LICENSE.txt +5 -0
  109. package/dist/metaAdder.cjs.js +2 -1
  110. package/dist/metaAdder.cjs.js.LICENSE.txt +5 -0
  111. package/dist/metaAdder.esm.js +2 -1
  112. package/dist/metaAdder.esm.js.LICENSE.txt +5 -0
  113. package/dist/modal2025.cjs.js +2 -1
  114. package/dist/modal2025.cjs.js.LICENSE.txt +5 -0
  115. package/dist/modal2025.esm.js +2 -1
  116. package/dist/modal2025.esm.js.LICENSE.txt +5 -0
  117. package/dist/multiswitchers.esm.js +2 -1
  118. package/dist/multiswitchers.esm.js.LICENSE.txt +5 -0
  119. package/dist/newNavBar.cjs.js +2 -1
  120. package/dist/newNavBar.cjs.js.LICENSE.txt +5 -0
  121. package/dist/newNavBar.esm.js +2 -1
  122. package/dist/newNavBar.esm.js.LICENSE.txt +5 -0
  123. package/dist/picker.cjs.js +2 -1
  124. package/dist/picker.cjs.js.LICENSE.txt +5 -0
  125. package/dist/picker.esm.js +2 -1
  126. package/dist/picker.esm.js.LICENSE.txt +5 -0
  127. package/dist/progress.cjs.js +2 -1
  128. package/dist/progress.cjs.js.LICENSE.txt +5 -0
  129. package/dist/progress.esm.js +2 -1
  130. package/dist/progress.esm.js.LICENSE.txt +5 -0
  131. package/dist/radio.cjs.js +2 -1
  132. package/dist/radio.cjs.js.LICENSE.txt +5 -0
  133. package/dist/radio.esm.js +2 -1
  134. package/dist/radio.esm.js.LICENSE.txt +5 -0
  135. package/dist/range.cjs.js +2 -1
  136. package/dist/range.cjs.js.LICENSE.txt +5 -0
  137. package/dist/range.esm.js +2 -1
  138. package/dist/range.esm.js.LICENSE.txt +5 -0
  139. package/dist/scrollvideo.cjs.js +2 -0
  140. package/dist/scrollvideo.cjs.js.LICENSE.txt +5 -0
  141. package/dist/scrollvideo.esm.js +2 -0
  142. package/dist/scrollvideo.esm.js.LICENSE.txt +5 -0
  143. package/dist/sideBar.cjs.js +2 -1
  144. package/dist/sideBar.cjs.js.LICENSE.txt +5 -0
  145. package/dist/sideBar.esm.js +2 -1
  146. package/dist/sideBar.esm.js.LICENSE.txt +5 -0
  147. package/dist/sideNavBar.cjs.js +2 -1
  148. package/dist/sideNavBar.cjs.js.LICENSE.txt +5 -0
  149. package/dist/sideNavBar.esm.js +2 -1
  150. package/dist/sideNavBar.esm.js.LICENSE.txt +5 -0
  151. package/dist/simpleBar.cjs.js +2 -1
  152. package/dist/simpleBar.cjs.js.LICENSE.txt +5 -0
  153. package/dist/simpleBar.esm.js +2 -1
  154. package/dist/simpleBar.esm.js.LICENSE.txt +5 -0
  155. package/dist/stack.cjs.js +2 -1
  156. package/dist/stack.cjs.js.LICENSE.txt +5 -0
  157. package/dist/stack.esm.js +2 -1
  158. package/dist/stack.esm.js.LICENSE.txt +5 -0
  159. package/dist/stacker.cjs.js +2 -0
  160. package/dist/stacker.cjs.js.LICENSE.txt +5 -0
  161. package/dist/stacker.esm.js +2 -0
  162. package/dist/stacker.esm.js.LICENSE.txt +5 -0
  163. package/dist/table.cjs.js +2 -1
  164. package/dist/table.cjs.js.LICENSE.txt +5 -0
  165. package/dist/table.esm.js +2 -1
  166. package/dist/table.esm.js.LICENSE.txt +5 -0
  167. package/dist/text.cjs.js +2 -1
  168. package/dist/text.cjs.js.LICENSE.txt +5 -0
  169. package/dist/text.esm.js +2 -1
  170. package/dist/text.esm.js.LICENSE.txt +5 -0
  171. package/dist/textField.cjs.js +2 -1
  172. package/dist/textField.cjs.js.LICENSE.txt +5 -0
  173. package/dist/textField.esm.js +2 -1
  174. package/dist/textField.esm.js.LICENSE.txt +5 -0
  175. package/dist/transformanim.cjs.js +2 -0
  176. package/dist/transformanim.cjs.js.LICENSE.txt +5 -0
  177. package/dist/transformanim.esm.js +2 -0
  178. package/dist/transformanim.esm.js.LICENSE.txt +5 -0
  179. package/dist/wrap.cjs.js +2 -1
  180. package/dist/wrap.cjs.js.LICENSE.txt +5 -0
  181. package/dist/wrap.esm.js +2 -1
  182. package/dist/wrap.esm.js.LICENSE.txt +5 -0
  183. package/dist/zoomCard.cjs.js +2 -1
  184. package/dist/zoomCard.cjs.js.LICENSE.txt +5 -0
  185. package/dist/zoomCard.esm.js +2 -1
  186. package/dist/zoomCard.esm.js.LICENSE.txt +5 -0
  187. package/layout/DEPRECATED-PARAGRAPH.js +6 -0
  188. package/layout/animator.js +5 -2
  189. package/layout/audio.js +6 -0
  190. package/layout/audionew.js +6 -0
  191. package/layout/base-2.js +6 -0
  192. package/layout/base.js +6 -0
  193. package/layout/betaDesktopBar.js +6 -0
  194. package/layout/betaMobileBar.js +6 -0
  195. package/layout/box.js +6 -0
  196. package/layout/button.js +6 -0
  197. package/layout/cards.js +6 -0
  198. package/layout/center.js +6 -0
  199. package/layout/checkbox.js +6 -0
  200. package/layout/cleanRow.js +6 -0
  201. package/layout/code.js +6 -0
  202. package/layout/container.js +6 -0
  203. package/layout/custom.js +6 -0
  204. package/layout/divImage.js +6 -0
  205. package/layout/dropdown.js +6 -0
  206. package/layout/dropdown2025.js +6 -0
  207. package/layout/emptyElement.js +6 -0
  208. package/layout/externalStylesheet.js +6 -0
  209. package/layout/flexCard.js +6 -0
  210. package/layout/flexGrid.js +6 -0
  211. package/layout/flexrow.js +6 -0
  212. package/layout/footer.js +6 -0
  213. package/layout/formComponents/custom.js +6 -0
  214. package/layout/formComponents/dataList.js +6 -0
  215. package/layout/formComponents/floatingInput.js +5 -0
  216. package/layout/formComponents/form-all.js +6 -0
  217. package/layout/formComponents/form.js +5 -0
  218. package/layout/formComponents/imagePicker.js +6 -0
  219. package/layout/formComponents/picker.js +6 -0
  220. package/layout/formComponents/radio.js +6 -0
  221. package/layout/formComponents/radiogroup.js +6 -0
  222. package/layout/formComponents/range.js +6 -0
  223. package/layout/free.js +6 -0
  224. package/layout/grid-new.js +6 -0
  225. package/layout/grid.js +6 -0
  226. package/layout/gridSwitcher.js +6 -0
  227. package/layout/group.js +6 -0
  228. package/layout/header.js +6 -0
  229. package/layout/horizontalScroller.js +6 -0
  230. package/layout/image-old.js +6 -0
  231. package/layout/image.js +6 -0
  232. package/layout/index.js +22 -0
  233. package/layout/label.js +6 -0
  234. package/layout/link.js +6 -0
  235. package/layout/list-OLD.js +6 -0
  236. package/layout/list.js +6 -0
  237. package/layout/metaAdder.js +6 -0
  238. package/layout/modal2025.js +6 -0
  239. package/layout/modernwrap.js +6 -0
  240. package/layout/multiswitcher.js +6 -0
  241. package/layout/multiswitcherBeta.js +6 -0
  242. package/layout/navBar-OLD.js +6 -0
  243. package/layout/navBar.js +6 -0
  244. package/layout/navFactor/customDiv.js +5 -1
  245. package/layout/newFlatAdder.js +6 -0
  246. package/layout/newNavBar copy 2.js +6 -0
  247. package/layout/newNavBar copy.js +6 -0
  248. package/layout/newNavBar.js +6 -0
  249. package/layout/offsetContainer.js +6 -0
  250. package/layout/progress.js +6 -0
  251. package/layout/row.js +6 -0
  252. package/layout/savedNewNavBar.js +6 -0
  253. package/layout/scrollvideo.js +6 -0
  254. package/layout/sideBar.js +6 -0
  255. package/layout/sideNavBar.js +6 -0
  256. package/layout/simpleBar.js +6 -0
  257. package/layout/slider2025.js +6 -0
  258. package/layout/spacer.js +6 -0
  259. package/layout/stack.js +6 -0
  260. package/layout/styler.js +6 -0
  261. package/layout/switcher.js +6 -0
  262. package/layout/table.js +6 -0
  263. package/layout/text.js +9 -1
  264. package/layout/textField.js +6 -0
  265. package/layout/ulist.js +6 -0
  266. package/layout/video.js +6 -0
  267. package/layout/withoutNew.js +6 -0
  268. package/layout/wrap.js +6 -0
  269. package/layout/zoomCard.js +6 -0
  270. package/lib/AppleAnim.js +794 -0
  271. package/lib/Stacker.js +40 -0
  272. package/lib/TransformAnim.js +517 -0
  273. package/lib/cardGetter.js +6 -0
  274. package/lib/designer.js +217 -14
  275. package/lib/elementMapper.js +15 -8
  276. package/lib/linkGetter.js +6 -0
  277. package/lib/scrollvideo.js +129 -0
  278. package/package.json +23 -4
package/lib/Stacker.js ADDED
@@ -0,0 +1,40 @@
1
+ /*!
2
+ * nodality v1.0.0-beta.71
3
+ * (c) 2025 Filip Vabrousek
4
+ * License: MIT
5
+ */
6
+
7
+ class Stacker {
8
+ constructor(){
9
+ this.res = document.createElement("div");
10
+ this.res.style.display = "flex";
11
+ this.res.style.flexDirection = "column";
12
+ }
13
+
14
+ add(items){
15
+ for (var i = 0; i < items.length; i++){
16
+ let item = items[i].render();
17
+
18
+ if (i === 0){ // if KeyframeAnima and then transformAnim apply this condition
19
+ // Keep this in stacker for now
20
+ item.style.zIndex = 1; // important
21
+ }
22
+
23
+ this.res.appendChild(item);
24
+ }
25
+
26
+ return this;
27
+ }
28
+
29
+ render(div){
30
+ if (div){
31
+ document.querySelector(div).appendChild(this.res);
32
+ } else {
33
+ return this.res;
34
+ }
35
+ // document.body.appendChild(this.res);
36
+ }
37
+ }
38
+
39
+
40
+ export {Stacker};
@@ -0,0 +1,517 @@
1
+ /*!
2
+ * nodality v1.0.0-beta.71
3
+ * (c) 2025 Filip Vabrousek
4
+ * License: MIT
5
+ */
6
+
7
+ function convertRange(value, oldRange, newRange) {
8
+ let val = ((value - oldRange.min) * (newRange.max - newRange.min)) / (oldRange.max - oldRange.min) + newRange.min;
9
+
10
+ if (val > 1) {
11
+ val = 2 - val;
12
+ }
13
+
14
+ return val;
15
+ }
16
+
17
+ class TransformAnim { // 133506
18
+ constructor(data) {
19
+ this.data = data;
20
+ this.targetHeight = this.data.targetHeight;
21
+ if (this.data.type === undefined) {
22
+ this.type = "default";
23
+ } else {
24
+ this.type = this.data.type;
25
+ }
26
+
27
+ // this.id = this.data.identifiers.wrapDIV;
28
+ this.layout = "flex";
29
+ this.setup();
30
+ }
31
+
32
+ toCode(){
33
+ return [""];
34
+ }
35
+ set(obj){
36
+ console.log("WHY NOT 900")
37
+ // alert(this.res.style.height);
38
+ obj.arrayPadding && (this.wrdiv.style.marginTop = obj.arrayPadding.value /*this.res.style.height*/);
39
+ obj.height && (this.wrdiv.style.height = obj.height);
40
+ return this;
41
+ }
42
+
43
+ setup() {
44
+ // this.fireDist = this.data.fireDist;
45
+
46
+ // I need two
47
+ let wrapDiv = document.createElement("div");
48
+ this.wrdiv = wrapDiv;
49
+ wrapDiv.style.display = "flex";
50
+ wrapDiv.style.flexDirection = "column";
51
+
52
+ if (this.data.overflow){
53
+ wrapDiv.style.overflow = "hidden";
54
+ }
55
+
56
+ // wrapDiv.setAttribute("id", this.data.identifiers.wrapDIV);
57
+ wrapDiv.style.display = "flex";
58
+ wrapDiv.style.justifyContent = "center";
59
+ wrapDiv.style.alignItems = "center";
60
+ wrapDiv.style.background = "orange";
61
+ // wrapDiv.style.height = "100vh"; // Keep this
62
+ wrapDiv.style.height = "900px"; // same as paddingTop
63
+
64
+
65
+ if (!this.data.sticky) {
66
+
67
+ wrapDiv.style.position = "fixed";
68
+ }
69
+
70
+ wrapDiv.style.marginTop = "0px";
71
+
72
+
73
+
74
+
75
+ let img = document.createElement("img");
76
+ img.style.gridArea = "1/1";
77
+ img.style.display = "none";
78
+ img.style.width = "50%";
79
+ img.setAttribute("src", "M2.jpeg");
80
+ img.setAttribute("class", "m2");
81
+ // img.setAttribute("id", this.data.identifiers.imageID);
82
+ // img.style.transform = `scale(1.5)`;
83
+ wrapDiv.appendChild(img);
84
+
85
+
86
+ if (this.data.view){
87
+ // wrapDiv.appendChild(this.data.view.render());
88
+
89
+ this.m2img = this.data.view.render();
90
+ wrapDiv.appendChild(this.m2img);
91
+
92
+ }
93
+
94
+ if (this.data.paragraph){
95
+ this.paragraph = this.data.paragraph.render();
96
+ wrapDiv.appendChild(this.paragraph);
97
+ }
98
+
99
+ if (this.data.view){
100
+ img.style.display = "none";
101
+ // img.style.opacity = 0;
102
+ }
103
+
104
+ let h2 = document.createElement("h2");
105
+ // h2.setAttribute("id", this.data.identifiers.headerID);
106
+ // h2.setAttribute("id", "header");
107
+ h2.style.fontFamily = "Arial";
108
+ h2.style.fontSize = "2.4rem";
109
+ h2.style.background = "linear-gradient(#3498db, #1abc9c)";
110
+ h2.style.webkitBackgroundClip = "text";
111
+ h2.style.webkitTextFillColor = "transparent"; // 222318
112
+
113
+ let node = document.createTextNode("Supercharged");
114
+ h2.appendChild(node);
115
+
116
+ if (this.data.showTitle === true || this.data.showTitle === undefined){
117
+
118
+ if (this.data.content && this.data.content.render){
119
+ wrapDiv.appendChild(this.data.content.render());
120
+ } else {
121
+ wrapDiv.appendChild(h2);
122
+ }
123
+ // wrapDiv.appendChild(h2);
124
+ }
125
+
126
+
127
+ let p = document.createElement("p");
128
+ let pn = document.createTextNode("Hello");
129
+ // p.appendChild(pn);
130
+
131
+
132
+
133
+ wrapDiv.appendChild(p);
134
+
135
+ this.res = wrapDiv;
136
+
137
+ window.addEventListener("scroll", (e) => this.resize(wrapDiv, img, h2));
138
+ this.resize(wrapDiv, img, h2);
139
+ }
140
+
141
+ setStickyData(obj){
142
+ this.data.stickyData = obj;
143
+ return this;
144
+ }
145
+
146
+
147
+ toAuto(){
148
+ // M3 Max won't fit no 100vh
149
+ this.res.style.height = "auto";
150
+ return this;
151
+ }
152
+
153
+
154
+ stick(obj){
155
+ if (!obj){
156
+ this.makeSticky();
157
+ return this;
158
+ }
159
+
160
+
161
+ if (obj.offset){
162
+ if (this.data.stickyData != undefined){
163
+ // alert(topOffset);
164
+ this.data.stickyData.top = obj.offset;
165
+
166
+ } else {
167
+ this.data.stickyData = {top: obj.offset};
168
+ this.fixedToRelative(true); // inner method
169
+
170
+ }
171
+ }
172
+
173
+ if (obj.value){
174
+ this.makeSticky();
175
+ } else {
176
+ this.noSticky();
177
+ }
178
+
179
+ return this;
180
+ }
181
+
182
+ makeSticky(){
183
+ this.wrdiv.style.position = "sticky";
184
+ this.wrdiv.style.top = 0;
185
+
186
+ // 22:23:18 Yes!!!
187
+ // 22:23:39 mobile
188
+ //this.wrdiv.style.marginTop = "800px";
189
+ return this;
190
+ }
191
+
192
+
193
+ setProps(obj){
194
+
195
+ if (obj.targetHeight){
196
+ this.data.targetHeight = obj.targetHeight;
197
+ }
198
+
199
+
200
+ if (obj.flagValue){
201
+ this.data.flagValue = obj.flagValue;
202
+ }
203
+
204
+ return this;
205
+ /* targetHeight: 600,
206
+ flagValue: 3700,*/
207
+ }
208
+
209
+
210
+ noSticky(){
211
+ // this.wrdiv.style.display = "none";
212
+ // this.wrdiv.style.filter = "grayscale(1)";
213
+ this.wrdiv.style.position = "";
214
+ return this;
215
+ }
216
+
217
+ toSticky(){
218
+ this.wrdiv.style.position = "sticky";
219
+ this.wrdiv.style.top = "0";
220
+ return this;
221
+ }
222
+
223
+ toOpacity(opacity){
224
+ this.res.style.opacity = `${opacity}`;
225
+ }
226
+
227
+ setUncomment(value){
228
+ this.data.uncomment = value;
229
+ }
230
+
231
+ fixedToRelative(value){
232
+ this.data.uncomment = value;
233
+ return this;
234
+ }
235
+
236
+
237
+
238
+
239
+
240
+
241
+
242
+ mask(data){
243
+ window.addEventListener("scroll", () => {
244
+ this.innerMask(data);
245
+ });
246
+
247
+ return this;
248
+ }
249
+
250
+ innerMask(data){
251
+ if (data){
252
+
253
+ let smart = smartRange(window.scrollY, {min: data.start, max: data.end}, {min: 7, max: 0}) // The other way
254
+ console.warn(smart);
255
+ console.warn(window.scrollY);
256
+ // this.res.style.opacity = 0.7;
257
+
258
+
259
+ // let smart = smartRange(window.scrollY, { min: data.start, max: data.end }, { min: 0, max: 7 }) // The other way
260
+ let radius = smartRange(window.scrollY, { min: data.start, max: data.end }, { min: 37, max: 37 }) // both are 20 to stay round
261
+ // this.res.style.clipPath = `inset(${smart}% ${smart}% round ${radius}px ${radius}px 0 0)`;
262
+
263
+
264
+
265
+
266
+ // this.res.style.clipPath = `inset(${smart}% ${smart}% round 20px)`;
267
+ // console.log(`SMART: ${smart}`);
268
+ // console.log(this.textOpacity);
269
+
270
+
271
+
272
+
273
+ // this.res.style.backgroundColor = "orange";
274
+
275
+ /* if (!this.hasH2){
276
+ let grayBack = document.createElement("div");
277
+ grayBack.style.background = "#ecf0f1";
278
+ grayBack.style.width = "86%";
279
+ grayBack.style.marginLeft = "7%";
280
+ grayBack.style.borderRadius = "1rem";
281
+
282
+ this.hasH2 = true;
283
+ grayBack.appendChild(this.data.newSection.render());
284
+ rem.parentElement.appendChild(grayBack);
285
+ }*/
286
+ }
287
+
288
+
289
+ return this;
290
+ }
291
+
292
+ setScale(obj){
293
+ //alert("///")
294
+ /*
295
+ range: {
296
+ min: 0,
297
+ max: 750,
298
+ scaleMin: 0.67,
299
+ scaleMax: 2.4
300
+ },
301
+ */
302
+
303
+ // alert("J");
304
+ this.data.range = obj;
305
+
306
+ this.m2img.style.transform = `scale(${this.data.range.scaleMax})`;
307
+
308
+ window.addEventListener("scroll", () => {
309
+ let resa = smartRange(window.scrollY, {
310
+ min: this.data.range.min,
311
+ max: this.data.range.max // has to be switched
312
+ }, {
313
+ min: this.data.range.scaleMax,
314
+ max: this.data.range.scaleMin
315
+ });
316
+
317
+ if (this.m2img != undefined) {
318
+ this.m2img.style.transform = `scale(${resa})`;
319
+ }
320
+
321
+ });
322
+
323
+ return this;
324
+
325
+ }
326
+
327
+
328
+
329
+
330
+
331
+ resize(wrapDiv, img, h2){
332
+ let st = window.scrollY || document.documentElement.scrollTop; // Credits: "https://github.com/qeremy/so/blob/master/so.dom.js#L426"
333
+ if (st > this.lastScrollTop) {
334
+ this.isUp = false;
335
+ } else {
336
+ this.isUp = true;
337
+ }
338
+
339
+
340
+ // console.log(window.scrollY);
341
+
342
+
343
+ // let wrapDiv =document.querySelector(`#${this.data.identifiers.wrapDIV}`);
344
+
345
+ // let magicNumber = this.fireDist + 110;
346
+
347
+
348
+ if (!this.data.sticky){
349
+
350
+
351
+ if (this.data.stickyData){
352
+ // console.log(this.data.stickyData.top);
353
+
354
+ const top = this.data.stickyData.top; //800;
355
+
356
+
357
+ // UNCOMMENT HERE
358
+
359
+
360
+
361
+ if (this.data.uncomment) {
362
+ if (window.scrollY > top) { // MAKE THIS ADJUSTABLE
363
+ wrapDiv.style.background = "pink";
364
+ wrapDiv.style.position = "relative";
365
+ wrapDiv.style.top = top; // FIX HERE
366
+ } else {
367
+ wrapDiv.style.background = "orange";
368
+ wrapDiv.style.top = 0;
369
+ wrapDiv.style.position = "fixed";
370
+ }
371
+ }
372
+
373
+
374
+
375
+ }
376
+
377
+
378
+
379
+ } else {
380
+ wrapDiv.style.background = "#fafafa";
381
+ // wrapDiv.style.position = "relative"; UNCOMMENT ???
382
+ // wrapDiv.style.height = "100vh";
383
+ // wrapDiv.style.marginTop = "900px"; // 17:09:46 Nice!!!
384
+ // After Psyche launch
385
+ }
386
+
387
+ // 15:19:50 Nice!!!
388
+
389
+
390
+
391
+ /* if (wrapDiv) {
392
+ if (window.scrollY > this.data.distanceObject.scrollUpper) {
393
+ if (wrapDiv) {
394
+ wrapDiv.style.background = "pink";
395
+ wrapDiv.style.position = "relative";
396
+ wrapDiv.style.top = `${this.data.distanceObject.scrollUpper}px`;
397
+ h2.textContent = "Always";
398
+ }
399
+ } else if (window.scrollY < this.data.distanceObject.scrollUpper && this.isUp) {
400
+ wrapDiv.style.background = "orange";
401
+ wrapDiv.style.top = "0px";
402
+ wrapDiv.style.position = "fixed";
403
+ }
404
+ } */
405
+
406
+
407
+
408
+
409
+ this.lastScrollTop = st <= 0 ? 0 : st; // For Mobile or negative scrolling
410
+
411
+ let hTwo = wrapDiv;
412
+ /* let elHeight = this.data.targetHeight;
413
+ let begin = elHeight - 250;
414
+ let end = elHeight + 250;*/
415
+
416
+ /* let resa = smartRange(window.scrollY, {
417
+ min: this.data.range.min,
418
+ max: this.data.range.max // has to be switched
419
+ }, {
420
+ min: this.data.range.scaleMax,
421
+ max: this.data.range.scaleMin
422
+ });
423
+ */
424
+ let m2img = img;
425
+ let header = h2;
426
+
427
+ this.m2img = img;
428
+
429
+ if (this.data.view){
430
+ m2img = this.m2img;
431
+ }
432
+
433
+
434
+ if (m2img != undefined) {
435
+ // m2img.style.transform = `scale(${resa})`;
436
+ }
437
+
438
+
439
+ let translated = smartRange(window.scrollY, {
440
+ min: 3150,
441
+ max: 3300 // has to be switched
442
+ }, {
443
+ min: 0,
444
+ max: 100
445
+ });
446
+
447
+ let translateScale = smartRange(window.scrollY, {
448
+ min: 3150,
449
+ max: 3300 // has to be switched
450
+ }, {
451
+ min: 60,
452
+ max: 80
453
+ });
454
+
455
+ let rotateScale = smartRange(window.scrollY, {
456
+ min: 3150,
457
+ max: 3300 // has to be switched
458
+ }, {
459
+ min: 0,
460
+ max: 40
461
+ });
462
+
463
+
464
+
465
+ // console.warn(translateScale);
466
+
467
+
468
+ if (this.data.operation){
469
+ if (this.data.operation.type === "translate"){
470
+ m2img.style.transform = `translate3d(${translated}%, ${translated / 2}%, 0px) scale(${translateScale / 100}) rotate(${rotateScale}deg)`;
471
+ // alert("I")
472
+ }
473
+ }
474
+ }
475
+
476
+
477
+ render(id) {
478
+ if (id) {
479
+ document.querySelector(id).appendChild(this.res);
480
+ } else {
481
+ return this.res;
482
+ }
483
+ }
484
+ }
485
+
486
+
487
+ function smartRange(val, from, to) {
488
+
489
+ if (val < from.min) {
490
+ val = from.min;
491
+ }
492
+
493
+ if (val > from.max) {
494
+ val = from.max;
495
+ }
496
+
497
+ let percent = (val - from.min) / (from.max - from.min);
498
+
499
+ if (from.min > from.max) {
500
+ percent = (val - from.max) / (from.min - from.max);
501
+ }
502
+
503
+ let toRange = (to.min - to.max) * percent - to.min;
504
+ toRange = Math.abs(toRange);
505
+
506
+ if (to.min < to.max) {
507
+ let sm = to.max + Math.abs(to.min);
508
+ let timesPerc = sm * percent;
509
+ toRange = to.min + timesPerc;
510
+ }
511
+
512
+
513
+ return toRange;
514
+ }
515
+
516
+
517
+ export {TransformAnim};
package/lib/cardGetter.js CHANGED
@@ -1,3 +1,9 @@
1
+ /*!
2
+ * nodality v1.0.0-beta.71
3
+ * (c) 2025 Filip Vabrousek
4
+ * License: MIT
5
+ */
6
+
1
7
  class CardGen {
2
8
 
3
9
  static cards(el, cardOption, storage) {