nodality 1.0.0-beta.4 → 1.0.0-beta.41

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