@lobehub/ui 6.0.0-beta.4 → 6.0.0-beta.6
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/es/ActionIcon/style.mjs +1 -1
- package/es/ActionIcon/style.mjs.map +1 -1
- package/es/Anchor/Anchor.mjs +2 -2
- package/es/Anchor/Anchor.mjs.map +1 -1
- package/es/Carousel/Carousel.mjs +1 -1
- package/es/Carousel/Carousel.mjs.map +1 -1
- package/es/CodeDiff/CodeDiff.mjs.map +1 -1
- package/es/CodeDiff/PatchDiff.mjs.map +1 -1
- package/es/CodeDiff/theme.mjs.map +1 -1
- package/es/CodeDiff/type.d.mts +2 -2
- package/es/CodeEditor/CodeEditor.mjs +1 -1
- package/es/CodeEditor/CodeEditor.mjs.map +1 -1
- package/es/ColorPicker/ColorPicker.mjs +1 -1
- package/es/ColorPicker/ColorPicker.mjs.map +1 -1
- package/es/ColorSwatches/ColorSwatches.mjs +18 -23
- package/es/ColorSwatches/ColorSwatches.mjs.map +1 -1
- package/es/ColorSwatches/CustomPicker.mjs +101 -0
- package/es/ColorSwatches/CustomPicker.mjs.map +1 -0
- package/es/ColorSwatches/index.d.mts +2 -2
- package/es/ColorSwatches/marker.stylex.mjs +9 -0
- package/es/ColorSwatches/marker.stylex.mjs.map +1 -0
- package/es/ColorSwatches/style.mjs +36 -0
- package/es/ColorSwatches/style.mjs.map +1 -1
- package/es/ColorSwatches/type.d.mts +9 -0
- package/es/ConfigProvider/cdnAssets.mjs +6 -0
- package/es/ConfigProvider/cdnAssets.mjs.map +1 -0
- package/es/ConfigProvider/index.mjs +2 -1
- package/es/ConfigProvider/index.mjs.map +1 -1
- package/es/ContextMenu/store.d.mts +0 -1
- package/es/ContextMenu/store.mjs.map +1 -1
- package/es/DatePicker/DatePicker.mjs +1 -1
- package/es/DatePicker/DatePicker.mjs.map +1 -1
- package/es/DatePicker/DateRangePicker.mjs +1 -1
- package/es/DatePicker/DateRangePicker.mjs.map +1 -1
- package/es/DraggablePanel/atoms.mjs +1 -1
- package/es/DraggablePanel/atoms.mjs.map +1 -1
- package/es/DraggableSideNav/DraggableSideNav.mjs +2 -2
- package/es/DraggableSideNav/DraggableSideNav.mjs.map +1 -1
- package/es/Drawer/atoms.mjs +1 -1
- package/es/Drawer/atoms.mjs.map +1 -1
- package/es/DropdownMenu/atoms.mjs +1 -1
- package/es/DropdownMenu/atoms.mjs.map +1 -1
- package/es/EditableText/ControlInput.mjs +42 -29
- package/es/EditableText/ControlInput.mjs.map +1 -1
- package/es/EditableText/EditableText.mjs +1 -1
- package/es/EditableText/EditableText.mjs.map +1 -1
- package/es/EmojiPicker/EmojiPicker.mjs +3 -9
- package/es/EmojiPicker/EmojiPicker.mjs.map +1 -1
- package/es/EmojiPicker/useEmojiMartI18n.mjs +37 -0
- package/es/EmojiPicker/useEmojiMartI18n.mjs.map +1 -0
- package/es/FormKit/engine/tanstack.mjs +1 -1
- package/es/FormKit/engine/tanstack.mjs.map +1 -1
- package/es/Grid/style.mjs +1 -1
- package/es/Grid/style.mjs.map +1 -1
- package/es/HotkeyInput/HotkeyInput.mjs +1 -1
- package/es/HotkeyInput/HotkeyInput.mjs.map +1 -1
- package/es/Image/type.d.mts +1 -0
- package/es/Image/viewer/ImageViewer.mjs +2 -1
- package/es/Image/viewer/ImageViewer.mjs.map +1 -1
- package/es/Image/viewer/Toolbar.mjs +19 -6
- package/es/Image/viewer/Toolbar.mjs.map +1 -1
- package/es/Image/viewer/ViewerChrome.mjs.map +1 -1
- package/es/ImageSelect/ImageSelect.mjs +1 -1
- package/es/ImageSelect/ImageSelect.mjs.map +1 -1
- package/es/Input/Input.mjs +7 -5
- package/es/Input/Input.mjs.map +1 -1
- package/es/Input/TextArea.mjs +1 -1
- package/es/Input/TextArea.mjs.map +1 -1
- package/es/Input/style.mjs +3 -3
- package/es/Input/style.mjs.map +1 -1
- package/es/Modal/atoms.mjs +3 -3
- package/es/Modal/atoms.mjs.map +1 -1
- package/es/Pagination/Pagination.mjs +1 -1
- package/es/Pagination/Pagination.mjs.map +1 -1
- package/es/Popover/PopoverInGroup.mjs +1 -1
- package/es/Popover/PopoverInGroup.mjs.map +1 -1
- package/es/Popover/atoms.mjs +1 -1
- package/es/Popover/atoms.mjs.map +1 -1
- package/es/Rate/Rate.mjs +1 -1
- package/es/Rate/Rate.mjs.map +1 -1
- package/es/ScrollShadow/ScrollShadow.mjs +1 -1
- package/es/ScrollShadow/ScrollShadow.mjs.map +1 -1
- package/es/SearchBar/SearchBar.mjs +31 -25
- package/es/SearchBar/SearchBar.mjs.map +1 -1
- package/es/Segmented/Segmented.mjs +1 -1
- package/es/Segmented/Segmented.mjs.map +1 -1
- package/es/Select/atoms.mjs +1 -1
- package/es/Select/atoms.mjs.map +1 -1
- package/es/Switch/atoms.mjs +1 -1
- package/es/Switch/atoms.mjs.map +1 -1
- package/es/Tabs/Tabs.mjs +35 -21
- package/es/Tabs/Tabs.mjs.map +1 -1
- package/es/ToggleGroup/ToggleGroup.mjs +1 -1
- package/es/ToggleGroup/ToggleGroup.mjs.map +1 -1
- package/es/Tooltip/TooltipInGroup.mjs +1 -1
- package/es/Tooltip/TooltipInGroup.mjs.map +1 -1
- package/es/Tooltip/TooltipStandalone.mjs +1 -1
- package/es/Tooltip/TooltipStandalone.mjs.map +1 -1
- package/es/Tree/Tree.mjs +1 -1
- package/es/Tree/Tree.mjs.map +1 -1
- package/es/awesome/Giscus/style.mjs +9 -9
- package/es/awesome/Giscus/style.mjs.map +1 -1
- package/es/awesome/Grainient/Grainient.d.mts +11 -0
- package/es/awesome/Grainient/Grainient.mjs +314 -0
- package/es/awesome/Grainient/Grainient.mjs.map +1 -0
- package/es/awesome/Grainient/index.d.mts +3 -0
- package/es/awesome/Grainient/style.mjs +23 -0
- package/es/awesome/Grainient/style.mjs.map +1 -0
- package/es/awesome/Grainient/type.d.mts +121 -0
- package/es/awesome/GridBackground/GridBackground.mjs +1 -1
- package/es/awesome/GridBackground/GridBackground.mjs.map +1 -1
- package/es/awesome/GridBackground/GridShowcase.mjs +4 -4
- package/es/awesome/GridBackground/GridShowcase.mjs.map +1 -1
- package/es/awesome/Spline/ParentSize.mjs +1 -1
- package/es/awesome/Spline/ParentSize.mjs.map +1 -1
- package/es/awesome/index.d.mts +4 -1
- package/es/awesome/index.mjs +2 -1
- package/es/chat/BackBottom/BackBottom.mjs +1 -1
- package/es/chat/BackBottom/BackBottom.mjs.map +1 -1
- package/es/chat/BackBottom/type.d.mts +2 -2
- package/es/chat/EditableMessage/EditableMessage.mjs +1 -1
- package/es/chat/EditableMessage/EditableMessage.mjs.map +1 -1
- package/es/chat/EditableMessageList/EditableMessageList.mjs +1 -1
- package/es/chat/EditableMessageList/EditableMessageList.mjs.map +1 -1
- package/es/chat/EditableMessageList/messageReducer.mjs +30 -23
- package/es/chat/EditableMessageList/messageReducer.mjs.map +1 -1
- package/es/chat/MessageModal/MessageModal.mjs +1 -1
- package/es/chat/MessageModal/MessageModal.mjs.map +1 -1
- package/es/chat/TokenTag/TokenTag.mjs +2 -3
- package/es/chat/TokenTag/TokenTag.mjs.map +1 -1
- package/es/dashboard/AuthLayout/Aside.d.mts +10 -0
- package/es/dashboard/AuthLayout/Aside.mjs +31 -0
- package/es/dashboard/AuthLayout/Aside.mjs.map +1 -0
- package/es/dashboard/AuthLayout/AuthLayout.d.mts +3 -1
- package/es/dashboard/AuthLayout/AuthLayout.mjs +93 -37
- package/es/dashboard/AuthLayout/AuthLayout.mjs.map +1 -1
- package/es/dashboard/AuthLayout/index.d.mts +3 -2
- package/es/dashboard/AuthLayout/style.mjs +98 -1
- package/es/dashboard/AuthLayout/style.mjs.map +1 -1
- package/es/dashboard/AuthLayout/type.d.mts +38 -2
- package/es/dashboard/AuthTools/AuthLocaleSwitch.d.mts +10 -0
- package/es/dashboard/AuthTools/AuthLocaleSwitch.mjs +33 -0
- package/es/dashboard/AuthTools/AuthLocaleSwitch.mjs.map +1 -0
- package/es/dashboard/AuthTools/AuthThemeSwitch.d.mts +10 -0
- package/es/dashboard/AuthTools/AuthThemeSwitch.mjs +59 -0
- package/es/dashboard/AuthTools/AuthThemeSwitch.mjs.map +1 -0
- package/es/dashboard/AuthTools/index.d.mts +4 -0
- package/es/dashboard/AuthTools/style.mjs +27 -0
- package/es/dashboard/AuthTools/style.mjs.map +1 -0
- package/es/dashboard/AuthTools/type.d.mts +29 -0
- package/es/dashboard/ChartGrid/ChartGrid.d.mts +10 -0
- package/es/dashboard/ChartGrid/ChartGrid.mjs +19 -0
- package/es/dashboard/ChartGrid/ChartGrid.mjs.map +1 -0
- package/es/dashboard/ChartGrid/index.d.mts +3 -0
- package/es/dashboard/ChartGrid/style.mjs +18 -0
- package/es/dashboard/ChartGrid/style.mjs.map +1 -0
- package/es/dashboard/ChartGrid/type.d.mts +8 -0
- package/es/dashboard/ConsoleNav/Skeleton.d.mts +15 -0
- package/es/dashboard/ConsoleNav/Skeleton.mjs +82 -0
- package/es/dashboard/ConsoleNav/Skeleton.mjs.map +1 -0
- package/es/dashboard/ConsoleNav/index.d.mts +3 -2
- package/es/dashboard/ConsoleNav/style.mjs +18 -0
- package/es/dashboard/ConsoleNav/style.mjs.map +1 -1
- package/es/dashboard/ConsoleNav/type.d.mts +13 -0
- package/es/dashboard/ConsoleShell/ConsoleShell.d.mts +1 -1
- package/es/dashboard/ConsoleShell/ConsoleShell.mjs +26 -6
- package/es/dashboard/ConsoleShell/ConsoleShell.mjs.map +1 -1
- package/es/dashboard/ConsoleShell/style.mjs +10 -0
- package/es/dashboard/ConsoleShell/style.mjs.map +1 -1
- package/es/dashboard/ConsoleShell/type.d.mts +11 -0
- package/es/dashboard/FilterSidebar/FilterSidebar.mjs +18 -17
- package/es/dashboard/FilterSidebar/FilterSidebar.mjs.map +1 -1
- package/es/dashboard/FilterStrip/FilterStrip.d.mts +11 -0
- package/es/dashboard/FilterStrip/FilterStrip.mjs +55 -0
- package/es/dashboard/FilterStrip/FilterStrip.mjs.map +1 -0
- package/es/dashboard/FilterStrip/index.d.mts +3 -0
- package/es/dashboard/FilterStrip/style.mjs +78 -0
- package/es/dashboard/FilterStrip/style.mjs.map +1 -0
- package/es/dashboard/FilterStrip/type.d.mts +25 -0
- package/es/dashboard/LabelWithKey/LabelWithKey.d.mts +10 -0
- package/es/dashboard/LabelWithKey/LabelWithKey.mjs +18 -0
- package/es/dashboard/LabelWithKey/LabelWithKey.mjs.map +1 -0
- package/es/dashboard/LabelWithKey/index.d.mts +3 -0
- package/es/dashboard/LabelWithKey/type.d.mts +11 -0
- package/es/dashboard/MetricStrip/MetricCell.mjs +81 -0
- package/es/dashboard/MetricStrip/MetricCell.mjs.map +1 -0
- package/es/dashboard/MetricStrip/MetricStrip.d.mts +13 -0
- package/es/dashboard/MetricStrip/MetricStrip.mjs +47 -0
- package/es/dashboard/MetricStrip/MetricStrip.mjs.map +1 -0
- package/es/dashboard/MetricStrip/index.d.mts +3 -0
- package/es/dashboard/MetricStrip/style.mjs +156 -0
- package/es/dashboard/MetricStrip/style.mjs.map +1 -0
- package/es/dashboard/MetricStrip/type.d.mts +36 -0
- package/es/dashboard/PageSkeleton/PageSkeleton.mjs +20 -18
- package/es/dashboard/PageSkeleton/PageSkeleton.mjs.map +1 -1
- package/es/dashboard/PageSkeleton/style.mjs +1 -1
- package/es/dashboard/PageSkeleton/style.mjs.map +1 -1
- package/es/dashboard/PageToolbar/PageToolbar.d.mts +10 -0
- package/es/dashboard/PageToolbar/PageToolbar.mjs +22 -0
- package/es/dashboard/PageToolbar/PageToolbar.mjs.map +1 -0
- package/es/dashboard/PageToolbar/index.d.mts +3 -0
- package/es/dashboard/PageToolbar/style.mjs +36 -0
- package/es/dashboard/PageToolbar/style.mjs.map +1 -0
- package/es/dashboard/PageToolbar/type.d.mts +11 -0
- package/es/dashboard/PanelSurface/PanelSurface.d.mts +10 -0
- package/es/dashboard/PanelSurface/PanelSurface.mjs +40 -0
- package/es/dashboard/PanelSurface/PanelSurface.mjs.map +1 -0
- package/es/dashboard/PanelSurface/index.d.mts +3 -0
- package/es/dashboard/PanelSurface/style.mjs +25 -0
- package/es/dashboard/PanelSurface/style.mjs.map +1 -0
- package/es/dashboard/PanelSurface/type.d.mts +17 -0
- package/es/dashboard/Section/Section.d.mts +10 -0
- package/es/dashboard/Section/Section.mjs +81 -0
- package/es/dashboard/Section/Section.mjs.map +1 -0
- package/es/dashboard/Section/index.d.mts +3 -0
- package/es/dashboard/Section/style.mjs +31 -0
- package/es/dashboard/Section/style.mjs.map +1 -0
- package/es/dashboard/Section/type.d.mts +23 -0
- package/es/dashboard/StatCard/StatCard.d.mts +2 -1
- package/es/dashboard/StatCard/StatCard.mjs +28 -91
- package/es/dashboard/StatCard/StatCard.mjs.map +1 -1
- package/es/dashboard/StatCard/type.d.mts +16 -5
- package/es/dashboard/Surface/Surface.d.mts +4 -3
- package/es/dashboard/Surface/Surface.mjs +91 -8
- package/es/dashboard/Surface/Surface.mjs.map +1 -1
- package/es/dashboard/Surface/index.d.mts +3 -2
- package/es/dashboard/Surface/link.d.mts +16 -0
- package/es/dashboard/Surface/link.mjs +40 -0
- package/es/dashboard/Surface/link.mjs.map +1 -0
- package/es/dashboard/Surface/marker.stylex.mjs +9 -0
- package/es/dashboard/Surface/marker.stylex.mjs.map +1 -0
- package/es/dashboard/Surface/style.d.mts +2 -0
- package/es/dashboard/Surface/style.mjs +155 -14
- package/es/dashboard/Surface/style.mjs.map +1 -1
- package/es/dashboard/Surface/type.d.mts +29 -1
- package/es/dashboard/TableIconActions/TableIconActions.d.mts +17 -0
- package/es/dashboard/TableIconActions/TableIconActions.mjs +39 -0
- package/es/dashboard/TableIconActions/TableIconActions.mjs.map +1 -0
- package/es/dashboard/TableIconActions/index.d.mts +3 -0
- package/es/dashboard/TableIconActions/type.d.mts +17 -0
- package/es/dashboard/TitleWithTips/TitleWithTips.d.mts +10 -0
- package/es/dashboard/TitleWithTips/TitleWithTips.mjs +28 -0
- package/es/dashboard/TitleWithTips/TitleWithTips.mjs.map +1 -0
- package/es/dashboard/TitleWithTips/index.d.mts +3 -0
- package/es/dashboard/TitleWithTips/type.d.mts +10 -0
- package/es/dashboard/index.d.mts +38 -4
- package/es/dashboard/index.mjs +17 -3
- package/es/hooks/useControlledState.mjs +20 -0
- package/es/hooks/useControlledState.mjs.map +1 -0
- package/es/hooks/useHighlight.mjs +2 -2
- package/es/hooks/useHighlight.mjs.map +1 -1
- package/es/hooks/useHover.mjs +22 -0
- package/es/hooks/useHover.mjs.map +1 -0
- package/es/hooks/useScroll.d.mts +8 -0
- package/es/hooks/useScroll.mjs +33 -0
- package/es/hooks/useScroll.mjs.map +1 -0
- package/es/hooks/useSize.mjs +26 -0
- package/es/hooks/useSize.mjs.map +1 -0
- package/es/internal/virtual/VirtualScrollArea.mjs +1 -1
- package/es/internal/virtual/VirtualScrollArea.mjs.map +1 -1
- package/es/mobile/ChatInputArea/ChatInputArea.mjs +1 -1
- package/es/mobile/ChatInputArea/ChatInputArea.mjs.map +1 -1
- package/es/mobile/TabBar/TabBar.mjs +1 -1
- package/es/mobile/TabBar/TabBar.mjs.map +1 -1
- package/es/node_modules/.pnpm/@eslint_core@1.2.1/node_modules/@eslint/core/dist/esm/types.d.mts +2 -46
- package/es/node_modules/.pnpm/@eslint_plugin-kit@0.7.3/node_modules/@eslint/plugin-kit/dist/cjs/index.d.mts +1 -1
- package/es/node_modules/.pnpm/@types_estree@1.0.9/node_modules/@types/estree/index.d.mts +1 -4
- package/es/node_modules/.pnpm/eslint@10.12.0_jiti@2.6.1_supports-color@10.2.2/node_modules/eslint/lib/types/index.d.mts +1 -1
- package/es/style.css +339 -32
- package/es/styles/theme/token/neutral.mjs +5 -5
- package/es/styles/theme/token/neutral.mjs.map +1 -1
- package/es/utils/colorMath.mjs +52 -0
- package/es/utils/colorMath.mjs.map +1 -0
- package/es/utils/formatNumber.mjs +7 -0
- package/es/utils/formatNumber.mjs.map +1 -0
- package/es/utils/genCdnUrl.mjs +6 -3
- package/es/utils/genCdnUrl.mjs.map +1 -1
- package/es/utils/hashString.mjs +19 -0
- package/es/utils/hashString.mjs.map +1 -0
- package/es/utils/mergeRefs.mjs +20 -0
- package/es/utils/mergeRefs.mjs.map +1 -0
- package/es/utils/placement.d.mts +5 -5
- package/es/utils/placement.mjs.map +1 -1
- package/package.json +16 -42
- package/es/dashboard/StatCard/style.mjs +0 -105
- package/es/dashboard/StatCard/style.mjs.map +0 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
|
+
import { withAlpha } from "../../utils/colorMath.mjs";
|
|
1
2
|
import { useTheme } from "../../styles/theme/scope.mjs";
|
|
2
3
|
import { safeReadableColor } from "../../utils/safeReadableColor.mjs";
|
|
3
4
|
import { useMemo } from "react";
|
|
4
|
-
import { rgba } from "polished";
|
|
5
5
|
//#region src/awesome/Giscus/style.ts
|
|
6
6
|
const useStyles = () => {
|
|
7
7
|
const theme = useTheme();
|
|
@@ -26,22 +26,22 @@ const useStyles = () => {
|
|
|
26
26
|
--color-prettylights-syntax-variable: ${colorRed};
|
|
27
27
|
--color-prettylights-syntax-brackethighlighter-unmatched: ${colorRed};
|
|
28
28
|
--color-prettylights-syntax-invalid-illegal-text: ${colorTextSecondary};
|
|
29
|
-
--color-prettylights-syntax-invalid-illegal-bg: ${
|
|
29
|
+
--color-prettylights-syntax-invalid-illegal-bg: ${withAlpha(colorRed, .4)};
|
|
30
30
|
--color-prettylights-syntax-carriage-return-text: ${colorTextSecondary};
|
|
31
|
-
--color-prettylights-syntax-carriage-return-bg: ${
|
|
31
|
+
--color-prettylights-syntax-carriage-return-bg: ${withAlpha(colorRed, .6)};
|
|
32
32
|
--color-prettylights-syntax-string-regexp: ${colorGreen};
|
|
33
33
|
--color-prettylights-syntax-markup-list: ${colorOrange};
|
|
34
34
|
--color-prettylights-syntax-markup-heading: ${colorBlue};
|
|
35
35
|
--color-prettylights-syntax-markup-italic: ${colorTextSecondary};
|
|
36
36
|
--color-prettylights-syntax-markup-bold: ${colorTextSecondary};
|
|
37
37
|
--color-prettylights-syntax-markup-deleted-text: ${colorTextSecondary};
|
|
38
|
-
--color-prettylights-syntax-markup-deleted-bg: ${
|
|
38
|
+
--color-prettylights-syntax-markup-deleted-bg: ${withAlpha(colorRed, .2)};
|
|
39
39
|
--color-prettylights-syntax-markup-inserted-text: ${colorGreen};
|
|
40
|
-
--color-prettylights-syntax-markup-inserted-bg: ${
|
|
40
|
+
--color-prettylights-syntax-markup-inserted-bg: ${withAlpha(colorGreen, .2)};
|
|
41
41
|
--color-prettylights-syntax-markup-changed-text: ${colorOrange};
|
|
42
|
-
--color-prettylights-syntax-markup-changed-bg: ${
|
|
42
|
+
--color-prettylights-syntax-markup-changed-bg: ${withAlpha(colorRed, .2)};
|
|
43
43
|
--color-prettylights-syntax-markup-ignored-text: ${colorTextSecondary};
|
|
44
|
-
--color-prettylights-syntax-markup-ignored-bg: ${
|
|
44
|
+
--color-prettylights-syntax-markup-ignored-bg: ${withAlpha(colorBlue, .2)};
|
|
45
45
|
--color-prettylights-syntax-meta-diff-range: ${colorOrange};
|
|
46
46
|
--color-prettylights-syntax-brackethighlighter-angle: ${colorTextSecondary};
|
|
47
47
|
--color-prettylights-syntax-sublimelinter-gutter-mark: ${colorTextTertiary};
|
|
@@ -70,8 +70,8 @@ const useStyles = () => {
|
|
|
70
70
|
${safeReadableColor(theme.colorPrimary)} 50%,
|
|
71
71
|
transparent
|
|
72
72
|
);
|
|
73
|
-
--color-btn-primary-disabled-bg: ${
|
|
74
|
-
--color-btn-primary-disabled-border: ${
|
|
73
|
+
--color-btn-primary-disabled-bg: ${withAlpha(theme.colorPrimary, .5)};
|
|
74
|
+
--color-btn-primary-disabled-border: ${withAlpha(theme.colorPrimaryBorder, .5)};
|
|
75
75
|
--color-action-list-item-default-hover-bg: ${theme.colorFillQuaternary};
|
|
76
76
|
--color-segmented-control-bg: ${theme.colorFillTertiary};
|
|
77
77
|
--color-segmented-control-button-bg: transparent;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"style.mjs","names":[],"sources":["../../../src/awesome/Giscus/style.ts"],"sourcesContent":["import {
|
|
1
|
+
{"version":3,"file":"style.mjs","names":[],"sources":["../../../src/awesome/Giscus/style.ts"],"sourcesContent":["import { useMemo } from 'react';\n\nimport { useTheme } from '@/styles/theme/scope';\nimport { withAlpha } from '@/utils/colorMath';\nimport { safeReadableColor } from '@/utils/safeReadableColor';\n\nexport const useStyles = () => {\n const theme = useTheme();\n const colorText = theme.colorText;\n const colorTextSecondary = theme.colorTextSecondary;\n const colorTextTertiary = theme.colorTextTertiary;\n const colorRed = theme.colorError;\n const colorOrange = theme.colorWarning;\n const colorGreen = theme.colorSuccess;\n const colorBlue = theme.colorInfo;\n const loaderContainer = theme.isDarkMode\n ? 'https://github.com/images/modules/pulls/progressive-disclosure-line-dark.svg'\n : 'https://github.com/images/modules/pulls/progressive-disclosure-line.svg';\n const loadingImage = theme.isDarkMode\n ? 'https://github.githubassets.com/images/mona-loading-dark.gif'\n : 'https://github.githubassets.com/images/mona-loading-default.gif';\n const styles = `\n main {\n --color-prettylights-syntax-comment: ${colorTextTertiary};\n --color-prettylights-syntax-constant: ${colorGreen};\n --color-prettylights-syntax-entity: ${colorOrange};\n --color-prettylights-syntax-storage-modifier-import: ${colorRed};\n --color-prettylights-syntax-entity-tag: ${colorBlue};\n --color-prettylights-syntax-keyword: ${colorBlue};\n --color-prettylights-syntax-string: ${colorGreen};\n --color-prettylights-syntax-variable: ${colorRed};\n --color-prettylights-syntax-brackethighlighter-unmatched: ${colorRed};\n --color-prettylights-syntax-invalid-illegal-text: ${colorTextSecondary};\n --color-prettylights-syntax-invalid-illegal-bg: ${withAlpha(colorRed, 0.4)};\n --color-prettylights-syntax-carriage-return-text: ${colorTextSecondary};\n --color-prettylights-syntax-carriage-return-bg: ${withAlpha(colorRed, 0.6)};\n --color-prettylights-syntax-string-regexp: ${colorGreen};\n --color-prettylights-syntax-markup-list: ${colorOrange};\n --color-prettylights-syntax-markup-heading: ${colorBlue};\n --color-prettylights-syntax-markup-italic: ${colorTextSecondary};\n --color-prettylights-syntax-markup-bold: ${colorTextSecondary};\n --color-prettylights-syntax-markup-deleted-text: ${colorTextSecondary};\n --color-prettylights-syntax-markup-deleted-bg: ${withAlpha(colorRed, 0.2)};\n --color-prettylights-syntax-markup-inserted-text: ${colorGreen};\n --color-prettylights-syntax-markup-inserted-bg: ${withAlpha(colorGreen, 0.2)};\n --color-prettylights-syntax-markup-changed-text: ${colorOrange};\n --color-prettylights-syntax-markup-changed-bg: ${withAlpha(colorRed, 0.2)};\n --color-prettylights-syntax-markup-ignored-text: ${colorTextSecondary};\n --color-prettylights-syntax-markup-ignored-bg: ${withAlpha(colorBlue, 0.2)};\n --color-prettylights-syntax-meta-diff-range: ${colorOrange};\n --color-prettylights-syntax-brackethighlighter-angle: ${colorTextSecondary};\n --color-prettylights-syntax-sublimelinter-gutter-mark: ${colorTextTertiary};\n --color-prettylights-syntax-constant-other-reference-link: ${colorBlue};\n --color-btn-text: ${theme.colorText};\n --color-btn-bg: ${theme.colorFillTertiary};\n --color-btn-border: ${theme.colorBorderSecondary};\n --color-btn-shadow: 0 0 transparent;\n --color-btn-inset-shadow: 0 0 transparent;\n --color-btn-hover-bg: ${theme.colorFillSecondary};\n --color-btn-hover-border: ${theme.colorBorder};\n --color-btn-active-bg: ${theme.colorFillSecondary};\n --color-btn-active-border: ${theme.colorBorder};\n --color-btn-selected-bg: ${theme.colorFillSecondary};\n --color-btn-primary-text: ${safeReadableColor(theme.colorPrimary)};\n --color-btn-primary-bg: ${theme.colorPrimary};\n --color-btn-primary-border: ${theme.colorPrimaryBorder};\n --color-btn-primary-shadow: 0 0 transparent;\n --color-btn-primary-inset-shadow: 0 0 transparent;\n --color-btn-primary-hover-bg: ${theme.colorPrimaryHover};\n --color-btn-primary-hover-border: ${theme.colorPrimaryBorderHover};\n --color-btn-primary-selected-bg: ${theme.colorPrimaryActive};\n --color-btn-primary-selected-shadow: 0 0 transparent;\n --color-btn-primary-disabled-text: color-mix(\n in srgb,\n ${safeReadableColor(theme.colorPrimary)} 50%,\n transparent\n );\n --color-btn-primary-disabled-bg: ${withAlpha(theme.colorPrimary, 0.5)};\n --color-btn-primary-disabled-border: ${withAlpha(theme.colorPrimaryBorder, 0.5)};\n --color-action-list-item-default-hover-bg: ${theme.colorFillQuaternary};\n --color-segmented-control-bg: ${theme.colorFillTertiary};\n --color-segmented-control-button-bg: transparent;\n --color-segmented-control-button-selected-border: ${theme.colorBorder};\n --color-fg-default: ${theme.colorText};\n --color-fg-muted: ${theme.colorTextSecondary};\n --color-fg-subtle: ${theme.colorTextQuaternary};\n --color-canvas-default: transparent;\n --color-canvas-overlay: ${theme.colorBgElevated};\n --color-canvas-inset: transparent;\n --color-canvas-subtle: ${theme.colorFillQuaternary};\n --color-border-default: ${theme.colorBorder};\n --color-border-muted: ${theme.colorBorderSecondary};\n --color-neutral-muted: ${theme.colorFillQuaternary};\n --color-neutral-subtle: ${theme.colorFillTertiary};\n --color-accent-fg: ${theme.colorInfo};\n --color-accent-emphasis: ${theme.colorInfoBorderHover};\n --color-accent-muted: ${theme.colorInfoBorder};\n --color-accent-subtle: ${theme.colorInfoBg};\n --color-success-fg: ${theme.colorSuccess};\n --color-attention-fg: ${theme.colorWarning};\n --color-attention-muted: ${theme.colorWarningBorder};\n --color-attention-subtle: ${theme.colorWarningBg};\n --color-danger-fg: ${theme.colorError};\n --color-danger-muted: ${theme.colorErrorBorder};\n --color-danger-subtle: ${theme.colorErrorBg};\n --color-primer-shadow-inset: 0 0 transparent;\n --color-scale-gray-7: ${theme.colorBgContainer};\n --color-scale-blue-8: ${theme.colorInfoBg};\n --color-social-reaction-bg-hover: ${theme.colorFillSecondary};\n --color-social-reaction-bg-reacted-hover: ${theme.colorInfoBgHover};\n\n .markdown pre {\n color: ${colorText};\n }\n\n .pagination-loader-container {\n background-image: url(${loaderContainer});\n }\n\n .gsc-pagination-button {\n background-color: var(--color-btn-bg);\n }\n\n .gsc-reactions-popover {\n width: 170px;\n\n > .m-2 {\n display: flex;\n flex-wrap: wrap;\n gap: 8px;\n }\n }\n\n .gsc-emoji-button.has-reacted {\n border-color: ${theme.colorInfoBorderHover};\n border-radius: ${theme.borderRadius}px;\n }\n\n .gsc-loading-image {\n background-image: url(${loadingImage});\n }\n }\n `;\n\n return useMemo(() => `data:text/css;base64,${btoa(styles)}`, [styles]);\n};\n\nexport const formatLang = (lang: string) => {\n if (['zh_CN', 'zh_TW'].includes(lang)) {\n return lang.replace('_', '-');\n } else if (lang === 'zh_HK') {\n return 'zh-TW';\n } else {\n return lang.split('_')[0];\n }\n};\n"],"mappings":";;;;;AAMA,MAAa,kBAAkB;CAC7B,MAAM,QAAQ,SAAS;CACvB,MAAM,YAAY,MAAM;CACxB,MAAM,qBAAqB,MAAM;CACjC,MAAM,oBAAoB,MAAM;CAChC,MAAM,WAAW,MAAM;CACvB,MAAM,cAAc,MAAM;CAC1B,MAAM,aAAa,MAAM;CACzB,MAAM,YAAY,MAAM;CACxB,MAAM,kBAAkB,MAAM,aAC1B,iFACA;CACJ,MAAM,eAAe,MAAM,aACvB,iEACA;CACJ,MAAM,SAAS;;6CAE4B,kBAAkB;8CACjB,WAAW;4CACb,YAAY;6DACK,SAAS;gDACtB,UAAU;6CACb,UAAU;4CACX,WAAW;8CACT,SAAS;kEACW,SAAS;0DACjB,mBAAmB;wDACrB,UAAU,UAAU,EAAG,EAAE;0DACvB,mBAAmB;wDACrB,UAAU,UAAU,EAAG,EAAE;mDAC9B,WAAW;iDACb,YAAY;oDACT,UAAU;mDACX,mBAAmB;iDACrB,mBAAmB;yDACX,mBAAmB;uDACrB,UAAU,UAAU,EAAG,EAAE;0DACtB,WAAW;wDACb,UAAU,YAAY,EAAG,EAAE;yDAC1B,YAAY;uDACd,UAAU,UAAU,EAAG,EAAE;yDACvB,mBAAmB;uDACrB,UAAU,WAAW,EAAG,EAAE;qDAC5B,YAAY;8DACH,mBAAmB;+DAClB,kBAAkB;mEACd,UAAU;0BACnD,MAAM,UAAU;wBAClB,MAAM,kBAAkB;4BACpB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AAO,KAAK,QAAQ,KAAK,GAAG;MACvB,IAAI,SAAS,SAClB,OAAO;MAEP,OAAO,KAAK,MAAM,GAAG,CAAC,CAAC;AAE3B"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { GrainientProps } from "./type.mjs";
|
|
2
|
+
//#region src/awesome/Grainient/Grainient.d.ts
|
|
3
|
+
/**
|
|
4
|
+
* Animated grainy gradient (WebGL2, no extra dependency). Fills its nearest positioned ancestor,
|
|
5
|
+
* pauses when off-screen or the tab is hidden, and draws one still frame when reduced motion is
|
|
6
|
+
* preferred. Without WebGL2 it renders nothing, so give the parent a fallback background.
|
|
7
|
+
*/
|
|
8
|
+
declare const Grainient: import("react").NamedExoticComponent<GrainientProps>;
|
|
9
|
+
//#endregion
|
|
10
|
+
export { Grainient as default };
|
|
11
|
+
//# sourceMappingURL=Grainient.d.mts.map
|
|
@@ -0,0 +1,314 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { styleProps } from "../../styles/stylex/props.mjs";
|
|
3
|
+
import { useThemeMode } from "../../styles/theme/scope.mjs";
|
|
4
|
+
import { styles } from "./style.mjs";
|
|
5
|
+
import { memo, useEffect, useRef } from "react";
|
|
6
|
+
import { jsx } from "react/jsx-runtime";
|
|
7
|
+
import * as stylex from "@stylexjs/stylex";
|
|
8
|
+
//#region src/awesome/Grainient/Grainient.tsx
|
|
9
|
+
const VERTEX_SHADER = `#version 300 es
|
|
10
|
+
in vec2 position;
|
|
11
|
+
void main() {
|
|
12
|
+
gl_Position = vec4(position, 0.0, 1.0);
|
|
13
|
+
}
|
|
14
|
+
`;
|
|
15
|
+
const FRAGMENT_SHADER = `#version 300 es
|
|
16
|
+
precision highp float;
|
|
17
|
+
uniform vec2 iResolution;
|
|
18
|
+
uniform float iTime;
|
|
19
|
+
uniform float uTimeSpeed;
|
|
20
|
+
uniform float uColorBalance;
|
|
21
|
+
uniform float uWarpStrength;
|
|
22
|
+
uniform float uWarpFrequency;
|
|
23
|
+
uniform float uWarpSpeed;
|
|
24
|
+
uniform float uWarpAmplitude;
|
|
25
|
+
uniform float uBlendAngle;
|
|
26
|
+
uniform float uBlendSoftness;
|
|
27
|
+
uniform float uRotationAmount;
|
|
28
|
+
uniform float uNoiseScale;
|
|
29
|
+
uniform float uGrainAmount;
|
|
30
|
+
uniform float uGrainScale;
|
|
31
|
+
uniform float uGrainAnimated;
|
|
32
|
+
uniform float uContrast;
|
|
33
|
+
uniform float uGamma;
|
|
34
|
+
uniform float uSaturation;
|
|
35
|
+
uniform vec2 uCenterOffset;
|
|
36
|
+
uniform float uZoom;
|
|
37
|
+
uniform vec3 uColor1;
|
|
38
|
+
uniform vec3 uColor2;
|
|
39
|
+
uniform vec3 uColor3;
|
|
40
|
+
uniform float uLightMode;
|
|
41
|
+
out vec4 fragColor;
|
|
42
|
+
#define S(a,b,t) smoothstep(a,b,t)
|
|
43
|
+
mat2 Rot(float a){float s=sin(a),c=cos(a);return mat2(c,-s,s,c);}
|
|
44
|
+
vec2 hash(vec2 p){p=vec2(dot(p,vec2(2127.1,81.17)),dot(p,vec2(1269.5,283.37)));return fract(sin(p)*43758.5453);}
|
|
45
|
+
float noise(vec2 p){vec2 i=floor(p),f=fract(p),u=f*f*(3.0-2.0*f);float n=mix(mix(dot(-1.0+2.0*hash(i+vec2(0.0,0.0)),f-vec2(0.0,0.0)),dot(-1.0+2.0*hash(i+vec2(1.0,0.0)),f-vec2(1.0,0.0)),u.x),mix(dot(-1.0+2.0*hash(i+vec2(0.0,1.0)),f-vec2(0.0,1.0)),dot(-1.0+2.0*hash(i+vec2(1.0,1.0)),f-vec2(1.0,1.0)),u.x),u.y);return 0.5+0.5*n;}
|
|
46
|
+
void mainImage(out vec4 o, vec2 C){
|
|
47
|
+
float t=iTime*uTimeSpeed;
|
|
48
|
+
vec2 uv=C/iResolution.xy;
|
|
49
|
+
float ratio=iResolution.x/iResolution.y;
|
|
50
|
+
vec2 tuv=uv-0.5+uCenterOffset;
|
|
51
|
+
tuv/=max(uZoom,0.001);
|
|
52
|
+
|
|
53
|
+
float degree=noise(vec2(t*0.1,tuv.x*tuv.y)*uNoiseScale);
|
|
54
|
+
tuv.y*=1.0/ratio;
|
|
55
|
+
tuv*=Rot(radians((degree-0.5)*uRotationAmount+180.0));
|
|
56
|
+
tuv.y*=ratio;
|
|
57
|
+
|
|
58
|
+
float frequency=uWarpFrequency;
|
|
59
|
+
float ws=max(uWarpStrength,0.001);
|
|
60
|
+
float amplitude=uWarpAmplitude/ws;
|
|
61
|
+
float warpTime=t*uWarpSpeed;
|
|
62
|
+
tuv.x+=sin(tuv.y*frequency+warpTime)/amplitude;
|
|
63
|
+
tuv.y+=sin(tuv.x*(frequency*1.5)+warpTime)/(amplitude*0.5);
|
|
64
|
+
|
|
65
|
+
vec3 colLav=uColor1;
|
|
66
|
+
vec3 colOrg=uColor2;
|
|
67
|
+
vec3 colDark=uColor3;
|
|
68
|
+
float b=uColorBalance;
|
|
69
|
+
float s=max(uBlendSoftness,0.0);
|
|
70
|
+
mat2 blendRot=Rot(radians(uBlendAngle));
|
|
71
|
+
float blendX=(tuv*blendRot).x;
|
|
72
|
+
float edge0=-0.3-b-s;
|
|
73
|
+
float edge1=0.2-b+s;
|
|
74
|
+
float v0=0.5-b+s;
|
|
75
|
+
float v1=-0.3-b-s;
|
|
76
|
+
vec3 layer1=mix(colDark,colOrg,S(edge0,edge1,blendX));
|
|
77
|
+
vec3 layer2=mix(colOrg,colLav,S(edge0,edge1,blendX));
|
|
78
|
+
vec3 col=mix(layer1,layer2,S(v0,v1,tuv.y));
|
|
79
|
+
|
|
80
|
+
vec2 grainUv=uv*max(uGrainScale,0.001);
|
|
81
|
+
if(uGrainAnimated>0.5){grainUv+=vec2(iTime*0.05);}
|
|
82
|
+
float grain=fract(sin(dot(grainUv,vec2(12.9898,78.233)))*43758.5453);
|
|
83
|
+
col+=(grain-0.5)*uGrainAmount;
|
|
84
|
+
|
|
85
|
+
col=(col-0.5)*uContrast+0.5;
|
|
86
|
+
float luma=dot(col,vec3(0.2126,0.7152,0.0722));
|
|
87
|
+
col=mix(vec3(luma),col,uSaturation);
|
|
88
|
+
col=pow(max(col,0.0),vec3(1.0/max(uGamma,0.001)));
|
|
89
|
+
col=clamp(col,0.0,1.0);
|
|
90
|
+
if(uLightMode>0.5){
|
|
91
|
+
float energy=max(max(col.r,col.g),col.b);
|
|
92
|
+
vec3 hue=col/max(energy,0.001);
|
|
93
|
+
float chroma=length(col-vec3(dot(col,vec3(0.333333))));
|
|
94
|
+
float coverage=clamp(0.12+chroma*1.15+energy*0.18,0.0,0.88);
|
|
95
|
+
col=mix(vec3(1.0),clamp(hue*0.58+col*0.18,0.0,1.0),coverage);
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
o=vec4(col,1.0);
|
|
99
|
+
}
|
|
100
|
+
void main(){
|
|
101
|
+
vec4 o=vec4(0.0);
|
|
102
|
+
mainImage(o,gl_FragCoord.xy);
|
|
103
|
+
fragColor=o;
|
|
104
|
+
}
|
|
105
|
+
`;
|
|
106
|
+
const hexToRgb = (hex) => {
|
|
107
|
+
let value = hex.trim().replace("#", "");
|
|
108
|
+
if (value.length === 3) value = [...value].map((c) => c + c).join("");
|
|
109
|
+
const result = /^([\da-f]{2})([\da-f]{2})([\da-f]{2})$/i.exec(value);
|
|
110
|
+
if (!result) return [
|
|
111
|
+
1,
|
|
112
|
+
1,
|
|
113
|
+
1
|
|
114
|
+
];
|
|
115
|
+
return [
|
|
116
|
+
Number.parseInt(result[1], 16) / 255,
|
|
117
|
+
Number.parseInt(result[2], 16) / 255,
|
|
118
|
+
Number.parseInt(result[3], 16) / 255
|
|
119
|
+
];
|
|
120
|
+
};
|
|
121
|
+
const compile = (gl, type, source) => {
|
|
122
|
+
const shader = gl.createShader(type);
|
|
123
|
+
if (!shader) return null;
|
|
124
|
+
gl.shaderSource(shader, source);
|
|
125
|
+
gl.compileShader(shader);
|
|
126
|
+
if (!gl.getShaderParameter(shader, gl.COMPILE_STATUS)) {
|
|
127
|
+
gl.deleteShader(shader);
|
|
128
|
+
return null;
|
|
129
|
+
}
|
|
130
|
+
return shader;
|
|
131
|
+
};
|
|
132
|
+
/**
|
|
133
|
+
* Animated grainy gradient (WebGL2, no extra dependency). Fills its nearest positioned ancestor,
|
|
134
|
+
* pauses when off-screen or the tab is hidden, and draws one still frame when reduced motion is
|
|
135
|
+
* preferred. Without WebGL2 it renders nothing, so give the parent a fallback background.
|
|
136
|
+
*/
|
|
137
|
+
const Grainient = memo(({ timeSpeed = .25, colorBalance = 0, warpStrength = 1, warpFrequency = 5, warpSpeed = 2, warpAmplitude = 50, blendAngle = 0, blendSoftness = .05, rotationAmount = 500, noiseScale = 2, grainAmount = .1, grainScale = 2, contrast = 1.5, gamma = 1, saturation = 1, zoom = .9, centerX = 0, centerY = 0, color1 = "#FF9FFC", color2 = "#5227FF", color3 = "#B497CF", grainAnimated = false, lightMode = false, className, style, ...rest }) => {
|
|
138
|
+
const containerRef = useRef(null);
|
|
139
|
+
const drawRef = useRef(null);
|
|
140
|
+
const uniformsRef = useRef(null);
|
|
141
|
+
const { isDarkMode } = useThemeMode();
|
|
142
|
+
const light = lightMode === "auto" ? !isDarkMode : lightMode;
|
|
143
|
+
useEffect(() => {
|
|
144
|
+
const container = containerRef.current;
|
|
145
|
+
if (!container) return;
|
|
146
|
+
const canvas = document.createElement("canvas");
|
|
147
|
+
canvas.className = stylex.props(styles.canvas).className ?? "";
|
|
148
|
+
const gl = canvas.getContext("webgl2", {
|
|
149
|
+
alpha: true,
|
|
150
|
+
antialias: false
|
|
151
|
+
});
|
|
152
|
+
if (!gl) return;
|
|
153
|
+
container.append(canvas);
|
|
154
|
+
const vs = compile(gl, gl.VERTEX_SHADER, VERTEX_SHADER);
|
|
155
|
+
const fs = compile(gl, gl.FRAGMENT_SHADER, FRAGMENT_SHADER);
|
|
156
|
+
const program = gl.createProgram();
|
|
157
|
+
if (!vs || !fs || !program) {
|
|
158
|
+
canvas.remove();
|
|
159
|
+
return;
|
|
160
|
+
}
|
|
161
|
+
gl.attachShader(program, vs);
|
|
162
|
+
gl.attachShader(program, fs);
|
|
163
|
+
gl.linkProgram(program);
|
|
164
|
+
if (!gl.getProgramParameter(program, gl.LINK_STATUS)) {
|
|
165
|
+
canvas.remove();
|
|
166
|
+
return;
|
|
167
|
+
}
|
|
168
|
+
gl.useProgram(program);
|
|
169
|
+
const buffer = gl.createBuffer();
|
|
170
|
+
gl.bindBuffer(gl.ARRAY_BUFFER, buffer);
|
|
171
|
+
gl.bufferData(gl.ARRAY_BUFFER, new Float32Array([
|
|
172
|
+
-1,
|
|
173
|
+
-1,
|
|
174
|
+
3,
|
|
175
|
+
-1,
|
|
176
|
+
-1,
|
|
177
|
+
3
|
|
178
|
+
]), gl.STATIC_DRAW);
|
|
179
|
+
const position = gl.getAttribLocation(program, "position");
|
|
180
|
+
gl.enableVertexAttribArray(position);
|
|
181
|
+
gl.vertexAttribPointer(position, 2, gl.FLOAT, false, 0, 0);
|
|
182
|
+
const loc = (name) => gl.getUniformLocation(program, name);
|
|
183
|
+
const uTime = loc("iTime");
|
|
184
|
+
const uRes = loc("iResolution");
|
|
185
|
+
const started = performance.now();
|
|
186
|
+
const draw = () => {
|
|
187
|
+
gl.uniform1f(uTime, (performance.now() - started) * .001);
|
|
188
|
+
gl.drawArrays(gl.TRIANGLES, 0, 3);
|
|
189
|
+
};
|
|
190
|
+
drawRef.current = draw;
|
|
191
|
+
uniformsRef.current?.();
|
|
192
|
+
const setSize = () => {
|
|
193
|
+
const rect = container.getBoundingClientRect();
|
|
194
|
+
const dpr = Math.min(window.devicePixelRatio || 1, 2);
|
|
195
|
+
canvas.width = Math.max(1, Math.floor(rect.width * dpr));
|
|
196
|
+
canvas.height = Math.max(1, Math.floor(rect.height * dpr));
|
|
197
|
+
gl.viewport(0, 0, canvas.width, canvas.height);
|
|
198
|
+
gl.uniform2f(uRes, canvas.width, canvas.height);
|
|
199
|
+
draw();
|
|
200
|
+
};
|
|
201
|
+
const reducedMotion = window.matchMedia?.("(prefers-reduced-motion: reduce)");
|
|
202
|
+
let raf = 0;
|
|
203
|
+
let inView = true;
|
|
204
|
+
const loop = () => {
|
|
205
|
+
draw();
|
|
206
|
+
raf = requestAnimationFrame(loop);
|
|
207
|
+
};
|
|
208
|
+
const stop = () => {
|
|
209
|
+
if (raf) cancelAnimationFrame(raf);
|
|
210
|
+
raf = 0;
|
|
211
|
+
};
|
|
212
|
+
const sync = () => {
|
|
213
|
+
const run = inView && !document.hidden && !reducedMotion?.matches;
|
|
214
|
+
if (run && !raf) raf = requestAnimationFrame(loop);
|
|
215
|
+
if (!run) {
|
|
216
|
+
stop();
|
|
217
|
+
draw();
|
|
218
|
+
}
|
|
219
|
+
};
|
|
220
|
+
const resizeObserver = new ResizeObserver(setSize);
|
|
221
|
+
resizeObserver.observe(container);
|
|
222
|
+
const intersectionObserver = new IntersectionObserver(([entry]) => {
|
|
223
|
+
inView = entry.isIntersecting;
|
|
224
|
+
sync();
|
|
225
|
+
});
|
|
226
|
+
intersectionObserver.observe(container);
|
|
227
|
+
document.addEventListener("visibilitychange", sync);
|
|
228
|
+
reducedMotion?.addEventListener("change", sync);
|
|
229
|
+
setSize();
|
|
230
|
+
sync();
|
|
231
|
+
return () => {
|
|
232
|
+
stop();
|
|
233
|
+
resizeObserver.disconnect();
|
|
234
|
+
intersectionObserver.disconnect();
|
|
235
|
+
document.removeEventListener("visibilitychange", sync);
|
|
236
|
+
reducedMotion?.removeEventListener("change", sync);
|
|
237
|
+
drawRef.current = null;
|
|
238
|
+
gl.deleteBuffer(buffer);
|
|
239
|
+
gl.deleteProgram(program);
|
|
240
|
+
gl.deleteShader(vs);
|
|
241
|
+
gl.deleteShader(fs);
|
|
242
|
+
canvas.remove();
|
|
243
|
+
};
|
|
244
|
+
}, []);
|
|
245
|
+
useEffect(() => {
|
|
246
|
+
const apply = () => {
|
|
247
|
+
const gl = (containerRef.current?.querySelector("canvas"))?.getContext("webgl2");
|
|
248
|
+
if (!gl) return;
|
|
249
|
+
const program = gl.getParameter(gl.CURRENT_PROGRAM);
|
|
250
|
+
if (!program) return;
|
|
251
|
+
const loc = (name) => gl.getUniformLocation(program, name);
|
|
252
|
+
gl.uniform1f(loc("uTimeSpeed"), timeSpeed);
|
|
253
|
+
gl.uniform1f(loc("uColorBalance"), colorBalance);
|
|
254
|
+
gl.uniform1f(loc("uWarpStrength"), warpStrength);
|
|
255
|
+
gl.uniform1f(loc("uWarpFrequency"), warpFrequency);
|
|
256
|
+
gl.uniform1f(loc("uWarpSpeed"), warpSpeed);
|
|
257
|
+
gl.uniform1f(loc("uWarpAmplitude"), warpAmplitude);
|
|
258
|
+
gl.uniform1f(loc("uBlendAngle"), blendAngle);
|
|
259
|
+
gl.uniform1f(loc("uBlendSoftness"), blendSoftness);
|
|
260
|
+
gl.uniform1f(loc("uRotationAmount"), rotationAmount);
|
|
261
|
+
gl.uniform1f(loc("uNoiseScale"), noiseScale);
|
|
262
|
+
gl.uniform1f(loc("uGrainAmount"), grainAmount);
|
|
263
|
+
gl.uniform1f(loc("uGrainScale"), grainScale);
|
|
264
|
+
gl.uniform1f(loc("uContrast"), contrast);
|
|
265
|
+
gl.uniform1f(loc("uGamma"), gamma);
|
|
266
|
+
gl.uniform1f(loc("uSaturation"), saturation);
|
|
267
|
+
gl.uniform1f(loc("uZoom"), zoom);
|
|
268
|
+
gl.uniform1f(loc("uGrainAnimated"), grainAnimated ? 1 : 0);
|
|
269
|
+
gl.uniform1f(loc("uLightMode"), light ? 1 : 0);
|
|
270
|
+
gl.uniform2f(loc("uCenterOffset"), centerX, centerY);
|
|
271
|
+
gl.uniform3f(loc("uColor1"), ...hexToRgb(color1));
|
|
272
|
+
gl.uniform3f(loc("uColor2"), ...hexToRgb(color2));
|
|
273
|
+
gl.uniform3f(loc("uColor3"), ...hexToRgb(color3));
|
|
274
|
+
drawRef.current?.();
|
|
275
|
+
};
|
|
276
|
+
uniformsRef.current = apply;
|
|
277
|
+
apply();
|
|
278
|
+
}, [
|
|
279
|
+
timeSpeed,
|
|
280
|
+
colorBalance,
|
|
281
|
+
warpStrength,
|
|
282
|
+
warpFrequency,
|
|
283
|
+
warpSpeed,
|
|
284
|
+
warpAmplitude,
|
|
285
|
+
blendAngle,
|
|
286
|
+
blendSoftness,
|
|
287
|
+
rotationAmount,
|
|
288
|
+
noiseScale,
|
|
289
|
+
grainAmount,
|
|
290
|
+
grainScale,
|
|
291
|
+
contrast,
|
|
292
|
+
gamma,
|
|
293
|
+
saturation,
|
|
294
|
+
zoom,
|
|
295
|
+
centerX,
|
|
296
|
+
centerY,
|
|
297
|
+
color1,
|
|
298
|
+
color2,
|
|
299
|
+
color3,
|
|
300
|
+
grainAnimated,
|
|
301
|
+
light
|
|
302
|
+
]);
|
|
303
|
+
return /* @__PURE__ */ jsx("div", {
|
|
304
|
+
"aria-hidden": true,
|
|
305
|
+
ref: containerRef,
|
|
306
|
+
...rest,
|
|
307
|
+
...styleProps(styles.root, className, style)
|
|
308
|
+
});
|
|
309
|
+
});
|
|
310
|
+
Grainient.displayName = "Grainient";
|
|
311
|
+
//#endregion
|
|
312
|
+
export { Grainient as default, hexToRgb };
|
|
313
|
+
|
|
314
|
+
//# sourceMappingURL=Grainient.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Grainient.mjs","names":[],"sources":["../../../src/awesome/Grainient/Grainient.tsx"],"sourcesContent":["'use client';\n\nimport * as stylex from '@stylexjs/stylex';\nimport { memo, useEffect, useRef } from 'react';\n\nimport { styleProps } from '@/styles/stylex/props';\nimport { useThemeMode } from '@/styles/theme/scope';\n\nimport { styles } from './style';\nimport type { GrainientProps } from './type';\n\nconst VERTEX_SHADER = `#version 300 es\nin vec2 position;\nvoid main() {\n gl_Position = vec4(position, 0.0, 1.0);\n}\n`;\n\nconst FRAGMENT_SHADER = `#version 300 es\nprecision highp float;\nuniform vec2 iResolution;\nuniform float iTime;\nuniform float uTimeSpeed;\nuniform float uColorBalance;\nuniform float uWarpStrength;\nuniform float uWarpFrequency;\nuniform float uWarpSpeed;\nuniform float uWarpAmplitude;\nuniform float uBlendAngle;\nuniform float uBlendSoftness;\nuniform float uRotationAmount;\nuniform float uNoiseScale;\nuniform float uGrainAmount;\nuniform float uGrainScale;\nuniform float uGrainAnimated;\nuniform float uContrast;\nuniform float uGamma;\nuniform float uSaturation;\nuniform vec2 uCenterOffset;\nuniform float uZoom;\nuniform vec3 uColor1;\nuniform vec3 uColor2;\nuniform vec3 uColor3;\nuniform float uLightMode;\nout vec4 fragColor;\n#define S(a,b,t) smoothstep(a,b,t)\nmat2 Rot(float a){float s=sin(a),c=cos(a);return mat2(c,-s,s,c);}\nvec2 hash(vec2 p){p=vec2(dot(p,vec2(2127.1,81.17)),dot(p,vec2(1269.5,283.37)));return fract(sin(p)*43758.5453);}\nfloat noise(vec2 p){vec2 i=floor(p),f=fract(p),u=f*f*(3.0-2.0*f);float n=mix(mix(dot(-1.0+2.0*hash(i+vec2(0.0,0.0)),f-vec2(0.0,0.0)),dot(-1.0+2.0*hash(i+vec2(1.0,0.0)),f-vec2(1.0,0.0)),u.x),mix(dot(-1.0+2.0*hash(i+vec2(0.0,1.0)),f-vec2(0.0,1.0)),dot(-1.0+2.0*hash(i+vec2(1.0,1.0)),f-vec2(1.0,1.0)),u.x),u.y);return 0.5+0.5*n;}\nvoid mainImage(out vec4 o, vec2 C){\n float t=iTime*uTimeSpeed;\n vec2 uv=C/iResolution.xy;\n float ratio=iResolution.x/iResolution.y;\n vec2 tuv=uv-0.5+uCenterOffset;\n tuv/=max(uZoom,0.001);\n\n float degree=noise(vec2(t*0.1,tuv.x*tuv.y)*uNoiseScale);\n tuv.y*=1.0/ratio;\n tuv*=Rot(radians((degree-0.5)*uRotationAmount+180.0));\n tuv.y*=ratio;\n\n float frequency=uWarpFrequency;\n float ws=max(uWarpStrength,0.001);\n float amplitude=uWarpAmplitude/ws;\n float warpTime=t*uWarpSpeed;\n tuv.x+=sin(tuv.y*frequency+warpTime)/amplitude;\n tuv.y+=sin(tuv.x*(frequency*1.5)+warpTime)/(amplitude*0.5);\n\n vec3 colLav=uColor1;\n vec3 colOrg=uColor2;\n vec3 colDark=uColor3;\n float b=uColorBalance;\n float s=max(uBlendSoftness,0.0);\n mat2 blendRot=Rot(radians(uBlendAngle));\n float blendX=(tuv*blendRot).x;\n float edge0=-0.3-b-s;\n float edge1=0.2-b+s;\n float v0=0.5-b+s;\n float v1=-0.3-b-s;\n vec3 layer1=mix(colDark,colOrg,S(edge0,edge1,blendX));\n vec3 layer2=mix(colOrg,colLav,S(edge0,edge1,blendX));\n vec3 col=mix(layer1,layer2,S(v0,v1,tuv.y));\n\n vec2 grainUv=uv*max(uGrainScale,0.001);\n if(uGrainAnimated>0.5){grainUv+=vec2(iTime*0.05);}\n float grain=fract(sin(dot(grainUv,vec2(12.9898,78.233)))*43758.5453);\n col+=(grain-0.5)*uGrainAmount;\n\n col=(col-0.5)*uContrast+0.5;\n float luma=dot(col,vec3(0.2126,0.7152,0.0722));\n col=mix(vec3(luma),col,uSaturation);\n col=pow(max(col,0.0),vec3(1.0/max(uGamma,0.001)));\n col=clamp(col,0.0,1.0);\n if(uLightMode>0.5){\n float energy=max(max(col.r,col.g),col.b);\n vec3 hue=col/max(energy,0.001);\n float chroma=length(col-vec3(dot(col,vec3(0.333333))));\n float coverage=clamp(0.12+chroma*1.15+energy*0.18,0.0,0.88);\n col=mix(vec3(1.0),clamp(hue*0.58+col*0.18,0.0,1.0),coverage);\n }\n\n o=vec4(col,1.0);\n}\nvoid main(){\n vec4 o=vec4(0.0);\n mainImage(o,gl_FragCoord.xy);\n fragColor=o;\n}\n`;\n\nexport const hexToRgb = (hex: string): [number, number, number] => {\n let value = hex.trim().replace('#', '');\n if (value.length === 3) value = [...value].map((c) => c + c).join('');\n const result = /^([\\da-f]{2})([\\da-f]{2})([\\da-f]{2})$/i.exec(value);\n if (!result) return [1, 1, 1];\n return [\n Number.parseInt(result[1], 16) / 255,\n Number.parseInt(result[2], 16) / 255,\n Number.parseInt(result[3], 16) / 255,\n ];\n};\n\nconst compile = (gl: WebGL2RenderingContext, type: number, source: string) => {\n const shader = gl.createShader(type);\n if (!shader) return null;\n gl.shaderSource(shader, source);\n gl.compileShader(shader);\n if (!gl.getShaderParameter(shader, gl.COMPILE_STATUS)) {\n gl.deleteShader(shader);\n return null;\n }\n return shader;\n};\n\n/**\n * Animated grainy gradient (WebGL2, no extra dependency). Fills its nearest positioned ancestor,\n * pauses when off-screen or the tab is hidden, and draws one still frame when reduced motion is\n * preferred. Without WebGL2 it renders nothing, so give the parent a fallback background.\n */\nconst Grainient = memo<GrainientProps>(\n ({\n timeSpeed = 0.25,\n colorBalance = 0,\n warpStrength = 1,\n warpFrequency = 5,\n warpSpeed = 2,\n warpAmplitude = 50,\n blendAngle = 0,\n blendSoftness = 0.05,\n rotationAmount = 500,\n noiseScale = 2,\n grainAmount = 0.1,\n grainScale = 2,\n contrast = 1.5,\n gamma = 1,\n saturation = 1,\n zoom = 0.9,\n centerX = 0,\n centerY = 0,\n color1 = '#FF9FFC',\n color2 = '#5227FF',\n color3 = '#B497CF',\n grainAnimated = false,\n lightMode = false,\n className,\n style,\n ...rest\n }) => {\n const containerRef = useRef<HTMLDivElement>(null);\n const drawRef = useRef<(() => void) | null>(null);\n const uniformsRef = useRef<(() => void) | null>(null);\n const { isDarkMode } = useThemeMode();\n const light = lightMode === 'auto' ? !isDarkMode : lightMode;\n\n useEffect(() => {\n const container = containerRef.current;\n if (!container) return;\n\n const canvas = document.createElement('canvas');\n canvas.className = stylex.props(styles.canvas).className ?? '';\n const gl = canvas.getContext('webgl2', { alpha: true, antialias: false });\n if (!gl) return;\n container.append(canvas);\n\n const vs = compile(gl, gl.VERTEX_SHADER, VERTEX_SHADER);\n const fs = compile(gl, gl.FRAGMENT_SHADER, FRAGMENT_SHADER);\n const program = gl.createProgram();\n if (!vs || !fs || !program) {\n canvas.remove();\n return;\n }\n gl.attachShader(program, vs);\n gl.attachShader(program, fs);\n gl.linkProgram(program);\n if (!gl.getProgramParameter(program, gl.LINK_STATUS)) {\n canvas.remove();\n return;\n }\n gl.useProgram(program);\n\n // One triangle that covers the viewport.\n const buffer = gl.createBuffer();\n gl.bindBuffer(gl.ARRAY_BUFFER, buffer);\n gl.bufferData(gl.ARRAY_BUFFER, new Float32Array([-1, -1, 3, -1, -1, 3]), gl.STATIC_DRAW);\n const position = gl.getAttribLocation(program, 'position');\n gl.enableVertexAttribArray(position);\n gl.vertexAttribPointer(position, 2, gl.FLOAT, false, 0, 0);\n\n const loc = (name: string) => gl.getUniformLocation(program, name);\n const uTime = loc('iTime');\n const uRes = loc('iResolution');\n const started = performance.now();\n\n const draw = () => {\n gl.uniform1f(uTime, (performance.now() - started) * 0.001);\n gl.drawArrays(gl.TRIANGLES, 0, 3);\n };\n drawRef.current = draw;\n uniformsRef.current?.();\n\n const setSize = () => {\n const rect = container.getBoundingClientRect();\n const dpr = Math.min(window.devicePixelRatio || 1, 2);\n canvas.width = Math.max(1, Math.floor(rect.width * dpr));\n canvas.height = Math.max(1, Math.floor(rect.height * dpr));\n gl.viewport(0, 0, canvas.width, canvas.height);\n gl.uniform2f(uRes, canvas.width, canvas.height);\n draw();\n };\n\n const reducedMotion = window.matchMedia?.('(prefers-reduced-motion: reduce)');\n let raf = 0;\n let inView = true;\n\n const loop = () => {\n draw();\n raf = requestAnimationFrame(loop);\n };\n const stop = () => {\n if (raf) cancelAnimationFrame(raf);\n raf = 0;\n };\n const sync = () => {\n const run = inView && !document.hidden && !reducedMotion?.matches;\n if (run && !raf) raf = requestAnimationFrame(loop);\n if (!run) {\n stop();\n draw();\n }\n };\n\n const resizeObserver = new ResizeObserver(setSize);\n resizeObserver.observe(container);\n const intersectionObserver = new IntersectionObserver(([entry]) => {\n inView = entry.isIntersecting;\n sync();\n });\n intersectionObserver.observe(container);\n document.addEventListener('visibilitychange', sync);\n reducedMotion?.addEventListener('change', sync);\n setSize();\n sync();\n\n return () => {\n stop();\n resizeObserver.disconnect();\n intersectionObserver.disconnect();\n document.removeEventListener('visibilitychange', sync);\n reducedMotion?.removeEventListener('change', sync);\n drawRef.current = null;\n gl.deleteBuffer(buffer);\n gl.deleteProgram(program);\n gl.deleteShader(vs);\n gl.deleteShader(fs);\n canvas.remove();\n };\n }, []);\n\n useEffect(() => {\n const apply = () => {\n const canvas = containerRef.current?.querySelector('canvas');\n const gl = canvas?.getContext('webgl2');\n if (!gl) return;\n const program = gl.getParameter(gl.CURRENT_PROGRAM) as WebGLProgram | null;\n if (!program) return;\n const loc = (name: string) => gl.getUniformLocation(program, name);\n gl.uniform1f(loc('uTimeSpeed'), timeSpeed);\n gl.uniform1f(loc('uColorBalance'), colorBalance);\n gl.uniform1f(loc('uWarpStrength'), warpStrength);\n gl.uniform1f(loc('uWarpFrequency'), warpFrequency);\n gl.uniform1f(loc('uWarpSpeed'), warpSpeed);\n gl.uniform1f(loc('uWarpAmplitude'), warpAmplitude);\n gl.uniform1f(loc('uBlendAngle'), blendAngle);\n gl.uniform1f(loc('uBlendSoftness'), blendSoftness);\n gl.uniform1f(loc('uRotationAmount'), rotationAmount);\n gl.uniform1f(loc('uNoiseScale'), noiseScale);\n gl.uniform1f(loc('uGrainAmount'), grainAmount);\n gl.uniform1f(loc('uGrainScale'), grainScale);\n gl.uniform1f(loc('uContrast'), contrast);\n gl.uniform1f(loc('uGamma'), gamma);\n gl.uniform1f(loc('uSaturation'), saturation);\n gl.uniform1f(loc('uZoom'), zoom);\n gl.uniform1f(loc('uGrainAnimated'), grainAnimated ? 1 : 0);\n gl.uniform1f(loc('uLightMode'), light ? 1 : 0);\n gl.uniform2f(loc('uCenterOffset'), centerX, centerY);\n gl.uniform3f(loc('uColor1'), ...hexToRgb(color1));\n gl.uniform3f(loc('uColor2'), ...hexToRgb(color2));\n gl.uniform3f(loc('uColor3'), ...hexToRgb(color3));\n drawRef.current?.();\n };\n uniformsRef.current = apply;\n apply();\n }, [\n timeSpeed,\n colorBalance,\n warpStrength,\n warpFrequency,\n warpSpeed,\n warpAmplitude,\n blendAngle,\n blendSoftness,\n rotationAmount,\n noiseScale,\n grainAmount,\n grainScale,\n contrast,\n gamma,\n saturation,\n zoom,\n centerX,\n centerY,\n color1,\n color2,\n color3,\n grainAnimated,\n light,\n ]);\n\n return (\n <div\n aria-hidden\n ref={containerRef}\n {...rest}\n {...styleProps(styles.root, className, style)}\n />\n );\n },\n);\n\nGrainient.displayName = 'Grainient';\n\nexport default Grainient;\n"],"mappings":";;;;;;;;AAQA,MAAM,gBAAgB;;;;;;AAMtB,MAAM,kBAAkB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA2FxB,MAAa,YAAY,QAA0C;CACjE,IAAI,QAAQ,IAAI,KAAK,CAAC,CAAC,QAAQ,KAAK,EAAE;CACtC,IAAI,MAAM,WAAW,GAAG,QAAQ,CAAC,GAAG,KAAK,CAAC,CAAC,KAAI,MAAK,IAAI,CAAC,CAAC,CAAC,KAAK,EAAE;CAClE,MAAM,SAAS,0CAA0C,KAAK,KAAK;CACnE,IAAI,CAAC,QAAQ,OAAO;EAAC;EAAG;EAAG;CAAC;CAC5B,OAAO;EAAC,OAAO,SAAS,OAAO,IAAI,EAAE,IAAI;EAAK,OAAO,SAAS,OAAO,IAAI,EAAE,IAAI;EAAK,OAAO,SAAS,OAAO,IAAI,EAAE,IAAI;CAAG;AAC1H;AACA,MAAM,WAAW,IAA4B,MAAc,WAAmB;CAC5E,MAAM,SAAS,GAAG,aAAa,IAAI;CACnC,IAAI,CAAC,QAAQ,OAAO;CACpB,GAAG,aAAa,QAAQ,MAAM;CAC9B,GAAG,cAAc,MAAM;CACvB,IAAI,CAAC,GAAG,mBAAmB,QAAQ,GAAG,cAAc,GAAG;EACrD,GAAG,aAAa,MAAM;EACtB,OAAO;CACT;CACA,OAAO;AACT;;;;;;AAOA,MAAM,YAAY,MAAsB,EACtC,YAAY,KACZ,eAAe,GACf,e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|
+
kVAEAm: "lb10l6tqk",
|
|
9
|
+
$$css: true
|
|
10
|
+
},
|
|
11
|
+
root: {
|
|
12
|
+
kpwlN0: "lb10a8y8t",
|
|
13
|
+
kVQacm: "lbb3r6kr",
|
|
14
|
+
kfzvcC: "lb47corl",
|
|
15
|
+
kVAEAm: "lb10l6tqk",
|
|
16
|
+
kY2c9j: "lb1ja2u2z",
|
|
17
|
+
$$css: true
|
|
18
|
+
}
|
|
19
|
+
};
|
|
20
|
+
//#endregion
|
|
21
|
+
export { styles };
|
|
22
|
+
|
|
23
|
+
//# sourceMappingURL=style.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"style.mjs","names":[],"sources":["../../../src/awesome/Grainient/style.ts"],"sourcesContent":["import * as stylex from '@stylexjs/stylex';\n\nexport const styles = stylex.create({\n canvas: {\n inset: 0,\n blockSize: '100%',\n display: 'block',\n inlineSize: '100%',\n position: 'absolute',\n },\n root: {\n inset: 0,\n overflow: 'hidden',\n pointerEvents: 'none',\n position: 'absolute',\n zIndex: 0,\n },\n});\n"],"mappings":";AACA,MAAa,SAAS;CACpB,QAAQ;EACN,QAAQ;EACR,QAAQ;EACR,QAAQ;EACR,QAAQ;EACR,QAAQ;EACR,OAAO;CACT;CACA,MAAM;EACJ,QAAQ;EACR,QAAQ;EACR,QAAQ;EACR,QAAQ;EACR,QAAQ;EACR,OAAO;CACT;AACF"}
|
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
import { DivProps } from "../../types/index.mjs";
|
|
2
|
+
//#region src/awesome/Grainient/type.d.ts
|
|
3
|
+
export interface GrainientProps extends DivProps {
|
|
4
|
+
/**
|
|
5
|
+
* Angle of the color blend, in degrees.
|
|
6
|
+
* @default 0
|
|
7
|
+
*/
|
|
8
|
+
blendAngle?: number;
|
|
9
|
+
/**
|
|
10
|
+
* Softness of the color edges.
|
|
11
|
+
* @default 0.05
|
|
12
|
+
*/
|
|
13
|
+
blendSoftness?: number;
|
|
14
|
+
/**
|
|
15
|
+
* Horizontal offset of the field center.
|
|
16
|
+
* @default 0
|
|
17
|
+
*/
|
|
18
|
+
centerX?: number;
|
|
19
|
+
/**
|
|
20
|
+
* Vertical offset of the field center.
|
|
21
|
+
* @default 0
|
|
22
|
+
*/
|
|
23
|
+
centerY?: number;
|
|
24
|
+
/**
|
|
25
|
+
* First color stop, as hex.
|
|
26
|
+
* @default '#FF9FFC'
|
|
27
|
+
*/
|
|
28
|
+
color1?: string;
|
|
29
|
+
/**
|
|
30
|
+
* Second color stop, as hex.
|
|
31
|
+
* @default '#5227FF'
|
|
32
|
+
*/
|
|
33
|
+
color2?: string;
|
|
34
|
+
/**
|
|
35
|
+
* Third color stop, as hex.
|
|
36
|
+
* @default '#B497CF'
|
|
37
|
+
*/
|
|
38
|
+
color3?: string;
|
|
39
|
+
/**
|
|
40
|
+
* Shifts the blend toward color1 (negative) or color3 (positive).
|
|
41
|
+
* @default 0
|
|
42
|
+
*/
|
|
43
|
+
colorBalance?: number;
|
|
44
|
+
/**
|
|
45
|
+
* Output contrast.
|
|
46
|
+
* @default 1.5
|
|
47
|
+
*/
|
|
48
|
+
contrast?: number;
|
|
49
|
+
/**
|
|
50
|
+
* Output gamma.
|
|
51
|
+
* @default 1
|
|
52
|
+
*/
|
|
53
|
+
gamma?: number;
|
|
54
|
+
/**
|
|
55
|
+
* Film grain strength. 0 turns it off.
|
|
56
|
+
* @default 0.1
|
|
57
|
+
*/
|
|
58
|
+
grainAmount?: number;
|
|
59
|
+
/**
|
|
60
|
+
* Animate the grain with time.
|
|
61
|
+
* @default false
|
|
62
|
+
*/
|
|
63
|
+
grainAnimated?: boolean;
|
|
64
|
+
/**
|
|
65
|
+
* Film grain scale.
|
|
66
|
+
* @default 2
|
|
67
|
+
*/
|
|
68
|
+
grainScale?: number;
|
|
69
|
+
/**
|
|
70
|
+
* Wash the colors toward white for a light surface. `'auto'` follows the current theme.
|
|
71
|
+
* @default false
|
|
72
|
+
*/
|
|
73
|
+
lightMode?: boolean | 'auto';
|
|
74
|
+
/**
|
|
75
|
+
* Scale of the rotation noise.
|
|
76
|
+
* @default 2
|
|
77
|
+
*/
|
|
78
|
+
noiseScale?: number;
|
|
79
|
+
/**
|
|
80
|
+
* Noise-driven rotation, in degrees.
|
|
81
|
+
* @default 500
|
|
82
|
+
*/
|
|
83
|
+
rotationAmount?: number;
|
|
84
|
+
/**
|
|
85
|
+
* Output saturation.
|
|
86
|
+
* @default 1
|
|
87
|
+
*/
|
|
88
|
+
saturation?: number;
|
|
89
|
+
/**
|
|
90
|
+
* Animation speed. A still frame is drawn when reduced motion is preferred.
|
|
91
|
+
* @default 0.25
|
|
92
|
+
*/
|
|
93
|
+
timeSpeed?: number;
|
|
94
|
+
/**
|
|
95
|
+
* Warp amplitude divisor; higher is calmer.
|
|
96
|
+
* @default 50
|
|
97
|
+
*/
|
|
98
|
+
warpAmplitude?: number;
|
|
99
|
+
/**
|
|
100
|
+
* Frequency of the warp waves.
|
|
101
|
+
* @default 5
|
|
102
|
+
*/
|
|
103
|
+
warpFrequency?: number;
|
|
104
|
+
/**
|
|
105
|
+
* Speed of the warp waves.
|
|
106
|
+
* @default 2
|
|
107
|
+
*/
|
|
108
|
+
warpSpeed?: number;
|
|
109
|
+
/**
|
|
110
|
+
* How strongly the field is warped.
|
|
111
|
+
* @default 1
|
|
112
|
+
*/
|
|
113
|
+
warpStrength?: number;
|
|
114
|
+
/**
|
|
115
|
+
* Zoom of the field.
|
|
116
|
+
* @default 0.9
|
|
117
|
+
*/
|
|
118
|
+
zoom?: number;
|
|
119
|
+
}
|
|
120
|
+
//#endregion
|
|
121
|
+
//# sourceMappingURL=type.d.mts.map
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
import { styleProps } from "../../styles/stylex/props.mjs";
|
|
3
3
|
import { cssVar } from "../../styles/stylex/cssVar.stylex.mjs";
|
|
4
4
|
import { useTheme } from "../../styles/theme/scope.mjs";
|
|
5
|
+
import { useSize } from "../../hooks/useSize.mjs";
|
|
5
6
|
import Grid from "./components/Grid.mjs";
|
|
6
7
|
import { styles } from "./style.mjs";
|
|
7
8
|
import { memo, useCallback, useEffect, useMemo, useRef, useState } from "react";
|
|
@@ -9,7 +10,6 @@ import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
|
|
|
9
10
|
import * as stylex from "@stylexjs/stylex";
|
|
10
11
|
import { shuffle } from "es-toolkit/compat";
|
|
11
12
|
import chroma from "chroma-js";
|
|
12
|
-
import { useSize } from "ahooks";
|
|
13
13
|
//#region src/awesome/GridBackground/GridBackground.tsx
|
|
14
14
|
const initialGroup = [
|
|
15
15
|
0,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GridBackground.mjs","names":[],"sources":["../../../src/awesome/GridBackground/GridBackground.tsx"],"sourcesContent":["'use client';\n\nimport * as stylex from '@stylexjs/stylex';\nimport
|
|
1
|
+
{"version":3,"file":"GridBackground.mjs","names":[],"sources":["../../../src/awesome/GridBackground/GridBackground.tsx"],"sourcesContent":["'use client';\n\nimport * as stylex from '@stylexjs/stylex';\nimport chroma from 'chroma-js';\nimport { shuffle } from 'es-toolkit/compat';\nimport { memo, useCallback, useEffect, useMemo, useRef, useState } from 'react';\n\nimport { useSize } from '@/hooks/useSize';\nimport { cssVar } from '@/styles/stylex/cssVar.stylex';\nimport { styleProps } from '@/styles/stylex/props';\nimport { useTheme } from '@/styles/theme/scope';\n\nimport Grid, { type GridProps } from './components/Grid';\nimport { styles } from './style';\nimport type { GridBackgroundProps } from './type';\n\nconst initialGroup = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14];\n\nconst GridBackground = memo<GridBackgroundProps>(\n ({\n flip,\n reverse,\n showBackground,\n backgroundColor,\n random,\n animationDuration = 8,\n className,\n colorFront,\n colorBack,\n strokeWidth,\n style,\n animation,\n ...rest\n }) => {\n const ref = useRef(null);\n const size = useSize(ref);\n const theme = useTheme();\n\n const backgroundCssVariables = useMemo<Record<string, string>>(() => {\n if (!showBackground) return {} as Record<string, string>;\n\n const scale = chroma\n .bezier([theme.colorText, backgroundColor || 'blue', theme.colorBgLayout])\n .scale()\n .mode('lch')\n .correctLightness()\n .colors(6);\n\n return {\n '--grid-background-color-1': scale[1],\n '--grid-background-color-2': scale[2],\n '--grid-background-color-3': scale[3],\n '--grid-background-color-4': scale[4],\n };\n }, [showBackground, backgroundColor, theme.colorText, theme.colorBgLayout]);\n\n const gridProps: GridProps = useMemo(\n () => ({\n className: stylex.props(styles.highlight, reverse && styles.highlightReverse).className,\n color: colorFront || cssVar.colorText,\n strokeWidth,\n }),\n [reverse, colorFront, strokeWidth],\n );\n\n const [group, setGroup] = useState(random ? initialGroup : undefined);\n useEffect(() => {\n setGroup(random ? shuffle(initialGroup) : undefined);\n }, [random]);\n\n const HighlightGrid = useCallback(() => {\n if (!group)\n return <Grid style={{ '--duration': `${animationDuration}s` } as any} {...gridProps} />;\n\n return (\n <>\n {group.map((item, index) => {\n return (\n <Grid\n key={item}\n linePick={item}\n style={\n {\n '--delay': `${index + Math.random()}s`,\n '--duration': `${animationDuration}s`,\n } as any\n }\n {...gridProps}\n />\n );\n })}\n </>\n );\n }, [group, animationDuration, gridProps]);\n\n return (\n <div\n {...styleProps(\n styles.container,\n className,\n flip ? { transform: 'scaleY(-1)', ...style } : style,\n )}\n ref={ref}\n {...rest}\n >\n <Grid\n color={colorBack || cssVar.colorBorder}\n strokeWidth={strokeWidth}\n style={{ zIndex: 2 }}\n />\n {animation && <HighlightGrid />}\n {showBackground && (\n <div\n {...stylex.props(styles.backgroundContainer)}\n style={{\n ...(size ? { fontSize: size.width / 80 } : {}),\n ...backgroundCssVariables,\n }}\n >\n <div {...stylex.props(styles.backgroundShape)} />\n </div>\n )}\n </div>\n );\n },\n);\n\nGridBackground.displayName = 'GridBackground';\n\nexport default GridBackground;\n"],"mappings":";;;;;;;;;;;;;AAaA,MAAM,eAAe;CAAC;CAAG;CAAG;CAAG;CAAG;CAAG;CAAG;CAAG;C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