mirror of
https://github.com/different-ai/openwork
synced 2026-04-25 17:15:34 +02:00
* feat(ui): add shared seeded paper gradients Centralize the Paper mesh and grain wrappers so React and Solid apps can reuse the same deterministic seed-based visuals without repeating shader config. Add a standalone demo surface and update existing consumers so the shared package is easier to validate and evolve. * fix(ui): resolve shared package from source Point the shared UI package exports at source files so Next builds do not depend on a prebuilt dist directory. Add Next transpilation for @openwork/ui in Landing and Den Web so monorepo and Vercel builds resolve the package consistently. --------- Co-authored-by: src-opn <src-opn@users.noreply.github.com>
32 lines
733 B
TypeScript
32 lines
733 B
TypeScript
"use client";
|
|
|
|
import { PaperGrainGradient } from "@openwork/ui/react";
|
|
|
|
type Props = {
|
|
seed?: string;
|
|
colors: string[];
|
|
colorBack: string;
|
|
softness: number;
|
|
intensity: number;
|
|
noise: number;
|
|
shape: "corners" | "wave" | "dots" | "truchet" | "ripple" | "blob" | "sphere";
|
|
speed: number;
|
|
className?: string;
|
|
};
|
|
|
|
export function ResponsiveGrain(props: Props) {
|
|
return (
|
|
<PaperGrainGradient
|
|
className={`absolute inset-0 overflow-hidden ${props.className || ""}`}
|
|
seed={props.seed}
|
|
colors={props.colors}
|
|
colorBack={props.colorBack}
|
|
softness={props.softness}
|
|
intensity={props.intensity}
|
|
noise={props.noise}
|
|
shape={props.shape}
|
|
speed={props.speed}
|
|
/>
|
|
);
|
|
}
|