@onepercentio/one-ui 0.29.4 → 0.29.5

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 (286) hide show
  1. package/dist/components/Switch/Switch.d.ts +1 -1
  2. package/dist/components/Switch/Switch.js +1 -1
  3. package/dist-ts/components/Switch/Switch.d.ts +1 -1
  4. package/package.json +1 -1
  5. package/src/assets/img/svg/checkbox.svg +0 -3
  6. package/src/assets/styles/index.scss +0 -2
  7. package/src/assets/styles/mixins.scss +0 -12
  8. package/src/assets/styles/variables.scss +0 -49
  9. package/src/components/AdaptiveButton/AdaptiveButton.module.scss +0 -7
  10. package/src/components/AdaptiveButton/AdaptiveButton.tsx +0 -26
  11. package/src/components/AdaptiveButton/index.tsx +0 -2
  12. package/src/components/AdaptiveContainer/AdaptiveContainer.module.scss +0 -53
  13. package/src/components/AdaptiveContainer/AdaptiveContainer.tsx +0 -200
  14. package/src/components/AdaptiveContainer/index.tsx +0 -2
  15. package/src/components/AdaptiveDialog/AdaptiveDialog.module.scss +0 -147
  16. package/src/components/AdaptiveDialog/AdaptiveDialog.tsx +0 -97
  17. package/src/components/AdaptiveDialog/index.tsx +0 -2
  18. package/src/components/AdaptiveSidebar/AdaptiveSidebar.module.scss +0 -49
  19. package/src/components/AdaptiveSidebar/AdaptiveSidebar.sample.tsx +0 -10
  20. package/src/components/AdaptiveSidebar/AdaptiveSidebar.tsx +0 -123
  21. package/src/components/AdaptiveSidebar/index.tsx +0 -2
  22. package/src/components/AnchoredTooltip/AnchoredTooltip.module.scss +0 -64
  23. package/src/components/AnchoredTooltip/AnchoredTooltip.tsx +0 -250
  24. package/src/components/AnchoredTooltip/index.tsx +0 -2
  25. package/src/components/AnimatedEntrance/AnimatedEntrance.module.scss +0 -108
  26. package/src/components/AnimatedEntrance/AnimatedEntrance.tsx +0 -227
  27. package/src/components/AnimatedEntrance/index.tsx +0 -2
  28. package/src/components/AsyncWrapper/AsyncWrapper.tsx +0 -38
  29. package/src/components/AsyncWrapper/index.tsx +0 -2
  30. package/src/components/Avatar/Avatar.module.scss +0 -22
  31. package/src/components/Avatar/Avatar.tsx +0 -31
  32. package/src/components/Avatar/index.tsx +0 -2
  33. package/src/components/BucketFill/BucketFill.module.scss +0 -36
  34. package/src/components/BucketFill/BucketFill.tsx +0 -65
  35. package/src/components/BucketFill/index.tsx +0 -2
  36. package/src/components/Button/Button.module.scss +0 -45
  37. package/src/components/Button/Button.tsx +0 -40
  38. package/src/components/Button/index.tsx +0 -2
  39. package/src/components/Card/Card.module.scss +0 -12
  40. package/src/components/Card/Card.tsx +0 -9
  41. package/src/components/Card/index.tsx +0 -2
  42. package/src/components/Chart/Chart.e2e.ts +0 -4
  43. package/src/components/Chart/Chart.logic.tsx +0 -8
  44. package/src/components/Chart/Chart.module.scss +0 -58
  45. package/src/components/Chart/Chart.tsx +0 -2
  46. package/src/components/Chart/Chart.types.ts +0 -35
  47. package/src/components/Chart/Chart.view.tsx +0 -241
  48. package/src/components/Chart/index.tsx +0 -2
  49. package/src/components/CheckBox/CheckBox.module.scss +0 -36
  50. package/src/components/CheckBox/CheckBox.tsx +0 -63
  51. package/src/components/CheckBox/index.tsx +0 -2
  52. package/src/components/CodeInput/CodeInput.module.scss +0 -5
  53. package/src/components/CodeInput/CodeInput.tsx +0 -84
  54. package/src/components/CodeInput/index.tsx +0 -2
  55. package/src/components/Collapsable/Collapsable.module.scss +0 -42
  56. package/src/components/Collapsable/Collapsable.tsx +0 -253
  57. package/src/components/Collapsable/index.tsx +0 -2
  58. package/src/components/Countdown/Countdown.tsx +0 -130
  59. package/src/components/Countdown/index.tsx +0 -2
  60. package/src/components/CurrencyInput/CurrencyInput.hook.ts +0 -37
  61. package/src/components/CurrencyInput/CurrencyInput.tsx +0 -25
  62. package/src/components/CurrencyInput/index.tsx +0 -2
  63. package/src/components/Divider/Divider.module.scss +0 -7
  64. package/src/components/Divider/Divider.tsx +0 -13
  65. package/src/components/Divider/index.tsx +0 -2
  66. package/src/components/EmailInput/EmailInput.module.scss +0 -0
  67. package/src/components/EmailInput/EmailInput.tsx +0 -51
  68. package/src/components/EmailInput/index.tsx +0 -2
  69. package/src/components/FadeIn/FadeIn.module.scss +0 -9
  70. package/src/components/FadeIn/FadeIn.tsx +0 -77
  71. package/src/components/FadeIn/index.tsx +0 -2
  72. package/src/components/FileInput/FileInput.module.scss +0 -6
  73. package/src/components/FileInput/FileInput.tsx +0 -75
  74. package/src/components/FileInput/View/BigFactory/BigFactory.module.scss +0 -20
  75. package/src/components/FileInput/View/BigFactory/BigFactory.tsx +0 -48
  76. package/src/components/FileInput/View/BigFactory/index.tsx +0 -2
  77. package/src/components/FileInput/View/Compact/Compact.module.scss +0 -68
  78. package/src/components/FileInput/View/Compact/Compact.tsx +0 -151
  79. package/src/components/FileInput/View/Compact/index.tsx +0 -2
  80. package/src/components/FileInput/View/View.types.ts +0 -12
  81. package/src/components/FileInput/index.tsx +0 -2
  82. package/src/components/FlowController/FlowController.module.scss +0 -47
  83. package/src/components/FlowController/FlowController.tsx +0 -93
  84. package/src/components/FlowController/index.tsx +0 -2
  85. package/src/components/Form/Form.tsx +0 -243
  86. package/src/components/Form/index.ts +0 -2
  87. package/src/components/Form/v2/Form.hook.ts +0 -341
  88. package/src/components/Form/v2/Form.module.scss +0 -0
  89. package/src/components/Form/v2/Form.tsx +0 -78
  90. package/src/components/Form/v2/Form.types.ts +0 -118
  91. package/src/components/Form/v2/FormField/Extensions/DateField/DateField.module.scss +0 -0
  92. package/src/components/Form/v2/FormField/Extensions/DateField/DateField.tsx +0 -73
  93. package/src/components/Form/v2/FormField/Extensions/DateField/index.tsx +0 -2
  94. package/src/components/Form/v2/FormField/Extensions/PhoneField/PhoneField.module.scss +0 -0
  95. package/src/components/Form/v2/FormField/Extensions/PhoneField/PhoneField.tsx +0 -91
  96. package/src/components/Form/v2/FormField/Extensions/PhoneField/index.tsx +0 -2
  97. package/src/components/Form/v2/FormField/FormField.module.scss +0 -0
  98. package/src/components/Form/v2/FormField/FormField.tsx +0 -378
  99. package/src/components/Form/v2/FormField/FormField.types.ts +0 -129
  100. package/src/components/Form/v2/FormField/index.tsx +0 -2
  101. package/src/components/Form/v2/index.tsx +0 -2
  102. package/src/components/Freeze/Freeze.tsx +0 -9
  103. package/src/components/Freeze/index.tsx +0 -2
  104. package/src/components/HSForms/HSForms.tsx +0 -57
  105. package/src/components/HSForms/index.tsx +0 -2
  106. package/src/components/Header/Header.module.scss +0 -119
  107. package/src/components/Header/Header.tsx +0 -138
  108. package/src/components/Header/index.tsx +0 -2
  109. package/src/components/HeaderCloseBtn/HeaderCloseBtn.module.scss +0 -44
  110. package/src/components/HeaderCloseBtn/HeaderCloseBtn.tsx +0 -28
  111. package/src/components/HeaderCloseBtn/index.tsx +0 -2
  112. package/src/components/InfinityScroll/InfinityScroll.module.scss +0 -30
  113. package/src/components/InfinityScroll/InfinityScroll.tsx +0 -187
  114. package/src/components/InfinityScroll/index.tsx +0 -2
  115. package/src/components/Input/Input.module.scss +0 -71
  116. package/src/components/Input/Input.tsx +0 -134
  117. package/src/components/Input/index.tsx +0 -2
  118. package/src/components/InstantCounter/InstantCounter.tsx +0 -77
  119. package/src/components/InstantCounter/index.tsx +0 -2
  120. package/src/components/LavaLamp/LavaLamp.data.tsx +0 -114
  121. package/src/components/LavaLamp/LavaLamp.module.scss +0 -26
  122. package/src/components/LavaLamp/LavaLamp.tsx +0 -131
  123. package/src/components/LavaLamp/index.tsx +0 -2
  124. package/src/components/LavaLamp/v2/LavaLamp.module.scss +0 -23
  125. package/src/components/LavaLamp/v2/LavaLamp.tsx +0 -197
  126. package/src/components/LinkToId/LinkToId.module.scss +0 -4
  127. package/src/components/LinkToId/LinkToId.tsx +0 -51
  128. package/src/components/LinkToId/index.tsx +0 -2
  129. package/src/components/Loader/Loader.module.scss +0 -40
  130. package/src/components/Loader/Loader.tsx +0 -18
  131. package/src/components/Loader/index.tsx +0 -2
  132. package/src/components/LoaderDotsIndicator/LoaderDotsIndicator.tsx +0 -34
  133. package/src/components/LoaderDotsIndicator/index.tsx +0 -2
  134. package/src/components/LoopableVideo/LoopableVideo.tsx +0 -37
  135. package/src/components/LoopableVideo/index.tsx +0 -2
  136. package/src/components/MainGrid/MainGrid.module.scss +0 -28
  137. package/src/components/MainGrid/MainGrid.tsx +0 -68
  138. package/src/components/MainGrid/index.tsx +0 -2
  139. package/src/components/MutableHamburgerButton/MutableHamburgerButton.module.scss +0 -220
  140. package/src/components/MutableHamburgerButton/MutableHamburgerButton.tsx +0 -38
  141. package/src/components/MutableHamburgerButton/index.tsx +0 -2
  142. package/src/components/Notification/Notification.module.scss +0 -25
  143. package/src/components/Notification/Notification.tsx +0 -13
  144. package/src/components/Notification/index.tsx +0 -2
  145. package/src/components/OrderableList/OrderableList.module.scss +0 -98
  146. package/src/components/OrderableList/OrderableList.tsx +0 -564
  147. package/src/components/OrderableList/index.tsx +0 -2
  148. package/src/components/PaginationIndicator/PaginationIndicator.tsx +0 -365
  149. package/src/components/PaginationIndicator/index.tsx +0 -2
  150. package/src/components/Parallax/Parallax.module.scss +0 -28
  151. package/src/components/Parallax/Parallax.tsx +0 -225
  152. package/src/components/Parallax/index.tsx +0 -2
  153. package/src/components/Parallax/math/helpers.ts +0 -289
  154. package/src/components/PasswordInput/PasswordInput.module.scss +0 -17
  155. package/src/components/PasswordInput/PasswordInput.tsx +0 -154
  156. package/src/components/PasswordInput/index.tsx +0 -2
  157. package/src/components/PingPongText/PingPongText.module.scss +0 -4
  158. package/src/components/PingPongText/PingPongText.tsx +0 -83
  159. package/src/components/PingPongText/index.tsx +0 -2
  160. package/src/components/PixelatedScan/PixelatedScan.module.scss +0 -86
  161. package/src/components/PixelatedScan/PixelatedScan.tsx +0 -175
  162. package/src/components/PixelatedScan/index.tsx +0 -2
  163. package/src/components/Portal/Portal.module.scss +0 -3
  164. package/src/components/Portal/Portal.tsx +0 -68
  165. package/src/components/Portal/index.tsx +0 -2
  166. package/src/components/ProgressBar/ProgressBar.module.scss +0 -44
  167. package/src/components/ProgressBar/ProgressBar.tsx +0 -124
  168. package/src/components/ProgressBar/index.tsx +0 -2
  169. package/src/components/ProgressTexts/ProgressTexts.module.scss +0 -37
  170. package/src/components/ProgressTexts/ProgressTexts.tsx +0 -85
  171. package/src/components/ProgressTexts/index.tsx +0 -2
  172. package/src/components/Radio/Radio.module.scss +0 -36
  173. package/src/components/Radio/Radio.tsx +0 -53
  174. package/src/components/Radio/index.tsx +0 -2
  175. package/src/components/SectionContainer/SectionContainer.module.scss +0 -30
  176. package/src/components/SectionContainer/SectionContainer.tsx +0 -49
  177. package/src/components/SectionContainer/index.tsx +0 -2
  178. package/src/components/Select/Select.module.scss +0 -58
  179. package/src/components/Select/Select.tsx +0 -192
  180. package/src/components/Select/index.tsx +0 -2
  181. package/src/components/Skeleton/Skeleton.module.scss +0 -21
  182. package/src/components/Skeleton/Skeleton.tsx +0 -29
  183. package/src/components/Skeleton/index.tsx +0 -2
  184. package/src/components/Spacing/Spacing.module.scss +0 -13
  185. package/src/components/Spacing/Spacing.tsx +0 -24
  186. package/src/components/Spacing/index.tsx +0 -2
  187. package/src/components/StaticScroller/StaticScroller.module.scss +0 -14
  188. package/src/components/StaticScroller/StaticScroller.tsx +0 -83
  189. package/src/components/StaticScroller/index.tsx +0 -2
  190. package/src/components/Switch/Switch.module.scss +0 -43
  191. package/src/components/Switch/Switch.tsx +0 -41
  192. package/src/components/Switch/index.tsx +0 -2
  193. package/src/components/Table/Table.module.scss +0 -76
  194. package/src/components/Table/Table.tsx +0 -152
  195. package/src/components/Table/index.tsx +0 -2
  196. package/src/components/Tabs/Tabs.module.scss +0 -40
  197. package/src/components/Tabs/Tabs.tsx +0 -104
  198. package/src/components/Tabs/index.tsx +0 -2
  199. package/src/components/Text/Text.module.scss +0 -81
  200. package/src/components/Text/Text.tsx +0 -42
  201. package/src/components/Text/index.tsx +0 -2
  202. package/src/components/Transition/MasksFactory/DiagonalReveal.tsx +0 -47
  203. package/src/components/Transition/MasksFactory/DiagonalSquareToBalls.tsx +0 -78
  204. package/src/components/Transition/MasksFactory/PhysicsSquares.tsx +0 -106
  205. package/src/components/Transition/MasksFactory/SquareToBalls.tsx +0 -66
  206. package/src/components/Transition/MasksFactory/utils.ts +0 -35
  207. package/src/components/Transition/Transition.module.scss +0 -211
  208. package/src/components/Transition/Transition.tsx +0 -495
  209. package/src/components/Transition/index.tsx +0 -2
  210. package/src/components/UncontrolledTransition/UncontrolledTransition.ai.md +0 -9
  211. package/src/components/UncontrolledTransition/UncontrolledTransition.sample.tsx +0 -34
  212. package/src/components/UncontrolledTransition/UncontrolledTransition.tsx +0 -143
  213. package/src/components/UncontrolledTransition/index.tsx +0 -2
  214. package/src/components/WalletConnectionWrapper/WalletConnectionWrapper.tsx +0 -212
  215. package/src/components/WalletConnectionWrapper/index.tsx +0 -2
  216. package/src/components/utilitary/ScrollAndFocusLock/ScrollAndFocusLock.module.scss +0 -5
  217. package/src/components/utilitary/ScrollAndFocusLock/ScrollAndFocusLock.tsx +0 -52
  218. package/src/components/utilitary/ScrollAndFocusLock/index.tsx +0 -2
  219. package/src/context/AsyncProcess.tsx +0 -107
  220. package/src/context/ContextAsyncControl.tsx +0 -89
  221. package/src/context/CustomBrowserRouter.tsx +0 -55
  222. package/src/context/OneUIProvider.tsx +0 -308
  223. package/src/hooks/logs/useDependencyChangeDetection.ts +0 -25
  224. package/src/hooks/logs/useIsMounting.ts +0 -7
  225. package/src/hooks/persistence/useLocalStorage.ts +0 -45
  226. package/src/hooks/shims/ObjectWatchShim.ts +0 -56
  227. package/src/hooks/ui/useAdaptiveImage.tsx +0 -36
  228. package/src/hooks/ui/useAlternating.tsx +0 -22
  229. package/src/hooks/ui/useBreakpoint.tsx +0 -21
  230. package/src/hooks/ui/useCustomScrollbar.module.scss +0 -20
  231. package/src/hooks/ui/useCustomScrollbar.tsx +0 -22
  232. package/src/hooks/ui/useEffectIf.ts +0 -11
  233. package/src/hooks/ui/useMouseHover.tsx +0 -26
  234. package/src/hooks/ui/usePaginationControls.module.scss +0 -16
  235. package/src/hooks/ui/usePaginationControls.tsx +0 -176
  236. package/src/hooks/ui/useSnapToViewport.module.scss +0 -6
  237. package/src/hooks/ui/useSnapToViewport.ts +0 -28
  238. package/src/hooks/ui/useTilt.tsx +0 -219
  239. package/src/hooks/ui/useZoomable.module.scss +0 -34
  240. package/src/hooks/ui/useZoomable.tsx +0 -144
  241. package/src/hooks/useAsyncControl.ai.md +0 -25
  242. package/src/hooks/useAsyncControl.ts +0 -101
  243. package/src/hooks/useContainedRepositioning.ts +0 -110
  244. package/src/hooks/useCustomHistory.ts +0 -14
  245. package/src/hooks/useElementFit.ts +0 -82
  246. package/src/hooks/useFirestoreWatch.ts +0 -54
  247. package/src/hooks/useForm.ts +0 -49
  248. package/src/hooks/useFreeze.ts +0 -12
  249. package/src/hooks/useHero.module.scss +0 -41
  250. package/src/hooks/useHero.ts +0 -514
  251. package/src/hooks/useIntersection.ts +0 -32
  252. package/src/hooks/useMergeRefs.ts +0 -29
  253. package/src/hooks/useObserve.ts +0 -24
  254. package/src/hooks/usePagination.ts +0 -228
  255. package/src/hooks/usePooledOperation.ts +0 -54
  256. package/src/hooks/usePooling.ts +0 -46
  257. package/src/hooks/useRebound.ts +0 -23
  258. package/src/hooks/useShortIntl.ai.md +0 -5
  259. package/src/hooks/useShortIntl.ts +0 -97
  260. package/src/hooks/utility/useAsyncMemo.ts +0 -43
  261. package/src/hooks/utility/useDepChange.ts +0 -11
  262. package/src/hooks/utility/useEvents.ts +0 -33
  263. package/src/hooks/utility/useImmediate.ts +0 -8
  264. package/src/hooks/utility/useManualInit.ts +0 -24
  265. package/src/hooks/utility/useModule.ts +0 -15
  266. package/src/hooks/utility/useQuery.ts +0 -15
  267. package/src/hooks/utility/useUniqueEffect.ts +0 -22
  268. package/src/index.preprocess.ts +0 -82
  269. package/src/index.ts +0 -229
  270. package/src/models/DebugLogger.ts +0 -7
  271. package/src/models/GenericContract.ts +0 -169
  272. package/src/models/Orbs.ts +0 -97
  273. package/src/reac-app-env.d.ts +0 -6
  274. package/src/storybook/assets/video/txt-reversed.mp4 +0 -0
  275. package/src/storybookUtils/index.tsx +0 -53
  276. package/src/test.tsx +0 -0
  277. package/src/type-utils.ts +0 -49
  278. package/src/types.ts +0 -199
  279. package/src/utility.d.ts +0 -70
  280. package/src/utils/blockchain.ts +0 -43
  281. package/src/utils/e2e.ts +0 -55
  282. package/src/utils/flatten.ts +0 -17
  283. package/src/utils/formatters.ts +0 -36
  284. package/src/utils/html.utils.ts +0 -3
  285. package/src/utils/ownEvent.ts +0 -8
  286. package/src/utils/test.ts +0 -20
@@ -1,131 +0,0 @@
1
- import React, { PropsWithChildren, useMemo, useRef } from "react";
2
- import useLavaLampSetup from "./LavaLamp.data";
3
- import Styles from "./LavaLamp.module.scss";
4
-
5
- type LavaLampProps = {
6
- /**
7
- * Required for defining the dimensions the lava lamp should have
8
- */
9
- className: string;
10
- };
11
-
12
- /**
13
- * A peaceful component simulating an interactive lavalamp
14
- **/
15
- export default function LavaLamp({
16
- className,
17
- children,
18
- }: PropsWithChildren<LavaLampProps>) {
19
- const circleRef = useRef<SVGCircleElement>(null);
20
-
21
- const { relativeTo, d, circlesConfig } = useLavaLampSetup(
22
- (cx, cy) => {
23
- const style: any = circleRef.current!.style;
24
- style.cx = cx;
25
- style.cy = cy;
26
- },
27
- (size) => {
28
- const style: any = circleRef.current!.style;
29
- style.r = size;
30
- }
31
- );
32
-
33
- const randomCircles = useMemo(() => {
34
- return circlesConfig.map(
35
- ({ baseSize, startX, startY, translateX, translateY }) => (
36
- <circle
37
- r={baseSize + Math.random() * (baseSize / 2)}
38
- fill="#fff"
39
- cx={startX}
40
- cy={startY}
41
- >
42
- <animateTransform
43
- additive="sum"
44
- attributeName="transform"
45
- attributeType="XML"
46
- type="translate"
47
- values={`0 0; ${translateX} ${translateY}; 0 0;`}
48
- dur={`${5 + Math.random() * 5}s`}
49
- repeatCount="indefinite"
50
- />
51
- </circle>
52
- )
53
- );
54
- }, [circlesConfig]);
55
-
56
- return (
57
- <div ref={relativeTo} className={`${Styles.root} ${className}`}>
58
- {d && (
59
- <svg className={Styles.effect} viewBox={`0 0 ${d.width} ${d.height}`}>
60
- <filter
61
- id={`goo-lava-lamp`}
62
- width="10"
63
- height="10"
64
- x="0%"
65
- y="0%"
66
- filterRes="1"
67
- >
68
- <feGaussianBlur
69
- in="SourceGraphic"
70
- result="blur"
71
- stdDeviation="40"
72
- />
73
- <feColorMatrix
74
- in="blur"
75
- mode="matrix"
76
- values="1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 50 -7"
77
- result="goo"
78
- />
79
- </filter>
80
- <mask id={`mask-lava-lamp`}>
81
- <g filter={`url(#${`goo-lava-lamp`})`} fill="#fff">
82
- {randomCircles}
83
- <circle ref={circleRef} fill="#fff" />
84
- </g>
85
- </mask>
86
- <defs>
87
- <radialGradient
88
- id="grad1"
89
- cx="50%"
90
- cy="50%"
91
- r="50%"
92
- fx="50%"
93
- fy="50%"
94
- >
95
- <stop
96
- offset="0%"
97
- style={{
98
- stopColor: "var(--lava-lamp-color-a)",
99
- stopOpacity: 1,
100
- }}
101
- />
102
- <stop
103
- offset="67.33%"
104
- style={{
105
- stopColor: "var(--lava-lamp-color-b)",
106
- stopOpacity: 1,
107
- }}
108
- />
109
- <stop
110
- offset="88.33%"
111
- style={{
112
- stopColor: "var(--lava-lamp-color-c)",
113
- stopOpacity: 1,
114
- }}
115
- />
116
- </radialGradient>
117
- </defs>
118
- <rect
119
- x="-50%"
120
- y="-50%"
121
- mask={`url(#${`mask-lava-lamp`})`}
122
- width="200%"
123
- height="200%"
124
- style={{ fill: "url(#grad1)" }}
125
- ></rect>
126
- </svg>
127
- )}
128
- <div>{children}</div>
129
- </div>
130
- );
131
- }
@@ -1,2 +0,0 @@
1
- export { default } from "./LavaLamp";
2
- export * from "./LavaLamp";
@@ -1,23 +0,0 @@
1
- @use 'sass:math';
2
-
3
- $transitionMs: math.div(1000, 5);
4
- $transitionPositionMs: math.div($transitionMs, 2);
5
- @value transitionMs #{$transitionMs};
6
- @value transitionPositionMs #{$transitionPositionMs};
7
-
8
- .root {
9
- position: relative;
10
- > canvas {
11
- position: absolute;
12
- top: 0;
13
- left: 0;
14
- bottom: 0;
15
- right: 0;
16
- width: 100%;
17
- height: 100%;
18
- }
19
- > div {
20
- position: relative;
21
- z-index: 1;
22
- }
23
- }
@@ -1,197 +0,0 @@
1
- import React, { PropsWithChildren, useEffect, useMemo, useRef } from "react";
2
- import useMergeRefs from "../../../hooks/useMergeRefs";
3
- import useLavaLampSetup, { transitionPositionMs } from "../LavaLamp.data";
4
- import Styles from "./LavaLamp.module.scss";
5
- import { GuideOrb, Orb, OrbDrawer } from "../../../models/Orbs";
6
-
7
- export default function LavaLamp({
8
- className,
9
- children,
10
- }: PropsWithChildren<{ className: string }>) {
11
- const guideConfig = useRef<{
12
- x: number;
13
- y: number;
14
- posTimestamp: number;
15
- posIncrement: [x: number, y: number];
16
-
17
- size: number;
18
- sizeTimestamp: number;
19
- sizeIncrement: number;
20
- }>({
21
- size: 0,
22
- sizeTimestamp: Date.now(),
23
- sizeIncrement: 0,
24
- x: 0,
25
- y: 0,
26
- posTimestamp: Date.now(),
27
- posIncrement: [0, 0],
28
- });
29
- const { relativeTo, circlesConfig, d } = useLavaLampSetup(
30
- (x, y) => {
31
- guideConfig.current.posIncrement = [
32
- x - guideConfig.current.x,
33
- y - guideConfig.current.y,
34
- ];
35
- guideConfig.current.x = x;
36
- guideConfig.current.y = y;
37
- guideConfig.current.posTimestamp = Date.now();
38
- },
39
- (_size) => {
40
- const size = _size * 1.2;
41
- guideConfig.current.sizeIncrement =
42
- guideConfig.current.size === 0 ? 0 : size - guideConfig.current.size;
43
- guideConfig.current.size = size;
44
- guideConfig.current.sizeTimestamp = Date.now();
45
- }
46
- );
47
- const _canvasRef = useRef<HTMLCanvasElement>(null);
48
- const canvasRef = useMergeRefs(
49
- _canvasRef,
50
- relativeTo as unknown as typeof _canvasRef
51
- );
52
- useEffect(() => {
53
- if (!d) return;
54
- const fc = canvasRef.current!;
55
-
56
- const baseColor =
57
- getComputedStyle(relativeTo.current!).getPropertyValue(
58
- "--digital-blue"
59
- ) || "#000000";
60
-
61
- var c = document.createElement("canvas"),
62
- w = (c.width = fc.width = d.width),
63
- h = (c.height = fc.height = d.height),
64
- ctx = c.getContext("2d")!,
65
- fctx = fc.getContext("2d")!, // f means final
66
- opts = {
67
- orbCount: circlesConfig.length,
68
- baseVel: Math.max(d.width * 0.001, 1),
69
- addedVel: Math.max(d.width * 0.001, 1),
70
-
71
- alphaThreshold: 200,
72
- },
73
- orbs = [] as (Orb | GuideOrb)[];
74
- class CanvasOrbDrawer implements OrbDrawer {
75
- protected gradient?: CanvasGradient;
76
-
77
- private newGradient(color: string, radius: number) {
78
- const gradient = ctx.createRadialGradient(0, 0, 0, 0, 0, radius);
79
- gradient.addColorStop(0, `${color}ff`);
80
- gradient.addColorStop(0.8, `${color}cc`);
81
- gradient.addColorStop(1, `${color}00`);
82
-
83
- return gradient;
84
- }
85
-
86
- private oldDrawCircle(x: number, y: number, radius: number) {
87
- ctx.fillStyle = this.gradient ?? this.newGradient(baseColor, radius);
88
- ctx.translate(x | 0, y | 0);
89
- ctx.beginPath();
90
- ctx.arc(0, 0, radius, 0, Math.PI * 2);
91
- ctx.fill();
92
- ctx.translate(-x | 0, -y | 0);
93
- }
94
- drawOrb(x: number, y: number, radius: number) {
95
- this.oldDrawCircle(x, y, radius);
96
- }
97
-
98
- constructor(gradientRadius?: number) {
99
- if (gradientRadius)
100
- this.gradient = this.newGradient(baseColor, gradientRadius);
101
- }
102
- }
103
-
104
- let animFrame: number;
105
- function anim() {
106
- animFrame = window.requestAnimationFrame(anim);
107
-
108
- ctx.clearRect(0, 0, w, h);
109
- fctx.fillStyle = "#0000";
110
- fctx.fillRect(0, 0, w, h);
111
-
112
- for (var i = 0; i < orbs.length; i++) {
113
- const thisOrb = orbs[i];
114
- if (thisOrb instanceof Orb) {
115
- thisOrb.step();
116
- } else {
117
- thisOrb.step(
118
- guideConfig.current!.size,
119
- guideConfig.current!.sizeIncrement,
120
- guideConfig.current!.sizeTimestamp,
121
- guideConfig.current.posTimestamp,
122
- guideConfig.current!,
123
- {
124
- x: guideConfig.current!.posIncrement[0],
125
- y: guideConfig.current!.posIncrement[1],
126
- }
127
- );
128
- }
129
- }
130
-
131
- var image = ctx.getImageData(0, 0, w, h),
132
- data = new Uint8Array(image.data.buffer);
133
-
134
- for (var i = 3; i < data.length; i += 4)
135
- data[i] /= data[i] < opts.alphaThreshold ? 6 : 1;
136
-
137
- fctx.putImageData(image, 0, 0);
138
- }
139
-
140
- function randomVelocity() {
141
- return (opts.baseVel + opts.addedVel * Math.random()) | 0;
142
- }
143
- const orbBounds = { width: w, height: h };
144
-
145
- for (let circleConfig of circlesConfig) {
146
- const radius = circleConfig.baseSize * 1.5;
147
- const randomRadius = (radius + (radius / 2) * Math.random()) | 0;
148
- const drawerInstance = new CanvasOrbDrawer(randomRadius);
149
- orbs.push(
150
- new Orb(drawerInstance, randomVelocity(), orbBounds, randomRadius)
151
- );
152
- }
153
- const guideOrbInstance = new GuideOrb(
154
- new CanvasOrbDrawer(),
155
- transitionPositionMs
156
- );
157
- let guideOrbAutoInstance: Orb;
158
- orbs.push(guideOrbInstance);
159
-
160
- canvasRef.current!.parentElement!.onmouseleave = () => {
161
- const indexOfGuide = orbs.indexOf(guideOrbInstance);
162
- if (indexOfGuide !== -1) {
163
- const drawerInstance = new CanvasOrbDrawer(guideOrbInstance.lastRadius);
164
- guideOrbAutoInstance = new Orb(
165
- drawerInstance,
166
- randomVelocity(),
167
- orbBounds,
168
- guideOrbInstance.lastRadius
169
- );
170
- guideOrbAutoInstance.radius = guideOrbInstance.lastRadius;
171
- guideOrbAutoInstance.x = guideOrbInstance.lastX;
172
- guideOrbAutoInstance.y = guideOrbInstance.lastY;
173
- orbs.splice(indexOfGuide, 1);
174
- orbs.push(guideOrbAutoInstance);
175
- }
176
- };
177
- canvasRef.current!.parentElement!.onmouseenter = () => {
178
- if (orbs.indexOf(guideOrbInstance) === -1) {
179
- orbs.push(guideOrbInstance);
180
- orbs.splice(orbs.indexOf(guideOrbAutoInstance), 1);
181
- }
182
- };
183
-
184
- anim();
185
-
186
- return () => {
187
- window.cancelAnimationFrame(animFrame);
188
- };
189
- }, [circlesConfig]);
190
-
191
- return (
192
- <div className={`${className} ${Styles.root}`}>
193
- <canvas ref={canvasRef} />
194
- <div>{children}</div>
195
- </div>
196
- );
197
- }
@@ -1,4 +0,0 @@
1
- .root:hover {
2
- text-decoration: underline;
3
- cursor: pointer;
4
- }
@@ -1,51 +0,0 @@
1
- import React, { PropsWithChildren } from "react";
2
- import Styles from "./LinkToId.module.scss";
3
-
4
- export function scrollToId(
5
- id: OnepercentUtility.PageSections,
6
- shouldScrollToCenter: boolean = false
7
- ) {
8
- const el = document.getElementById(id);
9
-
10
- if (el) {
11
- const elStyles = window.getComputedStyle(el);
12
- const padding = Number(elStyles.paddingTop.replace(/[^0-9]+/g, ""));
13
- const elementPosition = el.offsetTop;
14
- const elementHeight = el.clientHeight;
15
-
16
- window.scrollTo({
17
- behavior: "smooth",
18
- //Go to element, scroll half the screen height scrollback half the element height
19
- top: shouldScrollToCenter
20
- ? elementPosition + elementHeight / 2 - window.innerHeight / 2
21
- : elementPosition + padding,
22
- });
23
- }
24
- }
25
-
26
- /**
27
- * This component creates an iteractive element and on click, routes to the specified id
28
- **/
29
- export default function LinkToId({
30
- children,
31
- id,
32
- link,
33
- scrollToCenter = false,
34
- }: PropsWithChildren<{
35
- id?: OnepercentUtility.PageSections;
36
- link?: string;
37
- scrollToCenter?: boolean;
38
- }>) {
39
- return link ? (
40
- <span className={Styles.root} onClick={() => window.open(link, "_blank")}>
41
- {children}
42
- </span>
43
- ) : (
44
- <span
45
- className={Styles.root}
46
- onClick={() => scrollToId(id!, scrollToCenter)}
47
- >
48
- {children}
49
- </span>
50
- );
51
- }
@@ -1,2 +0,0 @@
1
- export { default } from "./LinkToId";
2
- export * from "./LinkToId";
@@ -1,40 +0,0 @@
1
- @import "../../assets/styles/variables.scss";
2
-
3
- .indicator {
4
- white-space: nowrap;
5
- font-size: 14px;
6
- & span {
7
- display: inline-block;
8
- width: 0.75em;
9
- height: 0.75em;
10
- border-radius: 0.375em;
11
- margin-left: 4px;
12
- background-color: var(--loader--indicator-bg, $digitalBlue);
13
- animation-name: transparentToOpaque;
14
- animation-duration: $normal;
15
- animation-iteration-count: infinite;
16
- animation-timing-function: ease-out;
17
- &:nth-child(1) {
18
- margin-left: initial;
19
- animation-delay: 0;
20
- }
21
- &:nth-child(2) {
22
- animation-delay: $veryFast;
23
- }
24
- &:nth-child(3) {
25
- animation-delay: $fast;
26
- }
27
- }
28
- }
29
-
30
- @keyframes transparentToOpaque {
31
- 0% {
32
- opacity: 0;
33
- }
34
- 50% {
35
- opacity: 1;
36
- }
37
- 100% {
38
- opacity: 0;
39
- }
40
- }
@@ -1,18 +0,0 @@
1
- import React from "react";
2
- import Styles from "./Loader.module.scss";
3
-
4
- /**
5
- * A simple loader
6
- **/
7
- export default function Loader({
8
- className = "",
9
- ...props
10
- }: { className?: string } & React.HTMLProps<HTMLDivElement>) {
11
- return (
12
- <span className={`${Styles.indicator} ${className}`} {...props}>
13
- <span />
14
- <span />
15
- <span />
16
- </span>
17
- );
18
- }
@@ -1,2 +0,0 @@
1
- export { default } from "./Loader";
2
- export * from "./Loader";
@@ -1,34 +0,0 @@
1
- import React, { useEffect, useState } from "react";
2
-
3
- /**
4
- * . .. ... . .. ...
5
- **/
6
- export default function LoaderDotsIndicator({
7
- dotsCount = 3,
8
- lockSize = false,
9
- }: {
10
- dotsCount?: number;
11
- /** Makes the dots so that they do not affect layout size */
12
- lockSize?: boolean;
13
- }) {
14
- const [text, setText] = useState(".");
15
- useEffect(() => {
16
- const fullText = new Array(dotsCount).fill(".").join("");
17
- const intervalId = setInterval(() => {
18
- setText((a) => (a === fullText ? "." : a + "."));
19
- }, 250);
20
-
21
- return () => clearInterval(intervalId);
22
- }, [dotsCount]);
23
-
24
- return (
25
- <>
26
- {text}
27
- {lockSize && (
28
- <span style={{ color: "#0000" }}>
29
- {new Array(dotsCount - text.length).fill(".")}
30
- </span>
31
- )}
32
- </>
33
- );
34
- }
@@ -1,2 +0,0 @@
1
- export { default } from "./LoaderDotsIndicator";
2
- export * from "./LoaderDotsIndicator";
@@ -1,37 +0,0 @@
1
- import React, {
2
- DetailedHTMLProps,
3
- HTMLAttributes,
4
- useLayoutEffect,
5
- useRef,
6
- } from "react";
7
-
8
- /**
9
- * Plays a video and loops between the end and the timestamp you set
10
- **/
11
- export default function LoopableVideo({
12
- videoSrc,
13
- percentToBackTo,
14
- ...props
15
- }: {
16
- videoSrc: string;
17
- /** A value between 0-1 indicating the timestamp to go back to */
18
- percentToBackTo: number;
19
- } & DetailedHTMLProps<HTMLAttributes<HTMLVideoElement>, HTMLVideoElement>) {
20
- if (process.env.NODE_ENV === "development")
21
- if (percentToBackTo < 0 || percentToBackTo > 1)
22
- throw new Error(`percentToBackTo should be a value between 0-1`);
23
- return (
24
- <video
25
- autoPlay
26
- muted
27
- onEnded={({ currentTarget }) => {
28
- const el = currentTarget as Omit<HTMLVideoElement, keyof HTMLElement>;
29
- el.currentTime = el.duration * percentToBackTo;
30
- el.play();
31
- }}
32
- {...props}
33
- >
34
- <source src={videoSrc} />
35
- </video>
36
- );
37
- }
@@ -1,2 +0,0 @@
1
- export { default } from "./LoopableVideo";
2
- export * from "./LoopableVideo";
@@ -1,28 +0,0 @@
1
- .container {
2
- display: flex;
3
- flex-wrap: wrap;
4
- align-items: flex-start;
5
- justify-content: space-between;
6
-
7
- // TODO: Priorize reducing width of empty elements insteas of the main container
8
- > :nth-child(1),
9
- > :nth-child(3) {
10
- flex: 1;
11
- max-width: 250px;
12
- min-width: 150px;
13
- }
14
-
15
- .content {
16
- min-width: 250px;
17
- }
18
-
19
- > :nth-child(2) {
20
- flex: 1;
21
- max-width: 1200px;
22
- }
23
- }
24
-
25
- .section {
26
- align-items: flex-start;
27
- min-height: initial;
28
- }
@@ -1,68 +0,0 @@
1
- import React, {
2
- ElementRef,
3
- ForwardedRef,
4
- forwardRef,
5
- useImperativeHandle,
6
- useRef,
7
- } from "react";
8
- import UncontrolledTransition from "../UncontrolledTransition";
9
- import Styles from "./MainGrid.module.scss";
10
-
11
- function _MainGrid(
12
- {
13
- children,
14
- leftContent,
15
- rightContent,
16
- }: {
17
- leftContent?: React.ReactElement;
18
- rightContent?: React.ReactElement;
19
- children: React.ReactElement;
20
- },
21
- ref: ForwardedRef<
22
- Pick<ElementRef<typeof UncontrolledTransition>, "setOrientation">
23
- >
24
- ) {
25
- const refs = [
26
- useRef<ElementRef<typeof UncontrolledTransition>>(null),
27
- useRef<ElementRef<typeof UncontrolledTransition>>(null),
28
- useRef<ElementRef<typeof UncontrolledTransition>>(null),
29
- ];
30
-
31
- useImperativeHandle(
32
- ref,
33
- () => ({
34
- setOrientation: (orientation) => {
35
- refs.forEach((r) => r.current?.setOrientation(orientation));
36
- },
37
- }),
38
- []
39
- );
40
-
41
- return (
42
- <>
43
- <div className={Styles.container}>
44
- <div className={leftContent ? Styles.content : ""}>
45
- <UncontrolledTransition className={Styles.section} ref={refs[0]}>
46
- {leftContent}
47
- </UncontrolledTransition>
48
- </div>
49
- <div>
50
- <UncontrolledTransition className={Styles.section} ref={refs[1]}>
51
- {children}
52
- </UncontrolledTransition>
53
- </div>
54
- <div className={rightContent ? Styles.content : ""}>
55
- <UncontrolledTransition className={Styles.section} ref={refs[2]}>
56
- {rightContent}
57
- </UncontrolledTransition>
58
- </div>
59
- </div>
60
- </>
61
- );
62
- }
63
-
64
- /**
65
- * This layout divides the screen in 3 fragments and provides a responsive adaptation when on mobile
66
- **/
67
- const MainGrid = forwardRef(_MainGrid);
68
- export default MainGrid;
@@ -1,2 +0,0 @@
1
- export { default } from "./MainGrid";
2
- export * from "./MainGrid";