@unicom-cloud/ui-common 0.1.47 → 0.1.48
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/.virtual/_rolldown/runtime.js +1 -1
- package/animation/Animation.js +1 -1
- package/animation/constants.js +1 -1
- package/animation/context.js +1 -1
- package/animation/index.js +1 -1
- package/animation/style/index.js +1 -1
- package/animation/utils.js +1 -1
- package/base/Base.js +1 -1
- package/base/constants.js +1 -1
- package/base/context.js +1 -1
- package/base/index.js +1 -1
- package/base/style/index.js +1 -1
- package/base/utils.js +1 -1
- package/border-beam/BorderBeam.js +1 -1
- package/border-beam/Effect.js +1 -1
- package/border-beam/constants.js +1 -1
- package/border-beam/context.js +1 -1
- package/border-beam/hooks/useBorderSize.js +1 -1
- package/border-beam/hooks/useChildDom.js +1 -1
- package/border-beam/index.js +1 -1
- package/border-beam/style/index.js +1 -1
- package/border-beam/utils.js +1 -1
- package/development/Development.js +1 -1
- package/development/constants.js +1 -1
- package/development/context.js +1 -1
- package/development/index.js +1 -1
- package/development/style/index.js +1 -1
- package/development/utils.js +1 -1
- package/empty/Empty.js +1 -1
- package/empty/constants.js +1 -1
- package/empty/context.js +1 -1
- package/empty/index.js +1 -1
- package/empty/style/index.js +1 -1
- package/empty/utils.js +1 -1
- package/flex/Flex.js +1 -1
- package/flex/FlexVertical.js +1 -1
- package/flex/constants.js +1 -1
- package/flex/context.js +1 -1
- package/flex/index.js +1 -1
- package/flex/style/index.js +1 -1
- package/flex/utils.js +1 -1
- package/grid/Grid.js +1 -1
- package/grid/Item.js +1 -1
- package/grid/constants.js +1 -1
- package/grid/context.js +1 -1
- package/grid/index.js +1 -1
- package/grid/style/index.js +1 -1
- package/grid/utils.js +1 -1
- package/higher-order/index.js +1 -1
- package/higher-order/with-speech-synthesis/context.js +1 -1
- package/higher-order/with-speech-synthesis/index.js +1 -1
- package/higher-order/with-speech-synthesis/style/index.js +1 -1
- package/higher-order/with-speech-synthesis/withSpeechSynthesis.js +1 -1
- package/hoc/withContext.js +1 -1
- package/hooks/create-deep-compare-effect/index.js +1 -1
- package/hooks/create-update-effect/index.js +1 -1
- package/hooks/create-use-storage-state/index.js +1 -1
- package/hooks/index.js +1 -1
- package/hooks/use-async-effect/index.js +1 -1
- package/hooks/use-boolean/index.js +1 -1
- package/hooks/use-click-away/index.js +1 -1
- package/hooks/use-computed-state/index.d.ts +1 -1
- package/hooks/use-computed-state/index.js +1 -1
- package/hooks/use-controllable-value/index.js +1 -1
- package/hooks/use-cookie-state/index.js +1 -1
- package/hooks/use-count-down/index.js +1 -1
- package/hooks/use-counter/index.js +1 -1
- package/hooks/use-create/index.js +1 -1
- package/hooks/use-creation/index.js +1 -1
- package/hooks/use-debounce/index.js +1 -1
- package/hooks/use-debounce-effect/index.js +1 -1
- package/hooks/use-debounce-fn/index.js +1 -1
- package/hooks/use-deep-compare-effect/index.js +1 -1
- package/hooks/use-deep-compare-layout-effect/index.js +1 -1
- package/hooks/use-document-visibility/index.js +1 -1
- package/hooks/use-drag/index.js +1 -1
- package/hooks/use-drag-move/index.js +1 -1
- package/hooks/use-drop/index.js +1 -1
- package/hooks/use-effect-event/index.js +1 -1
- package/hooks/use-event/index.js +1 -1
- package/hooks/use-event-emitter/index.js +1 -1
- package/hooks/use-event-listener/index.js +1 -1
- package/hooks/use-event-target/index.js +1 -1
- package/hooks/use-external/index.js +1 -1
- package/hooks/use-favicon/index.js +1 -1
- package/hooks/use-focus-within/index.js +1 -1
- package/hooks/use-force-update/index.js +1 -1
- package/hooks/use-fullscreen/index.js +1 -1
- package/hooks/use-get-state/index.js +1 -1
- package/hooks/use-history-travel/index.js +1 -1
- package/hooks/use-hover/index.js +1 -1
- package/hooks/use-id/index.js +1 -1
- package/hooks/use-in-viewport/index.js +1 -1
- package/hooks/use-infinite-scroll/index.js +1 -1
- package/hooks/use-intersection-observer/index.js +1 -1
- package/hooks/use-intersection-observers/index.js +16 -11
- package/hooks/use-interval/index.js +1 -1
- package/hooks/use-is-first-render/index.js +1 -1
- package/hooks/use-isomorphic-layout-effect/index.js +1 -1
- package/hooks/use-key-press/index.js +1 -1
- package/hooks/use-keyboard-event/index.js +1 -1
- package/hooks/use-latest/index.js +1 -1
- package/hooks/use-listen-window-resize/index.js +1 -1
- package/hooks/use-local-storage-state/index.js +1 -1
- package/hooks/use-lock-fn/index.js +1 -1
- package/hooks/use-long-press/index.js +1 -1
- package/hooks/use-map/index.js +1 -1
- package/hooks/use-media/index.js +1 -1
- package/hooks/use-memo/index.js +1 -1
- package/hooks/use-memoized-fn/index.js +1 -1
- package/hooks/use-merge-component-props/index.js +1 -1
- package/hooks/use-merge-value/index.js +1 -1
- package/hooks/use-mobile/index.js +1 -1
- package/hooks/use-mount/index.js +1 -1
- package/hooks/use-mouse/index.js +1 -1
- package/hooks/use-move/index.js +1 -1
- package/hooks/use-mutation-observer/index.js +1 -1
- package/hooks/use-mutation-observers/index.js +15 -10
- package/hooks/use-network/index.js +1 -1
- package/hooks/use-online-status/index.js +1 -1
- package/hooks/use-overflow-hidden/index.js +1 -1
- package/hooks/use-override-ref/index.js +1 -1
- package/hooks/use-pagination/index.js +1 -1
- package/hooks/use-paste-image/index.js +1 -1
- package/hooks/use-persist-callback/index.js +1 -1
- package/hooks/use-prefers-color-scheme-dark/index.js +1 -1
- package/hooks/use-previous/index.d.ts +1 -1
- package/hooks/use-previous/index.js +1 -1
- package/hooks/use-raf-interval/index.js +1 -1
- package/hooks/use-raf-state/index.js +1 -1
- package/hooks/use-raf-timeout/index.js +1 -1
- package/hooks/use-reactive/index.js +1 -1
- package/hooks/use-ref-latest/index.js +1 -1
- package/hooks/use-ref-map/index.js +1 -1
- package/hooks/use-refs/index.js +1 -1
- package/hooks/use-request/index.js +1 -1
- package/hooks/use-request/src/Fetch.js +1 -1
- package/hooks/use-request/src/plugins/useAutoRunPlugin.js +1 -1
- package/hooks/use-request/src/plugins/useCachePlugin.js +1 -1
- package/hooks/use-request/src/plugins/useDebouncePlugin.js +1 -1
- package/hooks/use-request/src/plugins/useLoadingDelayPlugin.js +1 -1
- package/hooks/use-request/src/plugins/usePollingPlugin.js +1 -1
- package/hooks/use-request/src/plugins/useRefreshOnWindowFocusPlugin.js +1 -1
- package/hooks/use-request/src/plugins/useRetryPlugin.js +1 -1
- package/hooks/use-request/src/plugins/useThrottlePlugin.js +1 -1
- package/hooks/use-request/src/useRequest.js +1 -1
- package/hooks/use-request/src/useRequestImplement.js +1 -1
- package/hooks/use-request/src/utils/cache.js +1 -1
- package/hooks/use-request/src/utils/cachePromise.js +1 -1
- package/hooks/use-request/src/utils/cacheSubscribe.js +1 -1
- package/hooks/use-request/src/utils/isDocumentVisible.js +1 -1
- package/hooks/use-request/src/utils/isOnline.js +1 -1
- package/hooks/use-request/src/utils/limit.js +1 -1
- package/hooks/use-request/src/utils/subscribeFocus.js +1 -1
- package/hooks/use-request/src/utils/subscribeReVisible.js +1 -1
- package/hooks/use-reset-state/index.js +1 -1
- package/hooks/use-resize-observer/index.js +1 -1
- package/hooks/use-resize-observers/index.js +16 -11
- package/hooks/use-responsive/index.js +1 -1
- package/hooks/use-safe-state/index.js +1 -1
- package/hooks/use-scroll/index.js +1 -1
- package/hooks/use-selections/index.js +1 -1
- package/hooks/use-session-storage-state/index.js +1 -1
- package/hooks/use-set/index.js +1 -1
- package/hooks/use-set-state/index.js +1 -1
- package/hooks/use-size/index.js +1 -1
- package/hooks/use-state-callback/index.js +1 -1
- package/hooks/use-state-with-promise/index.js +1 -1
- package/hooks/use-sync-state/index.js +1 -1
- package/hooks/use-text-selection/index.js +1 -1
- package/hooks/use-theme/index.js +1 -1
- package/hooks/use-throttle/index.js +1 -1
- package/hooks/use-throttle-effect/index.js +1 -1
- package/hooks/use-throttle-fn/index.js +1 -1
- package/hooks/use-throttle-fn-with-raf/index.js +1 -1
- package/hooks/use-timeout/index.js +1 -1
- package/hooks/use-title/index.js +1 -1
- package/hooks/use-toggle/index.js +1 -1
- package/hooks/use-tracked-effect/index.js +1 -1
- package/hooks/use-unmount/index.js +1 -1
- package/hooks/use-unmounted-ref/index.js +1 -1
- package/hooks/use-update/index.js +1 -1
- package/hooks/use-update-effect/index.js +1 -1
- package/hooks/use-update-layout-effect/index.js +1 -1
- package/hooks/use-url-state/index.js +1 -1
- package/hooks/use-virtual-list/index.js +1 -1
- package/hooks/use-watch/index.d.ts +1 -1
- package/hooks/use-watch/index.js +1 -1
- package/hooks/use-web-socket/index.js +1 -1
- package/hooks/use-why-did-you-update/index.js +1 -1
- package/hooks/use-window-size/index.js +1 -1
- package/hooks/utils/createEffectWithTarget.js +1 -1
- package/hooks/utils/depsAreSame.js +1 -1
- package/hooks/utils/depsEqual.js +1 -1
- package/hooks/utils/domTarget.js +1 -1
- package/hooks/utils/getDocumentOrShadow.js +1 -1
- package/hooks/utils/index.js +1 -1
- package/hooks/utils/isAppleDevice.js +1 -1
- package/hooks/utils/isBrowser.js +1 -1
- package/hooks/utils/isDev.js +1 -1
- package/hooks/utils/rect.js +1 -1
- package/hooks/utils/useDeepCompareWithTarget.js +1 -1
- package/hooks/utils/useEffectWithTarget.js +1 -1
- package/hooks/utils/useIsomorphicLayoutEffectWithTarget.js +1 -1
- package/hooks/utils/useLayoutEffectWithTarget.js +1 -1
- package/icons/file/File.js +1 -1
- package/icons/file/context.js +1 -1
- package/icons/file/index.js +1 -1
- package/icons/file/style/index.js +1 -1
- package/index.d.ts +0 -2
- package/index.js +208 -208
- package/morphicons/core/interpolate.js +1 -1
- package/morphicons/core/normalize.js +1 -1
- package/morphicons/core/resample.js +1 -1
- package/morphicons/core/serialize.js +1 -1
- package/morphicons/core/spring.js +1 -1
- package/morphicons/dom/index.js +111 -0
- package/morphicons/index.d.ts +1 -0
- package/morphicons/index.js +3 -2
- package/morphicons/react/index.js +104 -0
- package/package.json +1 -1
- package/progress/Progress.js +1 -1
- package/progress/constants.js +1 -1
- package/progress/context.js +1 -1
- package/progress/index.js +1 -1
- package/progress/style/index.js +1 -1
- package/progress/utils.js +1 -1
- package/resize-observer/Collection.js +1 -1
- package/resize-observer/ResizeObserver.js +1 -1
- package/resize-observer/SingleObserver.js +1 -1
- package/resize-observer/constants.js +1 -1
- package/resize-observer/context.js +1 -1
- package/resize-observer/index.js +1 -1
- package/resize-observer/observerUtil.js +1 -1
- package/resize-observer/style/index.js +1 -1
- package/resize-observer/utils.js +1 -1
- package/space/Space.js +1 -1
- package/space/SpaceVertical.js +1 -1
- package/space/constants.js +1 -1
- package/space/context.js +1 -1
- package/space/index.js +1 -1
- package/space/style/index.js +1 -1
- package/space/utils.js +1 -1
- package/style/global.less +9 -0
- package/style.css +1 -1
- package/suspense-fallback-test/SuspenseFallbackTest.js +1 -1
- package/suspense-fallback-test/constants.js +1 -1
- package/suspense-fallback-test/context.js +1 -1
- package/suspense-fallback-test/index.js +1 -1
- package/suspense-fallback-test/style/index.js +1 -1
- package/suspense-fallback-test/utils.js +1 -1
- package/test.js +1 -1
- package/timer/Timer.js +1 -1
- package/timer/constants.js +1 -1
- package/timer/context.js +1 -1
- package/timer/index.js +1 -1
- package/timer/style/index.js +1 -1
- package/timer/utils.js +1 -1
- package/transition/Transition.js +1 -1
- package/transition/TransitionCSS.js +1 -1
- package/transition/TransitionGroup.js +1 -1
- package/transition/TransitionStyle.js +1 -1
- package/transition/constants.js +1 -1
- package/transition/context.js +1 -1
- package/transition/index.js +1 -1
- package/transition/style/index.js +1 -1
- package/transition/utils.js +1 -1
- package/utils/callOrReturn.js +1 -1
- package/utils/callbackOriginRef.js +1 -1
- package/utils/caseName.js +1 -1
- package/utils/className.js +1 -1
- package/utils/confetti.js +1 -1
- package/utils/constants.js +1 -1
- package/utils/copy.js +1 -1
- package/utils/css.js +1 -1
- package/utils/date.js +1 -1
- package/utils/dayjs.js +1 -1
- package/utils/document.js +1 -1
- package/utils/dom.js +1 -1
- package/utils/emitter.js +1 -1
- package/utils/file.js +1 -1
- package/utils/fileRead.js +1 -1
- package/utils/fileToDataURL.js +1 -1
- package/utils/fillNBSP.js +1 -1
- package/utils/getCompatProp.js +1 -1
- package/utils/getElement.js +1 -1
- package/utils/getHighlightText.js +1 -1
- package/utils/getHotkeyHandler.js +1 -1
- package/utils/getPrefixCls.js +1 -1
- package/utils/getScrollBarHeight.js +1 -1
- package/utils/getScrollBarSize.js +1 -1
- package/utils/getScrollBarWidth.js +1 -1
- package/utils/getScrollParent.js +1 -1
- package/utils/getStringLength.js +1 -1
- package/utils/getURLSearchByParams.d.ts +2 -0
- package/utils/getURLSearchByParams.js +10 -0
- package/utils/include.js +1 -1
- package/utils/index.d.ts +1 -0
- package/utils/index.js +94 -92
- package/utils/initAllLineClamp.js +1 -1
- package/utils/intersectionObserver.js +1 -1
- package/utils/is.js +1 -1
- package/utils/keyboardCode.js +1 -1
- package/utils/lodash.js +1 -1
- package/utils/math.js +1 -1
- package/utils/mergeProps.js +1 -1
- package/utils/mergedToString.js +1 -1
- package/utils/migrateLegacyProps.js +1 -1
- package/utils/mutationObserver.js +1 -1
- package/utils/names.d.ts +0 -8
- package/utils/names.js +5 -29
- package/utils/object.js +1 -1
- package/utils/omit.js +1 -1
- package/utils/pad.js +1 -1
- package/utils/pick.js +1 -1
- package/utils/pinyin.js +1 -1
- package/utils/react19Adapter.js +1 -1
- package/utils/reactNode.js +1 -1
- package/utils/ref.js +1 -1
- package/utils/resizeObserver.js +1 -1
- package/utils/saveAs.d.ts +1 -1
- package/utils/saveAs.js +3 -3
- package/utils/screenfull.js +1 -1
- package/utils/scrollIntoViewIfNeeded.js +1 -1
- package/utils/scrollTo.js +1 -1
- package/utils/setCreateRoot.js +1 -1
- package/utils/setDarkTheme.js +1 -1
- package/utils/setDir.js +1 -1
- package/utils/setPrimaryColor.js +1 -1
- package/utils/setTheme.js +1 -1
- package/utils/string.js +1 -1
- package/utils/style.js +1 -1
- package/utils/tinycolor.js +1 -1
- package/utils/toArray.js +1 -1
- package/utils/tree.js +1 -1
- package/utils/tunnel.js +1 -1
- package/utils/tween.js +1 -1
- package/utils/uuid.js +1 -1
- package/utils/validate.js +1 -1
- package/utils/warning.js +1 -1
- package/version/index.js +7 -7
- package/globe/Globe.d.ts +0 -10
- package/globe/Globe.js +0 -140
- package/globe/constants.d.ts +0 -0
- package/globe/constants.js +0 -4
- package/globe/context.d.ts +0 -3
- package/globe/context.js +0 -26
- package/globe/globe.json.js +0 -42585
- package/globe/hooks/index.d.ts +0 -0
- package/globe/index.d.ts +0 -19
- package/globe/index.js +0 -15
- package/globe/interface.d.ts +0 -46
- package/globe/style/index.css +0 -1
- package/globe/style/index.d.ts +0 -1
- package/globe/style/index.js +0 -5
- package/globe/utils.d.ts +0 -0
- package/globe/utils.js +0 -4
- package/liquid-logo/LiquidLogo.d.ts +0 -10
- package/liquid-logo/LiquidLogo.js +0 -122
- package/liquid-logo/constants.d.ts +0 -0
- package/liquid-logo/constants.js +0 -4
- package/liquid-logo/context.d.ts +0 -3
- package/liquid-logo/context.js +0 -17
- package/liquid-logo/hooks/index.d.ts +0 -0
- package/liquid-logo/index.d.ts +0 -21
- package/liquid-logo/index.js +0 -17
- package/liquid-logo/interface.d.ts +0 -12
- package/liquid-logo/parseLogoImage.d.ts +0 -4
- package/liquid-logo/parseLogoImage.js +0 -77
- package/liquid-logo/shader.d.ts +0 -2
- package/liquid-logo/shader.js +0 -8
- package/liquid-logo/style/index.d.ts +0 -1
- package/liquid-logo/style/index.js +0 -5
- package/liquid-logo/utils.d.ts +0 -0
- package/liquid-logo/utils.js +0 -4
- package/splash-cursor/FluidCursor.d.ts +0 -2
- package/splash-cursor/FluidCursor.js +0 -9
- package/splash-cursor/SplashCursor.d.ts +0 -10
- package/splash-cursor/SplashCursor.js +0 -437
- package/splash-cursor/constants.d.ts +0 -0
- package/splash-cursor/constants.js +0 -4
- package/splash-cursor/context.d.ts +0 -3
- package/splash-cursor/context.js +0 -9
- package/splash-cursor/hooks/index.d.ts +0 -0
- package/splash-cursor/index.d.ts +0 -21
- package/splash-cursor/index.js +0 -16
- package/splash-cursor/interface.d.ts +0 -59
- package/splash-cursor/style/index.css +0 -1
- package/splash-cursor/style/index.d.ts +0 -1
- package/splash-cursor/style/index.js +0 -5
- package/splash-cursor/utils.d.ts +0 -2
- package/splash-cursor/utils.js +0 -25
- package/typewriter/Typewriter.d.ts +0 -10
- package/typewriter/Typewriter.js +0 -76
- package/typewriter/constants.d.ts +0 -0
- package/typewriter/constants.js +0 -4
- package/typewriter/context.d.ts +0 -3
- package/typewriter/context.js +0 -12
- package/typewriter/hooks/index.d.ts +0 -0
- package/typewriter/index.d.ts +0 -19
- package/typewriter/index.js +0 -15
- package/typewriter/interface.d.ts +0 -17
- package/typewriter/style/index.css +0 -1
- package/typewriter/style/index.d.ts +0 -1
- package/typewriter/style/index.js +0 -5
- package/typewriter/utils.d.ts +0 -0
- package/typewriter/utils.js +0 -4
package/globe/hooks/index.d.ts
DELETED
|
File without changes
|
package/globe/index.d.ts
DELETED
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import './style';
|
|
2
|
-
declare const Globe: import("react").ForwardRefExoticComponent<import("./interface").GlobeProps & import("react").RefAttributes<unknown>> & {
|
|
3
|
-
zh: string;
|
|
4
|
-
en: string;
|
|
5
|
-
displayName: string;
|
|
6
|
-
id: string;
|
|
7
|
-
legacy?: string;
|
|
8
|
-
descriptions?: string;
|
|
9
|
-
} & {
|
|
10
|
-
PropsContext: import("react").Context<Partial<import("./interface").GlobeProps>>;
|
|
11
|
-
zh: string;
|
|
12
|
-
en: string;
|
|
13
|
-
displayName: string;
|
|
14
|
-
id: string;
|
|
15
|
-
legacy?: string;
|
|
16
|
-
descriptions?: string;
|
|
17
|
-
};
|
|
18
|
-
export default Globe;
|
|
19
|
-
export type * from './interface';
|
package/globe/index.js
DELETED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
/* 潘启宝 2026-09-03 10:06:59 星期四 山东省济南市 */
|
|
2
|
-
/* 世界因你而美丽 */
|
|
3
|
-
import { COMPONENT_INFO_GLOBE as e } from "../utils/names.js";
|
|
4
|
-
import { PropsContext as t } from "./context.js";
|
|
5
|
-
import n from "./Globe.js";
|
|
6
|
-
import "./style/index.js";
|
|
7
|
-
//#region components/common/globe/index.ts
|
|
8
|
-
var r = Object.assign(n, {
|
|
9
|
-
...e,
|
|
10
|
-
PropsContext: t
|
|
11
|
-
});
|
|
12
|
-
//#endregion
|
|
13
|
-
export { r as default };
|
|
14
|
-
/* 欲穷千里目,更上一层楼 */
|
|
15
|
-
/* 独立思考,明辨是非 */
|
package/globe/interface.d.ts
DELETED
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
import type { HTMLAttributes } from 'react';
|
|
2
|
-
export interface Position {
|
|
3
|
-
order: number;
|
|
4
|
-
startLat: number;
|
|
5
|
-
startLng: number;
|
|
6
|
-
endLat: number;
|
|
7
|
-
endLng: number;
|
|
8
|
-
arcAlt: number;
|
|
9
|
-
color: string;
|
|
10
|
-
}
|
|
11
|
-
export interface GlobeData {
|
|
12
|
-
size: number | undefined;
|
|
13
|
-
order: number;
|
|
14
|
-
color: (t: number) => string;
|
|
15
|
-
lat: number;
|
|
16
|
-
lng: number;
|
|
17
|
-
}
|
|
18
|
-
export interface GlobeConfig {
|
|
19
|
-
pointSize?: number;
|
|
20
|
-
globeColor?: string;
|
|
21
|
-
showAtmosphere?: boolean;
|
|
22
|
-
atmosphereColor?: string;
|
|
23
|
-
atmosphereAltitude?: number;
|
|
24
|
-
emissive?: string;
|
|
25
|
-
emissiveIntensity?: number;
|
|
26
|
-
shininess?: number;
|
|
27
|
-
polygonColor?: string;
|
|
28
|
-
ambientLight?: string;
|
|
29
|
-
directionalLeftLight?: string;
|
|
30
|
-
directionalTopLight?: string;
|
|
31
|
-
pointLight?: string;
|
|
32
|
-
arcTime?: number;
|
|
33
|
-
arcLength?: number;
|
|
34
|
-
rings?: number;
|
|
35
|
-
maxRings?: number;
|
|
36
|
-
initialPosition?: {
|
|
37
|
-
lat: number;
|
|
38
|
-
lng: number;
|
|
39
|
-
};
|
|
40
|
-
autoRotate?: boolean;
|
|
41
|
-
autoRotateSpeed?: number;
|
|
42
|
-
}
|
|
43
|
-
export interface GlobeProps extends HTMLAttributes<HTMLCanvasElement> {
|
|
44
|
-
globeConfig?: GlobeConfig;
|
|
45
|
-
data: Position[];
|
|
46
|
-
}
|
package/globe/style/index.css
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
.pqbc-globe{width:100%;height:100%}
|
package/globe/style/index.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import './index.less';
|
package/globe/style/index.js
DELETED
package/globe/utils.d.ts
DELETED
|
File without changes
|
package/globe/utils.js
DELETED
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import type { LiquidLogoProps } from './interface';
|
|
2
|
-
declare const LiquidLogo: import("react").ForwardRefExoticComponent<LiquidLogoProps & import("react").RefAttributes<unknown>> & {
|
|
3
|
-
zh: string;
|
|
4
|
-
en: string;
|
|
5
|
-
displayName: string;
|
|
6
|
-
id: string;
|
|
7
|
-
legacy?: string;
|
|
8
|
-
descriptions?: string;
|
|
9
|
-
};
|
|
10
|
-
export default LiquidLogo;
|
|
@@ -1,122 +0,0 @@
|
|
|
1
|
-
/* 潘启宝 2026-09-03 10:06:59 星期四 山东省济南市 */
|
|
2
|
-
/* 世界因你而美丽 */
|
|
3
|
-
import { noop as e } from "../utils/lodash.js";
|
|
4
|
-
import t from "../hooks/use-merge-component-props/index.js";
|
|
5
|
-
import { cs as n } from "../utils/className.js";
|
|
6
|
-
import r from "../utils/getPrefixCls.js";
|
|
7
|
-
import { COMPONENT_INFO_LIQUID_LOGO as i } from "../utils/names.js";
|
|
8
|
-
import "../utils/index.js";
|
|
9
|
-
import { PropsContext as a, defaultProps as o } from "./context.js";
|
|
10
|
-
import { parseLogoImage as s } from "./parseLogoImage.js";
|
|
11
|
-
import { liquidFragSource as c, vertexShaderSource as l } from "./shader.js";
|
|
12
|
-
import { forwardRef as u, useContext as d, useEffect as f, useImperativeHandle as p, useRef as m } from "react";
|
|
13
|
-
import { jsx as h } from "react/jsx-runtime";
|
|
14
|
-
//#region components/common/liquid-logo/LiquidLogo.tsx
|
|
15
|
-
function g(i, u) {
|
|
16
|
-
let g = d(a), _ = r("liquid-logo"), v = t({
|
|
17
|
-
internalProps: i,
|
|
18
|
-
contextProps: g,
|
|
19
|
-
globalProps: {},
|
|
20
|
-
defaultProps: o
|
|
21
|
-
}, !0), { style: y, className: b } = v, x = m(null), S = m(null), C = m({}), w = m(0), T = m(0), E = m(null), D = m(!1), O = m(0), k = m(e);
|
|
22
|
-
function A() {
|
|
23
|
-
!S.current || !C.current || (S.current.uniform1f(C.current.u_edge, v.edge), S.current.uniform1f(C.current.u_patternBlur, v.patternBlur), S.current.uniform1f(C.current.u_time, 0), S.current.uniform1f(C.current.u_patternScale, v.patternScale), S.current.uniform1f(C.current.u_refraction, v.refraction), S.current.uniform1f(C.current.u_liquid, v.liquid));
|
|
24
|
-
}
|
|
25
|
-
function j() {
|
|
26
|
-
let e = E.current, t = e?.getContext("webgl2", {
|
|
27
|
-
antialias: !0,
|
|
28
|
-
alpha: !0
|
|
29
|
-
});
|
|
30
|
-
if (!e || !t) return;
|
|
31
|
-
t.enable(t.BLEND), t.blendFunc(t.SRC_ALPHA, t.ONE_MINUS_SRC_ALPHA);
|
|
32
|
-
function n(e, t, n) {
|
|
33
|
-
let r = e.createShader(n);
|
|
34
|
-
return r ? (e.shaderSource(r, t), e.compileShader(r), e.getShaderParameter(r, e.COMPILE_STATUS) ? r : (e.deleteShader(r), null)) : null;
|
|
35
|
-
}
|
|
36
|
-
let r = n(t, l, t.VERTEX_SHADER), i = n(t, c, t.FRAGMENT_SHADER), a = t.createProgram();
|
|
37
|
-
if (!a || !r || !i) return;
|
|
38
|
-
if (t.attachShader(a, r), t.attachShader(a, i), t.linkProgram(a), !t.getProgramParameter(a, t.LINK_STATUS)) return null;
|
|
39
|
-
function o(e, t) {
|
|
40
|
-
let n = {}, r = t.getProgramParameter(e, t.ACTIVE_UNIFORMS);
|
|
41
|
-
for (let i = 0; i < r; i++) {
|
|
42
|
-
let r = t.getActiveUniform(e, i)?.name;
|
|
43
|
-
r && (n[r] = t.getUniformLocation(e, r));
|
|
44
|
-
}
|
|
45
|
-
return n;
|
|
46
|
-
}
|
|
47
|
-
let s = o(a, t);
|
|
48
|
-
C.current = s;
|
|
49
|
-
let u = new Float32Array([
|
|
50
|
-
-1,
|
|
51
|
-
-1,
|
|
52
|
-
1,
|
|
53
|
-
-1,
|
|
54
|
-
-1,
|
|
55
|
-
1,
|
|
56
|
-
1,
|
|
57
|
-
1
|
|
58
|
-
]), d = t.createBuffer();
|
|
59
|
-
t.bindBuffer(t.ARRAY_BUFFER, d), t.bufferData(t.ARRAY_BUFFER, u, t.STATIC_DRAW), t.useProgram(a);
|
|
60
|
-
let f = t.getAttribLocation(a, "a_position");
|
|
61
|
-
t.enableVertexAttribArray(f), t.bindBuffer(t.ARRAY_BUFFER, d), t.vertexAttribPointer(f, 2, t.FLOAT, !1, 0, 0), S.current = t;
|
|
62
|
-
}
|
|
63
|
-
function M(e) {
|
|
64
|
-
let t = e - T.current;
|
|
65
|
-
T.current = e, w.current += t * v.speed, S.current.uniform1f(C.current.u_time, w.current), S.current.drawArrays(S.current.TRIANGLE_STRIP, 0, 4), O.current = requestAnimationFrame(M);
|
|
66
|
-
}
|
|
67
|
-
function N() {
|
|
68
|
-
return T.current = performance.now(), O.current = requestAnimationFrame(M), () => {
|
|
69
|
-
cancelAnimationFrame(O.current);
|
|
70
|
-
};
|
|
71
|
-
}
|
|
72
|
-
function P() {
|
|
73
|
-
let e = E.current, t = S.current;
|
|
74
|
-
if (!e || !t || !C.current) return;
|
|
75
|
-
let n = x.current ? x.current.width / x.current.height : 1;
|
|
76
|
-
t.uniform1f(C.current.u_img_ratio, n);
|
|
77
|
-
let r = 1e3;
|
|
78
|
-
e.width = r * devicePixelRatio, e.height = r * devicePixelRatio, t.viewport(0, 0, e.height, e.height), t.uniform1f(C.current.u_ratio, 1), t.uniform1f(C.current.u_img_ratio, n);
|
|
79
|
-
}
|
|
80
|
-
async function F() {
|
|
81
|
-
try {
|
|
82
|
-
let { imageData: e } = await s(v.imageUrl);
|
|
83
|
-
x.current = e;
|
|
84
|
-
} catch {}
|
|
85
|
-
}
|
|
86
|
-
async function I() {
|
|
87
|
-
let e = S.current;
|
|
88
|
-
if (!e || !C.current || !x.current) return;
|
|
89
|
-
let t = e.getParameter(e.TEXTURE_BINDING_2D);
|
|
90
|
-
t && e.deleteTexture(t);
|
|
91
|
-
let n = e.createTexture();
|
|
92
|
-
e.activeTexture(e.TEXTURE0), e.bindTexture(e.TEXTURE_2D, n), e.texParameteri(e.TEXTURE_2D, e.TEXTURE_MIN_FILTER, e.LINEAR), e.texParameteri(e.TEXTURE_2D, e.TEXTURE_MAG_FILTER, e.LINEAR), e.texParameteri(e.TEXTURE_2D, e.TEXTURE_WRAP_S, e.CLAMP_TO_EDGE), e.texParameteri(e.TEXTURE_2D, e.TEXTURE_WRAP_T, e.CLAMP_TO_EDGE), e.pixelStorei(e.UNPACK_ALIGNMENT, 1);
|
|
93
|
-
try {
|
|
94
|
-
e.texImage2D(e.TEXTURE_2D, 0, e.RGBA, x.current.width, x.current.height, 0, e.RGBA, e.UNSIGNED_BYTE, x.current.data), e.uniform1i(C.current.u_image_texture, 0);
|
|
95
|
-
} catch {}
|
|
96
|
-
return () => {
|
|
97
|
-
n && e.deleteTexture(n);
|
|
98
|
-
};
|
|
99
|
-
}
|
|
100
|
-
return f(() => (D.current = !0, F().then((e) => (j(), A(), I())).then((e) => {
|
|
101
|
-
k.current = e, D.current = !1, window.addEventListener("resize", P), P(), N();
|
|
102
|
-
}), () => {
|
|
103
|
-
window.removeEventListener("resize", P), cancelAnimationFrame(O.current), k.current && k.current();
|
|
104
|
-
}), []), f(() => (A(), () => {}), [
|
|
105
|
-
v.edge,
|
|
106
|
-
v.patternBlur,
|
|
107
|
-
v.patternScale,
|
|
108
|
-
v.refraction,
|
|
109
|
-
v.liquid
|
|
110
|
-
]), p(u, () => ({ getRootElement() {
|
|
111
|
-
return E.current;
|
|
112
|
-
} })), /* @__PURE__ */ h("canvas", {
|
|
113
|
-
ref: E,
|
|
114
|
-
style: { ...y },
|
|
115
|
-
className: n(_, D ? "hidden" : "", b)
|
|
116
|
-
});
|
|
117
|
-
}
|
|
118
|
-
var _ = Object.assign(u(g), { ...i });
|
|
119
|
-
//#endregion
|
|
120
|
-
export { _ as default };
|
|
121
|
-
/* 欲穷千里目,更上一层楼 */
|
|
122
|
-
/* 独立思考,明辨是非 */
|
|
File without changes
|
package/liquid-logo/constants.js
DELETED
package/liquid-logo/context.d.ts
DELETED
package/liquid-logo/context.js
DELETED
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
/* 潘启宝 2026-09-03 10:06:59 星期四 山东省济南市 */
|
|
2
|
-
/* 世界因你而美丽 */
|
|
3
|
-
import { createContext as e } from "react";
|
|
4
|
-
//#region components/common/liquid-logo/context.ts
|
|
5
|
-
var t = {
|
|
6
|
-
refraction: .015,
|
|
7
|
-
edge: .4,
|
|
8
|
-
patternScale: 2,
|
|
9
|
-
patternBlur: .005,
|
|
10
|
-
liquid: .07,
|
|
11
|
-
speed: .3,
|
|
12
|
-
showProcessing: !0
|
|
13
|
-
}, n = e({});
|
|
14
|
-
//#endregion
|
|
15
|
-
export { n as PropsContext, t as defaultProps };
|
|
16
|
-
/* 欲穷千里目,更上一层楼 */
|
|
17
|
-
/* 独立思考,明辨是非 */
|
|
File without changes
|
package/liquid-logo/index.d.ts
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import './style';
|
|
2
|
-
declare const LiquidLogo: import("react").ForwardRefExoticComponent<import("./interface").LiquidLogoProps & import("react").RefAttributes<unknown>> & {
|
|
3
|
-
zh: string;
|
|
4
|
-
en: string;
|
|
5
|
-
displayName: string;
|
|
6
|
-
id: string;
|
|
7
|
-
legacy?: string;
|
|
8
|
-
descriptions?: string;
|
|
9
|
-
} & {
|
|
10
|
-
PropsContext: import("react").Context<Partial<import("./interface").LiquidLogoProps>>;
|
|
11
|
-
zh: string;
|
|
12
|
-
en: string;
|
|
13
|
-
displayName: string;
|
|
14
|
-
id: string;
|
|
15
|
-
legacy?: string;
|
|
16
|
-
descriptions?: string;
|
|
17
|
-
};
|
|
18
|
-
export default LiquidLogo;
|
|
19
|
-
export type * from './interface';
|
|
20
|
-
export * from './parseLogoImage';
|
|
21
|
-
export * from './shader';
|
package/liquid-logo/index.js
DELETED
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
/* 潘启宝 2026-09-03 10:06:59 星期四 山东省济南市 */
|
|
2
|
-
/* 世界因你而美丽 */
|
|
3
|
-
import { COMPONENT_INFO_LIQUID_LOGO as e } from "../utils/names.js";
|
|
4
|
-
import { PropsContext as t } from "./context.js";
|
|
5
|
-
import { parseLogoImage as n } from "./parseLogoImage.js";
|
|
6
|
-
import { liquidFragSource as r, vertexShaderSource as i } from "./shader.js";
|
|
7
|
-
import a from "./LiquidLogo.js";
|
|
8
|
-
import "./style/index.js";
|
|
9
|
-
//#region components/common/liquid-logo/index.ts
|
|
10
|
-
var o = Object.assign(a, {
|
|
11
|
-
...e,
|
|
12
|
-
PropsContext: t
|
|
13
|
-
});
|
|
14
|
-
//#endregion
|
|
15
|
-
export { o as default, r as liquidFragSource, n as parseLogoImage, i as vertexShaderSource };
|
|
16
|
-
/* 欲穷千里目,更上一层楼 */
|
|
17
|
-
/* 独立思考,明辨是非 */
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import type { HTMLAttributes } from 'react';
|
|
2
|
-
export interface LiquidLogoProps extends HTMLAttributes<HTMLCanvasElement> {
|
|
3
|
-
className?: string;
|
|
4
|
-
imageUrl: string;
|
|
5
|
-
patternScale?: number;
|
|
6
|
-
refraction?: number;
|
|
7
|
-
edge?: number;
|
|
8
|
-
patternBlur?: number;
|
|
9
|
-
liquid?: number;
|
|
10
|
-
speed?: number;
|
|
11
|
-
showProcessing?: boolean;
|
|
12
|
-
}
|
|
@@ -1,77 +0,0 @@
|
|
|
1
|
-
/* 潘启宝 2026-09-03 10:06:59 星期四 山东省济南市 */
|
|
2
|
-
/* 世界因你而美丽 */
|
|
3
|
-
//#region components/common/liquid-logo/parseLogoImage.ts
|
|
4
|
-
function e(e) {
|
|
5
|
-
let t = document.createElement("canvas"), n = t.getContext("2d");
|
|
6
|
-
return new Promise((r, i) => {
|
|
7
|
-
if (!e || !n) {
|
|
8
|
-
i(/* @__PURE__ */ Error("Invalid image URL or context"));
|
|
9
|
-
return;
|
|
10
|
-
}
|
|
11
|
-
let a = new Image();
|
|
12
|
-
a.crossOrigin = "anonymous", a.onload = function() {
|
|
13
|
-
let e = 1e3, o = a.naturalWidth, s = a.naturalHeight;
|
|
14
|
-
(o > e || s > e || o < 500 || s < 500) && (o > s ? o > e ? (s = Math.round(s * e / o), o = e) : o < 500 && (s = Math.round(s * 500 / o), o = 500) : s > e ? (o = Math.round(o * e / s), s = e) : s < 500 && (o = Math.round(o * 500 / s), s = 500)), t.width = o, t.height = s;
|
|
15
|
-
let c = document.createElement("canvas");
|
|
16
|
-
c.width = o, c.height = s;
|
|
17
|
-
let l = c.getContext("2d");
|
|
18
|
-
l.drawImage(a, 0, 0, o, s);
|
|
19
|
-
let u = l.getImageData(0, 0, o, s).data, d = Array(o * s).fill(!1);
|
|
20
|
-
for (let e = 0; e < s; e++) for (let t = 0; t < o; t++) {
|
|
21
|
-
let n = (e * o + t) * 4, r = u[n], i = u[n + 1], a = u[n + 2], s = u[n + 3];
|
|
22
|
-
d[e * o + t] = !(r === 255 && i === 255 && a === 255 && s === 255 || s === 0);
|
|
23
|
-
}
|
|
24
|
-
function f(e, t) {
|
|
25
|
-
return e < 0 || e >= o || t < 0 || t >= s ? !1 : d[t * o + e];
|
|
26
|
-
}
|
|
27
|
-
let p = Array(o * s).fill(!1);
|
|
28
|
-
for (let e = 0; e < s; e++) for (let t = 0; t < o; t++) {
|
|
29
|
-
let n = e * o + t;
|
|
30
|
-
if (!d[n]) continue;
|
|
31
|
-
let r = !1;
|
|
32
|
-
for (let n = e - 1; n <= e + 1 && !r; n++) for (let e = t - 1; e <= t + 1 && !r; e++) f(e, n) || (r = !0);
|
|
33
|
-
r && (p[n] = !0);
|
|
34
|
-
}
|
|
35
|
-
let m = new Float32Array(o * s).fill(0), h = new Float32Array(o * s).fill(0);
|
|
36
|
-
function g(e, t, n) {
|
|
37
|
-
return e < 0 || e >= o || t < 0 || t >= s || !d[t * o + e] ? 0 : n[t * o + e];
|
|
38
|
-
}
|
|
39
|
-
for (let e = 0; e < 300; e++) {
|
|
40
|
-
for (let e = 0; e < s; e++) for (let t = 0; t < o; t++) {
|
|
41
|
-
let n = e * o + t;
|
|
42
|
-
if (!d[n] || p[n]) {
|
|
43
|
-
h[n] = 0;
|
|
44
|
-
continue;
|
|
45
|
-
}
|
|
46
|
-
h[n] = (.01 + (g(t + 1, e, m) + g(t - 1, e, m) + g(t, e + 1, m) + g(t, e - 1, m))) / 4;
|
|
47
|
-
}
|
|
48
|
-
m.set(h);
|
|
49
|
-
}
|
|
50
|
-
let _ = 0;
|
|
51
|
-
for (let e = 0; e < o * s; e++) m[e] > _ && (_ = m[e]);
|
|
52
|
-
let v = n.createImageData(o, s);
|
|
53
|
-
for (let e = 0; e < s; e++) for (let t = 0; t < o; t++) {
|
|
54
|
-
let n = e * o + t, r = n * 4;
|
|
55
|
-
if (!d[n]) v.data[r] = 255, v.data[r + 1] = 255, v.data[r + 2] = 255, v.data[r + 3] = 255;
|
|
56
|
-
else {
|
|
57
|
-
let e = 255 * (1 - (m[n] / _) ** 2);
|
|
58
|
-
v.data[r] = e, v.data[r + 1] = e, v.data[r + 2] = e, v.data[r + 3] = 255;
|
|
59
|
-
}
|
|
60
|
-
}
|
|
61
|
-
n.putImageData(v, 0, 0), t.toBlob((e) => {
|
|
62
|
-
if (!e) {
|
|
63
|
-
i(/* @__PURE__ */ Error("Failed to create PNG blob"));
|
|
64
|
-
return;
|
|
65
|
-
}
|
|
66
|
-
r({
|
|
67
|
-
imageData: v,
|
|
68
|
-
pngBlob: e
|
|
69
|
-
});
|
|
70
|
-
}, "image/png");
|
|
71
|
-
}, a.onerror = () => i(/* @__PURE__ */ Error("Failed to load image")), a.src = e;
|
|
72
|
-
});
|
|
73
|
-
}
|
|
74
|
-
//#endregion
|
|
75
|
-
export { e as parseLogoImage };
|
|
76
|
-
/* 欲穷千里目,更上一层楼 */
|
|
77
|
-
/* 独立思考,明辨是非 */
|
package/liquid-logo/shader.d.ts
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
export declare const vertexShaderSource = "#version 300 es\nprecision mediump float;\n\nin vec2 a_position;\nout vec2 vUv;\n\nvoid main() {\n vUv = .5 * (a_position + 1.);\n gl_Position = vec4(a_position, 0.0, 1.0);\n}";
|
|
2
|
-
export declare const liquidFragSource = "#version 300 es\nprecision mediump float;\n\nin vec2 vUv;\nout vec4 fragColor;\n\nuniform sampler2D u_image_texture;\nuniform float u_time;\nuniform float u_ratio;\nuniform float u_img_ratio;\nuniform float u_patternScale;\nuniform float u_refraction;\nuniform float u_edge;\nuniform float u_patternBlur;\nuniform float u_liquid;\n\n\n#define TWO_PI 6.28318530718\n#define PI 3.14159265358979323846\n\n\nvec3 mod289(vec3 x) { return x - floor(x * (1. / 289.)) * 289.; }\nvec2 mod289(vec2 x) { return x - floor(x * (1. / 289.)) * 289.; }\nvec3 permute(vec3 x) { return mod289(((x*34.)+1.)*x); }\nfloat snoise(vec2 v) {\n const vec4 C = vec4(0.211324865405187, 0.366025403784439, -0.577350269189626, 0.024390243902439);\n vec2 i = floor(v + dot(v, C.yy));\n vec2 x0 = v - i + dot(i, C.xx);\n vec2 i1;\n i1 = (x0.x > x0.y) ? vec2(1., 0.) : vec2(0., 1.);\n vec4 x12 = x0.xyxy + C.xxzz;\n x12.xy -= i1;\n i = mod289(i);\n vec3 p = permute(permute(i.y + vec3(0., i1.y, 1.)) + i.x + vec3(0., i1.x, 1.));\n vec3 m = max(0.5 - vec3(dot(x0, x0), dot(x12.xy, x12.xy), dot(x12.zw, x12.zw)), 0.);\n m = m*m;\n m = m*m;\n vec3 x = 2. * fract(p * C.www) - 1.;\n vec3 h = abs(x) - 0.5;\n vec3 ox = floor(x + 0.5);\n vec3 a0 = x - ox;\n m *= 1.79284291400159 - 0.85373472095314 * (a0*a0 + h*h);\n vec3 g;\n g.x = a0.x * x0.x + h.x * x0.y;\n g.yz = a0.yz * x12.xz + h.yz * x12.yw;\n return 130. * dot(m, g);\n}\n\nvec2 get_img_uv() {\n vec2 img_uv = vUv;\n img_uv -= .5;\n if (u_ratio > u_img_ratio) {\n img_uv.x = img_uv.x * u_ratio / u_img_ratio;\n } else {\n img_uv.y = img_uv.y * u_img_ratio / u_ratio;\n }\n float scale_factor = 1.;\n img_uv *= scale_factor;\n img_uv += .5;\n\n img_uv.y = 1. - img_uv.y;\n\n return img_uv;\n}\nvec2 rotate(vec2 uv, float th) {\n return mat2(cos(th), sin(th), -sin(th), cos(th)) * uv;\n}\nfloat get_color_channel(float c1, float c2, float stripe_p, vec3 w, float extra_blur, float b) {\n float ch = c2;\n float border = 0.;\n float blur = u_patternBlur + extra_blur;\n\n ch = mix(ch, c1, smoothstep(.0, blur, stripe_p));\n\n border = w[0];\n ch = mix(ch, c2, smoothstep(border - blur, border + blur, stripe_p));\n\n b = smoothstep(.2, .8, b);\n border = w[0] + .4 * (1. - b) * w[1];\n ch = mix(ch, c1, smoothstep(border - blur, border + blur, stripe_p));\n\n border = w[0] + .5 * (1. - b) * w[1];\n ch = mix(ch, c2, smoothstep(border - blur, border + blur, stripe_p));\n\n border = w[0] + w[1];\n ch = mix(ch, c1, smoothstep(border - blur, border + blur, stripe_p));\n\n float gradient_t = (stripe_p - w[0] - w[1]) / w[2];\n float gradient = mix(c1, c2, smoothstep(0., 1., gradient_t));\n ch = mix(ch, gradient, smoothstep(border - blur, border + blur, stripe_p));\n\n return ch;\n}\n\nfloat get_img_frame_alpha(vec2 uv, float img_frame_width) {\n float img_frame_alpha = smoothstep(0., img_frame_width, uv.x) * smoothstep(1., 1. - img_frame_width, uv.x);\n img_frame_alpha *= smoothstep(0., img_frame_width, uv.y) * smoothstep(1., 1. - img_frame_width, uv.y);\n return img_frame_alpha;\n}\n\nvoid main() {\n vec2 uv = vUv;\n uv.y = 1. - uv.y;\n uv.x *= u_ratio;\n\n float diagonal = uv.x - uv.y;\n\n float t = .001 * u_time;\n\n vec2 img_uv = get_img_uv();\n vec4 img = texture(u_image_texture, img_uv);\n\n vec3 color = vec3(0.);\n float opacity = 1.;\n\n vec3 color1 = vec3(.98, 0.98, 1.);\n vec3 color2 = vec3(.1, .1, .1 + .1 * smoothstep(.7, 1.3, uv.x + uv.y));\n\n float edge = img.r;\n\n\n vec2 grad_uv = uv;\n grad_uv -= .5;\n\n float dist = length(grad_uv + vec2(0., .2 * diagonal));\n\n grad_uv = rotate(grad_uv, (.25 - .2 * diagonal) * PI);\n\n float bulge = pow(1.8 * dist, 1.2);\n bulge = 1. - bulge;\n bulge *= pow(uv.y, .3);\n\n\n float cycle_width = u_patternScale;\n float thin_strip_1_ratio = .12 / cycle_width * (1. - .4 * bulge);\n float thin_strip_2_ratio = .07 / cycle_width * (1. + .4 * bulge);\n float wide_strip_ratio = (1. - thin_strip_1_ratio - thin_strip_2_ratio);\n\n float thin_strip_1_width = cycle_width * thin_strip_1_ratio;\n float thin_strip_2_width = cycle_width * thin_strip_2_ratio;\n\n opacity = 1. - smoothstep(.9 - .5 * u_edge, 1. - .5 * u_edge, edge);\n opacity *= get_img_frame_alpha(img_uv, 0.01);\n\n\n float noise = snoise(uv - t);\n\n edge += (1. - edge) * u_liquid * noise;\n\n float refr = 0.;\n refr += (1. - bulge);\n refr = clamp(refr, 0., 1.);\n\n float dir = grad_uv.x;\n\n\n dir += diagonal;\n\n dir -= 2. * noise * diagonal * (smoothstep(0., 1., edge) * smoothstep(1., 0., edge));\n\n bulge *= clamp(pow(uv.y, .1), .3, 1.);\n dir *= (.1 + (1.1 - edge) * bulge);\n\n dir *= smoothstep(1., .7, edge);\n\n dir += .18 * (smoothstep(.1, .2, uv.y) * smoothstep(.4, .2, uv.y));\n dir += .03 * (smoothstep(.1, .2, 1. - uv.y) * smoothstep(.4, .2, 1. - uv.y));\n\n dir *= (.5 + .5 * pow(uv.y, 2.));\n\n dir *= cycle_width;\n\n dir -= t;\n\n float refr_r = refr;\n refr_r += .03 * bulge * noise;\n float refr_b = 1.3 * refr;\n\n refr_r += 5. * (smoothstep(-.1, .2, uv.y) * smoothstep(.5, .1, uv.y)) * (smoothstep(.4, .6, bulge) * smoothstep(1., .4, bulge));\n refr_r -= diagonal;\n\n refr_b += (smoothstep(0., .4, uv.y) * smoothstep(.8, .1, uv.y)) * (smoothstep(.4, .6, bulge) * smoothstep(.8, .4, bulge));\n refr_b -= .2 * edge;\n\n refr_r *= u_refraction;\n refr_b *= u_refraction;\n\n vec3 w = vec3(thin_strip_1_width, thin_strip_2_width, wide_strip_ratio);\n w[1] -= .02 * smoothstep(.0, 1., edge + bulge);\n float stripe_r = mod(dir + refr_r, 1.);\n float r = get_color_channel(color1.r, color2.r, stripe_r, w, 0.02 + .03 * u_refraction * bulge, bulge);\n float stripe_g = mod(dir, 1.);\n float g = get_color_channel(color1.g, color2.g, stripe_g, w, 0.01 / (1. - diagonal), bulge);\n float stripe_b = mod(dir - refr_b, 1.);\n float b = get_color_channel(color1.b, color2.b, stripe_b, w, .01, bulge);\n\n color = vec3(r, g, b);\n\n color *= opacity;\n\n fragColor = vec4(color, opacity);\n}\n";
|
package/liquid-logo/shader.js
DELETED
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
/* 潘启宝 2026-09-03 10:06:59 星期四 山东省济南市 */
|
|
2
|
-
/* 世界因你而美丽 */
|
|
3
|
-
//#region components/common/liquid-logo/shader.ts
|
|
4
|
-
var e = "#version 300 es\nprecision mediump float;\n\nin vec2 a_position;\nout vec2 vUv;\n\nvoid main() {\n vUv = .5 * (a_position + 1.);\n gl_Position = vec4(a_position, 0.0, 1.0);\n}", t = "#version 300 es\nprecision mediump float;\n\nin vec2 vUv;\nout vec4 fragColor;\n\nuniform sampler2D u_image_texture;\nuniform float u_time;\nuniform float u_ratio;\nuniform float u_img_ratio;\nuniform float u_patternScale;\nuniform float u_refraction;\nuniform float u_edge;\nuniform float u_patternBlur;\nuniform float u_liquid;\n\n\n#define TWO_PI 6.28318530718\n#define PI 3.14159265358979323846\n\n\nvec3 mod289(vec3 x) { return x - floor(x * (1. / 289.)) * 289.; }\nvec2 mod289(vec2 x) { return x - floor(x * (1. / 289.)) * 289.; }\nvec3 permute(vec3 x) { return mod289(((x*34.)+1.)*x); }\nfloat snoise(vec2 v) {\n const vec4 C = vec4(0.211324865405187, 0.366025403784439, -0.577350269189626, 0.024390243902439);\n vec2 i = floor(v + dot(v, C.yy));\n vec2 x0 = v - i + dot(i, C.xx);\n vec2 i1;\n i1 = (x0.x > x0.y) ? vec2(1., 0.) : vec2(0., 1.);\n vec4 x12 = x0.xyxy + C.xxzz;\n x12.xy -= i1;\n i = mod289(i);\n vec3 p = permute(permute(i.y + vec3(0., i1.y, 1.)) + i.x + vec3(0., i1.x, 1.));\n vec3 m = max(0.5 - vec3(dot(x0, x0), dot(x12.xy, x12.xy), dot(x12.zw, x12.zw)), 0.);\n m = m*m;\n m = m*m;\n vec3 x = 2. * fract(p * C.www) - 1.;\n vec3 h = abs(x) - 0.5;\n vec3 ox = floor(x + 0.5);\n vec3 a0 = x - ox;\n m *= 1.79284291400159 - 0.85373472095314 * (a0*a0 + h*h);\n vec3 g;\n g.x = a0.x * x0.x + h.x * x0.y;\n g.yz = a0.yz * x12.xz + h.yz * x12.yw;\n return 130. * dot(m, g);\n}\n\nvec2 get_img_uv() {\n vec2 img_uv = vUv;\n img_uv -= .5;\n if (u_ratio > u_img_ratio) {\n img_uv.x = img_uv.x * u_ratio / u_img_ratio;\n } else {\n img_uv.y = img_uv.y * u_img_ratio / u_ratio;\n }\n float scale_factor = 1.;\n img_uv *= scale_factor;\n img_uv += .5;\n\n img_uv.y = 1. - img_uv.y;\n\n return img_uv;\n}\nvec2 rotate(vec2 uv, float th) {\n return mat2(cos(th), sin(th), -sin(th), cos(th)) * uv;\n}\nfloat get_color_channel(float c1, float c2, float stripe_p, vec3 w, float extra_blur, float b) {\n float ch = c2;\n float border = 0.;\n float blur = u_patternBlur + extra_blur;\n\n ch = mix(ch, c1, smoothstep(.0, blur, stripe_p));\n\n border = w[0];\n ch = mix(ch, c2, smoothstep(border - blur, border + blur, stripe_p));\n\n b = smoothstep(.2, .8, b);\n border = w[0] + .4 * (1. - b) * w[1];\n ch = mix(ch, c1, smoothstep(border - blur, border + blur, stripe_p));\n\n border = w[0] + .5 * (1. - b) * w[1];\n ch = mix(ch, c2, smoothstep(border - blur, border + blur, stripe_p));\n\n border = w[0] + w[1];\n ch = mix(ch, c1, smoothstep(border - blur, border + blur, stripe_p));\n\n float gradient_t = (stripe_p - w[0] - w[1]) / w[2];\n float gradient = mix(c1, c2, smoothstep(0., 1., gradient_t));\n ch = mix(ch, gradient, smoothstep(border - blur, border + blur, stripe_p));\n\n return ch;\n}\n\nfloat get_img_frame_alpha(vec2 uv, float img_frame_width) {\n float img_frame_alpha = smoothstep(0., img_frame_width, uv.x) * smoothstep(1., 1. - img_frame_width, uv.x);\n img_frame_alpha *= smoothstep(0., img_frame_width, uv.y) * smoothstep(1., 1. - img_frame_width, uv.y);\n return img_frame_alpha;\n}\n\nvoid main() {\n vec2 uv = vUv;\n uv.y = 1. - uv.y;\n uv.x *= u_ratio;\n\n float diagonal = uv.x - uv.y;\n\n float t = .001 * u_time;\n\n vec2 img_uv = get_img_uv();\n vec4 img = texture(u_image_texture, img_uv);\n\n vec3 color = vec3(0.);\n float opacity = 1.;\n\n vec3 color1 = vec3(.98, 0.98, 1.);\n vec3 color2 = vec3(.1, .1, .1 + .1 * smoothstep(.7, 1.3, uv.x + uv.y));\n\n float edge = img.r;\n\n\n vec2 grad_uv = uv;\n grad_uv -= .5;\n\n float dist = length(grad_uv + vec2(0., .2 * diagonal));\n\n grad_uv = rotate(grad_uv, (.25 - .2 * diagonal) * PI);\n\n float bulge = pow(1.8 * dist, 1.2);\n bulge = 1. - bulge;\n bulge *= pow(uv.y, .3);\n\n\n float cycle_width = u_patternScale;\n float thin_strip_1_ratio = .12 / cycle_width * (1. - .4 * bulge);\n float thin_strip_2_ratio = .07 / cycle_width * (1. + .4 * bulge);\n float wide_strip_ratio = (1. - thin_strip_1_ratio - thin_strip_2_ratio);\n\n float thin_strip_1_width = cycle_width * thin_strip_1_ratio;\n float thin_strip_2_width = cycle_width * thin_strip_2_ratio;\n\n opacity = 1. - smoothstep(.9 - .5 * u_edge, 1. - .5 * u_edge, edge);\n opacity *= get_img_frame_alpha(img_uv, 0.01);\n\n\n float noise = snoise(uv - t);\n\n edge += (1. - edge) * u_liquid * noise;\n\n float refr = 0.;\n refr += (1. - bulge);\n refr = clamp(refr, 0., 1.);\n\n float dir = grad_uv.x;\n\n\n dir += diagonal;\n\n dir -= 2. * noise * diagonal * (smoothstep(0., 1., edge) * smoothstep(1., 0., edge));\n\n bulge *= clamp(pow(uv.y, .1), .3, 1.);\n dir *= (.1 + (1.1 - edge) * bulge);\n\n dir *= smoothstep(1., .7, edge);\n\n dir += .18 * (smoothstep(.1, .2, uv.y) * smoothstep(.4, .2, uv.y));\n dir += .03 * (smoothstep(.1, .2, 1. - uv.y) * smoothstep(.4, .2, 1. - uv.y));\n\n dir *= (.5 + .5 * pow(uv.y, 2.));\n\n dir *= cycle_width;\n\n dir -= t;\n\n float refr_r = refr;\n refr_r += .03 * bulge * noise;\n float refr_b = 1.3 * refr;\n\n refr_r += 5. * (smoothstep(-.1, .2, uv.y) * smoothstep(.5, .1, uv.y)) * (smoothstep(.4, .6, bulge) * smoothstep(1., .4, bulge));\n refr_r -= diagonal;\n\n refr_b += (smoothstep(0., .4, uv.y) * smoothstep(.8, .1, uv.y)) * (smoothstep(.4, .6, bulge) * smoothstep(.8, .4, bulge));\n refr_b -= .2 * edge;\n\n refr_r *= u_refraction;\n refr_b *= u_refraction;\n\n vec3 w = vec3(thin_strip_1_width, thin_strip_2_width, wide_strip_ratio);\n w[1] -= .02 * smoothstep(.0, 1., edge + bulge);\n float stripe_r = mod(dir + refr_r, 1.);\n float r = get_color_channel(color1.r, color2.r, stripe_r, w, 0.02 + .03 * u_refraction * bulge, bulge);\n float stripe_g = mod(dir, 1.);\n float g = get_color_channel(color1.g, color2.g, stripe_g, w, 0.01 / (1. - diagonal), bulge);\n float stripe_b = mod(dir - refr_b, 1.);\n float b = get_color_channel(color1.b, color2.b, stripe_b, w, .01, bulge);\n\n color = vec3(r, g, b);\n\n color *= opacity;\n\n fragColor = vec4(color, opacity);\n}\n";
|
|
5
|
-
//#endregion
|
|
6
|
-
export { t as liquidFragSource, e as vertexShaderSource };
|
|
7
|
-
/* 欲穷千里目,更上一层楼 */
|
|
8
|
-
/* 独立思考,明辨是非 */
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import './index.less';
|
package/liquid-logo/utils.d.ts
DELETED
|
File without changes
|
package/liquid-logo/utils.js
DELETED
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import type { SplashCursorProps } from './interface';
|
|
2
|
-
declare const SplashCursor: import("react").ForwardRefExoticComponent<SplashCursorProps & import("react").RefAttributes<unknown>> & {
|
|
3
|
-
zh: string;
|
|
4
|
-
en: string;
|
|
5
|
-
displayName: string;
|
|
6
|
-
id: string;
|
|
7
|
-
legacy?: string;
|
|
8
|
-
descriptions?: string;
|
|
9
|
-
};
|
|
10
|
-
export default SplashCursor;
|