diff --git a/components.json b/components.json index a4dbfe4..65849d8 100644 --- a/components.json +++ b/components.json @@ -22,6 +22,7 @@ "hooks": "@/hooks" }, "registries": { - "@tool-ui": "https://www.tool-ui.com/r/{name}.json" + "@tool-ui": "https://www.tool-ui.com/r/{name}.json", + "@magicui": "https://magicui.design/r/{name}" } } diff --git a/components/canvas/canvas-sidebar.tsx b/components/canvas/canvas-sidebar.tsx index dfde480..6855b53 100644 --- a/components/canvas/canvas-sidebar.tsx +++ b/components/canvas/canvas-sidebar.tsx @@ -31,6 +31,7 @@ import { } from "lucide-react"; import { CanvasUserMenu } from "@/components/canvas/canvas-user-menu"; +import { ProgressiveBlur } from "@/components/ui/progressive-blur"; import { useAuthQuery } from "@/hooks/use-auth-query"; import { api } from "@/convex/_generated/api"; import type { Id } from "@/convex/_generated/dataModel"; @@ -240,15 +241,13 @@ export default function CanvasSidebar({ )} -
diff --git a/components/ui/progressive-blur.tsx b/components/ui/progressive-blur.tsx new file mode 100644 index 0000000..0d74b36 --- /dev/null +++ b/components/ui/progressive-blur.tsx @@ -0,0 +1,113 @@ +"use client" + +import React from "react" + +import { cn } from "@/lib/utils" + +export interface ProgressiveBlurProps { + className?: string + height?: string + position?: "top" | "bottom" | "both" + blurLevels?: number[] + children?: React.ReactNode +} + +export function ProgressiveBlur({ + className, + height = "30%", + position = "bottom", + blurLevels = [0.5, 1, 2, 4, 8, 16, 32, 64], +}: ProgressiveBlurProps) { + // Create array with length equal to blurLevels.length - 2 (for before/after pseudo elements) + const divElements = Array(blurLevels.length - 2).fill(null) + + return ( +
+ {/* First blur layer (pseudo element) */} +
+ + {/* Middle blur layers */} + {divElements.map((_, index) => { + const blurIndex = index + 1 + const startPercent = blurIndex * 12.5 + const midPercent = (blurIndex + 1) * 12.5 + const endPercent = (blurIndex + 2) * 12.5 + + const maskGradient = + position === "bottom" + ? `linear-gradient(to bottom, rgba(0,0,0,0) ${startPercent}%, rgba(0,0,0,1) ${midPercent}%, rgba(0,0,0,1) ${endPercent}%, rgba(0,0,0,0) ${endPercent + 12.5}%)` + : position === "top" + ? `linear-gradient(to top, rgba(0,0,0,0) ${startPercent}%, rgba(0,0,0,1) ${midPercent}%, rgba(0,0,0,1) ${endPercent}%, rgba(0,0,0,0) ${endPercent + 12.5}%)` + : `linear-gradient(rgba(0,0,0,0) 0%, rgba(0,0,0,1) 5%, rgba(0,0,0,1) 95%, rgba(0,0,0,0) 100%)` + + return ( +
+ ) + })} + + {/* Last blur layer (pseudo element) */} +
+
+ ) +}