@pareto-engineering/design-system 4.0.0-alpha.4 → 4.0.0-alpha.42
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/dist/cjs/a/AnimatedBlobs/AnimatedBlobs.js +90 -0
- 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 +60 -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/ContextProvider.js +0 -2
- package/dist/cjs/a/AppContext/useTheme.js +0 -4
- package/dist/cjs/a/BlurOverlay/BlurOverlay.js +59 -0
- package/dist/cjs/a/BlurOverlay/index.js +13 -0
- package/dist/cjs/a/BlurOverlay/styles.scss +31 -0
- package/dist/cjs/a/ContentTree/ContentTree.js +11 -5
- package/dist/cjs/a/ContentTree/common/Tree/Tree.js +12 -5
- package/dist/cjs/a/ContentTree/styles.scss +34 -11
- package/dist/cjs/a/Conversation/Conversation.js +12 -17
- package/dist/cjs/a/Conversation/common/Message/Message.js +15 -12
- package/dist/cjs/a/Conversation/styles.scss +56 -124
- package/dist/cjs/a/DotInfo/DotInfo.js +2 -2
- package/dist/cjs/a/Figure/Figure.js +2 -2
- package/dist/cjs/a/HamburgerButton/HamburgerButton.js +2 -2
- package/dist/cjs/a/IconList/IconList.js +2 -2
- package/dist/cjs/a/IconList/common/Item/Item.js +1 -1
- package/dist/cjs/a/Label/Label.js +14 -6
- package/dist/cjs/a/Label/styles.scss +4 -4
- package/dist/cjs/a/LoadingCircle/LoadingCircle.js +2 -2
- package/dist/cjs/a/MetaCard/MetaCard.js +65 -0
- package/dist/cjs/a/MetaCard/index.js +13 -0
- package/dist/cjs/a/MetaCard/styles.scss +45 -0
- package/dist/cjs/a/People/People.js +2 -2
- package/dist/cjs/a/People/common/Person/Person.js +5 -5
- package/dist/cjs/a/People/styles.scss +10 -4
- package/dist/cjs/a/Popover/Popover.js +4 -4
- package/dist/cjs/a/Popover/styles.scss +1 -1
- package/dist/cjs/a/ProgressBar/ProgressBar.js +2 -2
- package/dist/cjs/a/Quote/Quote.js +2 -2
- package/dist/cjs/a/SVG/SVG.js +2 -2
- package/dist/cjs/a/SnapScroller/SnapScroller.js +2 -2
- package/dist/cjs/a/SnapScroller/styles.scss +30 -9
- package/dist/cjs/a/Spinner/Spinner.js +2 -2
- 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 +2 -2
- 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 +43 -1
- package/dist/cjs/b/Button/Button.js +21 -8
- 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/styles.scss +38 -8
- 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 +38 -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 +2 -2
- package/dist/cjs/b/Page/Page.js +16 -6
- package/dist/cjs/b/Page/common/PageHelmet/PageHelmet.js +4 -2
- package/dist/cjs/b/Page/common/Section/Section.js +13 -3
- package/dist/cjs/b/Page/styles.scss +25 -4
- package/dist/cjs/b/SocialMediaButton/SocialMediaButton.js +2 -2
- package/dist/cjs/b/SocialMediaButton/styles.scss +1 -15
- package/dist/cjs/b/ThemeSelector/ThemeSelector.js +19 -31
- package/dist/cjs/b/ThemeSelector/styles.scss +2 -7
- package/dist/cjs/b/Title/Title.js +5 -3
- package/dist/cjs/b/index.js +8 -1
- package/dist/cjs/c/ContentSlides/ContentSlides.js +3 -3
- package/dist/cjs/c/ContentSlides/common/HorizontalMenu/HorizontalMenu.js +1 -3
- package/dist/cjs/c/ContentSlides/common/Sidebar/Sidebar.js +0 -2
- package/dist/cjs/c/ContentSlides/styles.scss +2 -2
- package/dist/cjs/c/Modal/Modal.js +3 -3
- package/dist/cjs/c/Modal/common/ModalHeader/ModalHeader.js +1 -1
- package/dist/cjs/c/Modal/styles.scss +9 -13
- package/dist/cjs/c/Shortener/Shortener.js +2 -2
- package/dist/cjs/c/SocialMediaShareButton/SocialMediaShareButton.js +2 -2
- package/dist/cjs/f/FormInput/FormInput.js +14 -4
- package/dist/cjs/f/common/Debugger/Debugger.js +2 -2
- package/dist/cjs/f/common/Description/Description.js +2 -2
- package/dist/cjs/f/common/InputWrapper/InputWrapper.js +74 -0
- package/dist/cjs/f/common/InputWrapper/index.js +13 -0
- package/dist/cjs/f/common/InputWrapper/styles.scss +13 -0
- package/dist/cjs/f/common/Label/Label.js +20 -6
- package/dist/cjs/f/common/Label/styles.scss +8 -2
- package/dist/cjs/f/common/index.js +8 -1
- package/dist/cjs/f/fields/Checkbox/Checkbox.js +42 -12
- package/dist/cjs/f/fields/Checkbox/styles.scss +6 -8
- package/dist/cjs/f/fields/ChoicesInput/ChoicesInput.js +57 -26
- package/dist/cjs/f/fields/ChoicesInput/common/Choice/Choice.js +2 -2
- package/dist/cjs/f/fields/ChoicesInput/styles.scss +52 -43
- package/dist/cjs/f/fields/EditorInput/EditorInput.js +223 -0
- package/dist/cjs/f/fields/EditorInput/common/Toolbar.js +193 -0
- package/dist/cjs/f/fields/EditorInput/common/TreeViewPlugin.js +19 -0
- package/dist/cjs/f/fields/EditorInput/common/index.js +20 -0
- package/dist/cjs/f/fields/EditorInput/index.js +13 -0
- package/dist/cjs/f/fields/EditorInput/styles.scss +121 -0
- package/dist/cjs/f/fields/LinkInput/LinkInput.js +164 -0
- package/dist/cjs/f/fields/LinkInput/index.js +13 -0
- package/dist/cjs/f/fields/LinkInput/styles.scss +89 -0
- package/dist/cjs/f/fields/QueryChoices/QueryChoices.js +27 -3
- package/dist/cjs/f/fields/QueryCombobox/QueryCombobox.js +37 -7
- package/dist/cjs/f/fields/QueryCombobox/common/Combobox/Combobox.js +44 -17
- package/dist/cjs/f/fields/QueryCombobox/common/Menu/Menu.js +1 -1
- package/dist/cjs/f/fields/QueryCombobox/common/MultipleCombobox/MultipleCombobox.js +36 -26
- package/dist/cjs/f/fields/QueryCombobox/styles.scss +64 -29
- package/dist/cjs/f/fields/QuerySelect/QuerySelect.js +17 -3
- package/dist/cjs/f/fields/RatingsInput/RatingsInput.js +43 -21
- package/dist/cjs/f/fields/RatingsInput/common/Rating/Rating.js +5 -5
- package/dist/cjs/f/fields/RatingsInput/styles.scss +6 -13
- package/dist/cjs/f/fields/SelectInput/SelectInput.js +47 -17
- package/dist/cjs/f/fields/SelectInput/styles.scss +60 -26
- package/dist/cjs/f/fields/TextInput/TextInput.js +50 -17
- package/dist/cjs/f/fields/TextInput/styles.scss +56 -20
- package/dist/cjs/f/fields/TextareaInput/TextareaInput.js +45 -24
- package/dist/cjs/f/fields/TextareaInput/styles.scss +42 -25
- package/dist/cjs/f/fields/index.js +15 -1
- package/dist/cjs/form.scss +1 -1
- package/dist/cjs/r/SwitchRouteMap/SwitchRouteMap.js +1 -1
- package/dist/cjs/r/common/PrivateRoute/PrivateRoute.js +1 -1
- package/dist/cjs/test/QueryLoader/QueryLoader.js +2 -0
- 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 +52 -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/useTheme.js +0 -4
- package/dist/es/a/BlurOverlay/BlurOverlay.js +51 -0
- package/dist/es/a/BlurOverlay/index.js +2 -0
- package/dist/es/a/BlurOverlay/styles.scss +31 -0
- package/dist/es/a/ContentTree/ContentTree.js +11 -5
- package/dist/es/a/ContentTree/common/Tree/Tree.js +12 -5
- package/dist/es/a/ContentTree/styles.scss +34 -11
- package/dist/es/a/Conversation/Conversation.js +12 -17
- package/dist/es/a/Conversation/common/Message/Message.js +15 -12
- package/dist/es/a/Conversation/styles.scss +56 -124
- package/dist/es/a/DotInfo/DotInfo.js +2 -2
- package/dist/es/a/Figure/Figure.js +2 -2
- package/dist/es/a/HamburgerButton/HamburgerButton.js +2 -2
- package/dist/es/a/IconList/IconList.js +2 -2
- package/dist/es/a/Label/Label.js +14 -6
- package/dist/es/a/Label/styles.scss +4 -4
- package/dist/es/a/LoadingCircle/LoadingCircle.js +2 -2
- package/dist/es/a/MetaCard/MetaCard.js +57 -0
- package/dist/es/a/MetaCard/index.js +1 -0
- package/dist/es/a/MetaCard/styles.scss +45 -0
- package/dist/es/a/People/People.js +2 -2
- package/dist/es/a/People/common/Person/Person.js +5 -5
- package/dist/es/a/People/styles.scss +10 -4
- package/dist/es/a/Popover/Popover.js +4 -4
- package/dist/es/a/Popover/styles.scss +1 -1
- package/dist/es/a/ProgressBar/ProgressBar.js +2 -2
- package/dist/es/a/Quote/Quote.js +2 -2
- package/dist/es/a/SVG/SVG.js +2 -2
- package/dist/es/a/SnapScroller/SnapScroller.js +2 -2
- package/dist/es/a/SnapScroller/styles.scss +30 -9
- package/dist/es/a/Spinner/Spinner.js +2 -2
- 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 +2 -2
- 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 +7 -1
- package/dist/es/b/Button/Button.js +21 -7
- 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 +38 -8
- 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 +38 -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 +2 -2
- package/dist/es/b/Page/Page.js +16 -5
- package/dist/es/b/Page/common/PageHelmet/PageHelmet.js +4 -2
- package/dist/es/b/Page/common/Section/Section.js +12 -2
- package/dist/es/b/Page/styles.scss +25 -4
- package/dist/es/b/SocialMediaButton/SocialMediaButton.js +2 -2
- package/dist/es/b/SocialMediaButton/styles.scss +1 -15
- package/dist/es/b/ThemeSelector/ThemeSelector.js +19 -32
- package/dist/es/b/ThemeSelector/styles.scss +2 -7
- package/dist/es/b/Title/Title.js +18 -12
- package/dist/es/b/index.js +2 -1
- package/dist/es/c/ContentSlides/ContentSlides.js +3 -3
- package/dist/es/c/ContentSlides/common/HorizontalMenu/HorizontalMenu.js +1 -1
- package/dist/es/c/ContentSlides/styles.scss +2 -2
- package/dist/es/c/Modal/Modal.js +3 -3
- package/dist/es/c/Modal/common/ModalHeader/ModalHeader.js +1 -1
- package/dist/es/c/Modal/styles.scss +9 -13
- package/dist/es/c/Shortener/Shortener.js +2 -2
- package/dist/es/c/SocialMediaShareButton/SocialMediaShareButton.js +2 -2
- package/dist/es/f/FormInput/FormInput.js +15 -3
- package/dist/es/f/common/Debugger/Debugger.js +2 -2
- package/dist/es/f/common/Description/Description.js +2 -2
- package/dist/es/f/common/InputWrapper/InputWrapper.js +66 -0
- package/dist/es/f/common/InputWrapper/index.js +2 -0
- package/dist/es/f/common/InputWrapper/styles.scss +13 -0
- package/dist/es/f/common/Label/Label.js +20 -6
- package/dist/es/f/common/Label/styles.scss +8 -2
- package/dist/es/f/common/index.js +2 -1
- package/dist/es/f/fields/Checkbox/Checkbox.js +43 -13
- package/dist/es/f/fields/Checkbox/styles.scss +6 -8
- package/dist/es/f/fields/ChoicesInput/ChoicesInput.js +58 -27
- package/dist/es/f/fields/ChoicesInput/common/Choice/Choice.js +1 -1
- package/dist/es/f/fields/ChoicesInput/styles.scss +52 -43
- package/dist/es/f/fields/EditorInput/EditorInput.js +218 -0
- package/dist/es/f/fields/EditorInput/common/Toolbar.js +182 -0
- package/dist/es/f/fields/EditorInput/common/TreeViewPlugin.js +11 -0
- package/dist/es/f/fields/EditorInput/common/index.js +2 -0
- package/dist/es/f/fields/EditorInput/index.js +2 -0
- package/dist/es/f/fields/EditorInput/styles.scss +121 -0
- package/dist/es/f/fields/LinkInput/LinkInput.js +156 -0
- package/dist/es/f/fields/LinkInput/index.js +2 -0
- package/dist/es/f/fields/LinkInput/styles.scss +89 -0
- package/dist/es/f/fields/QueryChoices/QueryChoices.js +26 -2
- package/dist/es/f/fields/QueryCombobox/QueryCombobox.js +37 -7
- package/dist/es/f/fields/QueryCombobox/common/Combobox/Combobox.js +43 -16
- package/dist/es/f/fields/QueryCombobox/common/MultipleCombobox/MultipleCombobox.js +35 -25
- package/dist/es/f/fields/QueryCombobox/styles.scss +64 -29
- package/dist/es/f/fields/QuerySelect/QuerySelect.js +17 -3
- package/dist/es/f/fields/RatingsInput/RatingsInput.js +44 -22
- package/dist/es/f/fields/RatingsInput/common/Rating/Rating.js +4 -4
- package/dist/es/f/fields/RatingsInput/styles.scss +6 -13
- package/dist/es/f/fields/SelectInput/SelectInput.js +48 -18
- package/dist/es/f/fields/SelectInput/styles.scss +60 -26
- package/dist/es/f/fields/TextInput/TextInput.js +51 -18
- package/dist/es/f/fields/TextInput/styles.scss +56 -20
- package/dist/es/f/fields/TextareaInput/TextareaInput.js +46 -25
- package/dist/es/f/fields/TextareaInput/styles.scss +42 -25
- package/dist/es/f/fields/index.js +3 -1
- package/dist/es/form.scss +1 -1
- package/package.json +19 -16
- package/src/stories/a/BlurOverlay.stories.jsx +39 -0
- package/src/stories/a/Conversation.stories.jsx +11 -42
- package/src/stories/a/MetaCard.stories.jsx +35 -0
- package/src/stories/a/People.stories.jsx +22 -2
- package/src/stories/a/Quote.stories.jsx +1 -1
- package/src/stories/a/SnapScroller.stories.jsx +2 -2
- package/src/stories/a/Spinner.stories.jsx +1 -1
- 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} +18 -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 +19 -3
- package/src/stories/b/ThemeSelector.stories.jsx +1 -1
- package/src/stories/b/Title.stories.jsx +1 -1
- package/src/stories/c/ContentSlides.stories.jsx +1 -1
- package/src/stories/colors.js +22 -10
- package/src/stories/f/Checkbox.stories.jsx +22 -7
- package/src/stories/f/ChoicesInput.stories.jsx +21 -7
- package/src/stories/f/EditorInput.stories.jsx +88 -0
- package/src/stories/f/LinkInput.stories.jsx +100 -0
- package/src/stories/f/QueryChoices.stories.jsx +20 -4
- package/src/stories/f/QueryCombobox.stories.jsx +25 -13
- package/src/stories/f/QuerySelect.stories.jsx +20 -5
- package/src/stories/f/RatingsInput.stories.jsx +16 -2
- package/src/stories/f/SelectInput.stories.jsx +27 -5
- package/src/stories/f/TextInput.stories.jsx +33 -12
- package/src/stories/f/TextareaInput.stories.jsx +16 -2
- 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 +73 -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/AppContext/useTheme.js +0 -4
- package/src/ui/a/BlurOverlay/BlurOverlay.jsx +75 -0
- package/src/ui/a/BlurOverlay/index.js +2 -0
- package/src/ui/a/BlurOverlay/styles.scss +31 -0
- package/src/ui/a/ContentTree/ContentTree.jsx +10 -6
- package/src/ui/a/ContentTree/common/Tree/Tree.jsx +19 -7
- package/src/ui/a/ContentTree/styles.scss +34 -11
- package/src/ui/a/Conversation/Conversation.jsx +16 -20
- package/src/ui/a/Conversation/common/Message/Message.jsx +18 -11
- package/src/ui/a/Conversation/styles.scss +56 -124
- 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 +4 -4
- package/src/ui/a/LoadingCircle/LoadingCircle.jsx +2 -2
- package/src/ui/a/MetaCard/MetaCard.jsx +81 -0
- package/src/ui/a/MetaCard/index.js +1 -0
- package/src/ui/a/MetaCard/styles.scss +45 -0
- package/src/ui/a/People/People.jsx +2 -2
- package/src/ui/a/People/common/Person/Person.jsx +5 -5
- package/src/ui/a/People/styles.scss +10 -4
- package/src/ui/a/Popover/Popover.jsx +4 -4
- package/src/ui/a/Popover/styles.scss +1 -1
- package/src/ui/a/ProgressBar/ProgressBar.jsx +2 -2
- package/src/ui/a/Quote/Quote.jsx +2 -2
- 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 +30 -9
- 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 +6 -0
- package/src/ui/b/Button/Button.jsx +26 -7
- 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 +38 -8
- 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 +38 -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/Page/Page.jsx +13 -3
- package/src/ui/b/Page/common/PageHelmet/PageHelmet.jsx +2 -3
- package/src/ui/b/Page/common/Section/Section.jsx +16 -1
- package/src/ui/b/Page/styles.scss +25 -4
- package/src/ui/b/SocialMediaButton/SocialMediaButton.jsx +2 -2
- package/src/ui/b/SocialMediaButton/styles.scss +1 -15
- package/src/ui/b/ThemeSelector/ThemeSelector.jsx +12 -30
- package/src/ui/b/ThemeSelector/styles.scss +2 -7
- 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/common/HorizontalMenu/HorizontalMenu.jsx +1 -1
- package/src/ui/c/ContentSlides/styles.scss +2 -2
- package/src/ui/c/Modal/Modal.jsx +3 -3
- package/src/ui/c/Modal/common/ModalHeader/ModalHeader.jsx +1 -1
- package/src/ui/c/Modal/styles.scss +9 -13
- package/src/ui/c/Shortener/Shortener.jsx +2 -2
- package/src/ui/c/SocialMediaShareButton/SocialMediaShareButton.jsx +2 -2
- package/src/ui/f/FormInput/FormInput.jsx +25 -2
- 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/InputWrapper/InputWrapper.jsx +89 -0
- package/src/ui/f/common/InputWrapper/index.js +2 -0
- package/src/ui/f/common/InputWrapper/styles.scss +13 -0
- package/src/ui/f/common/Label/Label.jsx +20 -4
- package/src/ui/f/common/Label/styles.scss +8 -2
- package/src/ui/f/common/index.js +1 -0
- package/src/ui/f/fields/Checkbox/Checkbox.jsx +67 -29
- package/src/ui/f/fields/Checkbox/styles.scss +6 -8
- package/src/ui/f/fields/ChoicesInput/ChoicesInput.jsx +85 -50
- package/src/ui/f/fields/ChoicesInput/common/Choice/Choice.jsx +10 -3
- package/src/ui/f/fields/ChoicesInput/styles.scss +52 -43
- package/src/ui/f/fields/EditorInput/EditorInput.jsx +273 -0
- package/src/ui/f/fields/EditorInput/common/Toolbar.jsx +254 -0
- package/src/ui/f/fields/EditorInput/common/TreeViewPlugin.jsx +16 -0
- package/src/ui/f/fields/EditorInput/common/index.jsx +2 -0
- package/src/ui/f/fields/EditorInput/index.js +2 -0
- package/src/ui/f/fields/EditorInput/styles.scss +121 -0
- package/src/ui/f/fields/LinkInput/LinkInput.jsx +197 -0
- package/src/ui/f/fields/LinkInput/index.js +2 -0
- package/src/ui/f/fields/LinkInput/styles.scss +89 -0
- package/src/ui/f/fields/QueryChoices/QueryChoices.jsx +28 -0
- package/src/ui/f/fields/QueryCombobox/QueryCombobox.jsx +39 -4
- package/src/ui/f/fields/QueryCombobox/common/Combobox/Combobox.jsx +68 -38
- package/src/ui/f/fields/QueryCombobox/common/MultipleCombobox/MultipleCombobox.jsx +81 -66
- package/src/ui/f/fields/QueryCombobox/styles.scss +64 -29
- package/src/ui/f/fields/QuerySelect/QuerySelect.jsx +16 -1
- package/src/ui/f/fields/RatingsInput/RatingsInput.jsx +57 -30
- package/src/ui/f/fields/RatingsInput/common/Rating/Rating.jsx +4 -4
- package/src/ui/f/fields/RatingsInput/styles.scss +6 -13
- package/src/ui/f/fields/SelectInput/SelectInput.jsx +90 -51
- package/src/ui/f/fields/SelectInput/styles.scss +60 -26
- package/src/ui/f/fields/TextInput/TextInput.jsx +71 -35
- package/src/ui/f/fields/TextInput/styles.scss +56 -20
- package/src/ui/f/fields/TextareaInput/TextareaInput.jsx +67 -45
- package/src/ui/f/fields/TextareaInput/styles.scss +42 -25
- package/src/ui/f/fields/index.js +2 -0
- package/src/ui/form.scss +1 -1
- package/tests/__snapshots__/Storyshots.test.js.snap +14551 -6190
|
@@ -0,0 +1,541 @@
|
|
|
1
|
+
/* eslint-disable */
|
|
2
|
+
/*
|
|
3
|
+
* Stripe WebGl Gradient Animation
|
|
4
|
+
* All Credits to Stripe.com
|
|
5
|
+
* ScrollObserver functionality to disable animation when not scrolled into view has been disabled and
|
|
6
|
+
* commented out for now.
|
|
7
|
+
* https://kevinhufnagl.com
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
// Converting colors to proper format
|
|
11
|
+
function normalizeColor(hexCode) {
|
|
12
|
+
return [(hexCode >> 16 & 255) / 255, (hexCode >> 8 & 255) / 255, (255 & hexCode) / 255]
|
|
13
|
+
} ['SCREEN', 'LINEAR_LIGHT'].reduce((hexCode, t, n) => Object.assign(hexCode, {
|
|
14
|
+
[t]:n,
|
|
15
|
+
}), {})
|
|
16
|
+
|
|
17
|
+
// Essential functionality of WebGl
|
|
18
|
+
// t = width
|
|
19
|
+
// n = height
|
|
20
|
+
class MiniGl {
|
|
21
|
+
constructor(canvas, width, height, debug = false) {
|
|
22
|
+
const _miniGl = this
|
|
23
|
+
const debug_output = document.location.search.toLowerCase().indexOf('debug=webgl') !== -1
|
|
24
|
+
_miniGl.canvas = canvas, _miniGl.gl = _miniGl.canvas.getContext('webgl', {
|
|
25
|
+
antialias:true,
|
|
26
|
+
}), _miniGl.meshes = []
|
|
27
|
+
const context = _miniGl.gl
|
|
28
|
+
width && height && this.setSize(width, height), _miniGl.lastDebugMsg, _miniGl.debug = debug && debug_output ? function (e) {
|
|
29
|
+
const t = new Date()
|
|
30
|
+
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
|
|
31
|
+
} : () => { }, Object.defineProperties(_miniGl, {
|
|
32
|
+
Material:{
|
|
33
|
+
enumerable:false,
|
|
34
|
+
value :class {
|
|
35
|
+
constructor(vertexShaders, fragments, uniforms = {}) {
|
|
36
|
+
const material = this
|
|
37
|
+
function getShaderByType(type, source) {
|
|
38
|
+
const shader = context.createShader(type)
|
|
39
|
+
return context.shaderSource(shader, source), context.compileShader(shader), context.getShaderParameter(shader, context.COMPILE_STATUS) || console.error(context.getShaderInfoLog(shader)), _miniGl.debug('Material.compileShaderSource', {
|
|
40
|
+
source,
|
|
41
|
+
}), shader
|
|
42
|
+
}
|
|
43
|
+
function getUniformVariableDeclarations(uniforms, type) {
|
|
44
|
+
return Object.entries(uniforms).map(([uniform, value]) => value.getDeclaration(uniform, type)).join('\n')
|
|
45
|
+
}
|
|
46
|
+
material.uniforms = uniforms, material.uniformInstances = []
|
|
47
|
+
|
|
48
|
+
const prefix = '\n precision highp float;\n '
|
|
49
|
+
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 `,
|
|
50
|
+
material.Source = `\n ${prefix}\n ${getUniformVariableDeclarations(_miniGl.commonUniforms, 'fragment')}\n ${getUniformVariableDeclarations(uniforms, 'fragment')}\n ${fragments}\n `,
|
|
51
|
+
material.vertexShader = getShaderByType(context.VERTEX_SHADER, material.vertexSource),
|
|
52
|
+
material.fragmentShader = getShaderByType(context.FRAGMENT_SHADER, material.Source),
|
|
53
|
+
material.program = context.createProgram(),
|
|
54
|
+
context.attachShader(material.program, material.vertexShader),
|
|
55
|
+
context.attachShader(material.program, material.fragmentShader),
|
|
56
|
+
context.linkProgram(material.program),
|
|
57
|
+
context.getProgramParameter(material.program, context.LINK_STATUS) || console.error(context.getProgramInfoLog(material.program)),
|
|
58
|
+
context.useProgram(material.program),
|
|
59
|
+
material.attachUniforms(void 0, _miniGl.commonUniforms),
|
|
60
|
+
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(([name, uniform]) => {
|
|
68
|
+
material.attachUniforms(name, uniform)
|
|
69
|
+
}) : uniforms.type == 'array' ? uniforms.value.forEach((uniform, i) => material.attachUniforms(`${name}[${i}]`, uniform)) : uniforms.type == 'struct' ? Object.entries(uniforms.value).forEach(([uniform, i]) => material.attachUniforms(`${name}.${uniform}`, i)) : (_miniGl.debug('Material.attachUniforms', {
|
|
70
|
+
name,
|
|
71
|
+
uniform:uniforms,
|
|
72
|
+
}), material.uniformInstances.push({
|
|
73
|
+
uniform :uniforms,
|
|
74
|
+
location:context.getUniformLocation(material.program, name),
|
|
75
|
+
}))
|
|
76
|
+
}
|
|
77
|
+
},
|
|
78
|
+
},
|
|
79
|
+
Uniform:{
|
|
80
|
+
enumerable:!1,
|
|
81
|
+
value :class {
|
|
82
|
+
constructor(e) {
|
|
83
|
+
this.type = 'float', Object.assign(this, e)
|
|
84
|
+
this.typeFn = {
|
|
85
|
+
float:'1f',
|
|
86
|
+
int :'1i',
|
|
87
|
+
vec2 :'2fv',
|
|
88
|
+
vec3 :'3fv',
|
|
89
|
+
vec4 :'4fv',
|
|
90
|
+
mat4 :'Matrix4fv',
|
|
91
|
+
}[this.type] || '1f', this.update()
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
update(value) {
|
|
95
|
+
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)
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
// e - name
|
|
99
|
+
// t - type
|
|
100
|
+
// n - length
|
|
101
|
+
getDeclaration(name, type, length) {
|
|
102
|
+
const uniform = this
|
|
103
|
+
if (uniform.excludeFrom !== type) {
|
|
104
|
+
if (uniform.type === 'array') return `${uniform.value[0].getDeclaration(name, type, uniform.value.length)}\nconst int ${name}_length = ${uniform.value.length};`
|
|
105
|
+
if (uniform.type === 'struct') {
|
|
106
|
+
let name_no_prefix = name.replace('u_', '')
|
|
107
|
+
return name_no_prefix = name_no_prefix.charAt(0).toUpperCase()
|
|
108
|
+
+ name_no_prefix.slice(1),
|
|
109
|
+
`uniform struct ${name_no_prefix}
|
|
110
|
+
{\n${
|
|
111
|
+
Object.entries(uniform.value).map(([name, uniform]) => uniform.getDeclaration(name, type)
|
|
112
|
+
.replace(/^uniform/, ''))
|
|
113
|
+
.join('')
|
|
114
|
+
}\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
|
+
|
|
146
|
+
setTopology(e = 1, t = 1) {
|
|
147
|
+
const n = this
|
|
148
|
+
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)
|
|
149
|
+
for (let e = 0; e <= n.ySegCount; e++) {
|
|
150
|
+
for (let t = 0; t <= n.xSegCount; t++) {
|
|
151
|
+
const i = e * (n.xSegCount + 1) + t
|
|
152
|
+
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) {
|
|
153
|
+
const s = e * n.xSegCount + t
|
|
154
|
+
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
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
n.attributes.uv.update(), n.attributes.uvNorm.update(), n.attributes.index.update(), _miniGl.debug('Geometry.setTopology', {
|
|
159
|
+
uv :n.attributes.uv,
|
|
160
|
+
uvNorm:n.attributes.uvNorm,
|
|
161
|
+
index :n.attributes.index,
|
|
162
|
+
})
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
setSize(width = 1, height = 1, orientation = 'xz') {
|
|
166
|
+
const geometry = this
|
|
167
|
+
geometry.width = width,
|
|
168
|
+
geometry.height = height,
|
|
169
|
+
geometry.orientation = orientation,
|
|
170
|
+
geometry.attributes.position.values && geometry.attributes.position.values.length === 3 * geometry.vertexCount
|
|
171
|
+
|| (geometry.attributes.position.values = new Float32Array(3 * geometry.vertexCount))
|
|
172
|
+
const o = width / -2
|
|
173
|
+
const r = height / -2
|
|
174
|
+
const segment_width = width / geometry.xSegCount
|
|
175
|
+
const segment_height = height / geometry.ySegCount
|
|
176
|
+
for (let yIndex = 0; yIndex <= geometry.ySegCount; yIndex++) {
|
|
177
|
+
const t = r + yIndex * segment_height
|
|
178
|
+
for (let xIndex = 0; xIndex <= geometry.xSegCount; xIndex++) {
|
|
179
|
+
const r = o + xIndex * segment_width
|
|
180
|
+
const l = yIndex * (geometry.xSegCount + 1) + xIndex
|
|
181
|
+
geometry.attributes.position.values[3 * l + 'xyz'.indexOf(orientation[0])] = r,
|
|
182
|
+
geometry.attributes.position.values[3 * l + 'xyz'.indexOf(orientation[1])] = -t
|
|
183
|
+
}
|
|
184
|
+
}
|
|
185
|
+
geometry.attributes.position.update(), _miniGl.debug('Geometry.setSize', {
|
|
186
|
+
position:geometry.attributes.position,
|
|
187
|
+
})
|
|
188
|
+
}
|
|
189
|
+
},
|
|
190
|
+
},
|
|
191
|
+
Mesh:{
|
|
192
|
+
enumerable:!1,
|
|
193
|
+
value :class {
|
|
194
|
+
constructor(geometry, material) {
|
|
195
|
+
const mesh = this
|
|
196
|
+
mesh.geometry = geometry, mesh.material = material, mesh.wireframe = !1, mesh.attributeInstances = [], Object.entries(mesh.geometry.attributes).forEach(([e, attribute]) => {
|
|
197
|
+
mesh.attributeInstances.push({
|
|
198
|
+
attribute,
|
|
199
|
+
location:attribute.attach(e, mesh.material.program),
|
|
200
|
+
})
|
|
201
|
+
}), _miniGl.meshes.push(mesh), _miniGl.debug('Mesh.constructor', {
|
|
202
|
+
mesh,
|
|
203
|
+
})
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
draw() {
|
|
207
|
+
context.useProgram(this.material.program), this.material.uniformInstances.forEach(({
|
|
208
|
+
uniform: e,
|
|
209
|
+
location: t,
|
|
210
|
+
}) => e.update(t)), this.attributeInstances.forEach(({
|
|
211
|
+
attribute: e,
|
|
212
|
+
location: t,
|
|
213
|
+
}) => e.use(t)), context.drawElements(this.wireframe ? context.LINES : context.TRIANGLES, this.geometry.attributes.index.values.length, context.UNSIGNED_SHORT, 0)
|
|
214
|
+
}
|
|
215
|
+
|
|
216
|
+
remove() {
|
|
217
|
+
_miniGl.meshes = _miniGl.meshes.filter((e) => e != this)
|
|
218
|
+
}
|
|
219
|
+
},
|
|
220
|
+
},
|
|
221
|
+
Attribute:{
|
|
222
|
+
enumerable:!1,
|
|
223
|
+
value :class {
|
|
224
|
+
constructor(e) {
|
|
225
|
+
this.type = context.FLOAT, this.normalized = !1, this.buffer = context.createBuffer(), Object.assign(this, e), this.update()
|
|
226
|
+
}
|
|
227
|
+
|
|
228
|
+
update() {
|
|
229
|
+
void 0 !== this.values && (context.bindBuffer(this.target, this.buffer), context.bufferData(this.target, this.values, context.STATIC_DRAW))
|
|
230
|
+
}
|
|
231
|
+
|
|
232
|
+
attach(e, t) {
|
|
233
|
+
const n = context.getAttribLocation(t, e)
|
|
234
|
+
return this.target === context.ARRAY_BUFFER && (context.enableVertexAttribArray(n), context.vertexAttribPointer(n, this.size, this.type, this.normalized, 0, 0)), n
|
|
235
|
+
}
|
|
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
|
+
|
|
264
|
+
setSize(e = 640, t = 480) {
|
|
265
|
+
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', {
|
|
266
|
+
width :e,
|
|
267
|
+
height:t,
|
|
268
|
+
})
|
|
269
|
+
}
|
|
270
|
+
|
|
271
|
+
// left, right, top, bottom, near, far
|
|
272
|
+
setOrthographicCamera(e = 0, t = 0, n = 0, i = -2e3, s = 2e3) {
|
|
273
|
+
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)
|
|
274
|
+
}
|
|
275
|
+
|
|
276
|
+
render() {
|
|
277
|
+
this.gl.clearColor(0, 0, 0, 0), this.gl.clearDepth(1), this.meshes.forEach((e) => e.draw())
|
|
278
|
+
}
|
|
279
|
+
}
|
|
280
|
+
|
|
281
|
+
// Sets initial properties
|
|
282
|
+
function e(object, propertyName, val) {
|
|
283
|
+
return propertyName in object ? Object.defineProperty(object, propertyName, {
|
|
284
|
+
value :val,
|
|
285
|
+
enumerable :!0,
|
|
286
|
+
configurable:!0,
|
|
287
|
+
writable :!0,
|
|
288
|
+
}) : object[propertyName] = val, object
|
|
289
|
+
}
|
|
290
|
+
|
|
291
|
+
// Gradient object
|
|
292
|
+
class Gradient {
|
|
293
|
+
constructor(...t) {
|
|
294
|
+
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', () => {
|
|
295
|
+
clearTimeout(this.scrollingTimeout), this.scrollingTimeout = setTimeout(this.handleScrollEnd, this.scrollingRefreshDelay), this.isGradientLegendVisible && this.hideGradientLegend(), this.conf.playing && (this.isScrolling = !0, this.pause())
|
|
296
|
+
}), e(this, 'handleScrollEnd', () => {
|
|
297
|
+
this.isScrolling = !1, this.isIntersecting && this.play()
|
|
298
|
+
}), e(this, 'resize', () => {
|
|
299
|
+
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
|
|
300
|
+
}), e(this, 'handleMouseDown', (e) => {
|
|
301
|
+
this.isGradientLegendVisible && (this.isMetaKey = e.metaKey, this.isMouseDown = !0, !1 === this.conf.playing && requestAnimationFrame(this.animate))
|
|
302
|
+
}), e(this, 'handleMouseUp', () => {
|
|
303
|
+
this.isMouseDown = !1
|
|
304
|
+
}), e(this, 'animate', (e) => {
|
|
305
|
+
if (!this.shouldSkipFrame(e) || this.isMouseDown) {
|
|
306
|
+
if (this.t += Math.min(e - this.last, 1e3 / 15), this.last = e, this.isMouseDown) {
|
|
307
|
+
let e = 160
|
|
308
|
+
this.isMetaKey && (e = -160), this.t += e
|
|
309
|
+
}
|
|
310
|
+
this.mesh.material.uniforms.u_time.value = this.t, this.minigl.render()
|
|
311
|
+
}
|
|
312
|
+
if (this.last !== 0 && this.isStatic) return this.minigl.render(), void this.disconnect();
|
|
313
|
+
(/* this.isIntersecting && */this.conf.playing || this.isMouseDown) && requestAnimationFrame(this.animate)
|
|
314
|
+
}), e(this, 'addIsLoadedClass', () => {
|
|
315
|
+
/* this.isIntersecting && */!this.isLoadedClass && (this.isLoadedClass = !0, this.el.classList.add('isLoaded'), setTimeout(() => {
|
|
316
|
+
this.el.parentElement.classList.add('isLoaded')
|
|
317
|
+
}, 3e3))
|
|
318
|
+
}), e(this, 'pause', () => {
|
|
319
|
+
this.conf.playing = false
|
|
320
|
+
}), e(this, 'play', () => {
|
|
321
|
+
requestAnimationFrame(this.animate), this.conf.playing = true
|
|
322
|
+
}), e(this, 'initGradient', (selector) => {
|
|
323
|
+
this.el = document.querySelector(selector)
|
|
324
|
+
this.connect()
|
|
325
|
+
return this
|
|
326
|
+
})
|
|
327
|
+
}
|
|
328
|
+
|
|
329
|
+
async connect() {
|
|
330
|
+
this.shaderFiles = {
|
|
331
|
+
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}',
|
|
332
|
+
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}',
|
|
333
|
+
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}',
|
|
334
|
+
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}',
|
|
335
|
+
},
|
|
336
|
+
this.conf = {
|
|
337
|
+
presetName:'',
|
|
338
|
+
wireframe :false,
|
|
339
|
+
density :[0.06, 0.16],
|
|
340
|
+
zoom :1,
|
|
341
|
+
rotation :0,
|
|
342
|
+
playing :true,
|
|
343
|
+
},
|
|
344
|
+
document.querySelectorAll('canvas').length < 1 ? console.log('DID NOT LOAD HERO STRIPE CANVAS') : (
|
|
345
|
+
|
|
346
|
+
this.minigl = new MiniGl(this.el, null, null, !0),
|
|
347
|
+
requestAnimationFrame(() => {
|
|
348
|
+
this.el && (this.computedCanvasStyle = getComputedStyle(this.el), this.waitForCssVars())
|
|
349
|
+
})
|
|
350
|
+
/*
|
|
351
|
+
this.scrollObserver = await s.create(.1, !1),
|
|
352
|
+
this.scrollObserver.observe(this.el),
|
|
353
|
+
this.scrollObserver.onSeparate(() => {
|
|
354
|
+
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()
|
|
355
|
+
}),
|
|
356
|
+
this.scrollObserver.onIntersect(() => {
|
|
357
|
+
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()
|
|
358
|
+
}) */
|
|
359
|
+
|
|
360
|
+
)
|
|
361
|
+
}
|
|
362
|
+
|
|
363
|
+
disconnect() {
|
|
364
|
+
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)
|
|
365
|
+
}
|
|
366
|
+
|
|
367
|
+
initMaterial() {
|
|
368
|
+
this.uniforms = {
|
|
369
|
+
u_time:new this.minigl.Uniform({
|
|
370
|
+
value:0,
|
|
371
|
+
}),
|
|
372
|
+
u_shadow_power:new this.minigl.Uniform({
|
|
373
|
+
value:5,
|
|
374
|
+
}),
|
|
375
|
+
u_darken_top:new this.minigl.Uniform({
|
|
376
|
+
value:this.el.dataset.jsDarkenTop === '' ? 1 : 0,
|
|
377
|
+
}),
|
|
378
|
+
u_active_colors:new this.minigl.Uniform({
|
|
379
|
+
value:this.activeColors,
|
|
380
|
+
type :'vec4',
|
|
381
|
+
}),
|
|
382
|
+
u_global:new this.minigl.Uniform({
|
|
383
|
+
value:{
|
|
384
|
+
noiseFreq:new this.minigl.Uniform({
|
|
385
|
+
value:[this.freqX, this.freqY],
|
|
386
|
+
type :'vec2',
|
|
387
|
+
}),
|
|
388
|
+
noiseSpeed:new this.minigl.Uniform({
|
|
389
|
+
value:5e-6,
|
|
390
|
+
}),
|
|
391
|
+
},
|
|
392
|
+
type:'struct',
|
|
393
|
+
}),
|
|
394
|
+
u_vertDeform:new this.minigl.Uniform({
|
|
395
|
+
value:{
|
|
396
|
+
incline:new this.minigl.Uniform({
|
|
397
|
+
value:Math.sin(this.angle) / Math.cos(this.angle),
|
|
398
|
+
}),
|
|
399
|
+
offsetTop:new this.minigl.Uniform({
|
|
400
|
+
value:-0.5,
|
|
401
|
+
}),
|
|
402
|
+
offsetBottom:new this.minigl.Uniform({
|
|
403
|
+
value:-0.5,
|
|
404
|
+
}),
|
|
405
|
+
noiseFreq:new this.minigl.Uniform({
|
|
406
|
+
value:[3, 4],
|
|
407
|
+
type :'vec2',
|
|
408
|
+
}),
|
|
409
|
+
noiseAmp:new this.minigl.Uniform({
|
|
410
|
+
value:this.amp,
|
|
411
|
+
}),
|
|
412
|
+
noiseSpeed:new this.minigl.Uniform({
|
|
413
|
+
value:10,
|
|
414
|
+
}),
|
|
415
|
+
noiseFlow:new this.minigl.Uniform({
|
|
416
|
+
value:3,
|
|
417
|
+
}),
|
|
418
|
+
noiseSeed:new this.minigl.Uniform({
|
|
419
|
+
value:this.seed,
|
|
420
|
+
}),
|
|
421
|
+
},
|
|
422
|
+
type :'struct',
|
|
423
|
+
excludeFrom:'fragment',
|
|
424
|
+
}),
|
|
425
|
+
u_baseColor:new this.minigl.Uniform({
|
|
426
|
+
value :this.sectionColors[0],
|
|
427
|
+
type :'vec3',
|
|
428
|
+
excludeFrom:'fragment',
|
|
429
|
+
}),
|
|
430
|
+
u_waveLayers:new this.minigl.Uniform({
|
|
431
|
+
value :[],
|
|
432
|
+
excludeFrom:'fragment',
|
|
433
|
+
type :'array',
|
|
434
|
+
}),
|
|
435
|
+
}
|
|
436
|
+
for (let e = 1; e < this.sectionColors.length; e += 1) {
|
|
437
|
+
this.uniforms.u_waveLayers.value.push(new this.minigl.Uniform({
|
|
438
|
+
value:{
|
|
439
|
+
color:new this.minigl.Uniform({
|
|
440
|
+
value:this.sectionColors[e],
|
|
441
|
+
type :'vec3',
|
|
442
|
+
}),
|
|
443
|
+
noiseFreq:new this.minigl.Uniform({
|
|
444
|
+
value:[2 + e / this.sectionColors.length, 3 + e / this.sectionColors.length],
|
|
445
|
+
type :'vec2',
|
|
446
|
+
}),
|
|
447
|
+
noiseSpeed:new this.minigl.Uniform({
|
|
448
|
+
value:11 + 0.3 * e,
|
|
449
|
+
}),
|
|
450
|
+
noiseFlow:new this.minigl.Uniform({
|
|
451
|
+
value:6.5 + 0.3 * e,
|
|
452
|
+
}),
|
|
453
|
+
noiseSeed:new this.minigl.Uniform({
|
|
454
|
+
value:this.seed + 10 * e,
|
|
455
|
+
}),
|
|
456
|
+
noiseFloor:new this.minigl.Uniform({
|
|
457
|
+
value:0.1,
|
|
458
|
+
}),
|
|
459
|
+
noiseCeil:new this.minigl.Uniform({
|
|
460
|
+
value:0.63 + 0.07 * e,
|
|
461
|
+
}),
|
|
462
|
+
},
|
|
463
|
+
type:'struct',
|
|
464
|
+
}))
|
|
465
|
+
}
|
|
466
|
+
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)
|
|
467
|
+
}
|
|
468
|
+
|
|
469
|
+
initMesh() {
|
|
470
|
+
this.material = this.initMaterial(), this.geometry = new this.minigl.PlaneGeometry(), this.mesh = new this.minigl.Mesh(this.geometry, this.material)
|
|
471
|
+
}
|
|
472
|
+
|
|
473
|
+
shouldSkipFrame(e) {
|
|
474
|
+
return !!window.document.hidden || (!this.conf.playing || (parseInt(e, 10) % 2 == 0 || void 0))
|
|
475
|
+
}
|
|
476
|
+
|
|
477
|
+
updateFrequency(e) {
|
|
478
|
+
this.freqX += e, this.freqY += e
|
|
479
|
+
}
|
|
480
|
+
|
|
481
|
+
toggleColor(index) {
|
|
482
|
+
this.activeColors[index] = this.activeColors[index] === 0 ? 1 : 0
|
|
483
|
+
}
|
|
484
|
+
|
|
485
|
+
showGradientLegend() {
|
|
486
|
+
this.width > this.minWidth && (this.isGradientLegendVisible = !0, document.body.classList.add('isGradientLegendVisible'))
|
|
487
|
+
}
|
|
488
|
+
|
|
489
|
+
hideGradientLegend() {
|
|
490
|
+
this.isGradientLegendVisible = !1, document.body.classList.remove('isGradientLegendVisible')
|
|
491
|
+
}
|
|
492
|
+
|
|
493
|
+
init() {
|
|
494
|
+
this.initGradientColors(), this.initMesh(), this.resize(), requestAnimationFrame(this.animate), window.addEventListener('resize', this.resize)
|
|
495
|
+
}
|
|
496
|
+
|
|
497
|
+
/*
|
|
498
|
+
* Waiting for the css variables to become available, usually on page load before we can continue.
|
|
499
|
+
* Using default colors assigned below if no variables have been found after maxCssVarRetries
|
|
500
|
+
*/
|
|
501
|
+
waitForCssVars() {
|
|
502
|
+
if (this.computedCanvasStyle && this.computedCanvasStyle.getPropertyValue('--gradient-color-1').indexOf('#') !== -1) this.init(), this.addIsLoadedClass()
|
|
503
|
+
else {
|
|
504
|
+
if (this.cssVarRetries += 1, this.cssVarRetries > this.maxCssVarRetries) {
|
|
505
|
+
return this.sectionColors = [16711680, 16711680, 16711935, 65280, 255], void this.init()
|
|
506
|
+
}
|
|
507
|
+
requestAnimationFrame(() => this.waitForCssVars())
|
|
508
|
+
}
|
|
509
|
+
}
|
|
510
|
+
|
|
511
|
+
/*
|
|
512
|
+
* Initializes the four section colors by retrieving them from css variables.
|
|
513
|
+
*/
|
|
514
|
+
initGradientColors() {
|
|
515
|
+
this.sectionColors = ['--gradient-color-1', '--gradient-color-2', '--gradient-color-3', '--gradient-color-4'].map((cssPropertyName) => {
|
|
516
|
+
let hex = this.computedCanvasStyle.getPropertyValue(cssPropertyName).trim()
|
|
517
|
+
// Check if shorthand hex value was used and double the length so the conversion in normalizeColor will work.
|
|
518
|
+
if (hex.length === 4) {
|
|
519
|
+
const hexTemp = hex.substr(1).split('').map((hexTemp) => hexTemp + hexTemp).join('')
|
|
520
|
+
hex = `#${hexTemp}`
|
|
521
|
+
}
|
|
522
|
+
return hex && `0x${hex.substr(1)}`
|
|
523
|
+
}).filter(Boolean).map(normalizeColor)
|
|
524
|
+
}
|
|
525
|
+
}
|
|
526
|
+
|
|
527
|
+
/*
|
|
528
|
+
*Finally initializing the Gradient class, assigning a canvas to it and calling Gradient.connect() which initializes everything,
|
|
529
|
+
* Use Gradient.pause() and Gradient.play() for controls.
|
|
530
|
+
*
|
|
531
|
+
* Here are some default property values you can change anytime:
|
|
532
|
+
* Amplitude: Gradient.amp = 0
|
|
533
|
+
* Colors: Gradient.sectionColors (if you change colors, use normalizeColor(#hexValue)) before you assign it.
|
|
534
|
+
*
|
|
535
|
+
*
|
|
536
|
+
* Useful functions
|
|
537
|
+
* Gradient.toggleColor(index)
|
|
538
|
+
* Gradient.updateFrequency(freq)
|
|
539
|
+
*/
|
|
540
|
+
|
|
541
|
+
export { Gradient }
|
|
@@ -14,9 +14,7 @@ export default (
|
|
|
14
14
|
const storage = window.localStorage
|
|
15
15
|
if (isClient) {
|
|
16
16
|
const storedTheme = window.localStorage.getItem(storageKey)
|
|
17
|
-
// console.log(storedTheme, storedTheme != userTheme)
|
|
18
17
|
if (storedTheme && (storedTheme !== userTheme)) {
|
|
19
|
-
// console.warn('Theme load')
|
|
20
18
|
setPreferredTheme(storedTheme)
|
|
21
19
|
setUserTheme(storedTheme)
|
|
22
20
|
} else if (preferredTheme && preferredTheme.length && preferredTheme !== 'system') {
|
|
@@ -25,11 +23,9 @@ export default (
|
|
|
25
23
|
storageKey,
|
|
26
24
|
preferredTheme,
|
|
27
25
|
)
|
|
28
|
-
// console.warn('theme change', preferredTheme)
|
|
29
26
|
} else {
|
|
30
27
|
setUserTheme(window.matchMedia('(prefers-color-scheme:dark)').matches ? 'dark' : 'light')
|
|
31
28
|
storage.removeItem(storageKey)
|
|
32
|
-
// console.warn('theme reset')
|
|
33
29
|
}
|
|
34
30
|
} else {
|
|
35
31
|
setUserTheme('light')
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
/* @pareto-engineering/generator-front 1.1.1-alpha.1 */
|
|
2
|
+
import * as React from 'react'
|
|
3
|
+
|
|
4
|
+
import { useInsertionEffect } from 'react'
|
|
5
|
+
|
|
6
|
+
import PropTypes from 'prop-types'
|
|
7
|
+
|
|
8
|
+
import styleNames from '@pareto-engineering/bem/exports'
|
|
9
|
+
|
|
10
|
+
const baseClassName = styleNames.base
|
|
11
|
+
|
|
12
|
+
const componentClassName = 'blur-overlay'
|
|
13
|
+
|
|
14
|
+
const BlurOverlay = ({
|
|
15
|
+
id,
|
|
16
|
+
className:userClassName,
|
|
17
|
+
style,
|
|
18
|
+
children,
|
|
19
|
+
blur,
|
|
20
|
+
}) => {
|
|
21
|
+
useInsertionEffect(() => {
|
|
22
|
+
import('./styles.scss')
|
|
23
|
+
}, [])
|
|
24
|
+
|
|
25
|
+
return (
|
|
26
|
+
<div
|
|
27
|
+
id={id}
|
|
28
|
+
className={[
|
|
29
|
+
baseClassName,
|
|
30
|
+
componentClassName,
|
|
31
|
+
userClassName,
|
|
32
|
+
blur && styleNames.modifierActive,
|
|
33
|
+
]
|
|
34
|
+
.filter((e) => e)
|
|
35
|
+
.join(' ')}
|
|
36
|
+
style={style}
|
|
37
|
+
>
|
|
38
|
+
{ children }
|
|
39
|
+
</div>
|
|
40
|
+
)
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
BlurOverlay.propTypes = {
|
|
44
|
+
/**
|
|
45
|
+
* The HTML id for this element
|
|
46
|
+
*/
|
|
47
|
+
id:PropTypes.string,
|
|
48
|
+
|
|
49
|
+
/**
|
|
50
|
+
* The HTML class names for this element
|
|
51
|
+
*/
|
|
52
|
+
className:PropTypes.string,
|
|
53
|
+
|
|
54
|
+
/**
|
|
55
|
+
* The React-written, css properties for this element.
|
|
56
|
+
*/
|
|
57
|
+
style:PropTypes.objectOf(PropTypes.string),
|
|
58
|
+
|
|
59
|
+
/**
|
|
60
|
+
* The children JSX
|
|
61
|
+
*/
|
|
62
|
+
children:PropTypes.node,
|
|
63
|
+
|
|
64
|
+
/**
|
|
65
|
+
* Boolean to toggle blur effect
|
|
66
|
+
*/
|
|
67
|
+
blur:PropTypes.bool,
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
BlurOverlay.defaultProps = {
|
|
71
|
+
blur:true,
|
|
72
|
+
// someProp:false
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
export default BlurOverlay
|