vevet 1.4.27 → 2.0.1-dev.3

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 (360) hide show
  1. package/LICENSE +1 -1
  2. package/README.md +7 -71
  3. package/build/cdn/index.js +12 -0
  4. package/build/cdn/index.js.LICENSE.txt +14 -0
  5. package/build/cjs/app/Application.js +297 -0
  6. package/build/cjs/app/events/PageLoad.js +74 -0
  7. package/build/cjs/app/events/Viewport.js +303 -0
  8. package/build/cjs/base/Callbacks.js +232 -0
  9. package/build/cjs/base/Component.js +56 -0
  10. package/build/cjs/base/Module.js +262 -0
  11. package/build/cjs/base/MutableProp.js +165 -0
  12. package/build/cjs/base/Plugin.js +56 -0
  13. package/build/cjs/components/animation-frame/AnimationFrame.js +183 -0
  14. package/build/cjs/components/canvas/Ctx2D.js +200 -0
  15. package/build/cjs/components/canvas/Ctx2DPrerender.js +72 -0
  16. package/build/cjs/components/cursor/CustomCursor.js +344 -0
  17. package/build/cjs/components/dragger/Dragger.js +229 -0
  18. package/build/cjs/components/dragger/DraggerDirection.js +77 -0
  19. package/build/cjs/components/dragger/DraggerMove.js +84 -0
  20. package/build/cjs/components/loading/Preloader.js +229 -0
  21. package/build/cjs/components/loading/ProgressPreloader.js +377 -0
  22. package/build/cjs/components/page/Page.js +353 -0
  23. package/build/cjs/components/scroll/custom-scroll/CustomScroll.js +517 -0
  24. package/build/cjs/components/scroll/plugins/SmoothScrollDragPlugin.js +178 -0
  25. package/build/cjs/components/scroll/plugins/SmoothScrollKeyboardPlugin.js +138 -0
  26. package/build/cjs/components/scroll/scrollable/ScrollEventsBase.js +133 -0
  27. package/build/cjs/components/scroll/scrollable/ScrollView.js +315 -0
  28. package/build/cjs/components/scroll/scrollbar/Bar.js +315 -0
  29. package/build/cjs/components/scroll/scrollbar/ScrollBar.js +206 -0
  30. package/build/cjs/components/scroll/smooth-scroll/SmoothScroll.js +625 -0
  31. package/build/cjs/components/scroll/types.js +2 -0
  32. package/build/cjs/components/split-text/SplitText.js +233 -0
  33. package/build/cjs/components/text/SplitText.js +329 -0
  34. package/build/cjs/components/timeline/StaticTimeline.js +137 -0
  35. package/build/cjs/components/timeline/Timeline.js +190 -0
  36. package/build/cjs/index.js +87 -0
  37. package/build/cjs/utils/common/index.js +12 -0
  38. package/build/cjs/utils/common/mergeWithoutArrays.js +19 -0
  39. package/build/cjs/utils/common/randID.js +11 -0
  40. package/build/cjs/utils/common/timeoutCallback.js +17 -0
  41. package/build/cjs/utils/errors.js +8 -0
  42. package/build/cjs/utils/listeners/index.js +10 -0
  43. package/build/cjs/utils/listeners/intersectionObserverSupported.js +11 -0
  44. package/build/cjs/utils/listeners/onScroll.js +47 -0
  45. package/build/cjs/utils/math/boundVal.js +16 -0
  46. package/build/cjs/utils/math/index.js +12 -0
  47. package/build/cjs/utils/math/lerp.js +15 -0
  48. package/build/cjs/utils/math/scopeProgress.js +25 -0
  49. package/build/cjs/utils/types/general.js +2 -0
  50. package/build/cjs/utils/types/utility.js +2 -0
  51. package/build/es/app/Application.js +210 -0
  52. package/build/es/app/events/PageLoad.js +47 -0
  53. package/build/es/app/events/Viewport.js +232 -0
  54. package/build/es/base/Callbacks.js +205 -0
  55. package/build/es/base/Component.js +32 -0
  56. package/build/es/base/Module.js +225 -0
  57. package/build/es/base/MutableProp.js +152 -0
  58. package/build/es/base/Plugin.js +31 -0
  59. package/build/es/components/animation-frame/AnimationFrame.js +145 -0
  60. package/build/es/components/canvas/Ctx2D.js +133 -0
  61. package/build/es/components/canvas/Ctx2DPrerender.js +37 -0
  62. package/build/es/components/cursor/CustomCursor.js +274 -0
  63. package/build/es/components/dragger/Dragger.js +175 -0
  64. package/build/es/components/dragger/DraggerDirection.js +42 -0
  65. package/build/es/components/dragger/DraggerMove.js +56 -0
  66. package/build/es/components/loading/Preloader.js +164 -0
  67. package/build/es/components/loading/ProgressPreloader.js +304 -0
  68. package/build/es/components/page/Page.js +283 -0
  69. package/build/es/components/scroll/custom-scroll/CustomScroll.js +486 -0
  70. package/build/es/components/scroll/plugins/SmoothScrollDragPlugin.js +140 -0
  71. package/build/es/components/scroll/plugins/SmoothScrollKeyboardPlugin.js +109 -0
  72. package/build/es/components/scroll/scrollable/ScrollEventsBase.js +79 -0
  73. package/build/es/components/scroll/scrollable/ScrollView.js +264 -0
  74. package/build/es/components/scroll/scrollbar/Bar.js +262 -0
  75. package/build/es/components/scroll/scrollbar/ScrollBar.js +152 -0
  76. package/build/es/components/scroll/smooth-scroll/SmoothScroll.js +519 -0
  77. package/build/es/components/scroll/types.js +1 -0
  78. package/build/es/components/split-text/SplitText.js +199 -0
  79. package/build/es/components/text/SplitText.js +270 -0
  80. package/build/es/components/timeline/StaticTimeline.js +92 -0
  81. package/build/es/components/timeline/Timeline.js +141 -0
  82. package/build/es/index.js +37 -0
  83. package/build/es/utils/common/index.js +4 -0
  84. package/build/es/utils/common/mergeWithoutArrays.js +13 -0
  85. package/build/es/utils/common/randID.js +7 -0
  86. package/build/es/utils/common/timeoutCallback.js +14 -0
  87. package/build/es/utils/errors.js +5 -0
  88. package/build/es/utils/listeners/index.js +3 -0
  89. package/build/es/utils/listeners/intersectionObserverSupported.js +8 -0
  90. package/build/es/utils/listeners/onScroll.js +44 -0
  91. package/build/es/utils/math/boundVal.js +12 -0
  92. package/build/es/utils/math/index.js +4 -0
  93. package/build/es/utils/math/lerp.js +11 -0
  94. package/build/es/utils/math/scopeProgress.js +22 -0
  95. package/build/es/utils/types/general.js +1 -0
  96. package/build/es/utils/types/utility.js +1 -0
  97. package/build/types/app/Application.d.ts +161 -0
  98. package/build/types/app/Application.d.ts.map +1 -0
  99. package/build/types/app/events/PageLoad.d.ts +28 -0
  100. package/build/types/app/events/PageLoad.d.ts.map +1 -0
  101. package/build/types/app/events/Viewport.d.ts +137 -0
  102. package/build/types/app/events/Viewport.d.ts.map +1 -0
  103. package/build/types/base/Callbacks.d.ts +174 -0
  104. package/build/types/base/Callbacks.d.ts.map +1 -0
  105. package/build/types/base/Component.d.ts +48 -0
  106. package/build/types/base/Component.d.ts.map +1 -0
  107. package/build/types/base/Module.d.ts +179 -0
  108. package/build/types/base/Module.d.ts.map +1 -0
  109. package/build/types/base/MutableProp.d.ts +142 -0
  110. package/build/types/base/MutableProp.d.ts.map +1 -0
  111. package/build/types/base/Plugin.d.ts +35 -0
  112. package/build/types/base/Plugin.d.ts.map +1 -0
  113. package/build/types/components/animation-frame/AnimationFrame.d.ts +96 -0
  114. package/build/types/components/animation-frame/AnimationFrame.d.ts.map +1 -0
  115. package/build/types/components/canvas/Ctx2D.d.ts +111 -0
  116. package/build/types/components/canvas/Ctx2D.d.ts.map +1 -0
  117. package/build/types/components/canvas/Ctx2DPrerender.d.ts +41 -0
  118. package/build/types/components/canvas/Ctx2DPrerender.d.ts.map +1 -0
  119. package/build/types/components/cursor/CustomCursor.d.ts +181 -0
  120. package/build/types/components/cursor/CustomCursor.d.ts.map +1 -0
  121. package/build/types/components/dragger/Dragger.d.ts +120 -0
  122. package/build/types/components/dragger/Dragger.d.ts.map +1 -0
  123. package/build/types/components/dragger/DraggerDirection.d.ts +39 -0
  124. package/build/types/components/dragger/DraggerDirection.d.ts.map +1 -0
  125. package/build/types/components/dragger/DraggerMove.d.ts +49 -0
  126. package/build/types/components/dragger/DraggerMove.d.ts.map +1 -0
  127. package/build/types/components/loading/Preloader.d.ts +107 -0
  128. package/build/types/components/loading/Preloader.d.ts.map +1 -0
  129. package/build/types/components/loading/ProgressPreloader.d.ts +166 -0
  130. package/build/types/components/loading/ProgressPreloader.d.ts.map +1 -0
  131. package/build/types/components/page/Page.d.ts +126 -0
  132. package/build/types/components/page/Page.d.ts.map +1 -0
  133. package/build/types/components/scroll/custom-scroll/CustomScroll.d.ts +322 -0
  134. package/build/types/components/scroll/custom-scroll/CustomScroll.d.ts.map +1 -0
  135. package/build/types/components/scroll/plugins/SmoothScrollDragPlugin.d.ts +97 -0
  136. package/build/types/components/scroll/plugins/SmoothScrollDragPlugin.d.ts.map +1 -0
  137. package/build/types/components/scroll/plugins/SmoothScrollKeyboardPlugin.d.ts +34 -0
  138. package/build/types/components/scroll/plugins/SmoothScrollKeyboardPlugin.d.ts.map +1 -0
  139. package/build/types/components/scroll/scrollable/ScrollEventsBase.d.ts +60 -0
  140. package/build/types/components/scroll/scrollable/ScrollEventsBase.d.ts.map +1 -0
  141. package/build/types/components/scroll/scrollable/ScrollView.d.ts +140 -0
  142. package/build/types/components/scroll/scrollable/ScrollView.d.ts.map +1 -0
  143. package/build/types/components/scroll/scrollbar/Bar.d.ts +84 -0
  144. package/build/types/components/scroll/scrollbar/Bar.d.ts.map +1 -0
  145. package/build/types/components/scroll/scrollbar/ScrollBar.d.ts +109 -0
  146. package/build/types/components/scroll/scrollbar/ScrollBar.d.ts.map +1 -0
  147. package/build/types/components/scroll/smooth-scroll/SmoothScroll.d.ts +307 -0
  148. package/build/types/components/scroll/smooth-scroll/SmoothScroll.d.ts.map +1 -0
  149. package/build/types/components/scroll/types.d.ts +11 -0
  150. package/build/types/components/scroll/types.d.ts.map +1 -0
  151. package/build/types/components/split-text/SplitText.d.ts +118 -0
  152. package/build/types/components/split-text/SplitText.d.ts.map +1 -0
  153. package/build/types/components/text/SplitText.d.ts +118 -0
  154. package/build/types/components/text/SplitText.d.ts.map +1 -0
  155. package/build/types/components/timeline/StaticTimeline.d.ts +92 -0
  156. package/build/types/components/timeline/StaticTimeline.d.ts.map +1 -0
  157. package/build/types/components/timeline/Timeline.d.ts +101 -0
  158. package/build/types/components/timeline/Timeline.d.ts.map +1 -0
  159. package/build/types/index.d.ts +38 -0
  160. package/build/types/index.d.ts.map +1 -0
  161. package/build/types/utils/common/index.d.ts +5 -0
  162. package/build/types/utils/common/index.d.ts.map +1 -0
  163. package/build/types/utils/common/mergeWithoutArrays.d.ts +6 -0
  164. package/build/types/utils/common/mergeWithoutArrays.d.ts.map +1 -0
  165. package/build/types/utils/common/randID.d.ts +5 -0
  166. package/build/types/utils/common/randID.d.ts.map +1 -0
  167. package/build/types/utils/common/timeoutCallback.d.ts +6 -0
  168. package/build/types/utils/common/timeoutCallback.d.ts.map +1 -0
  169. package/build/types/utils/errors.d.ts +3 -0
  170. package/build/types/utils/errors.d.ts.map +1 -0
  171. package/build/types/utils/listeners/index.d.ts +4 -0
  172. package/build/types/utils/listeners/index.d.ts.map +1 -0
  173. package/build/types/utils/listeners/intersectionObserverSupported.d.ts +2 -0
  174. package/build/types/utils/listeners/intersectionObserverSupported.d.ts.map +1 -0
  175. package/build/types/utils/listeners/onScroll.d.ts +10 -0
  176. package/build/types/utils/listeners/onScroll.d.ts.map +1 -0
  177. package/build/types/utils/math/boundVal.d.ts +5 -0
  178. package/build/types/utils/math/boundVal.d.ts.map +1 -0
  179. package/build/types/utils/math/index.d.ts +5 -0
  180. package/build/types/utils/math/index.d.ts.map +1 -0
  181. package/build/types/utils/math/lerp.d.ts +5 -0
  182. package/build/types/utils/math/lerp.d.ts.map +1 -0
  183. package/build/types/utils/math/scopeProgress.d.ts +20 -0
  184. package/build/types/utils/math/scopeProgress.d.ts.map +1 -0
  185. package/build/types/utils/types/general.d.ts +7 -0
  186. package/build/types/utils/types/general.d.ts.map +1 -0
  187. package/build/types/utils/types/utility.d.ts +14 -0
  188. package/build/types/utils/types/utility.d.ts.map +1 -0
  189. package/package.json +88 -82
  190. package/src/cdn/index.js +3 -0
  191. package/src/sass/base.scss +3 -0
  192. package/src/sass/components/cursor/_custom-cursor.scss +63 -0
  193. package/src/sass/components/index.scss +6 -0
  194. package/src/sass/components/loading/_preloader.scss +15 -0
  195. package/src/sass/components/scroll/_scrollbar.scss +73 -0
  196. package/src/sass/components/scroll/_smooth-scroll.scss +17 -0
  197. package/src/sass/index.scss +3 -0
  198. package/src/sass/mixins/_scroll.scss +7 -0
  199. package/{dist/scss → src/sass}/mixins/_transition.scss +8 -4
  200. package/src/sass/mixins/_viewport.scss +69 -0
  201. package/src/sass/mixins/index.scss +3 -0
  202. package/src/ts/app/Application.ts +350 -0
  203. package/src/ts/app/events/PageLoad.ts +79 -0
  204. package/src/ts/app/events/Viewport.ts +365 -0
  205. package/src/ts/base/Callbacks.ts +380 -0
  206. package/src/ts/base/Component.ts +83 -0
  207. package/src/ts/base/Module.ts +385 -0
  208. package/src/ts/base/MutableProp.ts +242 -0
  209. package/src/ts/base/Plugin.ts +76 -0
  210. package/src/ts/components/animation-frame/AnimationFrame.ts +264 -0
  211. package/src/ts/components/canvas/Ctx2D.ts +260 -0
  212. package/src/ts/components/canvas/Ctx2DPrerender.ts +96 -0
  213. package/src/ts/components/cursor/CustomCursor.ts +462 -0
  214. package/src/ts/components/dragger/Dragger.ts +313 -0
  215. package/src/ts/components/dragger/DraggerDirection.ts +106 -0
  216. package/src/ts/components/dragger/DraggerMove.ts +114 -0
  217. package/src/ts/components/loading/Preloader.ts +279 -0
  218. package/src/ts/components/loading/ProgressPreloader.ts +484 -0
  219. package/src/ts/components/page/Page.ts +421 -0
  220. package/src/ts/components/scroll/plugins/SmoothScrollDragPlugin.ts +251 -0
  221. package/src/ts/components/scroll/plugins/SmoothScrollKeyboardPlugin.ts +166 -0
  222. package/src/ts/components/scroll/scrollable/ScrollEventsBase.ts +151 -0
  223. package/src/ts/components/scroll/scrollable/ScrollView.ts +435 -0
  224. package/src/ts/components/scroll/scrollbar/Bar.ts +364 -0
  225. package/src/ts/components/scroll/scrollbar/ScrollBar.ts +292 -0
  226. package/src/ts/components/scroll/smooth-scroll/SmoothScroll.ts +861 -0
  227. package/src/ts/components/scroll/types.ts +10 -0
  228. package/src/ts/components/text/SplitText.ts +418 -0
  229. package/src/ts/components/timeline/StaticTimeline.ts +197 -0
  230. package/src/ts/components/timeline/Timeline.ts +256 -0
  231. package/src/ts/index.ts +94 -0
  232. package/src/ts/utils/common/index.ts +9 -0
  233. package/src/ts/utils/common/mergeWithoutArrays.ts +20 -0
  234. package/src/ts/utils/common/randID.ts +9 -0
  235. package/src/ts/utils/common/timeoutCallback.ts +16 -0
  236. package/src/ts/utils/errors.ts +6 -0
  237. package/src/ts/utils/listeners/index.ts +7 -0
  238. package/src/ts/utils/listeners/intersectionObserverSupported.ts +10 -0
  239. package/src/ts/utils/listeners/onScroll.ts +56 -0
  240. package/src/ts/utils/math/boundVal.ts +15 -0
  241. package/src/ts/utils/math/index.ts +9 -0
  242. package/src/ts/utils/math/lerp.ts +16 -0
  243. package/src/ts/utils/math/scopeProgress.ts +23 -0
  244. package/src/ts/utils/types/general.ts +7 -0
  245. package/src/ts/utils/types/utility.ts +34 -0
  246. package/dist/js/AJAXEvent.js +0 -355
  247. package/dist/js/Application.js +0 -345
  248. package/dist/js/ColumnsModule.js +0 -392
  249. package/dist/js/CursorModule.js +0 -390
  250. package/dist/js/DraggerModule.js +0 -792
  251. package/dist/js/Event.js +0 -538
  252. package/dist/js/FilterModule.js +0 -943
  253. package/dist/js/FormModule.js +0 -706
  254. package/dist/js/FrameModule.js +0 -229
  255. package/dist/js/IntervalModule.js +0 -270
  256. package/dist/js/KeydownModule.js +0 -293
  257. package/dist/js/LoadEvent.js +0 -106
  258. package/dist/js/MenuBaseModule.js +0 -292
  259. package/dist/js/MenuModule.js +0 -265
  260. package/dist/js/MenuTimelineModule.js +0 -321
  261. package/dist/js/Module.js +0 -478
  262. package/dist/js/PageAjaxModule.js +0 -1010
  263. package/dist/js/PageLoadMediaPlugin.js +0 -285
  264. package/dist/js/PageModule.js +0 -440
  265. package/dist/js/PaginationModule.js +0 -961
  266. package/dist/js/PaginationScrollPlugin.js +0 -209
  267. package/dist/js/Plugin.js +0 -114
  268. package/dist/js/PopupModule.js +0 -942
  269. package/dist/js/PreloaderModule.js +0 -724
  270. package/dist/js/ResponsiveProp.js +0 -301
  271. package/dist/js/ScrollAnchorModule.js +0 -554
  272. package/dist/js/ScrollAnimateModule.js +0 -419
  273. package/dist/js/ScrollBarPlugin.js +0 -594
  274. package/dist/js/ScrollDragPlugin.js +0 -396
  275. package/dist/js/ScrollModule.js +0 -1071
  276. package/dist/js/ScrollViewModule.js +0 -388
  277. package/dist/js/SelectModule.js +0 -860
  278. package/dist/js/SliderCanvasModule.js +0 -733
  279. package/dist/js/SliderControlsPlugin.js +0 -247
  280. package/dist/js/SliderCounterPlugin.js +0 -278
  281. package/dist/js/SliderDotsPlugin.js +0 -270
  282. package/dist/js/SliderDragSwipePlugin.js +0 -245
  283. package/dist/js/SliderIntervalPlugin.js +0 -192
  284. package/dist/js/SliderKeydownPlugin.js +0 -185
  285. package/dist/js/SliderModule.js +0 -1062
  286. package/dist/js/SliderWheelPlugin.js +0 -194
  287. package/dist/js/TextAnimateModule.js +0 -663
  288. package/dist/js/TextSplitModule.js +0 -785
  289. package/dist/js/TimelineBaseModule.js +0 -405
  290. package/dist/js/TimelineModule.js +0 -494
  291. package/dist/js/URLEvent.js +0 -239
  292. package/dist/js/ViewportEvent.js +0 -465
  293. package/dist/js/WheelEventModule.js +0 -295
  294. package/dist/js/domChildOf.js +0 -46
  295. package/dist/js/domChildren.js +0 -47
  296. package/dist/js/domInsertAfter.js +0 -32
  297. package/dist/js/domRemoveChildren.js +0 -26
  298. package/dist/js/easing.js +0 -363
  299. package/dist/js/eventListenerAdd.js +0 -87
  300. package/dist/js/eventListenerGet.js +0 -49
  301. package/dist/js/eventListenerRemove.js +0 -36
  302. package/dist/js/generateId.js +0 -29
  303. package/dist/js/getBrowserName.js +0 -60
  304. package/dist/js/getOsName.js +0 -39
  305. package/dist/js/getVevetProperties.js +0 -22
  306. package/dist/js/index.js +0 -519
  307. package/dist/js/mathScopeProgress.js +0 -32
  308. package/dist/js/mathSpreadScopeProgress.js +0 -35
  309. package/dist/js/merge.js +0 -33
  310. package/dist/js/normalizeWheel.js +0 -97
  311. package/dist/js/text_animate_module_addons/_composite_elementary.js +0 -196
  312. package/dist/js/text_animate_module_addons/_elementary.js +0 -88
  313. package/dist/js/timeoutCallback.js +0 -26
  314. package/dist/js/vevet.js +0 -10
  315. package/dist/scss/_prefix.scss +0 -1
  316. package/dist/scss/classes/_clear.scss +0 -5
  317. package/dist/scss/classes/_col-row.scss +0 -48
  318. package/dist/scss/classes/_display.scss +0 -65
  319. package/dist/scss/classes/_document-reset.scss +0 -28
  320. package/dist/scss/classes/_document.scss +0 -7
  321. package/dist/scss/classes/_overflow.scss +0 -39
  322. package/dist/scss/classes/_position.scss +0 -55
  323. package/dist/scss/classes/_text.scss +0 -24
  324. package/dist/scss/classes/_transition.scss +0 -22
  325. package/dist/scss/classes/_wrap.scss +0 -31
  326. package/dist/scss/classes/index.scss +0 -14
  327. package/dist/scss/index.scss +0 -3
  328. package/dist/scss/mixins/_clear.scss +0 -6
  329. package/dist/scss/mixins/_display.scss +0 -6
  330. package/dist/scss/mixins/_form.scss +0 -14
  331. package/dist/scss/mixins/_position.scss +0 -42
  332. package/dist/scss/mixins/_reset.scss +0 -17
  333. package/dist/scss/mixins/_responsive.scss +0 -88
  334. package/dist/scss/mixins/index.scss +0 -7
  335. package/dist/scss/modules/columns/_settings.scss +0 -1
  336. package/dist/scss/modules/columns/index.scss +0 -19
  337. package/dist/scss/modules/cursor/_settings.scss +0 -7
  338. package/dist/scss/modules/cursor/index.scss +0 -15
  339. package/dist/scss/modules/form/_settings.scss +0 -15
  340. package/dist/scss/modules/form/index.scss +0 -57
  341. package/dist/scss/modules/index.scss +0 -11
  342. package/dist/scss/modules/menu/_button.scss +0 -58
  343. package/dist/scss/modules/menu/_menu.scss +0 -25
  344. package/dist/scss/modules/menu/_settings.scss +0 -23
  345. package/dist/scss/modules/menu/index.scss +0 -3
  346. package/dist/scss/modules/pagination/_settings.scss +0 -6
  347. package/dist/scss/modules/pagination/index.scss +0 -24
  348. package/dist/scss/modules/popup/_settings.scss +0 -26
  349. package/dist/scss/modules/popup/index.scss +0 -294
  350. package/dist/scss/modules/preloader/_settings.scss +0 -3
  351. package/dist/scss/modules/preloader/index.scss +0 -19
  352. package/dist/scss/modules/scroll/_settings.scss +0 -22
  353. package/dist/scss/modules/scroll/index.scss +0 -94
  354. package/dist/scss/modules/select/_settings.scss +0 -28
  355. package/dist/scss/modules/select/index.scss +0 -142
  356. package/dist/scss/modules/slider/_settings.scss +0 -35
  357. package/dist/scss/modules/slider/index.scss +0 -153
  358. package/dist/scss/modules/text/_settings.scss +0 -1
  359. package/dist/scss/modules/text/index.scss +0 -19
  360. package/dist/types/types.d.ts +0 -18763
@@ -0,0 +1,199 @@
1
+ import { selectOne } from 'vevet-dom';
2
+ import { Component } from '../../base/Component';
3
+ import { mergeWithoutArrays } from '../../utils/common';
4
+ /**
5
+ * The class splits text in an element into words, letters, and lines.
6
+ * This may be useful when animating the text.
7
+ */
8
+ export class SplitText extends Component {
9
+ _getDefaultProp() {
10
+ const prop = {
11
+ container: '.v-text',
12
+ resizeTimeout: 0,
13
+ append: {
14
+ letters: true,
15
+ words: true,
16
+ lines: false,
17
+ },
18
+ };
19
+ return mergeWithoutArrays(super._getDefaultProp(), prop);
20
+ }
21
+ // Extra constructor
22
+ _constructor() {
23
+ this._create();
24
+ }
25
+ /**
26
+ * Text container
27
+ */
28
+ _container = null;
29
+ /**
30
+ * Get text container
31
+ */
32
+ get container() {
33
+ return this._container;
34
+ }
35
+ /**
36
+ * innerHTML of the container
37
+ */
38
+ _html = '';
39
+ /**
40
+ * textContent of the container
41
+ */
42
+ _text = '';
43
+ /**
44
+ * Defines if the text is already split
45
+ */
46
+ _isSplit = false;
47
+ /**
48
+ * Text letters
49
+ */
50
+ _letters = [];
51
+ /**
52
+ * Get text letters
53
+ */
54
+ get letters() {
55
+ return this._letters;
56
+ }
57
+ /**
58
+ * Create split text
59
+ */
60
+ _create() {
61
+ // get container
62
+ const container = selectOne(this.prop.container);
63
+ this._container = container;
64
+ if (!container) {
65
+ return;
66
+ }
67
+ container.classList.add(`${this.prefix}`);
68
+ console.log(this.prefix);
69
+ // update variables
70
+ this._text = container.textContent;
71
+ this._html = container.innerHTML;
72
+ console.log(this._container);
73
+ }
74
+ /**
75
+ * Set events
76
+ */
77
+ _setEvents() {
78
+ this.addViewportCallback('', () => {
79
+ this._resize();
80
+ }, {
81
+ timeout: this.prop.resizeTimeout,
82
+ name: this.name,
83
+ });
84
+ }
85
+ /**
86
+ * Resize the text
87
+ */
88
+ _resize() {
89
+ this.callbacks.tbt('resize', false);
90
+ this.split();
91
+ }
92
+ /**
93
+ * Split the text
94
+ */
95
+ split() {
96
+ // break if there's no text
97
+ if (!this._text) {
98
+ return;
99
+ }
100
+ // get prop
101
+ const { prop } = this;
102
+ // split text into letters and words
103
+ // this must happen only once
104
+ if (!this._isSplit) {
105
+ // split
106
+ this._splitToWords(this._text);
107
+ // this._lettersSplit();
108
+ // // clear innerHTML
109
+ // this._outer.innerHTML = '';
110
+ // // and append
111
+ // this._lettersAppend();
112
+ // this._wordsAppend();
113
+ }
114
+ // remove previous lines
115
+ // if (this._splitBool) {
116
+ // this._linesRemove();
117
+ // }
118
+ // // append spaces
119
+ // if (!prop.appendLines) {
120
+ // if (!this._splitBool) {
121
+ // this._appendSpaces();
122
+ // }
123
+ // }
124
+ // // split to lines
125
+ // if (prop.appendLines) {
126
+ // this._appendSpaces();
127
+ // this._linesSplit();
128
+ // this._removeBr();
129
+ // this._linesAppend();
130
+ // this._appendSpaces();
131
+ // } else {
132
+ // this._linesSplit();
133
+ // }
134
+ // // change value
135
+ // this._splitBool = true;
136
+ // // remove the class
137
+ // this._outer.classList.remove(`${this._prefix}_splitting`);
138
+ // // launch callback
139
+ // this.lbt('split', this._el);
140
+ }
141
+ /**
142
+ * Split text into words
143
+ */
144
+ _splitToWords(text) {
145
+ console.log(text);
146
+ // split text to chars
147
+ // const chars = text.split('');
148
+ // const el = [];
149
+ // let word: string[] = [];
150
+ // // gor through all chars and add them to single words
151
+ // chars.forEach((char, index) => {
152
+ // const charCode = char.charCodeAt(0);
153
+ // const isNewLine = charCode === 10;
154
+ // const isWhitespace = charCode === 32 || charCode === 160;
155
+ // const isLastChar = index === (chars.length - 1);
156
+ // // define if a new word
157
+ // let isNewWord = false;
158
+ // if (isNewLine || isWhitespace || isLastChar) {
159
+ // isNewWord = true;
160
+ // if (isLastChar) {
161
+ // word.push(char);
162
+ // }
163
+ // }
164
+ // // if a new word
165
+ // if (isNewWord) {
166
+ // // add previous word to elements
167
+ // if (word.length > 0) {
168
+ // el.push({
169
+ // el: false,
170
+ // children: word,
171
+ // newline: isNewLine,
172
+ // content: word.join(''),
173
+ // type: 'word',
174
+ // });
175
+ // }
176
+ // word = [];
177
+ // } else {
178
+ // word.push(char);
179
+ // }
180
+ // // iteration
181
+ // i++;
182
+ // });
183
+ // // add elements to words
184
+ // if (this._prop.appendWords) {
185
+ // el.forEach((word) => {
186
+ // word.el = dom({
187
+ // selector: 'span',
188
+ // styles: `${this._prefix}__word`,
189
+ // });
190
+ // word.el.classList.add();
191
+ // if (!this._prop.appendLetters) {
192
+ // word.el.innerHTML = word.content;
193
+ // }
194
+ // });
195
+ // }
196
+ // // add to stack
197
+ // this._el.words = el;
198
+ }
199
+ }
@@ -0,0 +1,270 @@
1
+ import { createElement, selectOne } from 'vevet-dom';
2
+ import { Component } from '../../base/Component';
3
+ /**
4
+ * Split text into letters, words & lines
5
+ */
6
+ export class SplitText extends Component {
7
+ constructor(initialProp, init = true) {
8
+ super(initialProp, false);
9
+ // get text container
10
+ if (this.prop.container) {
11
+ const container = selectOne(this.prop.container);
12
+ if (container instanceof HTMLElement) {
13
+ this._container = container;
14
+ }
15
+ }
16
+ // add classes
17
+ if (this._container) {
18
+ this._container.classList.add(this.prefix);
19
+ }
20
+ // get initial text
21
+ this._initHTML = this._container.innerHTML;
22
+ this._initText = (this._container.innerText || 'no rendered text').trim();
23
+ this._initText = this._initText.replace(/\s+\n/gm, '\n');
24
+ // set default vars
25
+ this._isPrimarySplit = false;
26
+ this._letters = [];
27
+ this._words = [];
28
+ this._lines = [];
29
+ // initialize the class
30
+ if (init) {
31
+ this.init();
32
+ }
33
+ }
34
+ _getDefaultProp() {
35
+ return Object.assign(Object.assign({}, super._getDefaultProp()), { container: `#${this.prefix}`, appendLetters: true, appendLines: false });
36
+ }
37
+ get prefix() {
38
+ return `${this._app.prefix}split-text`;
39
+ }
40
+ /**
41
+ * Text container
42
+ */
43
+ get container() {
44
+ return this._container;
45
+ }
46
+ get letters() {
47
+ return this._letters;
48
+ }
49
+ get words() {
50
+ return this._words;
51
+ }
52
+ get lines() {
53
+ return this._lines;
54
+ }
55
+ _setEvents() {
56
+ super._setEvents();
57
+ // split the text
58
+ this.splitText();
59
+ if (this.prop.appendLines) {
60
+ this.addViewportCallback('', () => {
61
+ this.splitText();
62
+ });
63
+ }
64
+ }
65
+ /**
66
+ * Split the text
67
+ */
68
+ splitText() {
69
+ // split into words & letters
70
+ if (!this._isPrimarySplit) {
71
+ this.container.innerHTML = '';
72
+ this._splitIntoWords();
73
+ this._splitIntoLetters();
74
+ this._appendWords();
75
+ this._isPrimarySplit = true;
76
+ }
77
+ // split text into lines
78
+ if (this.prop.appendLines) {
79
+ this._splitIntoLines();
80
+ }
81
+ // launch callbacks
82
+ this.callbacks.tbt('split', false);
83
+ }
84
+ /**
85
+ * Split the text into words
86
+ */
87
+ _splitIntoWords() {
88
+ const chars = this._initText.split('');
89
+ // create words
90
+ let wordIndex = 0;
91
+ chars.forEach((char) => {
92
+ // get an existing word or create a base for a new one
93
+ const currentWord = this._words[wordIndex] || {
94
+ content: '',
95
+ hasNewLine: false,
96
+ el: createElement('span', {
97
+ class: `${this.prefix}__word`,
98
+ }),
99
+ letters: [],
100
+ };
101
+ currentWord.el.style.display = 'inline-block';
102
+ this._words[wordIndex] = currentWord;
103
+ // get type of the char
104
+ const charCode = char.charCodeAt(0);
105
+ const isWhitespace = charCode === 32 || charCode === 160;
106
+ const isNewLine = charCode === 10;
107
+ // add elements
108
+ if (isWhitespace) {
109
+ currentWord.whitespace = document.createTextNode(' ');
110
+ }
111
+ if (isNewLine) {
112
+ currentWord.br = createElement('br');
113
+ }
114
+ // update word states
115
+ currentWord.hasNewLine = isNewLine;
116
+ // go to next word if needed
117
+ if (isWhitespace || isNewLine) {
118
+ wordIndex += 1;
119
+ return;
120
+ }
121
+ // update contents
122
+ currentWord.content += char;
123
+ if (!this.prop.appendLetters) {
124
+ currentWord.el.innerHTML = currentWord.content;
125
+ }
126
+ });
127
+ }
128
+ /**
129
+ * Append split words to the container
130
+ */
131
+ _appendWords() {
132
+ this._words.forEach((word) => {
133
+ this.container.appendChild(word.el);
134
+ if (word.whitespace) {
135
+ this.container.appendChild(word.whitespace);
136
+ }
137
+ if (word.br) {
138
+ this.container.appendChild(word.br);
139
+ }
140
+ });
141
+ }
142
+ /**
143
+ * Remove split words from DOM
144
+ */
145
+ _removeWords() {
146
+ this._words.forEach((word) => {
147
+ word.el.remove();
148
+ if (word.whitespace) {
149
+ word.whitespace.remove();
150
+ }
151
+ if (word.br) {
152
+ word.br.remove();
153
+ }
154
+ });
155
+ }
156
+ /**
157
+ * Split the text into letters
158
+ */
159
+ _splitIntoLetters() {
160
+ // check if need to have letters
161
+ if (!this.prop.appendLetters) {
162
+ return;
163
+ }
164
+ // create letters
165
+ this._words.forEach((word) => {
166
+ const chars = word.content.split('');
167
+ const wordLetters = [];
168
+ chars.forEach((char) => {
169
+ const letter = {
170
+ el: createElement('span', {
171
+ class: `${this.prefix}__letter`,
172
+ html: char,
173
+ }),
174
+ content: char,
175
+ word,
176
+ };
177
+ letter.el.style.display = 'inline-block';
178
+ this._letters.push(letter);
179
+ wordLetters.push(letter);
180
+ });
181
+ word.letters = wordLetters;
182
+ });
183
+ // append letters
184
+ this._letters.forEach((letter) => {
185
+ letter.word.el.appendChild(letter.el);
186
+ });
187
+ }
188
+ /**
189
+ * Split the text into lines
190
+ */
191
+ _splitIntoLines() {
192
+ // first of all, remove all previous lines
193
+ this._removeLines();
194
+ // create lines
195
+ let currentLine = false;
196
+ let prevOffsetTop = Infinity;
197
+ let prevWord = false;
198
+ this.words.forEach((word) => {
199
+ // check if need to create a new line
200
+ let isNewLine = false;
201
+ const top = word.el.offsetTop;
202
+ // check if the previous word contains BR
203
+ if (!!prevWord && !!prevWord.br) {
204
+ isNewLine = true;
205
+ }
206
+ else {
207
+ // otherwise check offset
208
+ isNewLine = top !== prevOffsetTop;
209
+ }
210
+ // update vars
211
+ prevWord = word;
212
+ prevOffsetTop = top;
213
+ // create new line
214
+ if (isNewLine) {
215
+ currentLine = {
216
+ el: createElement('span', {
217
+ class: `${this.prefix}__line`,
218
+ }),
219
+ content: '',
220
+ words: [],
221
+ };
222
+ currentLine.el.style.display = 'block';
223
+ this._lines.push(currentLine);
224
+ }
225
+ // append words
226
+ if (currentLine) {
227
+ currentLine.words.push(word);
228
+ }
229
+ });
230
+ // update lines content
231
+ this._lines.forEach((line) => {
232
+ line.content = line.words.map((word) => word.content).join(' ');
233
+ });
234
+ // append lines
235
+ this._lines.forEach((line) => {
236
+ line.words.forEach((word) => {
237
+ line.el.appendChild(word.el);
238
+ if (word.br) {
239
+ word.br.remove();
240
+ }
241
+ if (word.whitespace) {
242
+ line.el.appendChild(word.whitespace);
243
+ }
244
+ });
245
+ this.container.appendChild(line.el);
246
+ });
247
+ }
248
+ /**
249
+ * Remove all lines
250
+ */
251
+ _removeLines() {
252
+ // remove lines
253
+ this._lines.forEach((line) => {
254
+ line.el.remove();
255
+ });
256
+ this._lines = [];
257
+ // and append words
258
+ this._appendWords();
259
+ }
260
+ /**
261
+ * Destroy the module
262
+ */
263
+ _destroy() {
264
+ super._destroy();
265
+ this._lines = [];
266
+ this._words = [];
267
+ this._letters = [];
268
+ this._container.innerHTML = this._initHTML;
269
+ }
270
+ }
@@ -0,0 +1,92 @@
1
+ import easingProgress from 'easing-progress';
2
+ import { Component } from '../../base/Component';
3
+ import scopeProgress from '../../utils/math/scopeProgress';
4
+ import boundVal from '../../utils/math/boundVal';
5
+ /**
6
+ * StaticTimeline is the base class for Timeline itself.
7
+ * The difference between the coponents is that StaticTimeline has no animation:
8
+ * no play & pause methods.
9
+ */
10
+ export class StaticTimeline extends Component {
11
+ constructor(initialProp, init = true) {
12
+ super(initialProp, false);
13
+ // set default vars
14
+ this._progress = 0;
15
+ this._easing = 0;
16
+ this._nestedTimelines = [];
17
+ if (init) {
18
+ this.init();
19
+ }
20
+ }
21
+ /**
22
+ * Get default properties
23
+ */
24
+ _getDefaultProp() {
25
+ return Object.assign(Object.assign({}, super._getDefaultProp()), { easing: this._app.prop.easing, scope: [0, 1], useNestedEasingProgress: false });
26
+ }
27
+ /**
28
+ * Absolute progress of the timeline
29
+ */
30
+ get progress() {
31
+ return this._progress;
32
+ }
33
+ set progress(val) {
34
+ this._progress = val;
35
+ this._handleProgress();
36
+ }
37
+ /**
38
+ * Easing progress of the timeline
39
+ */
40
+ get easing() {
41
+ return this._easing;
42
+ }
43
+ /**
44
+ * Add a nested timeline
45
+ */
46
+ addNestedTimeline(tm) {
47
+ // add the timeline to the stack
48
+ this._nestedTimelines.push(tm);
49
+ }
50
+ /**
51
+ * Handle progress event
52
+ */
53
+ _handleProgress() {
54
+ // calculate easing progress
55
+ this._easing = easingProgress(this._progress, this.prop.easing);
56
+ // launch progress events
57
+ this._callbacks.tbt('progress', {
58
+ progress: this._progress,
59
+ easing: this._easing,
60
+ });
61
+ // render
62
+ this._renderNestedTimelines();
63
+ }
64
+ /**
65
+ * Render nested timelines
66
+ */
67
+ _renderNestedTimelines() {
68
+ const { length } = this._nestedTimelines;
69
+ if (length === 0) {
70
+ return;
71
+ }
72
+ // vars
73
+ const progressForNested = this.prop.useNestedEasingProgress ? this.easing : this.progress;
74
+ // render nested timelines
75
+ for (let index = 0, l = length; index < l; index += 1) {
76
+ const tm = this._nestedTimelines[index];
77
+ // calculate progress of this very timeline
78
+ const tmProgress = boundVal(scopeProgress(progressForNested, tm.prop.nestedScope), [0, 1]);
79
+ tm.progress = tmProgress;
80
+ }
81
+ }
82
+ /**
83
+ * Destroy the animation frame
84
+ */
85
+ _destroy() {
86
+ super._destroy();
87
+ // destroy nested timelines
88
+ this._nestedTimelines.forEach((tm) => {
89
+ tm.destroy();
90
+ });
91
+ }
92
+ }
@@ -0,0 +1,141 @@
1
+ import { StaticTimeline } from './StaticTimeline';
2
+ import boundVal from '../../utils/math/boundVal';
3
+ /**
4
+ * Timeline is an animation helper.
5
+ */
6
+ export class Timeline extends StaticTimeline {
7
+ constructor(initialProp, init = true) {
8
+ super(initialProp, false);
9
+ // set default variables
10
+ this._isPlaying = false;
11
+ this._isReversed = false;
12
+ this._isPaused = false;
13
+ this._animationFrameLastTime = 0;
14
+ if (init) {
15
+ this.init();
16
+ }
17
+ }
18
+ /**
19
+ * Get default properties
20
+ */
21
+ _getDefaultProp() {
22
+ return Object.assign(Object.assign({}, super._getDefaultProp()), { duration: 1000, reset: false, destroyOnEnd: false });
23
+ }
24
+ /**
25
+ * Check if timeline is playing
26
+ */
27
+ get isPlaying() {
28
+ return typeof this._animationFrame !== 'undefined';
29
+ }
30
+ /**
31
+ * Check if timeline is reversed
32
+ */
33
+ get isReversed() {
34
+ return this._isReversed;
35
+ }
36
+ /**
37
+ * Check if timeline is paused
38
+ */
39
+ get isPaused() {
40
+ return this._isPaused;
41
+ }
42
+ /**
43
+ * Play the timeline
44
+ */
45
+ play() {
46
+ if (this._destroyed) {
47
+ return;
48
+ }
49
+ if (this.prop.reset && this.progress === 1) {
50
+ this._progress = 0;
51
+ }
52
+ this._isReversed = false;
53
+ this._isPaused = false;
54
+ if (!this.isPlaying) {
55
+ this._animationFrameLastTime = +new Date();
56
+ this._animate();
57
+ }
58
+ }
59
+ /**
60
+ * Play reversed timeline
61
+ */
62
+ reverse() {
63
+ if (this._destroyed) {
64
+ return;
65
+ }
66
+ if (this.prop.reset && this.progress === 0) {
67
+ this._progress = 1;
68
+ }
69
+ this._isReversed = true;
70
+ this._isPaused = false;
71
+ if (!this.isPlaying) {
72
+ this._animationFrameLastTime = +new Date();
73
+ this._animate();
74
+ }
75
+ }
76
+ /**
77
+ * Pause animation
78
+ */
79
+ pause() {
80
+ if (this._destroyed) {
81
+ return;
82
+ }
83
+ this._isPaused = true;
84
+ if (this._animationFrame) {
85
+ window.cancelAnimationFrame(this._animationFrame);
86
+ }
87
+ this._animationFrame = undefined;
88
+ }
89
+ /**
90
+ * Start animation
91
+ */
92
+ _animate() {
93
+ // stop if animation is paused
94
+ if (this._isPaused) {
95
+ return;
96
+ }
97
+ const { isReversed } = this;
98
+ // calculate difference between frames
99
+ const currentTime = +new Date();
100
+ const frameDiff = Math.abs(this._animationFrameLastTime - currentTime);
101
+ this._animationFrameLastTime = currentTime;
102
+ // calculate current progress
103
+ const progressIterator = frameDiff / this.prop.duration / (isReversed ? -1 : 1);
104
+ const progressTarget = boundVal(this.progress + progressIterator, [0, 1]);
105
+ this.progress = progressTarget;
106
+ // end animation
107
+ if ((progressTarget === 1 && !isReversed)
108
+ || (progressTarget === 0 && isReversed)) {
109
+ this._isReversed = false;
110
+ this._isPaused = false;
111
+ this._animationFrame = undefined;
112
+ return;
113
+ }
114
+ // continue animation
115
+ this._animationFrame = window.requestAnimationFrame(this._animate.bind(this));
116
+ }
117
+ /**
118
+ * Events on progress
119
+ */
120
+ _handleProgress() {
121
+ super._handleProgress();
122
+ const progress = this._progress;
123
+ // launch callbacks
124
+ if (progress === 0) {
125
+ this.callbacks.tbt('start', false);
126
+ }
127
+ else if (progress === 1) {
128
+ this.callbacks.tbt('end', false);
129
+ if (this.prop.destroyOnEnd) {
130
+ this.destroy();
131
+ }
132
+ }
133
+ }
134
+ /**
135
+ * Destroy the timeline
136
+ */
137
+ _destroy() {
138
+ this.pause();
139
+ super._destroy();
140
+ }
141
+ }