@onepercentio/one-ui 0.19.2 → 0.19.4
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.
- package/.babelrc +17 -0
- package/.prod.babelrc +22 -0
- package/dist/assets/styles/variables.scss +1 -0
- package/dist/components/AdaptiveButton/AdaptiveButton.js +24 -25
- package/dist/components/AdaptiveButton/index.js +12 -8
- package/dist/components/AdaptiveContainer/AdaptiveContainer.js +95 -114
- package/dist/components/AdaptiveContainer/index.js +12 -8
- package/dist/components/AdaptiveDialog/AdaptiveDialog.js +85 -65
- package/dist/components/AdaptiveDialog/index.js +12 -8
- package/dist/components/AdaptiveSidebar/AdaptiveSidebar.js +84 -76
- package/dist/components/AdaptiveSidebar/index.js +12 -8
- package/dist/components/AnchoredTooltip/AnchoredTooltip.js +155 -160
- package/dist/components/AnchoredTooltip/index.js +12 -8
- package/dist/components/AnimatedEntrance/AnimatedEntrance.js +172 -139
- package/dist/components/AnimatedEntrance/index.js +26 -10
- package/dist/components/AsyncWrapper/AsyncWrapper.js +33 -21
- package/dist/components/AsyncWrapper/index.js +12 -8
- package/dist/components/Avatar/Avatar.js +34 -40
- package/dist/components/Avatar/index.js +12 -8
- package/dist/components/BucketFill/BucketFill.js +47 -58
- package/dist/components/BucketFill/index.js +12 -8
- package/dist/components/Button/Button.js +32 -49
- package/dist/components/Button/README.md +8 -0
- package/dist/components/Button/index.js +12 -8
- package/dist/components/Card/Card.js +16 -11
- package/dist/components/Card/index.js +12 -8
- package/dist/components/Chart/Chart.logic.js +10 -10
- package/dist/components/Chart/Chart.types.js +4 -2
- package/dist/components/Chart/Chart.view.js +212 -131
- package/dist/components/Chart/index.js +12 -8
- package/dist/components/CheckBox/CheckBox.d.ts +3 -1
- package/dist/components/CheckBox/CheckBox.js +43 -30
- package/dist/components/CheckBox/CheckBox.module.scss +6 -0
- package/dist/components/CheckBox/index.js +12 -8
- package/dist/components/Collapsable/Collapsable.d.ts +26 -27
- package/dist/components/Collapsable/Collapsable.js +173 -143
- package/dist/components/Collapsable/index.js +12 -8
- package/dist/components/Countdown/Countdown.js +87 -100
- package/dist/components/Countdown/index.js +12 -8
- package/dist/components/Divider/Divider.js +15 -12
- package/dist/components/Divider/index.js +12 -8
- package/dist/components/EmailInput/EmailInput.d.ts +4 -3
- package/dist/components/EmailInput/EmailInput.js +45 -43
- package/dist/components/EmailInput/README.md +10 -0
- package/dist/components/EmailInput/index.js +20 -9
- package/dist/components/FadeIn/FadeIn.js +62 -69
- package/dist/components/FadeIn/index.js +12 -8
- package/dist/components/FileInput/FileInput.d.ts +25 -9
- package/dist/components/FileInput/FileInput.js +41 -70
- package/dist/components/FileInput/FileInput.module.scss +0 -21
- package/dist/components/FileInput/View/BigFactory/BigFactory.d.ts +6 -0
- package/dist/components/FileInput/View/BigFactory/BigFactory.js +46 -0
- package/dist/components/FileInput/View/BigFactory/BigFactory.module.scss +20 -0
- package/dist/components/FileInput/View/BigFactory/index.d.ts +1 -0
- package/dist/components/FileInput/View/BigFactory/index.js +13 -0
- package/dist/components/FileInput/View/Compact/Compact.d.ts +5 -0
- package/dist/components/FileInput/View/Compact/Compact.js +88 -0
- package/dist/components/FileInput/View/Compact/Compact.module.scss +59 -0
- package/dist/components/FileInput/View/Compact/index.d.ts +1 -0
- package/dist/components/FileInput/View/Compact/index.js +13 -0
- package/dist/components/FileInput/View/View.types.d.ts +8 -0
- package/dist/components/FileInput/View/View.types.js +5 -0
- package/dist/components/FileInput/index.js +12 -8
- package/dist/components/FlowController/FlowController.js +60 -29
- package/dist/components/FlowController/README.md +13 -0
- package/dist/components/FlowController/index.js +12 -8
- package/dist/components/Form/Form.js +157 -96
- package/dist/components/Form/index.js +12 -8
- package/dist/components/Freeze/Freeze.js +11 -10
- package/dist/components/Freeze/index.js +12 -8
- package/dist/components/HSForms/HSForms.js +48 -68
- package/dist/components/HSForms/index.js +12 -8
- package/dist/components/Header/Header.js +100 -69
- package/dist/components/Header/index.js +12 -8
- package/dist/components/HeaderCloseBtn/HeaderCloseBtn.js +17 -13
- package/dist/components/HeaderCloseBtn/index.js +12 -8
- package/dist/components/InfinityScroll/InfinityScroll.js +137 -117
- package/dist/components/InfinityScroll/index.js +12 -8
- package/dist/components/Input/Input.d.ts +8 -6
- package/dist/components/Input/Input.js +105 -90
- package/dist/components/Input/Input.module.scss +4 -2
- package/dist/components/Input/README.md +10 -0
- package/dist/components/Input/index.js +12 -8
- package/dist/components/InstantCounter/InstantCounter.js +61 -52
- package/dist/components/InstantCounter/index.js +12 -8
- package/dist/components/LavaLamp/LavaLamp.data.js +95 -87
- package/dist/components/LavaLamp/LavaLamp.js +107 -70
- package/dist/components/LavaLamp/index.js +12 -8
- package/dist/components/LavaLamp/v2/LavaLamp.js +200 -182
- package/dist/components/LinkToId/LinkToId.js +42 -28
- package/dist/components/LinkToId/index.js +20 -9
- package/dist/components/Loader/Loader.js +20 -26
- package/dist/components/Loader/index.js +12 -8
- package/dist/components/LoaderDotsIndicator/LoaderDotsIndicator.js +34 -37
- package/dist/components/LoaderDotsIndicator/index.js +12 -8
- package/dist/components/LoopableVideo/LoopableVideo.js +29 -30
- package/dist/components/LoopableVideo/index.js +12 -8
- package/dist/components/MainGrid/MainGrid.js +44 -50
- package/dist/components/MainGrid/index.js +12 -8
- package/dist/components/MutableHamburgerButton/MutableHamburgerButton.js +26 -26
- package/dist/components/MutableHamburgerButton/index.js +12 -8
- package/dist/components/Notification/Notification.js +16 -12
- package/dist/components/Notification/index.js +12 -8
- package/dist/components/OrderableList/OrderableList.js +406 -374
- package/dist/components/OrderableList/index.js +12 -8
- package/dist/components/PaginationIndicator/PaginationIndicator.js +230 -196
- package/dist/components/PaginationIndicator/index.js +12 -8
- package/dist/components/Parallax/Parallax.js +164 -161
- package/dist/components/Parallax/index.js +12 -8
- package/dist/components/Parallax/math/helpers.js +128 -217
- package/dist/components/PasswordInput/PasswordInput.d.ts +4 -3
- package/dist/components/PasswordInput/PasswordInput.js +120 -97
- package/dist/components/PasswordInput/index.js +12 -8
- package/dist/components/PingPongText/PingPongText.d.ts +6 -0
- package/dist/components/PingPongText/PingPongText.js +69 -0
- package/dist/components/PingPongText/PingPongText.module.scss +4 -0
- package/dist/components/PingPongText/index.d.ts +1 -0
- package/dist/components/PingPongText/index.js +13 -0
- package/dist/components/PixelatedScan/PixelatedScan.js +140 -97
- package/dist/components/PixelatedScan/index.js +12 -8
- package/dist/components/Portal/Portal.js +54 -64
- package/dist/components/Portal/index.js +20 -9
- package/dist/components/ProgressBar/ProgressBar.js +48 -45
- package/dist/components/ProgressBar/ProgressBar.module.scss +4 -0
- package/dist/components/ProgressBar/index.js +20 -9
- package/dist/components/ProgressTexts/ProgressTexts.js +42 -34
- package/dist/components/ProgressTexts/README.md +12 -0
- package/dist/components/ProgressTexts/index.js +12 -8
- package/dist/components/Radio/Radio.d.ts +13 -0
- package/dist/components/Radio/Radio.js +47 -0
- package/dist/components/Radio/Radio.module.scss +34 -0
- package/dist/components/Radio/index.d.ts +1 -0
- package/dist/components/Radio/index.js +13 -0
- package/dist/components/SectionContainer/SectionContainer.js +35 -39
- package/dist/components/SectionContainer/index.js +12 -8
- package/dist/components/Select/Select.d.ts +2 -1
- package/dist/components/Select/Select.js +133 -82
- package/dist/components/Select/Select.module.scss +14 -2
- package/dist/components/Select/index.js +12 -8
- package/dist/components/Skeleton/Skeleton.js +21 -15
- package/dist/components/Skeleton/index.js +12 -8
- package/dist/components/Spacing/Spacing.js +14 -11
- package/dist/components/Spacing/index.js +12 -8
- package/dist/components/StaticScroller/StaticScroller.js +61 -81
- package/dist/components/StaticScroller/index.js +12 -8
- package/dist/components/Switch/Switch.js +29 -25
- package/dist/components/Switch/index.js +12 -8
- package/dist/components/Table/Table.js +111 -80
- package/dist/components/Table/index.js +12 -8
- package/dist/components/Tabs/Tabs.js +42 -52
- package/dist/components/Tabs/index.js +12 -8
- package/dist/components/Text/Text.js +31 -50
- package/dist/components/Text/index.js +12 -8
- package/dist/components/Transition/MasksFactory/DiagonalReveal.js +46 -22
- package/dist/components/Transition/MasksFactory/DiagonalSquareToBalls.js +71 -57
- package/dist/components/Transition/MasksFactory/PhysicsSquares.js +97 -80
- package/dist/components/Transition/MasksFactory/SquareToBalls.js +59 -50
- package/dist/components/Transition/MasksFactory/utils.js +25 -28
- package/dist/components/Transition/Transition.js +316 -309
- package/dist/components/Transition/index.js +20 -9
- package/dist/components/UncontrolledTransition/UncontrolledTransition.js +110 -86
- package/dist/components/UncontrolledTransition/index.js +12 -8
- package/dist/components/WalletConnectionWrapper/WalletConnectionWrapper.js +116 -105
- package/dist/components/WalletConnectionWrapper/index.js +20 -9
- package/dist/components/utilitary/ScrollAndFocusLock/ScrollAndFocusLock.js +51 -69
- package/dist/components/utilitary/ScrollAndFocusLock/index.js +12 -8
- package/dist/context/AsyncProcess.js +77 -63
- package/dist/context/CustomBrowserRouter.js +40 -52
- package/dist/context/OneUIProvider.d.ts +8 -2
- package/dist/context/OneUIProvider.js +90 -104
- package/dist/hooks/logs/README.md +3 -0
- package/dist/hooks/logs/useDependencyChangeDetection.js +17 -17
- package/dist/hooks/logs/useIsMounting.js +10 -8
- package/dist/hooks/persistence/useLocalStorage.js +40 -30
- package/dist/hooks/shims/ObjectWatchShim.d.ts +1 -0
- package/dist/hooks/shims/ObjectWatchShim.js +49 -46
- package/dist/hooks/ui/useAdaptiveImage.js +43 -35
- package/dist/hooks/ui/useBreakpoint.js +34 -19
- package/dist/hooks/ui/useCustomScrollbar.js +26 -21
- package/dist/hooks/ui/useMouseHover.js +29 -16
- package/dist/hooks/ui/usePaginationControls.d.ts +0 -4
- package/dist/hooks/ui/usePaginationControls.e2e.d.ts +4 -0
- package/dist/hooks/ui/usePaginationControls.js +125 -153
- package/dist/hooks/ui/useTilt.js +156 -128
- package/dist/hooks/ui/useZoomable.js +114 -138
- package/dist/hooks/useAsyncControl.js +82 -47
- package/dist/hooks/useContainedRepositioning.js +75 -72
- package/dist/hooks/useCustomHistory.js +21 -13
- package/dist/hooks/useElementFit.js +42 -34
- package/dist/hooks/useFirestoreWatch.js +54 -35
- package/dist/hooks/useForm.js +47 -22
- package/dist/hooks/useFreeze.js +11 -9
- package/dist/hooks/useHero.d.ts +4 -0
- package/dist/hooks/useHero.js +171 -159
- package/dist/hooks/useIntersection.js +33 -27
- package/dist/hooks/useMergeRefs.js +26 -23
- package/dist/hooks/useObserve.js +28 -15
- package/dist/hooks/usePagination.js +151 -129
- package/dist/hooks/usePooledOperation.js +43 -58
- package/dist/hooks/usePooling.js +62 -48
- package/dist/hooks/useRebound.js +36 -22
- package/dist/hooks/useShortIntl.js +79 -51
- package/dist/hooks/utility/useEvents.js +28 -22
- package/dist/hooks/utility/useModule.js +21 -10
- package/dist/hooks/utility/useQuery.js +14 -8
- package/dist/models/DebugLogger.js +7 -6
- package/dist/models/GenericContract.js +39 -12
- package/dist/reac-app-env.d.js +1 -0
- package/dist/storybook/assets/video/txt-reversed.mp4 +0 -0
- package/dist/storybookUtils/index.js +42 -24
- package/dist/type-utils.js +4 -2
- package/dist/types.js +4 -2
- package/dist/utility.d.js +17 -0
- package/dist/utils/blockchain.js +60 -54
- package/dist/utils/flatten.js +23 -13
- package/dist/utils/html.utils.js +9 -6
- package/dist/utils/ownEvent.js +9 -8
- package/package.json +14 -9
- package/tsconfig.json +3 -2
- package/cypress/support/commands.ts +0 -49
- package/cypress/support/component-index.html +0 -30
- package/cypress/support/component.ts +0 -39
- package/cypress/support/e2e.js +0 -49
- package/dist/components/AdaptiveButton/AdaptiveButton.js.map +0 -1
- package/dist/components/AdaptiveButton/index.js.map +0 -1
- package/dist/components/AdaptiveContainer/AdaptiveContainer.js.map +0 -1
- package/dist/components/AdaptiveContainer/index.js.map +0 -1
- package/dist/components/AdaptiveDialog/AdaptiveDialog.js.map +0 -1
- package/dist/components/AdaptiveDialog/index.js.map +0 -1
- package/dist/components/AdaptiveSidebar/AdaptiveSidebar.js.map +0 -1
- package/dist/components/AdaptiveSidebar/index.js.map +0 -1
- package/dist/components/AnchoredTooltip/AnchoredTooltip.js.map +0 -1
- package/dist/components/AnchoredTooltip/index.js.map +0 -1
- package/dist/components/AnimatedEntrance/AnimatedEntrance.js.map +0 -1
- package/dist/components/AnimatedEntrance/index.js.map +0 -1
- package/dist/components/AsyncWrapper/AsyncWrapper.js.map +0 -1
- package/dist/components/AsyncWrapper/index.js.map +0 -1
- package/dist/components/Avatar/Avatar.js.map +0 -1
- package/dist/components/Avatar/index.js.map +0 -1
- package/dist/components/BucketFill/BucketFill.js.map +0 -1
- package/dist/components/BucketFill/index.js.map +0 -1
- package/dist/components/Button/Button.js.map +0 -1
- package/dist/components/Button/index.js.map +0 -1
- package/dist/components/Card/Card.js.map +0 -1
- package/dist/components/Card/index.js.map +0 -1
- package/dist/components/Chart/Chart.e2e.js +0 -9
- package/dist/components/Chart/Chart.e2e.js.map +0 -1
- package/dist/components/Chart/Chart.logic.js.map +0 -1
- package/dist/components/Chart/Chart.types.js.map +0 -1
- package/dist/components/Chart/Chart.view.js.map +0 -1
- package/dist/components/Chart/index.js.map +0 -1
- package/dist/components/CheckBox/CheckBox.js.map +0 -1
- package/dist/components/CheckBox/index.js.map +0 -1
- package/dist/components/Collapsable/Collapsable.js.map +0 -1
- package/dist/components/Collapsable/index.js.map +0 -1
- package/dist/components/Countdown/Countdown.js.map +0 -1
- package/dist/components/Countdown/index.js.map +0 -1
- package/dist/components/Divider/Divider.js.map +0 -1
- package/dist/components/Divider/index.js.map +0 -1
- package/dist/components/EmailInput/EmailInput.js.map +0 -1
- package/dist/components/EmailInput/index.js.map +0 -1
- package/dist/components/FadeIn/FadeIn.js.map +0 -1
- package/dist/components/FadeIn/index.js.map +0 -1
- package/dist/components/FileInput/FileInput.js.map +0 -1
- package/dist/components/FileInput/index.js.map +0 -1
- package/dist/components/FlowController/FlowController.js.map +0 -1
- package/dist/components/FlowController/index.js.map +0 -1
- package/dist/components/Form/Form.js.map +0 -1
- package/dist/components/Form/index.js.map +0 -1
- package/dist/components/Freeze/Freeze.js.map +0 -1
- package/dist/components/Freeze/index.js.map +0 -1
- package/dist/components/HSForms/HSForms.js.map +0 -1
- package/dist/components/HSForms/index.js.map +0 -1
- package/dist/components/Header/Header.js.map +0 -1
- package/dist/components/Header/index.js.map +0 -1
- package/dist/components/HeaderCloseBtn/HeaderCloseBtn.js.map +0 -1
- package/dist/components/HeaderCloseBtn/index.js.map +0 -1
- package/dist/components/InfinityScroll/InfinityScroll.js.map +0 -1
- package/dist/components/InfinityScroll/index.js.map +0 -1
- package/dist/components/Input/Input.js.map +0 -1
- package/dist/components/Input/index.js.map +0 -1
- package/dist/components/InstantCounter/InstantCounter.js.map +0 -1
- package/dist/components/InstantCounter/index.js.map +0 -1
- package/dist/components/LavaLamp/LavaLamp.data.js.map +0 -1
- package/dist/components/LavaLamp/LavaLamp.js.map +0 -1
- package/dist/components/LavaLamp/index.js.map +0 -1
- package/dist/components/LavaLamp/v2/LavaLamp.js.map +0 -1
- package/dist/components/LinkToId/LinkToId.js.map +0 -1
- package/dist/components/LinkToId/index.js.map +0 -1
- package/dist/components/Loader/Loader.js.map +0 -1
- package/dist/components/Loader/index.js.map +0 -1
- package/dist/components/LoaderDotsIndicator/LoaderDotsIndicator.js.map +0 -1
- package/dist/components/LoaderDotsIndicator/index.js.map +0 -1
- package/dist/components/LoopableVideo/LoopableVideo.js.map +0 -1
- package/dist/components/LoopableVideo/index.js.map +0 -1
- package/dist/components/MainGrid/MainGrid.js.map +0 -1
- package/dist/components/MainGrid/index.js.map +0 -1
- package/dist/components/MutableHamburgerButton/MutableHamburgerButton.js.map +0 -1
- package/dist/components/MutableHamburgerButton/index.js.map +0 -1
- package/dist/components/Notification/Notification.js.map +0 -1
- package/dist/components/Notification/index.js.map +0 -1
- package/dist/components/OrderableList/OrderableList.js.map +0 -1
- package/dist/components/OrderableList/index.js.map +0 -1
- package/dist/components/PaginationIndicator/PaginationIndicator.js.map +0 -1
- package/dist/components/PaginationIndicator/index.js.map +0 -1
- package/dist/components/Parallax/Parallax.js.map +0 -1
- package/dist/components/Parallax/index.js.map +0 -1
- package/dist/components/Parallax/math/helpers.js.map +0 -1
- package/dist/components/PasswordInput/PasswordInput.js.map +0 -1
- package/dist/components/PasswordInput/index.js.map +0 -1
- package/dist/components/PixelatedScan/PixelatedScan.js.map +0 -1
- package/dist/components/PixelatedScan/index.js.map +0 -1
- package/dist/components/Portal/Portal.js.map +0 -1
- package/dist/components/Portal/index.js.map +0 -1
- package/dist/components/ProgressBar/ProgressBar.js.map +0 -1
- package/dist/components/ProgressBar/index.js.map +0 -1
- package/dist/components/ProgressTexts/ProgressTexts.js.map +0 -1
- package/dist/components/ProgressTexts/index.js.map +0 -1
- package/dist/components/SectionContainer/SectionContainer.js.map +0 -1
- package/dist/components/SectionContainer/index.js.map +0 -1
- package/dist/components/Select/Select.js.map +0 -1
- package/dist/components/Select/index.js.map +0 -1
- package/dist/components/Skeleton/Skeleton.js.map +0 -1
- package/dist/components/Skeleton/index.js.map +0 -1
- package/dist/components/Spacing/Spacing.js.map +0 -1
- package/dist/components/Spacing/index.js.map +0 -1
- package/dist/components/StaticScroller/StaticScroller.js.map +0 -1
- package/dist/components/StaticScroller/index.js.map +0 -1
- package/dist/components/Switch/Switch.js.map +0 -1
- package/dist/components/Switch/index.js.map +0 -1
- package/dist/components/Table/Table.js.map +0 -1
- package/dist/components/Table/index.js.map +0 -1
- package/dist/components/Tabs/Tabs.js.map +0 -1
- package/dist/components/Tabs/index.js.map +0 -1
- package/dist/components/Text/Text.js.map +0 -1
- package/dist/components/Text/index.js.map +0 -1
- package/dist/components/Transition/MasksFactory/DiagonalReveal.js.map +0 -1
- package/dist/components/Transition/MasksFactory/DiagonalSquareToBalls.js.map +0 -1
- package/dist/components/Transition/MasksFactory/PhysicsSquares.js.map +0 -1
- package/dist/components/Transition/MasksFactory/SquareToBalls.js.map +0 -1
- package/dist/components/Transition/MasksFactory/utils.js.map +0 -1
- package/dist/components/Transition/Transition.js.map +0 -1
- package/dist/components/Transition/index.js.map +0 -1
- package/dist/components/UncontrolledTransition/UncontrolledTransition.js.map +0 -1
- package/dist/components/UncontrolledTransition/index.js.map +0 -1
- package/dist/components/WalletConnectionWrapper/WalletConnectionWrapper.js.map +0 -1
- package/dist/components/WalletConnectionWrapper/index.js.map +0 -1
- package/dist/components/utilitary/ScrollAndFocusLock/ScrollAndFocusLock.js.map +0 -1
- package/dist/components/utilitary/ScrollAndFocusLock/index.js.map +0 -1
- package/dist/context/AsyncProcess.js.map +0 -1
- package/dist/context/CustomBrowserRouter.js.map +0 -1
- package/dist/context/OneUIProvider.js.map +0 -1
- package/dist/hooks/logs/useDependencyChangeDetection.js.map +0 -1
- package/dist/hooks/logs/useIsMounting.js.map +0 -1
- package/dist/hooks/persistence/useLocalStorage.js.map +0 -1
- package/dist/hooks/shims/ObjectWatchShim.js.map +0 -1
- package/dist/hooks/ui/useAdaptiveImage.js.map +0 -1
- package/dist/hooks/ui/useBreakpoint.js.map +0 -1
- package/dist/hooks/ui/useCustomScrollbar.js.map +0 -1
- package/dist/hooks/ui/useMouseHover.js.map +0 -1
- package/dist/hooks/ui/usePaginationControls.js.map +0 -1
- package/dist/hooks/ui/useTilt.js.map +0 -1
- package/dist/hooks/ui/useZoomable.js.map +0 -1
- package/dist/hooks/useAsyncControl.js.map +0 -1
- package/dist/hooks/useContainedRepositioning.js.map +0 -1
- package/dist/hooks/useCustomHistory.js.map +0 -1
- package/dist/hooks/useElementFit.js.map +0 -1
- package/dist/hooks/useFirestoreWatch.js.map +0 -1
- package/dist/hooks/useForm.js.map +0 -1
- package/dist/hooks/useFreeze.js.map +0 -1
- package/dist/hooks/useHero.js.map +0 -1
- package/dist/hooks/useHero.module.scss +0 -5
- package/dist/hooks/useIntersection.js.map +0 -1
- package/dist/hooks/useMergeRefs.js.map +0 -1
- package/dist/hooks/useObserve.js.map +0 -1
- package/dist/hooks/usePagination.js.map +0 -1
- package/dist/hooks/usePooledOperation.js.map +0 -1
- package/dist/hooks/usePooling.js.map +0 -1
- package/dist/hooks/useRebound.js.map +0 -1
- package/dist/hooks/useShortIntl.js.map +0 -1
- package/dist/hooks/utility/useEvents.js.map +0 -1
- package/dist/hooks/utility/useModule.js.map +0 -1
- package/dist/hooks/utility/useQuery.js.map +0 -1
- package/dist/models/DebugLogger.js.map +0 -1
- package/dist/models/GenericContract.js.map +0 -1
- package/dist/storybookUtils/index.js.map +0 -1
- package/dist/type-utils.js.map +0 -1
- package/dist/types.js.map +0 -1
- package/dist/utils/blockchain.js.map +0 -1
- package/dist/utils/flatten.js.map +0 -1
- package/dist/utils/html.utils.js.map +0 -1
- package/dist/utils/ownEvent.js.map +0 -1
|
@@ -1,76 +1,113 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
-
}) : function(o, v) {
|
|
16
|
-
o["default"] = v;
|
|
2
|
+
|
|
3
|
+
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
17
6
|
});
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
};
|
|
25
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
26
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
27
|
-
};
|
|
28
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
|
-
const react_1 = __importStar(require("react"));
|
|
30
|
-
const LavaLamp_data_1 = __importDefault(require("./LavaLamp.data"));
|
|
31
|
-
const LavaLamp_module_scss_1 = __importDefault(require("./LavaLamp.module.scss"));
|
|
7
|
+
exports.default = LavaLamp;
|
|
8
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
9
|
+
var _LavaLamp = _interopRequireDefault(require("./LavaLamp.data"));
|
|
10
|
+
var _LavaLampModule = _interopRequireDefault(require("./LavaLamp.module.scss"));
|
|
11
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
12
|
+
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
13
|
+
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
32
14
|
/**
|
|
33
15
|
* A peaceful component simulating an interactive lavalamp
|
|
34
16
|
**/
|
|
35
|
-
function LavaLamp(
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
17
|
+
function LavaLamp(_ref) {
|
|
18
|
+
let className = _ref.className,
|
|
19
|
+
children = _ref.children;
|
|
20
|
+
const circleRef = (0, _react.useRef)(null);
|
|
21
|
+
const _useLavaLampSetup = (0, _LavaLamp.default)(function () {}, function () {}),
|
|
22
|
+
relativeTo = _useLavaLampSetup.relativeTo,
|
|
23
|
+
d = _useLavaLampSetup.d,
|
|
24
|
+
circlesConfig = _useLavaLampSetup.circlesConfig;
|
|
25
|
+
const randomCircles = (0, _react.useMemo)(function () {
|
|
26
|
+
return circlesConfig.map(function (_ref2) {
|
|
27
|
+
let baseSize = _ref2.baseSize,
|
|
28
|
+
startX = _ref2.startX,
|
|
29
|
+
startY = _ref2.startY,
|
|
30
|
+
translateX = _ref2.translateX,
|
|
31
|
+
translateY = _ref2.translateY;
|
|
32
|
+
return /*#__PURE__*/_react.default.createElement("circle", {
|
|
33
|
+
r: baseSize + Math.random() * (baseSize / 2),
|
|
34
|
+
fill: "#fff",
|
|
35
|
+
cx: startX,
|
|
36
|
+
cy: startY
|
|
37
|
+
}, /*#__PURE__*/_react.default.createElement("animateTransform", {
|
|
38
|
+
additive: "sum",
|
|
39
|
+
attributeName: "transform",
|
|
40
|
+
attributeType: "XML",
|
|
41
|
+
type: "translate",
|
|
42
|
+
values: "0 0; ".concat(translateX, " ").concat(translateY, "; 0 0;"),
|
|
43
|
+
dur: "".concat(5 + Math.random() * 5, "s"),
|
|
44
|
+
repeatCount: "indefinite"
|
|
45
|
+
}));
|
|
44
46
|
});
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
47
|
+
}, [circlesConfig]);
|
|
48
|
+
return /*#__PURE__*/_react.default.createElement("div", {
|
|
49
|
+
ref: relativeTo,
|
|
50
|
+
className: "".concat(_LavaLampModule.default.root, " ").concat(className)
|
|
51
|
+
}, d && /*#__PURE__*/_react.default.createElement("svg", {
|
|
52
|
+
className: _LavaLampModule.default.effect,
|
|
53
|
+
viewBox: "0 0 ".concat(d.width, " ").concat(d.height)
|
|
54
|
+
}, /*#__PURE__*/_react.default.createElement("filter", {
|
|
55
|
+
id: "goo-lava-lamp",
|
|
56
|
+
width: "10",
|
|
57
|
+
height: "10",
|
|
58
|
+
x: "0%",
|
|
59
|
+
y: "0%",
|
|
60
|
+
filterRes: "1"
|
|
61
|
+
}, /*#__PURE__*/_react.default.createElement("feGaussianBlur", {
|
|
62
|
+
in: "SourceGraphic",
|
|
63
|
+
result: "blur",
|
|
64
|
+
stdDeviation: "40"
|
|
65
|
+
}), /*#__PURE__*/_react.default.createElement("feColorMatrix", {
|
|
66
|
+
in: "blur",
|
|
67
|
+
mode: "matrix",
|
|
68
|
+
values: "1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 50 -7",
|
|
69
|
+
result: "goo"
|
|
70
|
+
})), /*#__PURE__*/_react.default.createElement("mask", {
|
|
71
|
+
id: "mask-lava-lamp"
|
|
72
|
+
}, /*#__PURE__*/_react.default.createElement("g", {
|
|
73
|
+
filter: "url(#".concat("goo-lava-lamp", ")"),
|
|
74
|
+
fill: "#fff"
|
|
75
|
+
}, randomCircles, /*#__PURE__*/_react.default.createElement("circle", {
|
|
76
|
+
ref: circleRef,
|
|
77
|
+
fill: "#fff"
|
|
78
|
+
}))), /*#__PURE__*/_react.default.createElement("defs", null, /*#__PURE__*/_react.default.createElement("radialGradient", {
|
|
79
|
+
id: "grad1",
|
|
80
|
+
cx: "50%",
|
|
81
|
+
cy: "50%",
|
|
82
|
+
r: "50%",
|
|
83
|
+
fx: "50%",
|
|
84
|
+
fy: "50%"
|
|
85
|
+
}, /*#__PURE__*/_react.default.createElement("stop", {
|
|
86
|
+
offset: "0%",
|
|
87
|
+
style: {
|
|
88
|
+
stopColor: "var(--lava-lamp-color-a)",
|
|
89
|
+
stopOpacity: 1
|
|
90
|
+
}
|
|
91
|
+
}), /*#__PURE__*/_react.default.createElement("stop", {
|
|
92
|
+
offset: "67.33%",
|
|
93
|
+
style: {
|
|
94
|
+
stopColor: "var(--lava-lamp-color-b)",
|
|
95
|
+
stopOpacity: 1
|
|
96
|
+
}
|
|
97
|
+
}), /*#__PURE__*/_react.default.createElement("stop", {
|
|
98
|
+
offset: "88.33%",
|
|
99
|
+
style: {
|
|
100
|
+
stopColor: "var(--lava-lamp-color-c)",
|
|
101
|
+
stopOpacity: 1
|
|
102
|
+
}
|
|
103
|
+
}))), /*#__PURE__*/_react.default.createElement("rect", {
|
|
104
|
+
x: "-50%",
|
|
105
|
+
y: "-50%",
|
|
106
|
+
mask: "url(#".concat("mask-lava-lamp", ")"),
|
|
107
|
+
width: "200%",
|
|
108
|
+
height: "200%",
|
|
109
|
+
style: {
|
|
110
|
+
fill: "url(#grad1)"
|
|
111
|
+
}
|
|
112
|
+
})), /*#__PURE__*/_react.default.createElement("div", null, children));
|
|
113
|
+
}
|
|
@@ -1,9 +1,13 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
exports
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
Object.defineProperty(exports, "default", {
|
|
7
|
+
enumerable: true,
|
|
8
|
+
get: function get() {
|
|
9
|
+
return _LavaLamp.default;
|
|
10
|
+
}
|
|
11
|
+
});
|
|
12
|
+
var _LavaLamp = _interopRequireDefault(require("./LavaLamp"));
|
|
13
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
@@ -1,189 +1,207 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
-
}) : function(o, v) {
|
|
16
|
-
o["default"] = v;
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
17
5
|
});
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
};
|
|
25
|
-
var
|
|
26
|
-
|
|
27
|
-
};
|
|
28
|
-
Object.
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
function
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
6
|
+
exports.default = LavaLamp;
|
|
7
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
8
|
+
var _useMergeRefs = _interopRequireDefault(require("../../../hooks/useMergeRefs"));
|
|
9
|
+
var _LavaLamp = _interopRequireWildcard(require("../LavaLamp.data"));
|
|
10
|
+
var _LavaLampModule = _interopRequireDefault(require("./LavaLamp.module.scss"));
|
|
11
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
12
|
+
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
13
|
+
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
14
|
+
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
15
|
+
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }
|
|
16
|
+
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
17
|
+
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
18
|
+
function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return _assertThisInitialized(self); }
|
|
19
|
+
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
20
|
+
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
21
|
+
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
22
|
+
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
23
|
+
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }
|
|
24
|
+
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
|
25
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
26
|
+
function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
27
|
+
function LavaLamp(_ref) {
|
|
28
|
+
let className = _ref.className,
|
|
29
|
+
children = _ref.children;
|
|
30
|
+
const guideConfig = (0, _react.useRef)({
|
|
31
|
+
size: 0,
|
|
32
|
+
sizeTimestamp: Date.now(),
|
|
33
|
+
sizeIncrement: 0,
|
|
34
|
+
x: 0,
|
|
35
|
+
y: 0,
|
|
36
|
+
posTimestamp: Date.now(),
|
|
37
|
+
posIncrement: [0, 0]
|
|
38
|
+
});
|
|
39
|
+
const _useLavaLampSetup = (0, _LavaLamp.default)(function (x, y) {
|
|
40
|
+
guideConfig.current.posIncrement = [x - guideConfig.current.x, y - guideConfig.current.y];
|
|
41
|
+
guideConfig.current.x = x;
|
|
42
|
+
guideConfig.current.y = y;
|
|
43
|
+
guideConfig.current.posTimestamp = Date.now();
|
|
44
|
+
}, function (_size) {
|
|
45
|
+
const size = _size * 1.2;
|
|
46
|
+
guideConfig.current.sizeIncrement = guideConfig.current.size === 0 ? 0 : size - guideConfig.current.size;
|
|
47
|
+
guideConfig.current.size = size;
|
|
48
|
+
guideConfig.current.sizeTimestamp = Date.now();
|
|
49
|
+
}),
|
|
50
|
+
relativeTo = _useLavaLampSetup.relativeTo,
|
|
51
|
+
circlesConfig = _useLavaLampSetup.circlesConfig,
|
|
52
|
+
d = _useLavaLampSetup.d;
|
|
53
|
+
const _canvasRef = (0, _react.useRef)(null);
|
|
54
|
+
const canvasRef = (0, _useMergeRefs.default)(_canvasRef, relativeTo);
|
|
55
|
+
(0, _react.useEffect)(function () {
|
|
56
|
+
if (!d) return;
|
|
57
|
+
const fc = canvasRef.current;
|
|
58
|
+
const baseColor = getComputedStyle(relativeTo.current).getPropertyValue("--digital-blue") || "#000000";
|
|
59
|
+
var c = document.createElement("canvas"),
|
|
60
|
+
w = c.width = fc.width = d.width,
|
|
61
|
+
h = c.height = fc.height = d.height,
|
|
62
|
+
ctx = c.getContext("2d"),
|
|
63
|
+
fctx = fc.getContext("2d"),
|
|
64
|
+
// f means final
|
|
65
|
+
opts = {
|
|
66
|
+
orbCount: circlesConfig.length,
|
|
67
|
+
baseVel: Math.max(d.width * 0.0010, 1),
|
|
68
|
+
addedVel: Math.max(d.width * 0.0010, 1),
|
|
69
|
+
alphaThreshold: 200
|
|
70
|
+
},
|
|
71
|
+
orbs = [];
|
|
72
|
+
let animFrame;
|
|
73
|
+
function anim() {
|
|
74
|
+
animFrame = window.requestAnimationFrame(anim);
|
|
75
|
+
ctx.clearRect(0, 0, w, h);
|
|
76
|
+
fctx.fillStyle = "#0000";
|
|
77
|
+
fctx.fillRect(0, 0, w, h);
|
|
78
|
+
for (var i = 0; i < orbs.length; i++) orbs[i].step();
|
|
79
|
+
var image = ctx.getImageData(0, 0, w, h),
|
|
80
|
+
data = new Uint8Array(image.data.buffer);
|
|
81
|
+
for (var i = 3; i < data.length; i += 4) data[i] /= data[i] < opts.alphaThreshold ? 6 : 1;
|
|
82
|
+
fctx.putImageData(image, 0, 0);
|
|
83
|
+
}
|
|
84
|
+
let BaseOrb = /*#__PURE__*/function () {
|
|
85
|
+
function BaseOrb() {
|
|
86
|
+
_classCallCheck(this, BaseOrb);
|
|
87
|
+
}
|
|
88
|
+
_createClass(BaseOrb, [{
|
|
89
|
+
key: "oldDrawCircle",
|
|
90
|
+
value: function oldDrawCircle(x, y, radius) {
|
|
91
|
+
ctx.fillStyle = this.gradient;
|
|
92
|
+
ctx.translate(x | 0, y | 0);
|
|
93
|
+
ctx.beginPath();
|
|
94
|
+
ctx.arc(0, 0, radius, 0, Math.PI * 2);
|
|
95
|
+
ctx.fill();
|
|
96
|
+
ctx.translate(-x | 0, -y | 0);
|
|
97
97
|
}
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
this.y = (Math.random() * h) | 0;
|
|
103
|
-
this.radius = radius;
|
|
104
|
-
var color = baseColor;
|
|
105
|
-
this.gradient = ctx.createRadialGradient(0, 0, 0, 0, 0, this.radius);
|
|
106
|
-
this.gradient.addColorStop(0, `${color}ff`);
|
|
107
|
-
this.gradient.addColorStop(0.8, `${color}cc`);
|
|
108
|
-
this.gradient.addColorStop(1, `${color}00`);
|
|
109
|
-
var radiant = Math.random() * Math.PI * 2, vel = (opts.baseVel + opts.addedVel * Math.random()) | 0;
|
|
110
|
-
vel *= 0.2;
|
|
111
|
-
this.vx = Math.cos(radiant) * vel;
|
|
112
|
-
this.vy = Math.sin(radiant) * vel;
|
|
113
|
-
}
|
|
114
|
-
step() {
|
|
115
|
-
this.x += this.vx;
|
|
116
|
-
this.y += this.vy;
|
|
117
|
-
var radius = this.radius / 2;
|
|
118
|
-
if (this.x < -radius || this.x > w + radius)
|
|
119
|
-
this.vx *= -1;
|
|
120
|
-
if (this.y < -radius || this.y > h + radius)
|
|
121
|
-
this.vy *= -1;
|
|
122
|
-
this.drawCircle(this.x | 0, this.y | 0, this.radius);
|
|
123
|
-
}
|
|
98
|
+
}, {
|
|
99
|
+
key: "drawCircle",
|
|
100
|
+
value: function drawCircle(x, y, radius) {
|
|
101
|
+
this.oldDrawCircle(x, y, radius);
|
|
124
102
|
}
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
103
|
+
}]);
|
|
104
|
+
return BaseOrb;
|
|
105
|
+
}();
|
|
106
|
+
let Orb = /*#__PURE__*/function (_BaseOrb) {
|
|
107
|
+
_inherits(Orb, _BaseOrb);
|
|
108
|
+
var _super = _createSuper(Orb);
|
|
109
|
+
function Orb(radius) {
|
|
110
|
+
var _this;
|
|
111
|
+
_classCallCheck(this, Orb);
|
|
112
|
+
_this = _super.call(this);
|
|
113
|
+
_this.x = Math.random() * w | 0;
|
|
114
|
+
_this.y = Math.random() * h | 0;
|
|
115
|
+
_this.radius = radius;
|
|
116
|
+
var color = baseColor;
|
|
117
|
+
_this.gradient = ctx.createRadialGradient(0, 0, 0, 0, 0, _this.radius);
|
|
118
|
+
_this.gradient.addColorStop(0, "".concat(color, "ff"));
|
|
119
|
+
_this.gradient.addColorStop(0.8, "".concat(color, "cc"));
|
|
120
|
+
_this.gradient.addColorStop(1, "".concat(color, "00"));
|
|
121
|
+
var radiant = Math.random() * Math.PI * 2,
|
|
122
|
+
vel = opts.baseVel + opts.addedVel * Math.random() | 0;
|
|
123
|
+
vel *= 0.2;
|
|
124
|
+
_this.vx = Math.cos(radiant) * vel;
|
|
125
|
+
_this.vy = Math.sin(radiant) * vel;
|
|
126
|
+
return _this;
|
|
127
|
+
}
|
|
128
|
+
_createClass(Orb, [{
|
|
129
|
+
key: "step",
|
|
130
|
+
value: function step() {
|
|
131
|
+
this.x += this.vx;
|
|
132
|
+
this.y += this.vy;
|
|
133
|
+
var radius = this.radius / 2;
|
|
134
|
+
if (this.x < -radius || this.x > w + radius) this.vx *= -1;
|
|
135
|
+
if (this.y < -radius || this.y > h + radius) this.vy *= -1;
|
|
136
|
+
this.drawCircle(this.x | 0, this.y | 0, this.radius);
|
|
153
137
|
}
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
138
|
+
}]);
|
|
139
|
+
return Orb;
|
|
140
|
+
}(BaseOrb);
|
|
141
|
+
let GuideOrb = /*#__PURE__*/function (_BaseOrb2) {
|
|
142
|
+
_inherits(GuideOrb, _BaseOrb2);
|
|
143
|
+
var _super2 = _createSuper(GuideOrb);
|
|
144
|
+
function GuideOrb() {
|
|
145
|
+
_classCallCheck(this, GuideOrb);
|
|
146
|
+
return _super2.apply(this, arguments);
|
|
147
|
+
}
|
|
148
|
+
_createClass(GuideOrb, [{
|
|
149
|
+
key: "step",
|
|
150
|
+
value: function step() {
|
|
151
|
+
const deltaTime = Date.now() - guideConfig.current.sizeTimestamp;
|
|
152
|
+
const deltaTimePercent = deltaTime > 250 ? 1 : deltaTime * 100 / 250 / 100;
|
|
153
|
+
const radius = guideConfig.current.size - (guideConfig.current.sizeIncrement - guideConfig.current.sizeIncrement * deltaTimePercent);
|
|
154
|
+
this.lastRadius = radius;
|
|
155
|
+
var color = baseColor;
|
|
156
|
+
const gradient = ctx.createRadialGradient(0, 0, 0, 0, 0, radius);
|
|
157
|
+
gradient.addColorStop(0, "".concat(color, "ff"));
|
|
158
|
+
gradient.addColorStop(0.8, "".concat(color, "cc"));
|
|
159
|
+
gradient.addColorStop(1, "".concat(color, "00"));
|
|
160
|
+
this.gradient = gradient;
|
|
161
|
+
const deltaTimePos = Date.now() - guideConfig.current.posTimestamp;
|
|
162
|
+
const deltaTimePosPercent = deltaTimePos > _LavaLamp.transitionPositionMs ? 1 : deltaTimePos * 100 / _LavaLamp.transitionPositionMs / 100;
|
|
163
|
+
const translateX = guideConfig.current.x - (guideConfig.current.posIncrement[0] - guideConfig.current.posIncrement[0] * deltaTimePosPercent);
|
|
164
|
+
this.lastX = translateX;
|
|
165
|
+
const translateY = guideConfig.current.y - (guideConfig.current.posIncrement[1] - guideConfig.current.posIncrement[1] * deltaTimePosPercent);
|
|
166
|
+
this.lastY = translateY;
|
|
167
|
+
this.drawCircle(translateX | 0, translateY | 0, radius);
|
|
158
168
|
}
|
|
159
|
-
|
|
160
|
-
|
|
169
|
+
}]);
|
|
170
|
+
return GuideOrb;
|
|
171
|
+
}(BaseOrb);
|
|
172
|
+
for (let circleConfig of circlesConfig) {
|
|
173
|
+
const radius = circleConfig.baseSize * 1.5;
|
|
174
|
+
const randomRadius = radius + radius / 2 * Math.random() | 0;
|
|
175
|
+
orbs.push(new Orb(randomRadius));
|
|
176
|
+
}
|
|
177
|
+
const guideOrbInstance = new GuideOrb();
|
|
178
|
+
let guideOrbAutoInstance;
|
|
179
|
+
orbs.push(guideOrbInstance);
|
|
180
|
+
canvasRef.current.parentElement.onmouseleave = function () {
|
|
181
|
+
const indexOfGuide = orbs.indexOf(guideOrbInstance);
|
|
182
|
+
if (indexOfGuide !== -1) {
|
|
183
|
+
guideOrbAutoInstance = new Orb(guideOrbInstance.lastRadius);
|
|
184
|
+
guideOrbAutoInstance.radius = guideOrbInstance.lastRadius;
|
|
185
|
+
guideOrbAutoInstance.x = guideOrbInstance.lastX;
|
|
186
|
+
guideOrbAutoInstance.y = guideOrbInstance.lastY;
|
|
187
|
+
orbs.splice(indexOfGuide, 1);
|
|
188
|
+
orbs.push(guideOrbAutoInstance);
|
|
189
|
+
}
|
|
190
|
+
};
|
|
191
|
+
canvasRef.current.parentElement.onmouseenter = function () {
|
|
192
|
+
if (orbs.indexOf(guideOrbInstance) === -1) {
|
|
161
193
|
orbs.push(guideOrbInstance);
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
orbs.splice(orbs.indexOf(guideOrbAutoInstance), 1);
|
|
177
|
-
}
|
|
178
|
-
};
|
|
179
|
-
anim();
|
|
180
|
-
return () => {
|
|
181
|
-
window.cancelAnimationFrame(animFrame);
|
|
182
|
-
};
|
|
183
|
-
}, [circlesConfig]);
|
|
184
|
-
return (react_1.default.createElement("div", { className: `${className} ${LavaLamp_module_scss_1.default.root}` },
|
|
185
|
-
react_1.default.createElement("canvas", { ref: canvasRef }),
|
|
186
|
-
react_1.default.createElement("div", null, children)));
|
|
187
|
-
}
|
|
188
|
-
exports.default = LavaLamp;
|
|
189
|
-
//# sourceMappingURL=LavaLamp.js.map
|
|
194
|
+
orbs.splice(orbs.indexOf(guideOrbAutoInstance), 1);
|
|
195
|
+
}
|
|
196
|
+
};
|
|
197
|
+
anim();
|
|
198
|
+
return function () {
|
|
199
|
+
window.cancelAnimationFrame(animFrame);
|
|
200
|
+
};
|
|
201
|
+
}, [circlesConfig]);
|
|
202
|
+
return /*#__PURE__*/_react.default.createElement("div", {
|
|
203
|
+
className: "".concat(className, " ").concat(_LavaLampModule.default.root)
|
|
204
|
+
}, /*#__PURE__*/_react.default.createElement("canvas", {
|
|
205
|
+
ref: canvasRef
|
|
206
|
+
}), /*#__PURE__*/_react.default.createElement("div", null, children));
|
|
207
|
+
}
|