@pareto-engineering/design-system 3.0.0-alpha.29 → 4.0.0-alpha.13
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/.storybook/main.js +25 -63
- package/.storybook/preview.js +26 -9
- package/.storybook/webpackFinal.js +68 -0
- package/babel.config.js +25 -48
- package/dist/cjs/a/{AnimatedCounter/AnimatedCounter.js → AnimatedBlobs/AnimatedBlobs.js} +41 -56
- package/dist/cjs/a/AnimatedBlobs/index.js +13 -0
- package/dist/cjs/a/AnimatedBlobs/styles.scss +87 -0
- package/dist/cjs/a/AnimatedGradient/AnimatedGradient.js +56 -0
- package/dist/cjs/a/AnimatedGradient/index.js +13 -0
- package/dist/cjs/a/AnimatedGradient/styles.scss +14 -0
- package/dist/cjs/a/AnimatedGradient/webGIRenderer.js +528 -0
- package/dist/cjs/a/AppContext/Context.js +1 -1
- package/dist/cjs/a/AppContext/ContextProvider.js +19 -15
- package/dist/cjs/a/AppContext/index.js +4 -4
- package/dist/cjs/a/AppContext/useTheme.js +7 -7
- package/dist/cjs/a/ContentTree/ContentTree.js +8 -8
- package/dist/cjs/a/ContentTree/common/Tree/Tree.js +12 -12
- package/dist/cjs/a/ContentTree/common/Tree/index.js +1 -1
- package/dist/cjs/a/ContentTree/common/index.js +3 -3
- package/dist/cjs/a/ContentTree/common/useContentTree.js +14 -14
- package/dist/cjs/a/ContentTree/common/useFirstVisibleNode.js +10 -11
- package/dist/cjs/a/ContentTree/index.js +1 -1
- package/dist/cjs/a/ContentTree/styles.scss +20 -20
- package/dist/cjs/a/Conversation/Context.js +1 -1
- package/dist/cjs/a/Conversation/Conversation.js +7 -7
- package/dist/cjs/a/Conversation/common/Message/Message.js +8 -8
- package/dist/cjs/a/Conversation/common/Message/index.js +1 -1
- package/dist/cjs/a/Conversation/common/index.js +1 -1
- package/dist/cjs/a/Conversation/index.js +3 -3
- package/dist/cjs/a/Conversation/styles.scss +1 -0
- package/dist/cjs/a/DotInfo/DotInfo.js +11 -15
- package/dist/cjs/a/DotInfo/index.js +1 -1
- package/dist/cjs/a/Figure/Figure.js +6 -6
- package/dist/cjs/a/Figure/index.js +1 -1
- package/dist/cjs/a/HamburgerButton/HamburgerButton.js +17 -20
- package/dist/cjs/a/HamburgerButton/index.js +1 -1
- package/dist/cjs/a/IconList/IconList.js +19 -26
- package/dist/cjs/a/IconList/common/Item/Item.js +17 -24
- package/dist/cjs/a/IconList/common/Item/index.js +1 -1
- package/dist/cjs/a/IconList/common/index.js +1 -1
- package/dist/cjs/a/IconList/index.js +1 -1
- package/dist/cjs/a/Label/Label.js +19 -11
- package/dist/cjs/a/Label/index.js +1 -1
- package/dist/cjs/a/Label/styles.scss +22 -21
- package/dist/cjs/a/LoadingCircle/LoadingCircle.js +11 -15
- package/dist/cjs/a/LoadingCircle/index.js +1 -1
- package/dist/cjs/a/LoadingCircle/styles.scss +35 -37
- package/dist/cjs/a/MetaCard/MetaCard.js +60 -0
- package/dist/cjs/a/MetaCard/index.js +13 -0
- package/dist/cjs/a/MetaCard/styles.scss +30 -0
- package/dist/cjs/a/People/People.js +9 -13
- package/dist/cjs/a/People/common/Person/Person.js +7 -7
- package/dist/cjs/a/People/common/Person/index.js +1 -1
- package/dist/cjs/a/People/common/index.js +1 -1
- package/dist/cjs/a/People/index.js +1 -1
- package/dist/cjs/a/People/styles.scss +4 -4
- package/dist/cjs/a/Popover/Popover.js +10 -10
- package/dist/cjs/a/Popover/index.js +1 -1
- package/dist/cjs/a/Popover/styles.scss +4 -3
- package/dist/cjs/a/ProgressBar/ProgressBar.js +11 -15
- package/dist/cjs/a/ProgressBar/index.js +1 -1
- package/dist/cjs/a/Quote/Quote.js +7 -7
- package/dist/cjs/a/Quote/index.js +1 -1
- package/dist/cjs/a/Quote/styles.scss +41 -38
- package/dist/cjs/a/SVG/SVG.js +23 -26
- package/dist/cjs/a/SVG/common/UseSVG/UseSVG.js +9 -11
- package/dist/cjs/a/SVG/common/UseSVG/index.js +1 -1
- package/dist/cjs/a/SVG/common/index.js +1 -1
- package/dist/cjs/a/SVG/index.js +1 -1
- package/dist/cjs/a/SnapScroller/SnapScroller.js +6 -6
- package/dist/cjs/a/SnapScroller/index.js +1 -1
- package/dist/cjs/a/SnapScroller/styles.scss +22 -12
- package/dist/cjs/a/Spinner/Spinner.js +7 -7
- package/dist/cjs/a/Spinner/index.js +1 -1
- package/dist/cjs/a/TextSteps/TextSteps.js +70 -0
- package/dist/cjs/a/TextSteps/index.js +13 -0
- package/dist/cjs/a/TextSteps/styles.scss +29 -0
- package/dist/cjs/a/Timestamp/Timestamp.js +12 -12
- package/dist/cjs/a/Timestamp/index.js +1 -1
- package/dist/cjs/a/Tip/Tip.js +72 -0
- package/dist/cjs/a/Tip/index.js +13 -0
- package/dist/cjs/a/Tip/styles.scss +22 -0
- package/dist/cjs/a/index.js +53 -25
- package/dist/cjs/b/Button/Button.js +28 -26
- package/dist/cjs/b/Button/common/Group/Group.js +57 -0
- package/dist/cjs/b/Button/common/Group/index.js +13 -0
- package/dist/cjs/b/Button/common/Group/styles.scss +11 -0
- package/dist/cjs/b/Button/common/index.js +12 -0
- package/dist/cjs/b/Button/index.js +1 -1
- package/dist/cjs/b/Button/styles.scss +9 -2
- package/dist/cjs/b/Card/Card.js +74 -0
- package/dist/cjs/b/Card/common/Group/Group.js +73 -0
- package/dist/cjs/b/Card/common/Group/index.js +13 -0
- package/dist/cjs/b/Card/common/Group/styles.scss +42 -0
- package/dist/cjs/b/Card/common/Section/Section.js +59 -0
- package/dist/cjs/b/Card/common/Section/index.js +13 -0
- package/dist/cjs/b/Card/common/index.js +19 -0
- package/dist/cjs/b/Card/index.js +13 -0
- package/dist/cjs/b/Card/styles.scss +57 -0
- package/dist/cjs/b/Logo/Logo.js +13 -13
- package/dist/cjs/b/Logo/index.js +1 -1
- package/dist/cjs/b/Logo/styles.scss +4 -2
- package/dist/cjs/b/Page/Context.js +1 -1
- package/dist/cjs/b/Page/Page.js +25 -21
- package/dist/cjs/b/Page/common/PageHelmet/PageHelmet.js +41 -45
- package/dist/cjs/b/Page/common/PageHelmet/index.js +1 -1
- package/dist/cjs/b/Page/common/Section/Section.js +25 -18
- package/dist/cjs/b/Page/common/Section/index.js +1 -1
- package/dist/cjs/b/Page/common/index.js +2 -2
- package/dist/cjs/b/Page/index.js +3 -3
- package/dist/cjs/b/Page/styles.scss +29 -7
- package/dist/cjs/b/SocialMediaButton/SocialMediaButton.js +21 -25
- package/dist/cjs/b/SocialMediaButton/index.js +1 -1
- package/dist/cjs/b/SocialMediaButton/styles.scss +2 -16
- package/dist/cjs/b/ThemeSelector/ThemeSelector.js +9 -9
- package/dist/cjs/b/ThemeSelector/index.js +1 -1
- package/dist/cjs/b/Title/Title.js +9 -6
- package/dist/cjs/b/Title/index.js +1 -1
- package/dist/cjs/b/index.js +14 -7
- package/dist/cjs/c/ContentSlides/ContentSlides.js +33 -30
- package/dist/cjs/c/ContentSlides/Context.js +1 -1
- package/dist/cjs/c/ContentSlides/common/HorizontalMenu/HorizontalMenu.js +8 -8
- package/dist/cjs/c/ContentSlides/common/HorizontalMenu/index.js +1 -1
- package/dist/cjs/c/ContentSlides/common/Navigator/Navigator.js +7 -7
- package/dist/cjs/c/ContentSlides/common/Navigator/index.js +1 -1
- package/dist/cjs/c/ContentSlides/common/Sidebar/Sidebar.js +5 -5
- package/dist/cjs/c/ContentSlides/common/Sidebar/index.js +1 -1
- package/dist/cjs/c/ContentSlides/common/Slide/Slide.js +6 -6
- package/dist/cjs/c/ContentSlides/common/Slide/index.js +1 -1
- package/dist/cjs/c/ContentSlides/common/index.js +4 -4
- package/dist/cjs/c/ContentSlides/index.js +3 -3
- package/dist/cjs/c/ContentSlides/styles.scss +2 -4
- package/dist/cjs/c/Modal/Modal.js +6 -6
- package/dist/cjs/c/Modal/common/ModalHeader/ModalHeader.js +5 -5
- package/dist/cjs/c/Modal/common/ModalHeader/index.js +1 -1
- package/dist/cjs/c/Modal/common/index.js +1 -1
- package/dist/cjs/c/Modal/index.js +1 -1
- package/dist/cjs/c/Modal/styles.scss +9 -6
- package/dist/cjs/c/Shortener/Shortener.js +10 -10
- package/dist/cjs/c/Shortener/index.js +1 -1
- package/dist/cjs/c/SocialMediaShareButton/SocialMediaShareButton.js +12 -12
- package/dist/cjs/c/SocialMediaShareButton/index.js +1 -1
- package/dist/cjs/c/SocialMediaShareButton/styles.scss +3 -3
- package/dist/cjs/c/index.js +5 -5
- package/dist/cjs/f/FormInput/FormInput.js +14 -17
- package/dist/cjs/f/FormInput/index.js +1 -1
- package/dist/cjs/f/FormInput/styles.scss +4 -4
- package/dist/cjs/f/common/Debugger/Debugger.js +8 -8
- package/dist/cjs/f/common/Debugger/index.js +1 -1
- package/dist/cjs/f/common/Description/Description.js +8 -8
- package/dist/cjs/f/common/Description/index.js +1 -1
- package/dist/cjs/f/common/Label/Label.js +7 -7
- package/dist/cjs/f/common/Label/index.js +1 -1
- package/dist/cjs/f/common/Label/styles.scss +1 -1
- package/dist/cjs/f/common/index.js +3 -3
- package/dist/cjs/f/fields/Checkbox/Checkbox.js +7 -7
- package/dist/cjs/f/fields/Checkbox/index.js +1 -1
- package/dist/cjs/f/fields/Checkbox/styles.scss +9 -8
- package/dist/cjs/f/fields/ChoicesInput/ChoicesInput.js +26 -22
- package/dist/cjs/f/fields/ChoicesInput/common/Choice/Choice.js +7 -7
- package/dist/cjs/f/fields/ChoicesInput/common/Choice/index.js +1 -1
- package/dist/cjs/f/fields/ChoicesInput/common/index.js +1 -1
- package/dist/cjs/f/fields/ChoicesInput/index.js +1 -1
- package/dist/cjs/f/fields/ChoicesInput/styles.scss +23 -35
- package/dist/cjs/f/fields/QueryChoices/QueryChoices.js +25 -30
- package/dist/cjs/f/fields/QueryChoices/index.js +1 -1
- package/dist/cjs/f/fields/QueryCombobox/QueryCombobox.js +20 -22
- package/dist/cjs/f/fields/QueryCombobox/common/Combobox/Combobox.js +12 -12
- package/dist/cjs/f/fields/QueryCombobox/common/Combobox/index.js +1 -1
- package/dist/cjs/f/fields/QueryCombobox/common/Menu/Menu.js +14 -17
- package/dist/cjs/f/fields/QueryCombobox/common/Menu/index.js +1 -1
- package/dist/cjs/f/fields/QueryCombobox/common/MultipleCombobox/MultipleCombobox.js +22 -26
- package/dist/cjs/f/fields/QueryCombobox/common/MultipleCombobox/index.js +1 -1
- package/dist/cjs/f/fields/QueryCombobox/common/index.js +3 -3
- package/dist/cjs/f/fields/QueryCombobox/index.js +1 -1
- package/dist/cjs/f/fields/QueryCombobox/styles.scss +60 -59
- package/dist/cjs/f/fields/QuerySelect/QuerySelect.js +11 -11
- package/dist/cjs/f/fields/QuerySelect/index.js +1 -1
- package/dist/cjs/f/fields/RatingsInput/RatingsInput.js +9 -9
- package/dist/cjs/f/fields/RatingsInput/common/Rating/Rating.js +7 -7
- package/dist/cjs/f/fields/RatingsInput/common/Rating/index.js +1 -1
- package/dist/cjs/f/fields/RatingsInput/common/index.js +1 -1
- package/dist/cjs/f/fields/RatingsInput/index.js +1 -1
- package/dist/cjs/f/fields/RatingsInput/styles.scss +8 -9
- package/dist/cjs/f/fields/SelectInput/SelectInput.js +12 -12
- package/dist/cjs/f/fields/SelectInput/index.js +1 -1
- package/dist/cjs/f/fields/SelectInput/styles.scss +33 -23
- package/dist/cjs/f/fields/TextInput/TextInput.js +12 -10
- package/dist/cjs/f/fields/TextInput/index.js +1 -1
- package/dist/cjs/f/fields/TextInput/styles.scss +27 -18
- package/dist/cjs/f/fields/TextareaInput/TextareaInput.js +8 -8
- package/dist/cjs/f/fields/TextareaInput/index.js +1 -1
- package/dist/cjs/f/fields/TextareaInput/styles.scss +7 -6
- package/dist/cjs/f/fields/index.js +9 -9
- package/dist/cjs/f/index.js +3 -3
- package/dist/cjs/index.js +8 -8
- package/dist/cjs/r/SwitchRouteMap/SwitchRouteMap.js +7 -10
- package/dist/cjs/r/SwitchRouteMap/index.js +1 -1
- package/dist/cjs/r/common/PrivateRoute/PrivateRoute.js +13 -16
- package/dist/cjs/r/common/PrivateRoute/index.js +1 -1
- package/dist/cjs/r/common/index.js +1 -1
- package/dist/cjs/r/index.js +2 -2
- package/dist/cjs/test/QueryLoader/QueryLoader.js +4 -4
- package/dist/cjs/test/QueryLoader/__generated__/QueryLoaderHelloQuery.graphql.js +1 -1
- package/dist/cjs/test/QueryLoader/common/PreloadedTestData/PreloadedTestData.js +4 -4
- package/dist/cjs/test/QueryLoader/common/PreloadedTestData/index.js +1 -1
- package/dist/cjs/test/QueryLoader/common/index.js +1 -1
- package/dist/cjs/test/QueryLoader/index.js +1 -1
- package/dist/cjs/test/index.js +1 -1
- package/dist/cjs/utils/hooks/index.js +2 -2
- package/dist/cjs/utils/hooks/useDynamicPosition.js +24 -24
- package/dist/cjs/utils/hooks/useWindowSize.js +6 -6
- package/dist/cjs/utils/index.js +2 -2
- package/dist/es/a/AnimatedBlobs/AnimatedBlobs.js +82 -0
- package/dist/es/a/AnimatedBlobs/index.js +1 -0
- package/dist/es/a/AnimatedBlobs/styles.scss +87 -0
- package/dist/es/a/AnimatedGradient/AnimatedGradient.js +48 -0
- package/dist/es/a/AnimatedGradient/index.js +1 -0
- package/dist/es/a/AnimatedGradient/styles.scss +14 -0
- package/dist/es/a/AnimatedGradient/webGIRenderer.js +492 -0
- package/dist/es/a/AppContext/ContextProvider.js +7 -8
- package/dist/es/a/AppContext/useTheme.js +1 -2
- package/dist/es/a/ContentTree/ContentTree.js +11 -12
- package/dist/es/a/ContentTree/common/Tree/Tree.js +8 -9
- package/dist/es/a/ContentTree/styles.scss +20 -20
- package/dist/es/a/Conversation/Conversation.js +13 -14
- package/dist/es/a/Conversation/common/Message/Message.js +12 -13
- package/dist/es/a/Conversation/styles.scss +1 -0
- package/dist/es/a/DotInfo/DotInfo.js +13 -14
- package/dist/es/a/Figure/Figure.js +10 -11
- package/dist/es/a/HamburgerButton/HamburgerButton.js +12 -13
- package/dist/es/a/IconList/IconList.js +11 -12
- package/dist/es/a/IconList/common/Item/Item.js +17 -20
- package/dist/es/a/Label/Label.js +22 -15
- package/dist/es/a/Label/styles.scss +22 -21
- package/dist/es/a/LoadingCircle/LoadingCircle.js +12 -13
- package/dist/es/a/LoadingCircle/styles.scss +35 -37
- package/dist/es/a/MetaCard/MetaCard.js +52 -0
- package/dist/es/a/MetaCard/index.js +1 -0
- package/dist/es/a/MetaCard/styles.scss +30 -0
- package/dist/es/a/People/People.js +11 -12
- package/dist/es/a/People/common/Person/Person.js +24 -27
- package/dist/es/a/People/styles.scss +4 -4
- package/dist/es/a/Popover/Popover.js +17 -18
- package/dist/es/a/Popover/styles.scss +4 -3
- package/dist/es/a/ProgressBar/ProgressBar.js +12 -13
- package/dist/es/a/Quote/Quote.js +12 -13
- package/dist/es/a/Quote/styles.scss +41 -38
- package/dist/es/a/SVG/SVG.js +19 -20
- package/dist/es/a/SVG/common/UseSVG/UseSVG.js +19 -22
- package/dist/es/a/SnapScroller/SnapScroller.js +10 -11
- package/dist/es/a/SnapScroller/styles.scss +22 -12
- package/dist/es/a/Spinner/Spinner.js +9 -10
- package/dist/es/a/TextSteps/TextSteps.js +61 -0
- package/dist/es/a/TextSteps/index.js +1 -0
- package/dist/es/a/TextSteps/styles.scss +29 -0
- package/dist/es/a/Timestamp/Timestamp.js +16 -17
- package/dist/es/a/Tip/Tip.js +64 -0
- package/dist/es/a/Tip/index.js +2 -0
- package/dist/es/a/Tip/styles.scss +22 -0
- package/dist/es/a/index.js +6 -2
- package/dist/es/b/Button/Button.js +25 -20
- package/dist/es/b/Button/common/Group/Group.js +49 -0
- package/dist/es/b/Button/common/Group/index.js +1 -0
- package/dist/es/b/Button/common/Group/styles.scss +11 -0
- package/dist/es/b/Button/common/index.js +1 -0
- package/dist/es/b/Button/styles.scss +9 -2
- package/dist/es/b/Card/Card.js +66 -0
- package/dist/es/b/Card/common/Group/Group.js +65 -0
- package/dist/es/b/Card/common/Group/index.js +1 -0
- package/dist/es/b/Card/common/Group/styles.scss +42 -0
- package/dist/es/b/Card/common/Section/Section.js +48 -0
- package/dist/es/b/Card/common/Section/index.js +1 -0
- package/dist/es/b/Card/common/index.js +2 -0
- package/dist/es/b/Card/index.js +1 -0
- package/dist/es/b/Card/styles.scss +57 -0
- package/dist/es/b/Logo/Logo.js +14 -15
- package/dist/es/b/Logo/styles.scss +4 -2
- package/dist/es/b/Page/Page.js +21 -15
- package/dist/es/b/Page/common/PageHelmet/PageHelmet.js +9 -11
- package/dist/es/b/Page/common/Section/Section.js +19 -10
- package/dist/es/b/Page/styles.scss +29 -7
- package/dist/es/b/SocialMediaButton/SocialMediaButton.js +13 -14
- package/dist/es/b/SocialMediaButton/styles.scss +2 -16
- package/dist/es/b/ThemeSelector/ThemeSelector.js +10 -11
- package/dist/es/b/Title/Title.js +22 -19
- package/dist/es/b/index.js +2 -1
- package/dist/es/c/ContentSlides/ContentSlides.js +15 -18
- package/dist/es/c/ContentSlides/common/HorizontalMenu/HorizontalMenu.js +11 -12
- package/dist/es/c/ContentSlides/common/Navigator/Navigator.js +14 -15
- package/dist/es/c/ContentSlides/common/Sidebar/Sidebar.js +8 -9
- package/dist/es/c/ContentSlides/common/Slide/Slide.js +8 -9
- package/dist/es/c/ContentSlides/styles.scss +2 -4
- package/dist/es/c/Modal/Modal.js +12 -13
- package/dist/es/c/Modal/common/ModalHeader/ModalHeader.js +20 -23
- package/dist/es/c/Modal/styles.scss +9 -6
- package/dist/es/c/Shortener/Shortener.js +13 -14
- package/dist/es/c/SocialMediaShareButton/SocialMediaShareButton.js +11 -12
- package/dist/es/c/SocialMediaShareButton/styles.scss +3 -3
- package/dist/es/f/FormInput/FormInput.js +9 -10
- package/dist/es/f/FormInput/styles.scss +4 -4
- package/dist/es/f/common/Debugger/Debugger.js +9 -10
- package/dist/es/f/common/Description/Description.js +11 -12
- package/dist/es/f/common/Label/Label.js +13 -14
- package/dist/es/f/common/Label/styles.scss +1 -1
- package/dist/es/f/fields/Checkbox/Checkbox.js +13 -14
- package/dist/es/f/fields/Checkbox/styles.scss +9 -8
- package/dist/es/f/fields/ChoicesInput/ChoicesInput.js +33 -26
- package/dist/es/f/fields/ChoicesInput/common/Choice/Choice.js +13 -14
- package/dist/es/f/fields/ChoicesInput/styles.scss +23 -35
- package/dist/es/f/fields/QueryChoices/QueryChoices.js +16 -20
- package/dist/es/f/fields/QueryCombobox/QueryCombobox.js +29 -33
- package/dist/es/f/fields/QueryCombobox/common/Combobox/Combobox.js +22 -24
- package/dist/es/f/fields/QueryCombobox/common/Menu/Menu.js +22 -25
- package/dist/es/f/fields/QueryCombobox/common/MultipleCombobox/MultipleCombobox.js +24 -26
- package/dist/es/f/fields/QueryCombobox/styles.scss +60 -59
- package/dist/es/f/fields/QuerySelect/QuerySelect.js +24 -28
- package/dist/es/f/fields/RatingsInput/RatingsInput.js +18 -19
- package/dist/es/f/fields/RatingsInput/common/Rating/Rating.js +15 -16
- package/dist/es/f/fields/RatingsInput/styles.scss +8 -9
- package/dist/es/f/fields/SelectInput/SelectInput.js +20 -21
- package/dist/es/f/fields/SelectInput/styles.scss +33 -23
- package/dist/es/f/fields/TextInput/TextInput.js +24 -23
- package/dist/es/f/fields/TextInput/styles.scss +27 -18
- package/dist/es/f/fields/TextareaInput/TextareaInput.js +22 -23
- package/dist/es/f/fields/TextareaInput/styles.scss +7 -6
- package/dist/es/r/SwitchRouteMap/SwitchRouteMap.js +15 -21
- package/dist/es/r/common/PrivateRoute/PrivateRoute.js +6 -7
- package/dist/es/test/QueryLoader/QueryLoader.js +1 -1
- package/dist/es/test/QueryLoader/common/PreloadedTestData/PreloadedTestData.js +5 -6
- package/dist/es/utils/hooks/useDynamicPosition.js +9 -10
- package/dist/es/utils/hooks/useWindowSize.js +1 -2
- package/jest.config.js +5 -5
- package/package.json +44 -82
- package/src/stories/a/MetaCard.stories.jsx +35 -0
- package/src/stories/a/TextSteps.stories.jsx +19 -0
- package/src/stories/a/Tip.stories.jsx +28 -0
- package/src/stories/b/{Button.stories.jsx → Button/Button.stories.jsx} +15 -0
- package/src/stories/b/Button/Group.stories.jsx +35 -0
- package/src/stories/b/Card/Card.stories.jsx +59 -0
- package/src/stories/b/Card/Group.stories.jsx +59 -0
- package/src/stories/b/Page.stories.jsx +21 -4
- package/src/stories/colors.js +6 -6
- package/src/stories/f/SelectInput.stories.jsx +7 -0
- package/src/stories/f/TextInput.stories.jsx +4 -4
- package/src/stories/original/Button.jsx +55 -0
- package/src/stories/original/Button.stories.js +39 -0
- package/src/stories/original/Header.jsx +64 -0
- package/src/stories/original/Header.stories.js +22 -0
- package/src/stories/original/Introduction.mdx +211 -0
- package/src/stories/original/Page.jsx +76 -0
- package/src/stories/original/Page.stories.js +26 -0
- package/src/stories/original/assets/code-brackets.svg +1 -0
- package/src/stories/original/assets/colors.svg +1 -0
- package/src/stories/original/assets/comments.svg +1 -0
- package/src/stories/original/assets/direction.svg +1 -0
- package/src/stories/original/assets/flow.svg +1 -0
- package/src/stories/original/assets/plugin.svg +1 -0
- package/src/stories/original/assets/repo.svg +1 -0
- package/src/stories/original/assets/stackalt.svg +1 -0
- package/src/stories/original/button.css +30 -0
- package/src/stories/original/header.css +32 -0
- package/src/stories/original/page.css +69 -0
- package/src/ui/a/AnimatedBlobs/AnimatedBlobs.jsx +102 -0
- package/src/ui/a/AnimatedBlobs/index.js +1 -0
- package/src/ui/a/AnimatedBlobs/styles.scss +87 -0
- package/src/ui/a/AnimatedGradient/AnimatedGradient.jsx +69 -0
- package/src/ui/a/AnimatedGradient/index.js +1 -0
- package/src/ui/a/AnimatedGradient/styles.scss +14 -0
- package/src/ui/a/AnimatedGradient/webGIRenderer.js +541 -0
- package/src/ui/a/ContentTree/ContentTree.jsx +3 -3
- package/src/ui/a/ContentTree/styles.scss +20 -20
- package/src/ui/a/Conversation/Conversation.jsx +2 -2
- package/src/ui/a/Conversation/styles.scss +1 -0
- package/src/ui/a/DotInfo/DotInfo.jsx +2 -2
- package/src/ui/a/Figure/Figure.jsx +2 -2
- package/src/ui/a/HamburgerButton/HamburgerButton.jsx +2 -2
- package/src/ui/a/IconList/IconList.jsx +2 -2
- package/src/ui/a/Label/Label.jsx +13 -4
- package/src/ui/a/Label/styles.scss +22 -21
- package/src/ui/a/LoadingCircle/LoadingCircle.jsx +2 -2
- package/src/ui/a/LoadingCircle/styles.scss +35 -37
- package/src/ui/a/MetaCard/MetaCard.jsx +74 -0
- package/src/ui/a/MetaCard/index.js +1 -0
- package/src/ui/a/MetaCard/styles.scss +30 -0
- package/src/ui/a/People/People.jsx +2 -2
- package/src/ui/a/People/styles.scss +4 -4
- package/src/ui/a/Popover/Popover.jsx +3 -3
- package/src/ui/a/Popover/styles.scss +4 -3
- package/src/ui/a/ProgressBar/ProgressBar.jsx +2 -2
- package/src/ui/a/Quote/Quote.jsx +2 -2
- package/src/ui/a/Quote/styles.scss +41 -38
- package/src/ui/a/SVG/SVG.jsx +2 -2
- package/src/ui/a/SnapScroller/SnapScroller.jsx +2 -2
- package/src/ui/a/SnapScroller/styles.scss +22 -12
- package/src/ui/a/Spinner/Spinner.jsx +2 -2
- package/src/ui/a/TextSteps/TextSteps.jsx +87 -0
- package/src/ui/a/TextSteps/index.js +1 -0
- package/src/ui/a/TextSteps/styles.scss +29 -0
- package/src/ui/a/Timestamp/Timestamp.jsx +2 -2
- package/src/ui/a/Tip/Tip.jsx +88 -0
- package/src/ui/a/Tip/index.js +2 -0
- package/src/ui/a/Tip/styles.scss +22 -0
- package/src/ui/a/index.js +5 -1
- package/src/ui/b/Button/Button.jsx +14 -5
- package/src/ui/b/Button/common/Group/Group.jsx +71 -0
- package/src/ui/b/Button/common/Group/index.js +1 -0
- package/src/ui/b/Button/common/Group/styles.scss +11 -0
- package/src/ui/b/Button/common/index.js +1 -0
- package/src/ui/b/Button/styles.scss +9 -2
- package/src/ui/b/Card/Card.jsx +94 -0
- package/src/ui/b/Card/common/Group/Group.jsx +91 -0
- package/src/ui/b/Card/common/Group/index.js +1 -0
- package/src/ui/b/Card/common/Group/styles.scss +42 -0
- package/src/ui/b/Card/common/Section/Section.jsx +70 -0
- package/src/ui/b/Card/common/Section/index.js +1 -0
- package/src/ui/b/Card/common/index.js +2 -0
- package/src/ui/b/Card/index.js +1 -0
- package/src/ui/b/Card/styles.scss +57 -0
- package/src/ui/b/Logo/Logo.jsx +2 -2
- package/src/ui/b/Logo/styles.scss +4 -2
- package/src/ui/b/Page/Page.jsx +9 -3
- package/src/ui/b/Page/common/PageHelmet/PageHelmet.jsx +1 -1
- package/src/ui/b/Page/common/Section/Section.jsx +16 -1
- package/src/ui/b/Page/styles.scss +29 -7
- package/src/ui/b/SocialMediaButton/SocialMediaButton.jsx +2 -2
- package/src/ui/b/SocialMediaButton/styles.scss +2 -16
- package/src/ui/b/ThemeSelector/ThemeSelector.jsx +2 -2
- package/src/ui/b/Title/Title.jsx +30 -23
- package/src/ui/b/index.js +1 -0
- package/src/ui/c/ContentSlides/ContentSlides.jsx +3 -3
- package/src/ui/c/ContentSlides/styles.scss +2 -4
- package/src/ui/c/Modal/Modal.jsx +2 -2
- package/src/ui/c/Modal/styles.scss +9 -6
- package/src/ui/c/Shortener/Shortener.jsx +2 -2
- package/src/ui/c/SocialMediaShareButton/SocialMediaShareButton.jsx +2 -2
- package/src/ui/c/SocialMediaShareButton/styles.scss +3 -3
- package/src/ui/f/FormInput/FormInput.jsx +2 -2
- package/src/ui/f/FormInput/styles.scss +4 -4
- package/src/ui/f/common/Debugger/Debugger.jsx +2 -2
- package/src/ui/f/common/Description/Description.jsx +2 -2
- package/src/ui/f/common/Label/Label.jsx +2 -2
- package/src/ui/f/common/Label/styles.scss +1 -1
- package/src/ui/f/fields/Checkbox/Checkbox.jsx +2 -2
- package/src/ui/f/fields/Checkbox/styles.scss +9 -8
- package/src/ui/f/fields/ChoicesInput/ChoicesInput.jsx +12 -7
- package/src/ui/f/fields/ChoicesInput/styles.scss +23 -35
- package/src/ui/f/fields/QueryCombobox/QueryCombobox.jsx +2 -2
- package/src/ui/f/fields/QueryCombobox/styles.scss +60 -59
- package/src/ui/f/fields/RatingsInput/RatingsInput.jsx +2 -2
- package/src/ui/f/fields/RatingsInput/styles.scss +8 -9
- package/src/ui/f/fields/SelectInput/SelectInput.jsx +4 -4
- package/src/ui/f/fields/SelectInput/styles.scss +33 -23
- package/src/ui/f/fields/TextInput/TextInput.jsx +13 -11
- package/src/ui/f/fields/TextInput/styles.scss +27 -18
- package/src/ui/f/fields/TextareaInput/TextareaInput.jsx +2 -2
- package/src/ui/f/fields/TextareaInput/styles.scss +7 -6
- package/src/ui/test/QueryLoader/QueryLoader.jsx +1 -1
- package/{src → tests}/__snapshots__/Storyshots.test.js.snap +3426 -1617
- package/tests/staticStub.js +1 -0
- package/.storybook/manager-head.html +0 -6
- package/.storybook/preview-head.html +0 -5
- package/README.md +0 -1
- package/build-storybook.log +0 -2978
- package/config/CSSStub.js +0 -1
- package/dist/cjs/a/AnimatedCounter/index.js +0 -13
- package/dist/cjs/a/AnimatedCounter/styles.scss +0 -16
- package/dist/es/a/AnimatedCounter/AnimatedCounter.js +0 -98
- package/dist/es/a/AnimatedCounter/index.js +0 -2
- package/dist/es/a/AnimatedCounter/styles.scss +0 -16
- package/postcss.config.js +0 -13
- package/relay.config.js +0 -12
- package/src/assets/images/Ellipse1.png +0 -0
- package/src/assets/images/Ellipse2.png +0 -0
- package/src/assets/images/Fundraising.svg +0 -40
- package/src/assets/images/ParetoSupport.svg +0 -190
- package/src/assets/images/ParetoWorld.svg +0 -207
- package/src/assets/images/Vector.png +0 -0
- package/src/assets/images/email-attach.svg +0 -1
- package/src/assets/images/email-delete.svg +0 -1
- package/src/assets/images/favicon.png +0 -0
- package/src/assets/images/onboarding/focus-on-strategic-work.webp +0 -0
- package/src/assets/images/onboarding/launch-project.webp +0 -0
- package/src/assets/images/onboarding/meet-pareto-partner.webp +0 -0
- package/src/assets/images/quality.png +0 -0
- package/src/assets/images/sprite.svg +0 -253
- package/src/assets/images/test +0 -1
- package/src/local.scss +0 -16
- package/src/stories/a/AnimatedCounter.stories.jsx +0 -34
- package/src/ui/a/AnimatedCounter/AnimatedCounter.jsx +0 -118
- package/src/ui/a/AnimatedCounter/index.js +0 -2
- package/src/ui/a/AnimatedCounter/styles.scss +0 -16
- /package/{src → tests}/Storyshots.test.js +0 -0
- /package/{config → tests}/global-setup.js +0 -0
- /package/{config → tests}/test-setup.js +0 -0
|
@@ -0,0 +1,528 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.Gradient = void 0;
|
|
7
|
+
/* eslint-disable */
|
|
8
|
+
/*
|
|
9
|
+
* Stripe WebGl Gradient Animation
|
|
10
|
+
* All Credits to Stripe.com
|
|
11
|
+
* ScrollObserver functionality to disable animation when not scrolled into view has been disabled and
|
|
12
|
+
* commented out for now.
|
|
13
|
+
* https://kevinhufnagl.com
|
|
14
|
+
*/
|
|
15
|
+
|
|
16
|
+
// Converting colors to proper format
|
|
17
|
+
function normalizeColor(hexCode) {
|
|
18
|
+
return [(hexCode >> 16 & 255) / 255, (hexCode >> 8 & 255) / 255, (255 & hexCode) / 255];
|
|
19
|
+
}
|
|
20
|
+
['SCREEN', 'LINEAR_LIGHT'].reduce((hexCode, t, n) => Object.assign(hexCode, {
|
|
21
|
+
[t]: n
|
|
22
|
+
}), {});
|
|
23
|
+
|
|
24
|
+
// Essential functionality of WebGl
|
|
25
|
+
// t = width
|
|
26
|
+
// n = height
|
|
27
|
+
class MiniGl {
|
|
28
|
+
constructor(canvas, width, height) {
|
|
29
|
+
let debug = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : false;
|
|
30
|
+
const _miniGl = this;
|
|
31
|
+
const debug_output = document.location.search.toLowerCase().indexOf('debug=webgl') !== -1;
|
|
32
|
+
_miniGl.canvas = canvas, _miniGl.gl = _miniGl.canvas.getContext('webgl', {
|
|
33
|
+
antialias: true
|
|
34
|
+
}), _miniGl.meshes = [];
|
|
35
|
+
const context = _miniGl.gl;
|
|
36
|
+
width && height && this.setSize(width, height), _miniGl.lastDebugMsg, _miniGl.debug = debug && debug_output ? function (e) {
|
|
37
|
+
const t = new Date();
|
|
38
|
+
t - _miniGl.lastDebugMsg > 1e3 && console.log('---'), console.log(`${t.toLocaleTimeString() + Array(Math.max(0, 32 - e.length)).join(' ') + e}: `, ...Array.from(arguments).slice(1)), _miniGl.lastDebugMsg = t;
|
|
39
|
+
} : () => {}, Object.defineProperties(_miniGl, {
|
|
40
|
+
Material: {
|
|
41
|
+
enumerable: false,
|
|
42
|
+
value: class {
|
|
43
|
+
constructor(vertexShaders, fragments) {
|
|
44
|
+
let uniforms = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
|
|
45
|
+
const material = this;
|
|
46
|
+
function getShaderByType(type, source) {
|
|
47
|
+
const shader = context.createShader(type);
|
|
48
|
+
return context.shaderSource(shader, source), context.compileShader(shader), context.getShaderParameter(shader, context.COMPILE_STATUS) || console.error(context.getShaderInfoLog(shader)), _miniGl.debug('Material.compileShaderSource', {
|
|
49
|
+
source
|
|
50
|
+
}), shader;
|
|
51
|
+
}
|
|
52
|
+
function getUniformVariableDeclarations(uniforms, type) {
|
|
53
|
+
return Object.entries(uniforms).map(_ref => {
|
|
54
|
+
let [uniform, value] = _ref;
|
|
55
|
+
return value.getDeclaration(uniform, type);
|
|
56
|
+
}).join('\n');
|
|
57
|
+
}
|
|
58
|
+
material.uniforms = uniforms, material.uniformInstances = [];
|
|
59
|
+
const prefix = '\n precision highp float;\n ';
|
|
60
|
+
material.vertexSource = `\n ${prefix}\n attribute vec4 position;\n attribute vec2 uv;\n attribute vec2 uvNorm;\n ${getUniformVariableDeclarations(_miniGl.commonUniforms, 'vertex')}\n ${getUniformVariableDeclarations(uniforms, 'vertex')}\n ${vertexShaders}\n `, material.Source = `\n ${prefix}\n ${getUniformVariableDeclarations(_miniGl.commonUniforms, 'fragment')}\n ${getUniformVariableDeclarations(uniforms, 'fragment')}\n ${fragments}\n `, material.vertexShader = getShaderByType(context.VERTEX_SHADER, material.vertexSource), material.fragmentShader = getShaderByType(context.FRAGMENT_SHADER, material.Source), material.program = context.createProgram(), context.attachShader(material.program, material.vertexShader), context.attachShader(material.program, material.fragmentShader), context.linkProgram(material.program), context.getProgramParameter(material.program, context.LINK_STATUS) || console.error(context.getProgramInfoLog(material.program)), context.useProgram(material.program), material.attachUniforms(void 0, _miniGl.commonUniforms), material.attachUniforms(void 0, material.uniforms);
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
// t = uniform
|
|
64
|
+
attachUniforms(name, uniforms) {
|
|
65
|
+
// n = material
|
|
66
|
+
const material = this;
|
|
67
|
+
void 0 === name ? Object.entries(uniforms).forEach(_ref2 => {
|
|
68
|
+
let [name, uniform] = _ref2;
|
|
69
|
+
material.attachUniforms(name, uniform);
|
|
70
|
+
}) : uniforms.type == 'array' ? uniforms.value.forEach((uniform, i) => material.attachUniforms(`${name}[${i}]`, uniform)) : uniforms.type == 'struct' ? Object.entries(uniforms.value).forEach(_ref3 => {
|
|
71
|
+
let [uniform, i] = _ref3;
|
|
72
|
+
return material.attachUniforms(`${name}.${uniform}`, i);
|
|
73
|
+
}) : (_miniGl.debug('Material.attachUniforms', {
|
|
74
|
+
name,
|
|
75
|
+
uniform: uniforms
|
|
76
|
+
}), material.uniformInstances.push({
|
|
77
|
+
uniform: uniforms,
|
|
78
|
+
location: context.getUniformLocation(material.program, name)
|
|
79
|
+
}));
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
},
|
|
83
|
+
Uniform: {
|
|
84
|
+
enumerable: !1,
|
|
85
|
+
value: class {
|
|
86
|
+
constructor(e) {
|
|
87
|
+
this.type = 'float', Object.assign(this, e);
|
|
88
|
+
this.typeFn = {
|
|
89
|
+
float: '1f',
|
|
90
|
+
int: '1i',
|
|
91
|
+
vec2: '2fv',
|
|
92
|
+
vec3: '3fv',
|
|
93
|
+
vec4: '4fv',
|
|
94
|
+
mat4: 'Matrix4fv'
|
|
95
|
+
}[this.type] || '1f', this.update();
|
|
96
|
+
}
|
|
97
|
+
update(value) {
|
|
98
|
+
void 0 !== this.value && context[`uniform${this.typeFn}`](value, this.typeFn.indexOf('Matrix') === 0 ? this.transpose : this.value, this.typeFn.indexOf('Matrix') === 0 ? this.value : null);
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
// e - name
|
|
102
|
+
// t - type
|
|
103
|
+
// n - length
|
|
104
|
+
getDeclaration(name, type, length) {
|
|
105
|
+
const uniform = this;
|
|
106
|
+
if (uniform.excludeFrom !== type) {
|
|
107
|
+
if (uniform.type === 'array') return `${uniform.value[0].getDeclaration(name, type, uniform.value.length)}\nconst int ${name}_length = ${uniform.value.length};`;
|
|
108
|
+
if (uniform.type === 'struct') {
|
|
109
|
+
let name_no_prefix = name.replace('u_', '');
|
|
110
|
+
return name_no_prefix = name_no_prefix.charAt(0).toUpperCase() + name_no_prefix.slice(1), `uniform struct ${name_no_prefix}
|
|
111
|
+
{\n${Object.entries(uniform.value).map(_ref4 => {
|
|
112
|
+
let [name, uniform] = _ref4;
|
|
113
|
+
return uniform.getDeclaration(name, type).replace(/^uniform/, '');
|
|
114
|
+
}).join('')}\n} ${name}${length > 0 ? `[${length}]` : ''};`;
|
|
115
|
+
}
|
|
116
|
+
return `uniform ${uniform.type} ${name}${length > 0 ? `[${length}]` : ''};`;
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
},
|
|
121
|
+
PlaneGeometry: {
|
|
122
|
+
enumerable: !1,
|
|
123
|
+
value: class {
|
|
124
|
+
constructor(width, height, n, i, orientation) {
|
|
125
|
+
context.createBuffer(), this.attributes = {
|
|
126
|
+
position: new _miniGl.Attribute({
|
|
127
|
+
target: context.ARRAY_BUFFER,
|
|
128
|
+
size: 3
|
|
129
|
+
}),
|
|
130
|
+
uv: new _miniGl.Attribute({
|
|
131
|
+
target: context.ARRAY_BUFFER,
|
|
132
|
+
size: 2
|
|
133
|
+
}),
|
|
134
|
+
uvNorm: new _miniGl.Attribute({
|
|
135
|
+
target: context.ARRAY_BUFFER,
|
|
136
|
+
size: 2
|
|
137
|
+
}),
|
|
138
|
+
index: new _miniGl.Attribute({
|
|
139
|
+
target: context.ELEMENT_ARRAY_BUFFER,
|
|
140
|
+
size: 3,
|
|
141
|
+
type: context.UNSIGNED_SHORT
|
|
142
|
+
})
|
|
143
|
+
}, this.setTopology(n, i), this.setSize(width, height, orientation);
|
|
144
|
+
}
|
|
145
|
+
setTopology() {
|
|
146
|
+
let e = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 1;
|
|
147
|
+
let t = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 1;
|
|
148
|
+
const n = this;
|
|
149
|
+
n.xSegCount = e, n.ySegCount = t, n.vertexCount = (n.xSegCount + 1) * (n.ySegCount + 1), n.quadCount = n.xSegCount * n.ySegCount * 2, n.attributes.uv.values = new Float32Array(2 * n.vertexCount), n.attributes.uvNorm.values = new Float32Array(2 * n.vertexCount), n.attributes.index.values = new Uint16Array(3 * n.quadCount);
|
|
150
|
+
for (let e = 0; e <= n.ySegCount; e++) {
|
|
151
|
+
for (let t = 0; t <= n.xSegCount; t++) {
|
|
152
|
+
const i = e * (n.xSegCount + 1) + t;
|
|
153
|
+
if (n.attributes.uv.values[2 * i] = t / n.xSegCount, n.attributes.uv.values[2 * i + 1] = 1 - e / n.ySegCount, n.attributes.uvNorm.values[2 * i] = t / n.xSegCount * 2 - 1, n.attributes.uvNorm.values[2 * i + 1] = 1 - e / n.ySegCount * 2, t < n.xSegCount && e < n.ySegCount) {
|
|
154
|
+
const s = e * n.xSegCount + t;
|
|
155
|
+
n.attributes.index.values[6 * s] = i, n.attributes.index.values[6 * s + 1] = i + 1 + n.xSegCount, n.attributes.index.values[6 * s + 2] = i + 1, n.attributes.index.values[6 * s + 3] = i + 1, n.attributes.index.values[6 * s + 4] = i + 1 + n.xSegCount, n.attributes.index.values[6 * s + 5] = i + 2 + n.xSegCount;
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
n.attributes.uv.update(), n.attributes.uvNorm.update(), n.attributes.index.update(), _miniGl.debug('Geometry.setTopology', {
|
|
160
|
+
uv: n.attributes.uv,
|
|
161
|
+
uvNorm: n.attributes.uvNorm,
|
|
162
|
+
index: n.attributes.index
|
|
163
|
+
});
|
|
164
|
+
}
|
|
165
|
+
setSize() {
|
|
166
|
+
let width = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 1;
|
|
167
|
+
let height = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 1;
|
|
168
|
+
let orientation = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 'xz';
|
|
169
|
+
const geometry = this;
|
|
170
|
+
geometry.width = width, geometry.height = height, geometry.orientation = orientation, geometry.attributes.position.values && geometry.attributes.position.values.length === 3 * geometry.vertexCount || (geometry.attributes.position.values = new Float32Array(3 * geometry.vertexCount));
|
|
171
|
+
const o = width / -2;
|
|
172
|
+
const r = height / -2;
|
|
173
|
+
const segment_width = width / geometry.xSegCount;
|
|
174
|
+
const segment_height = height / geometry.ySegCount;
|
|
175
|
+
for (let yIndex = 0; yIndex <= geometry.ySegCount; yIndex++) {
|
|
176
|
+
const t = r + yIndex * segment_height;
|
|
177
|
+
for (let xIndex = 0; xIndex <= geometry.xSegCount; xIndex++) {
|
|
178
|
+
const r = o + xIndex * segment_width;
|
|
179
|
+
const l = yIndex * (geometry.xSegCount + 1) + xIndex;
|
|
180
|
+
geometry.attributes.position.values[3 * l + 'xyz'.indexOf(orientation[0])] = r, geometry.attributes.position.values[3 * l + 'xyz'.indexOf(orientation[1])] = -t;
|
|
181
|
+
}
|
|
182
|
+
}
|
|
183
|
+
geometry.attributes.position.update(), _miniGl.debug('Geometry.setSize', {
|
|
184
|
+
position: geometry.attributes.position
|
|
185
|
+
});
|
|
186
|
+
}
|
|
187
|
+
}
|
|
188
|
+
},
|
|
189
|
+
Mesh: {
|
|
190
|
+
enumerable: !1,
|
|
191
|
+
value: class {
|
|
192
|
+
constructor(geometry, material) {
|
|
193
|
+
const mesh = this;
|
|
194
|
+
mesh.geometry = geometry, mesh.material = material, mesh.wireframe = !1, mesh.attributeInstances = [], Object.entries(mesh.geometry.attributes).forEach(_ref5 => {
|
|
195
|
+
let [e, attribute] = _ref5;
|
|
196
|
+
mesh.attributeInstances.push({
|
|
197
|
+
attribute,
|
|
198
|
+
location: attribute.attach(e, mesh.material.program)
|
|
199
|
+
});
|
|
200
|
+
}), _miniGl.meshes.push(mesh), _miniGl.debug('Mesh.constructor', {
|
|
201
|
+
mesh
|
|
202
|
+
});
|
|
203
|
+
}
|
|
204
|
+
draw() {
|
|
205
|
+
context.useProgram(this.material.program), this.material.uniformInstances.forEach(_ref6 => {
|
|
206
|
+
let {
|
|
207
|
+
uniform: e,
|
|
208
|
+
location: t
|
|
209
|
+
} = _ref6;
|
|
210
|
+
return e.update(t);
|
|
211
|
+
}), this.attributeInstances.forEach(_ref7 => {
|
|
212
|
+
let {
|
|
213
|
+
attribute: e,
|
|
214
|
+
location: t
|
|
215
|
+
} = _ref7;
|
|
216
|
+
return e.use(t);
|
|
217
|
+
}), context.drawElements(this.wireframe ? context.LINES : context.TRIANGLES, this.geometry.attributes.index.values.length, context.UNSIGNED_SHORT, 0);
|
|
218
|
+
}
|
|
219
|
+
remove() {
|
|
220
|
+
_miniGl.meshes = _miniGl.meshes.filter(e => e != this);
|
|
221
|
+
}
|
|
222
|
+
}
|
|
223
|
+
},
|
|
224
|
+
Attribute: {
|
|
225
|
+
enumerable: !1,
|
|
226
|
+
value: class {
|
|
227
|
+
constructor(e) {
|
|
228
|
+
this.type = context.FLOAT, this.normalized = !1, this.buffer = context.createBuffer(), Object.assign(this, e), this.update();
|
|
229
|
+
}
|
|
230
|
+
update() {
|
|
231
|
+
void 0 !== this.values && (context.bindBuffer(this.target, this.buffer), context.bufferData(this.target, this.values, context.STATIC_DRAW));
|
|
232
|
+
}
|
|
233
|
+
attach(e, t) {
|
|
234
|
+
const n = context.getAttribLocation(t, e);
|
|
235
|
+
return this.target === context.ARRAY_BUFFER && (context.enableVertexAttribArray(n), context.vertexAttribPointer(n, this.size, this.type, this.normalized, 0, 0)), n;
|
|
236
|
+
}
|
|
237
|
+
use(e) {
|
|
238
|
+
context.bindBuffer(this.target, this.buffer), this.target === context.ARRAY_BUFFER && (context.enableVertexAttribArray(e), context.vertexAttribPointer(e, this.size, this.type, this.normalized, 0, 0));
|
|
239
|
+
}
|
|
240
|
+
}
|
|
241
|
+
}
|
|
242
|
+
});
|
|
243
|
+
const a = [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1];
|
|
244
|
+
_miniGl.commonUniforms = {
|
|
245
|
+
projectionMatrix: new _miniGl.Uniform({
|
|
246
|
+
type: 'mat4',
|
|
247
|
+
value: a
|
|
248
|
+
}),
|
|
249
|
+
modelViewMatrix: new _miniGl.Uniform({
|
|
250
|
+
type: 'mat4',
|
|
251
|
+
value: a
|
|
252
|
+
}),
|
|
253
|
+
resolution: new _miniGl.Uniform({
|
|
254
|
+
type: 'vec2',
|
|
255
|
+
value: [1, 1]
|
|
256
|
+
}),
|
|
257
|
+
aspectRatio: new _miniGl.Uniform({
|
|
258
|
+
type: 'float',
|
|
259
|
+
value: 1
|
|
260
|
+
})
|
|
261
|
+
};
|
|
262
|
+
}
|
|
263
|
+
setSize() {
|
|
264
|
+
let e = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 640;
|
|
265
|
+
let t = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 480;
|
|
266
|
+
this.width = e, this.height = t, this.canvas.width = e, this.canvas.height = t, this.gl.viewport(0, 0, e, t), this.commonUniforms.resolution.value = [e, t], this.commonUniforms.aspectRatio.value = e / t, this.debug('MiniGL.setSize', {
|
|
267
|
+
width: e,
|
|
268
|
+
height: t
|
|
269
|
+
});
|
|
270
|
+
}
|
|
271
|
+
|
|
272
|
+
// left, right, top, bottom, near, far
|
|
273
|
+
setOrthographicCamera() {
|
|
274
|
+
let e = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;
|
|
275
|
+
let t = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
|
|
276
|
+
let n = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0;
|
|
277
|
+
let i = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : -2e3;
|
|
278
|
+
let s = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : 2e3;
|
|
279
|
+
this.commonUniforms.projectionMatrix.value = [2 / this.width, 0, 0, 0, 0, 2 / this.height, 0, 0, 0, 0, 2 / (i - s), 0, e, t, n, 1], this.debug('setOrthographicCamera', this.commonUniforms.projectionMatrix.value);
|
|
280
|
+
}
|
|
281
|
+
render() {
|
|
282
|
+
this.gl.clearColor(0, 0, 0, 0), this.gl.clearDepth(1), this.meshes.forEach(e => e.draw());
|
|
283
|
+
}
|
|
284
|
+
}
|
|
285
|
+
|
|
286
|
+
// Sets initial properties
|
|
287
|
+
function e(object, propertyName, val) {
|
|
288
|
+
return propertyName in object ? Object.defineProperty(object, propertyName, {
|
|
289
|
+
value: val,
|
|
290
|
+
enumerable: !0,
|
|
291
|
+
configurable: !0,
|
|
292
|
+
writable: !0
|
|
293
|
+
}) : object[propertyName] = val, object;
|
|
294
|
+
}
|
|
295
|
+
|
|
296
|
+
// Gradient object
|
|
297
|
+
class Gradient {
|
|
298
|
+
constructor() {
|
|
299
|
+
e(this, 'el', void 0), e(this, 'cssVarRetries', 0), e(this, 'maxCssVarRetries', 200), e(this, 'angle', 0), e(this, 'isLoadedClass', !1), e(this, 'isScrolling', !1), /* e(this, "isStatic", o.disableAmbientAnimations()), */e(this, 'scrollingTimeout', void 0), e(this, 'scrollingRefreshDelay', 200), e(this, 'isIntersecting', !1), e(this, 'shaderFiles', void 0), e(this, 'vertexShader', void 0), e(this, 'sectionColors', void 0), e(this, 'computedCanvasStyle', void 0), e(this, 'conf', void 0), e(this, 'uniforms', void 0), e(this, 't', 1253106), e(this, 'last', 0), e(this, 'width', void 0), e(this, 'minWidth', 1111), e(this, 'height', 600), e(this, 'xSegCount', void 0), e(this, 'ySegCount', void 0), e(this, 'mesh', void 0), e(this, 'material', void 0), e(this, 'geometry', void 0), e(this, 'minigl', void 0), e(this, 'scrollObserver', void 0), e(this, 'amp', 320), e(this, 'seed', 5), e(this, 'freqX', 14e-5), e(this, 'freqY', 29e-5), e(this, 'freqDelta', 1e-5), e(this, 'activeColors', [1, 1, 1, 1]), e(this, 'isMetaKey', !1), e(this, 'isGradientLegendVisible', !1), e(this, 'isMouseDown', !1), e(this, 'handleScroll', () => {
|
|
300
|
+
clearTimeout(this.scrollingTimeout), this.scrollingTimeout = setTimeout(this.handleScrollEnd, this.scrollingRefreshDelay), this.isGradientLegendVisible && this.hideGradientLegend(), this.conf.playing && (this.isScrolling = !0, this.pause());
|
|
301
|
+
}), e(this, 'handleScrollEnd', () => {
|
|
302
|
+
this.isScrolling = !1, this.isIntersecting && this.play();
|
|
303
|
+
}), e(this, 'resize', () => {
|
|
304
|
+
this.width = window.innerWidth, this.minigl.setSize(this.width, this.height), this.minigl.setOrthographicCamera(), this.xSegCount = Math.ceil(this.width * this.conf.density[0]), this.ySegCount = Math.ceil(this.height * this.conf.density[1]), this.mesh.geometry.setTopology(this.xSegCount, this.ySegCount), this.mesh.geometry.setSize(this.width, this.height), this.mesh.material.uniforms.u_shadow_power.value = this.width < 600 ? 5 : 6;
|
|
305
|
+
}), e(this, 'handleMouseDown', e => {
|
|
306
|
+
this.isGradientLegendVisible && (this.isMetaKey = e.metaKey, this.isMouseDown = !0, !1 === this.conf.playing && requestAnimationFrame(this.animate));
|
|
307
|
+
}), e(this, 'handleMouseUp', () => {
|
|
308
|
+
this.isMouseDown = !1;
|
|
309
|
+
}), e(this, 'animate', e => {
|
|
310
|
+
if (!this.shouldSkipFrame(e) || this.isMouseDown) {
|
|
311
|
+
if (this.t += Math.min(e - this.last, 1e3 / 15), this.last = e, this.isMouseDown) {
|
|
312
|
+
let e = 160;
|
|
313
|
+
this.isMetaKey && (e = -160), this.t += e;
|
|
314
|
+
}
|
|
315
|
+
this.mesh.material.uniforms.u_time.value = this.t, this.minigl.render();
|
|
316
|
+
}
|
|
317
|
+
if (this.last !== 0 && this.isStatic) return this.minigl.render(), void this.disconnect();
|
|
318
|
+
( /* this.isIntersecting && */this.conf.playing || this.isMouseDown) && requestAnimationFrame(this.animate);
|
|
319
|
+
}), e(this, 'addIsLoadedClass', () => {
|
|
320
|
+
/* this.isIntersecting && */!this.isLoadedClass && (this.isLoadedClass = !0, this.el.classList.add('isLoaded'), setTimeout(() => {
|
|
321
|
+
this.el.parentElement.classList.add('isLoaded');
|
|
322
|
+
}, 3e3));
|
|
323
|
+
}), e(this, 'pause', () => {
|
|
324
|
+
this.conf.playing = false;
|
|
325
|
+
}), e(this, 'play', () => {
|
|
326
|
+
requestAnimationFrame(this.animate), this.conf.playing = true;
|
|
327
|
+
}), e(this, 'initGradient', selector => {
|
|
328
|
+
this.el = document.querySelector(selector);
|
|
329
|
+
this.connect();
|
|
330
|
+
return this;
|
|
331
|
+
});
|
|
332
|
+
}
|
|
333
|
+
async connect() {
|
|
334
|
+
this.shaderFiles = {
|
|
335
|
+
vertex: 'varying vec3 v_color;\n\nvoid main() {\n float time = u_time * u_global.noiseSpeed;\n\n vec2 noiseCoord = resolution * uvNorm * u_global.noiseFreq;\n\n vec2 st = 1. - uvNorm.xy;\n\n //\n // Tilting the plane\n //\n\n // Front-to-back tilt\n float tilt = resolution.y / 2.0 * uvNorm.y;\n\n // Left-to-right angle\n float incline = resolution.x * uvNorm.x / 2.0 * u_vertDeform.incline;\n\n // Up-down shift to offset incline\n float offset = resolution.x / 2.0 * u_vertDeform.incline * mix(u_vertDeform.offsetBottom, u_vertDeform.offsetTop, uv.y);\n\n //\n // Vertex noise\n //\n\n float noise = snoise(vec3(\n noiseCoord.x * u_vertDeform.noiseFreq.x + time * u_vertDeform.noiseFlow,\n noiseCoord.y * u_vertDeform.noiseFreq.y,\n time * u_vertDeform.noiseSpeed + u_vertDeform.noiseSeed\n )) * u_vertDeform.noiseAmp;\n\n // Fade noise to zero at edges\n noise *= 1.0 - pow(abs(uvNorm.y), 2.0);\n\n // Clamp to 0\n noise = max(0.0, noise);\n\n vec3 pos = vec3(\n position.x,\n position.y + tilt + incline + noise - offset,\n position.z\n );\n\n //\n // Vertex color, to be passed to fragment shader\n //\n\n if (u_active_colors[0] == 1.) {\n v_color = u_baseColor;\n }\n\n for (int i = 0; i < u_waveLayers_length; i++) {\n if (u_active_colors[i + 1] == 1.) {\n WaveLayers layer = u_waveLayers[i];\n\n float noise = smoothstep(\n layer.noiseFloor,\n layer.noiseCeil,\n snoise(vec3(\n noiseCoord.x * layer.noiseFreq.x + time * layer.noiseFlow,\n noiseCoord.y * layer.noiseFreq.y,\n time * layer.noiseSpeed + layer.noiseSeed\n )) / 2.0 + 0.5\n );\n\n v_color = blendNormal(v_color, layer.color, pow(noise, 4.));\n }\n }\n\n //\n // Finish\n //\n\n gl_Position = projectionMatrix * modelViewMatrix * vec4(pos, 1.0);\n}',
|
|
336
|
+
noise: '//\n// Description : Array and textureless GLSL 2D/3D/4D simplex\n// noise functions.\n// Author : Ian McEwan, Ashima Arts.\n// Maintainer : stegu\n// Lastmod : 20110822 (ijm)\n// License : Copyright (C) 2011 Ashima Arts. All rights reserved.\n// Distributed under the MIT License. See LICENSE file.\n// https://github.com/ashima/webgl-noise\n// https://github.com/stegu/webgl-noise\n//\n\nvec3 mod289(vec3 x) {\n return x - floor(x * (1.0 / 289.0)) * 289.0;\n}\n\nvec4 mod289(vec4 x) {\n return x - floor(x * (1.0 / 289.0)) * 289.0;\n}\n\nvec4 permute(vec4 x) {\n return mod289(((x*34.0)+1.0)*x);\n}\n\nvec4 taylorInvSqrt(vec4 r)\n{\n return 1.79284291400159 - 0.85373472095314 * r;\n}\n\nfloat snoise(vec3 v)\n{\n const vec2 C = vec2(1.0/6.0, 1.0/3.0) ;\n const vec4 D = vec4(0.0, 0.5, 1.0, 2.0);\n\n// First corner\n vec3 i = floor(v + dot(v, C.yyy) );\n vec3 x0 = v - i + dot(i, C.xxx) ;\n\n// Other corners\n vec3 g = step(x0.yzx, x0.xyz);\n vec3 l = 1.0 - g;\n vec3 i1 = min( g.xyz, l.zxy );\n vec3 i2 = max( g.xyz, l.zxy );\n\n // x0 = x0 - 0.0 + 0.0 * C.xxx;\n // x1 = x0 - i1 + 1.0 * C.xxx;\n // x2 = x0 - i2 + 2.0 * C.xxx;\n // x3 = x0 - 1.0 + 3.0 * C.xxx;\n vec3 x1 = x0 - i1 + C.xxx;\n vec3 x2 = x0 - i2 + C.yyy; // 2.0*C.x = 1/3 = C.y\n vec3 x3 = x0 - D.yyy; // -1.0+3.0*C.x = -0.5 = -D.y\n\n// Permutations\n i = mod289(i);\n vec4 p = permute( permute( permute(\n i.z + vec4(0.0, i1.z, i2.z, 1.0 ))\n + i.y + vec4(0.0, i1.y, i2.y, 1.0 ))\n + i.x + vec4(0.0, i1.x, i2.x, 1.0 ));\n\n// Gradients: 7x7 points over a square, mapped onto an octahedron.\n// The ring size 17*17 = 289 is close to a multiple of 49 (49*6 = 294)\n float n_ = 0.142857142857; // 1.0/7.0\n vec3 ns = n_ * D.wyz - D.xzx;\n\n vec4 j = p - 49.0 * floor(p * ns.z * ns.z); // mod(p,7*7)\n\n vec4 x_ = floor(j * ns.z);\n vec4 y_ = floor(j - 7.0 * x_ ); // mod(j,N)\n\n vec4 x = x_ *ns.x + ns.yyyy;\n vec4 y = y_ *ns.x + ns.yyyy;\n vec4 h = 1.0 - abs(x) - abs(y);\n\n vec4 b0 = vec4( x.xy, y.xy );\n vec4 b1 = vec4( x.zw, y.zw );\n\n //vec4 s0 = vec4(lessThan(b0,0.0))*2.0 - 1.0;\n //vec4 s1 = vec4(lessThan(b1,0.0))*2.0 - 1.0;\n vec4 s0 = floor(b0)*2.0 + 1.0;\n vec4 s1 = floor(b1)*2.0 + 1.0;\n vec4 sh = -step(h, vec4(0.0));\n\n vec4 a0 = b0.xzyw + s0.xzyw*sh.xxyy ;\n vec4 a1 = b1.xzyw + s1.xzyw*sh.zzww ;\n\n vec3 p0 = vec3(a0.xy,h.x);\n vec3 p1 = vec3(a0.zw,h.y);\n vec3 p2 = vec3(a1.xy,h.z);\n vec3 p3 = vec3(a1.zw,h.w);\n\n//Normalise gradients\n vec4 norm = taylorInvSqrt(vec4(dot(p0,p0), dot(p1,p1), dot(p2, p2), dot(p3,p3)));\n p0 *= norm.x;\n p1 *= norm.y;\n p2 *= norm.z;\n p3 *= norm.w;\n\n// Mix final noise value\n vec4 m = max(0.6 - vec4(dot(x0,x0), dot(x1,x1), dot(x2,x2), dot(x3,x3)), 0.0);\n m = m * m;\n return 42.0 * dot( m*m, vec4( dot(p0,x0), dot(p1,x1),\n dot(p2,x2), dot(p3,x3) ) );\n}',
|
|
337
|
+
blend: '//\n// https://github.com/jamieowen/glsl-blend\n//\n\n// Normal\n\nvec3 blendNormal(vec3 base, vec3 blend) {\n\treturn blend;\n}\n\nvec3 blendNormal(vec3 base, vec3 blend, float opacity) {\n\treturn (blendNormal(base, blend) * opacity + base * (1.0 - opacity));\n}\n\n// Screen\n\nfloat blendScreen(float base, float blend) {\n\treturn 1.0-((1.0-base)*(1.0-blend));\n}\n\nvec3 blendScreen(vec3 base, vec3 blend) {\n\treturn vec3(blendScreen(base.r,blend.r),blendScreen(base.g,blend.g),blendScreen(base.b,blend.b));\n}\n\nvec3 blendScreen(vec3 base, vec3 blend, float opacity) {\n\treturn (blendScreen(base, blend) * opacity + base * (1.0 - opacity));\n}\n\n// Multiply\n\nvec3 blendMultiply(vec3 base, vec3 blend) {\n\treturn base*blend;\n}\n\nvec3 blendMultiply(vec3 base, vec3 blend, float opacity) {\n\treturn (blendMultiply(base, blend) * opacity + base * (1.0 - opacity));\n}\n\n// Overlay\n\nfloat blendOverlay(float base, float blend) {\n\treturn base<0.5?(2.0*base*blend):(1.0-2.0*(1.0-base)*(1.0-blend));\n}\n\nvec3 blendOverlay(vec3 base, vec3 blend) {\n\treturn vec3(blendOverlay(base.r,blend.r),blendOverlay(base.g,blend.g),blendOverlay(base.b,blend.b));\n}\n\nvec3 blendOverlay(vec3 base, vec3 blend, float opacity) {\n\treturn (blendOverlay(base, blend) * opacity + base * (1.0 - opacity));\n}\n\n// Hard light\n\nvec3 blendHardLight(vec3 base, vec3 blend) {\n\treturn blendOverlay(blend,base);\n}\n\nvec3 blendHardLight(vec3 base, vec3 blend, float opacity) {\n\treturn (blendHardLight(base, blend) * opacity + base * (1.0 - opacity));\n}\n\n// Soft light\n\nfloat blendSoftLight(float base, float blend) {\n\treturn (blend<0.5)?(2.0*base*blend+base*base*(1.0-2.0*blend)):(sqrt(base)*(2.0*blend-1.0)+2.0*base*(1.0-blend));\n}\n\nvec3 blendSoftLight(vec3 base, vec3 blend) {\n\treturn vec3(blendSoftLight(base.r,blend.r),blendSoftLight(base.g,blend.g),blendSoftLight(base.b,blend.b));\n}\n\nvec3 blendSoftLight(vec3 base, vec3 blend, float opacity) {\n\treturn (blendSoftLight(base, blend) * opacity + base * (1.0 - opacity));\n}\n\n// Color dodge\n\nfloat blendColorDodge(float base, float blend) {\n\treturn (blend==1.0)?blend:min(base/(1.0-blend),1.0);\n}\n\nvec3 blendColorDodge(vec3 base, vec3 blend) {\n\treturn vec3(blendColorDodge(base.r,blend.r),blendColorDodge(base.g,blend.g),blendColorDodge(base.b,blend.b));\n}\n\nvec3 blendColorDodge(vec3 base, vec3 blend, float opacity) {\n\treturn (blendColorDodge(base, blend) * opacity + base * (1.0 - opacity));\n}\n\n// Color burn\n\nfloat blendColorBurn(float base, float blend) {\n\treturn (blend==0.0)?blend:max((1.0-((1.0-base)/blend)),0.0);\n}\n\nvec3 blendColorBurn(vec3 base, vec3 blend) {\n\treturn vec3(blendColorBurn(base.r,blend.r),blendColorBurn(base.g,blend.g),blendColorBurn(base.b,blend.b));\n}\n\nvec3 blendColorBurn(vec3 base, vec3 blend, float opacity) {\n\treturn (blendColorBurn(base, blend) * opacity + base * (1.0 - opacity));\n}\n\n// Vivid Light\n\nfloat blendVividLight(float base, float blend) {\n\treturn (blend<0.5)?blendColorBurn(base,(2.0*blend)):blendColorDodge(base,(2.0*(blend-0.5)));\n}\n\nvec3 blendVividLight(vec3 base, vec3 blend) {\n\treturn vec3(blendVividLight(base.r,blend.r),blendVividLight(base.g,blend.g),blendVividLight(base.b,blend.b));\n}\n\nvec3 blendVividLight(vec3 base, vec3 blend, float opacity) {\n\treturn (blendVividLight(base, blend) * opacity + base * (1.0 - opacity));\n}\n\n// Lighten\n\nfloat blendLighten(float base, float blend) {\n\treturn max(blend,base);\n}\n\nvec3 blendLighten(vec3 base, vec3 blend) {\n\treturn vec3(blendLighten(base.r,blend.r),blendLighten(base.g,blend.g),blendLighten(base.b,blend.b));\n}\n\nvec3 blendLighten(vec3 base, vec3 blend, float opacity) {\n\treturn (blendLighten(base, blend) * opacity + base * (1.0 - opacity));\n}\n\n// Linear burn\n\nfloat blendLinearBurn(float base, float blend) {\n\t// Note : Same implementation as BlendSubtractf\n\treturn max(base+blend-1.0,0.0);\n}\n\nvec3 blendLinearBurn(vec3 base, vec3 blend) {\n\t// Note : Same implementation as BlendSubtract\n\treturn max(base+blend-vec3(1.0),vec3(0.0));\n}\n\nvec3 blendLinearBurn(vec3 base, vec3 blend, float opacity) {\n\treturn (blendLinearBurn(base, blend) * opacity + base * (1.0 - opacity));\n}\n\n// Linear dodge\n\nfloat blendLinearDodge(float base, float blend) {\n\t// Note : Same implementation as BlendAddf\n\treturn min(base+blend,1.0);\n}\n\nvec3 blendLinearDodge(vec3 base, vec3 blend) {\n\t// Note : Same implementation as BlendAdd\n\treturn min(base+blend,vec3(1.0));\n}\n\nvec3 blendLinearDodge(vec3 base, vec3 blend, float opacity) {\n\treturn (blendLinearDodge(base, blend) * opacity + base * (1.0 - opacity));\n}\n\n// Linear light\n\nfloat blendLinearLight(float base, float blend) {\n\treturn blend<0.5?blendLinearBurn(base,(2.0*blend)):blendLinearDodge(base,(2.0*(blend-0.5)));\n}\n\nvec3 blendLinearLight(vec3 base, vec3 blend) {\n\treturn vec3(blendLinearLight(base.r,blend.r),blendLinearLight(base.g,blend.g),blendLinearLight(base.b,blend.b));\n}\n\nvec3 blendLinearLight(vec3 base, vec3 blend, float opacity) {\n\treturn (blendLinearLight(base, blend) * opacity + base * (1.0 - opacity));\n}',
|
|
338
|
+
fragment: 'varying vec3 v_color;\n\nvoid main() {\n vec3 color = v_color;\n if (u_darken_top == 1.0) {\n vec2 st = gl_FragCoord.xy/resolution.xy;\n color.g -= pow(st.y + sin(-12.0) * st.x, u_shadow_power) * 0.4;\n }\n gl_FragColor = vec4(color, 1.0);\n}'
|
|
339
|
+
}, this.conf = {
|
|
340
|
+
presetName: '',
|
|
341
|
+
wireframe: false,
|
|
342
|
+
density: [0.06, 0.16],
|
|
343
|
+
zoom: 1,
|
|
344
|
+
rotation: 0,
|
|
345
|
+
playing: true
|
|
346
|
+
}, document.querySelectorAll('canvas').length < 1 ? console.log('DID NOT LOAD HERO STRIPE CANVAS') : (this.minigl = new MiniGl(this.el, null, null, !0), requestAnimationFrame(() => {
|
|
347
|
+
this.el && (this.computedCanvasStyle = getComputedStyle(this.el), this.waitForCssVars());
|
|
348
|
+
})
|
|
349
|
+
/*
|
|
350
|
+
this.scrollObserver = await s.create(.1, !1),
|
|
351
|
+
this.scrollObserver.observe(this.el),
|
|
352
|
+
this.scrollObserver.onSeparate(() => {
|
|
353
|
+
window.removeEventListener("scroll", this.handleScroll), window.removeEventListener("mousedown", this.handleMouseDown), window.removeEventListener("mouseup", this.handleMouseUp), window.removeEventListener("keydown", this.handleKeyDown), this.isIntersecting = !1, this.conf.playing && this.pause()
|
|
354
|
+
}),
|
|
355
|
+
this.scrollObserver.onIntersect(() => {
|
|
356
|
+
window.addEventListener("scroll", this.handleScroll), window.addEventListener("mousedown", this.handleMouseDown), window.addEventListener("mouseup", this.handleMouseUp), window.addEventListener("keydown", this.handleKeyDown), this.isIntersecting = !0, this.addIsLoadedClass(), this.play()
|
|
357
|
+
}) */);
|
|
358
|
+
}
|
|
359
|
+
|
|
360
|
+
disconnect() {
|
|
361
|
+
this.scrollObserver && (window.removeEventListener('scroll', this.handleScroll), window.removeEventListener('mousedown', this.handleMouseDown), window.removeEventListener('mouseup', this.handleMouseUp), window.removeEventListener('keydown', this.handleKeyDown), this.scrollObserver.disconnect()), window.removeEventListener('resize', this.resize);
|
|
362
|
+
}
|
|
363
|
+
initMaterial() {
|
|
364
|
+
this.uniforms = {
|
|
365
|
+
u_time: new this.minigl.Uniform({
|
|
366
|
+
value: 0
|
|
367
|
+
}),
|
|
368
|
+
u_shadow_power: new this.minigl.Uniform({
|
|
369
|
+
value: 5
|
|
370
|
+
}),
|
|
371
|
+
u_darken_top: new this.minigl.Uniform({
|
|
372
|
+
value: this.el.dataset.jsDarkenTop === '' ? 1 : 0
|
|
373
|
+
}),
|
|
374
|
+
u_active_colors: new this.minigl.Uniform({
|
|
375
|
+
value: this.activeColors,
|
|
376
|
+
type: 'vec4'
|
|
377
|
+
}),
|
|
378
|
+
u_global: new this.minigl.Uniform({
|
|
379
|
+
value: {
|
|
380
|
+
noiseFreq: new this.minigl.Uniform({
|
|
381
|
+
value: [this.freqX, this.freqY],
|
|
382
|
+
type: 'vec2'
|
|
383
|
+
}),
|
|
384
|
+
noiseSpeed: new this.minigl.Uniform({
|
|
385
|
+
value: 5e-6
|
|
386
|
+
})
|
|
387
|
+
},
|
|
388
|
+
type: 'struct'
|
|
389
|
+
}),
|
|
390
|
+
u_vertDeform: new this.minigl.Uniform({
|
|
391
|
+
value: {
|
|
392
|
+
incline: new this.minigl.Uniform({
|
|
393
|
+
value: Math.sin(this.angle) / Math.cos(this.angle)
|
|
394
|
+
}),
|
|
395
|
+
offsetTop: new this.minigl.Uniform({
|
|
396
|
+
value: -0.5
|
|
397
|
+
}),
|
|
398
|
+
offsetBottom: new this.minigl.Uniform({
|
|
399
|
+
value: -0.5
|
|
400
|
+
}),
|
|
401
|
+
noiseFreq: new this.minigl.Uniform({
|
|
402
|
+
value: [3, 4],
|
|
403
|
+
type: 'vec2'
|
|
404
|
+
}),
|
|
405
|
+
noiseAmp: new this.minigl.Uniform({
|
|
406
|
+
value: this.amp
|
|
407
|
+
}),
|
|
408
|
+
noiseSpeed: new this.minigl.Uniform({
|
|
409
|
+
value: 10
|
|
410
|
+
}),
|
|
411
|
+
noiseFlow: new this.minigl.Uniform({
|
|
412
|
+
value: 3
|
|
413
|
+
}),
|
|
414
|
+
noiseSeed: new this.minigl.Uniform({
|
|
415
|
+
value: this.seed
|
|
416
|
+
})
|
|
417
|
+
},
|
|
418
|
+
type: 'struct',
|
|
419
|
+
excludeFrom: 'fragment'
|
|
420
|
+
}),
|
|
421
|
+
u_baseColor: new this.minigl.Uniform({
|
|
422
|
+
value: this.sectionColors[0],
|
|
423
|
+
type: 'vec3',
|
|
424
|
+
excludeFrom: 'fragment'
|
|
425
|
+
}),
|
|
426
|
+
u_waveLayers: new this.minigl.Uniform({
|
|
427
|
+
value: [],
|
|
428
|
+
excludeFrom: 'fragment',
|
|
429
|
+
type: 'array'
|
|
430
|
+
})
|
|
431
|
+
};
|
|
432
|
+
for (let e = 1; e < this.sectionColors.length; e += 1) {
|
|
433
|
+
this.uniforms.u_waveLayers.value.push(new this.minigl.Uniform({
|
|
434
|
+
value: {
|
|
435
|
+
color: new this.minigl.Uniform({
|
|
436
|
+
value: this.sectionColors[e],
|
|
437
|
+
type: 'vec3'
|
|
438
|
+
}),
|
|
439
|
+
noiseFreq: new this.minigl.Uniform({
|
|
440
|
+
value: [2 + e / this.sectionColors.length, 3 + e / this.sectionColors.length],
|
|
441
|
+
type: 'vec2'
|
|
442
|
+
}),
|
|
443
|
+
noiseSpeed: new this.minigl.Uniform({
|
|
444
|
+
value: 11 + 0.3 * e
|
|
445
|
+
}),
|
|
446
|
+
noiseFlow: new this.minigl.Uniform({
|
|
447
|
+
value: 6.5 + 0.3 * e
|
|
448
|
+
}),
|
|
449
|
+
noiseSeed: new this.minigl.Uniform({
|
|
450
|
+
value: this.seed + 10 * e
|
|
451
|
+
}),
|
|
452
|
+
noiseFloor: new this.minigl.Uniform({
|
|
453
|
+
value: 0.1
|
|
454
|
+
}),
|
|
455
|
+
noiseCeil: new this.minigl.Uniform({
|
|
456
|
+
value: 0.63 + 0.07 * e
|
|
457
|
+
})
|
|
458
|
+
},
|
|
459
|
+
type: 'struct'
|
|
460
|
+
}));
|
|
461
|
+
}
|
|
462
|
+
return this.vertexShader = [this.shaderFiles.noise, this.shaderFiles.blend, this.shaderFiles.vertex].join('\n\n'), new this.minigl.Material(this.vertexShader, this.shaderFiles.fragment, this.uniforms);
|
|
463
|
+
}
|
|
464
|
+
initMesh() {
|
|
465
|
+
this.material = this.initMaterial(), this.geometry = new this.minigl.PlaneGeometry(), this.mesh = new this.minigl.Mesh(this.geometry, this.material);
|
|
466
|
+
}
|
|
467
|
+
shouldSkipFrame(e) {
|
|
468
|
+
return !!window.document.hidden || !this.conf.playing || parseInt(e, 10) % 2 == 0 || void 0;
|
|
469
|
+
}
|
|
470
|
+
updateFrequency(e) {
|
|
471
|
+
this.freqX += e, this.freqY += e;
|
|
472
|
+
}
|
|
473
|
+
toggleColor(index) {
|
|
474
|
+
this.activeColors[index] = this.activeColors[index] === 0 ? 1 : 0;
|
|
475
|
+
}
|
|
476
|
+
showGradientLegend() {
|
|
477
|
+
this.width > this.minWidth && (this.isGradientLegendVisible = !0, document.body.classList.add('isGradientLegendVisible'));
|
|
478
|
+
}
|
|
479
|
+
hideGradientLegend() {
|
|
480
|
+
this.isGradientLegendVisible = !1, document.body.classList.remove('isGradientLegendVisible');
|
|
481
|
+
}
|
|
482
|
+
init() {
|
|
483
|
+
this.initGradientColors(), this.initMesh(), this.resize(), requestAnimationFrame(this.animate), window.addEventListener('resize', this.resize);
|
|
484
|
+
}
|
|
485
|
+
|
|
486
|
+
/*
|
|
487
|
+
* Waiting for the css variables to become available, usually on page load before we can continue.
|
|
488
|
+
* Using default colors assigned below if no variables have been found after maxCssVarRetries
|
|
489
|
+
*/
|
|
490
|
+
waitForCssVars() {
|
|
491
|
+
if (this.computedCanvasStyle && this.computedCanvasStyle.getPropertyValue('--gradient-color-1').indexOf('#') !== -1) this.init(), this.addIsLoadedClass();else {
|
|
492
|
+
if (this.cssVarRetries += 1, this.cssVarRetries > this.maxCssVarRetries) {
|
|
493
|
+
return this.sectionColors = [16711680, 16711680, 16711935, 65280, 255], void this.init();
|
|
494
|
+
}
|
|
495
|
+
requestAnimationFrame(() => this.waitForCssVars());
|
|
496
|
+
}
|
|
497
|
+
}
|
|
498
|
+
|
|
499
|
+
/*
|
|
500
|
+
* Initializes the four section colors by retrieving them from css variables.
|
|
501
|
+
*/
|
|
502
|
+
initGradientColors() {
|
|
503
|
+
this.sectionColors = ['--gradient-color-1', '--gradient-color-2', '--gradient-color-3', '--gradient-color-4'].map(cssPropertyName => {
|
|
504
|
+
let hex = this.computedCanvasStyle.getPropertyValue(cssPropertyName).trim();
|
|
505
|
+
// Check if shorthand hex value was used and double the length so the conversion in normalizeColor will work.
|
|
506
|
+
if (hex.length === 4) {
|
|
507
|
+
const hexTemp = hex.substr(1).split('').map(hexTemp => hexTemp + hexTemp).join('');
|
|
508
|
+
hex = `#${hexTemp}`;
|
|
509
|
+
}
|
|
510
|
+
return hex && `0x${hex.substr(1)}`;
|
|
511
|
+
}).filter(Boolean).map(normalizeColor);
|
|
512
|
+
}
|
|
513
|
+
}
|
|
514
|
+
|
|
515
|
+
/*
|
|
516
|
+
*Finally initializing the Gradient class, assigning a canvas to it and calling Gradient.connect() which initializes everything,
|
|
517
|
+
* Use Gradient.pause() and Gradient.play() for controls.
|
|
518
|
+
*
|
|
519
|
+
* Here are some default property values you can change anytime:
|
|
520
|
+
* Amplitude: Gradient.amp = 0
|
|
521
|
+
* Colors: Gradient.sectionColors (if you change colors, use normalizeColor(#hexValue)) before you assign it.
|
|
522
|
+
*
|
|
523
|
+
*
|
|
524
|
+
* Useful functions
|
|
525
|
+
* Gradient.toggleColor(index)
|
|
526
|
+
* Gradient.updateFrequency(freq)
|
|
527
|
+
*/
|
|
528
|
+
exports.Gradient = Gradient;
|
|
@@ -5,7 +5,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.default = void 0;
|
|
7
7
|
var React = _interopRequireWildcard(require("react"));
|
|
8
|
-
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function
|
|
8
|
+
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
9
9
|
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; }
|
|
10
10
|
var _default = /*#__PURE__*/React.createContext({});
|
|
11
11
|
exports.default = _default;
|
|
@@ -9,40 +9,44 @@ var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
|
9
9
|
var _useTheme = _interopRequireDefault(require("./useTheme"));
|
|
10
10
|
var _Context = _interopRequireDefault(require("./Context"));
|
|
11
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
|
|
12
|
+
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
13
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
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
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); }
|
|
14
|
+
/* @pareto-engineering/generator-front 0.2.3 */
|
|
15
|
+
|
|
16
|
+
// Package-level Imports
|
|
17
|
+
|
|
19
18
|
// Component-level imports
|
|
20
19
|
|
|
21
20
|
// Helper Definitions
|
|
22
21
|
|
|
23
|
-
|
|
22
|
+
const reducer = (state, action) => {
|
|
24
23
|
switch (action.type) {
|
|
25
24
|
case 'UPDATE_STATE':
|
|
26
|
-
return
|
|
25
|
+
return {
|
|
26
|
+
...state,
|
|
27
|
+
...action.payload
|
|
28
|
+
};
|
|
27
29
|
default:
|
|
28
30
|
return state;
|
|
29
31
|
}
|
|
30
32
|
};
|
|
31
|
-
|
|
32
|
-
|
|
33
|
+
const AppContextProvider = _ref => {
|
|
34
|
+
let {
|
|
33
35
|
children,
|
|
34
36
|
initialTheme,
|
|
35
37
|
config,
|
|
36
38
|
initialState
|
|
37
39
|
// ...otherProps
|
|
38
40
|
} = _ref;
|
|
39
|
-
|
|
40
|
-
|
|
41
|
+
const theme = (0, _useTheme.default)(initialTheme);
|
|
42
|
+
const [state, dispatch] = (0, React.useReducer)(reducer, initialState);
|
|
41
43
|
return /*#__PURE__*/React.createElement(_Context.default.Provider, {
|
|
42
|
-
value:
|
|
44
|
+
value: {
|
|
43
45
|
state,
|
|
44
|
-
dispatch
|
|
45
|
-
|
|
46
|
+
dispatch,
|
|
47
|
+
...config,
|
|
48
|
+
...theme
|
|
49
|
+
}
|
|
46
50
|
}, children);
|
|
47
51
|
};
|
|
48
52
|
AppContextProvider.propTypes = {
|
|
@@ -5,25 +5,25 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
Object.defineProperty(exports, "AppContext", {
|
|
7
7
|
enumerable: true,
|
|
8
|
-
get: function
|
|
8
|
+
get: function () {
|
|
9
9
|
return _Context.default;
|
|
10
10
|
}
|
|
11
11
|
});
|
|
12
12
|
Object.defineProperty(exports, "AppContextProvider", {
|
|
13
13
|
enumerable: true,
|
|
14
|
-
get: function
|
|
14
|
+
get: function () {
|
|
15
15
|
return _ContextProvider.default;
|
|
16
16
|
}
|
|
17
17
|
});
|
|
18
18
|
Object.defineProperty(exports, "useApp", {
|
|
19
19
|
enumerable: true,
|
|
20
|
-
get: function
|
|
20
|
+
get: function () {
|
|
21
21
|
return _useApp.default;
|
|
22
22
|
}
|
|
23
23
|
});
|
|
24
24
|
Object.defineProperty(exports, "useTheme", {
|
|
25
25
|
enumerable: true,
|
|
26
|
-
get: function
|
|
26
|
+
get: function () {
|
|
27
27
|
return _useTheme.default;
|
|
28
28
|
}
|
|
29
29
|
});
|