diff --git a/src/custom/LiquidGlass/LiquidGlass.tsx b/src/custom/LiquidGlass/LiquidGlass.tsx new file mode 100644 index 00000000..e6a4fe2f --- /dev/null +++ b/src/custom/LiquidGlass/LiquidGlass.tsx @@ -0,0 +1,77 @@ +import React, { type CSSProperties} from "react" + +interface LiquidGlassProps extends React.HTMLAttributes { + children: React.ReactNode + blurAmount?: number + saturation?: number + cornerRadius?: number + className?: string + padding?: string + style?: CSSProperties + overLight?: boolean + showShadow?: boolean + zIndex?: number + showTextShadow?: boolean +} + +export default function LiquidGlass({ + children, + blurAmount = 0.0625, + saturation = 140, + cornerRadius = 999, + className = "", + padding = "24px 32px", + overLight = false, + showShadow = true, + zIndex = 2, + showTextShadow = true, + style = {}, + }: LiquidGlassProps) { + + const baseBlur = overLight ? 12 : 4 + const blurPx = baseBlur + blurAmount * 32 + + const backdropStyle = { + backdropFilter: `blur(${blurPx}px) saturate(${saturation}%)`, + } + + return ( +
+
+ {/* backdrop layer that gets wiggly */} + + + {/* user content stays sharp */} +
+ {children} +
+
+
+ ); +} \ No newline at end of file diff --git a/src/custom/LiquidGlass/index.tsx b/src/custom/LiquidGlass/index.tsx new file mode 100644 index 00000000..4ab44075 --- /dev/null +++ b/src/custom/LiquidGlass/index.tsx @@ -0,0 +1 @@ +export {default as LiquidGlass} from './LiquidGlass'; \ No newline at end of file diff --git a/src/custom/index.tsx b/src/custom/index.tsx index a7d300d9..338bff26 100644 --- a/src/custom/index.tsx +++ b/src/custom/index.tsx @@ -171,3 +171,4 @@ export * from './ResourceDetailFormatters'; export * from './ShareModal'; export * from './UserSearchField'; export * from './Workspaces'; +export * from './LiquidGlass';