Skip to content

Commit

Permalink
chore(partners): add grid pattern background
Browse files Browse the repository at this point in the history
  • Loading branch information
hyamero committed Aug 17, 2024
1 parent f0c587f commit 28beac4
Show file tree
Hide file tree
Showing 2 changed files with 61 additions and 0 deletions.
59 changes: 59 additions & 0 deletions apps/partners/src/app/components/grid-pattern.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
"use client";

import { cn } from "@umamin/ui/lib/utils";
import { useId } from "react";

interface GridPatternProps {
width?: any;
height?: any;
x?: any;
y?: any;
squares?: Array<[x: number, y: number]>;
strokeDasharray?: any;
className?: string;
[key: string]: any;
}

export function GridPattern({
width = 40,
height = 40,
x = -1,
y = -1,
strokeDasharray = 0,
squares,
className,
...props
}: GridPatternProps) {
const id = useId();

return (
<svg
aria-hidden="true"
className={cn(
"pointer-events-auto absolute inset-0 h-full w-full fill-gray-400/20 stroke-gray-400/5",
className
)}
{...props}
>
<defs>
<pattern
id={id}
width={width}
height={height}
patternUnits="userSpaceOnUse"
x={x}
y={y}
>
<path
d={`M.5 ${height}V.5H${width}`}
fill="none"
strokeDasharray={strokeDasharray}
/>
</pattern>
</defs>
<rect width="100%" height="100%" strokeWidth={0} fill={`url(#${id})`} />
</svg>
);
}

export default GridPattern;
2 changes: 2 additions & 0 deletions apps/partners/src/app/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,12 @@ import { ExternalLink } from "lucide-react";
import { cn } from "@umamin/ui/lib/utils";
import { Button } from "@umamin/ui/components/button";
import { AnimatedShinyText } from "@umamin/ui/components/animated-shiny-text";
import GridPattern from "./components/grid-pattern";

export default function Home() {
return (
<main className="flex items-center flex-col min-h-screen lg:pt-44 py-36 md:gap-8 gap-6 container">
<GridPattern className="[mask-image:radial-gradient(ellipse_at_center,white,transparent_60%)]" />
<Link
href="#"
className={cn(
Expand Down

0 comments on commit 28beac4

Please sign in to comment.