Pipeline
- Docsusage, props, keywords
- Demosrc/demo.tsx
- Buildshadcn add → vite
- Capturelight, dark, motion
- IndexBM25 + vectors
Public log. Prompts, raw model errors and costs stay on the admin side.
Log
Demo source
src/demo.tsx · from an earlier run
import { useEffect, useRef, useState } from "react"import { createRetroDither, supportsHtmlInCanvas } from "@/components/canvasui/RetroDitherVanilla"import { Button } from "@/components/ui/button"import { Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle } from "@/components/ui/card"import { Input } from "@/components/ui/input"import { Label } from "@/components/ui/label"export default function RetroDitherDemo() { const sourceRef = useRef<HTMLCanvasElement>(null) const contentRef = useRef<HTMLDivElement>(null) const outputRef = useRef<HTMLCanvasElement>(null) const [supported, setSupported] = useState(false) useEffect(() => { setSupported(supportsHtmlInCanvas()) }, []) useEffect(() => { const source = sourceRef.current const content = contentRef.current const output = outputRef.current if (!supported || !source || !content || !output) return const instance = createRetroDither( { source, content, output }, { pattern: "bayer", levels: 4, radius: 0.4 }, ) return () => { instance?.destroy() } }, [supported]) const card = ( <Card className="w-full max-w-sm"> <CardHeader> <CardTitle>Login to your account</CardTitle> <CardDescription>Enter your email below to login to your account</CardDescription> </CardHeader> <CardContent> <div className="grid gap-2"> <Label htmlFor="email">Email</Label> <Input id="email" type="email" placeholder="m@example.com" /> </div> </CardContent> <CardFooter className="flex-col gap-2"> <Button className="w-full">Login</Button> </CardFooter> </Card> ) if (!supported) { return <div className="flex w-full max-w-lg justify-center">{card}</div> } return ( <div className="relative h-80 w-full max-w-lg overflow-hidden"> <canvas ref={sourceRef} className="absolute inset-0 h-full w-full"> <div ref={contentRef} className="absolute inset-0 flex items-center justify-center p-6"> {card} </div> </canvas> <canvas ref={outputRef} className="pointer-events-none absolute inset-0 h-full w-full" /> </div> )}