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 } from 'react';import { Button } from '@/components/ui/button';import { Badge } from '@/components/ui/badge';import { createAsciiSweep, type AsciiSweepInstance } from '@/components/canvasui/AsciiSweepVanilla';export default function AsciiSweepDemo() { const outputRef = useRef<HTMLCanvasElement>(null); const source0 = useRef<HTMLCanvasElement>(null); const source1 = useRef<HTMLCanvasElement>(null); const content0 = useRef<HTMLDivElement>(null); const content1 = useRef<HTMLDivElement>(null); const instanceRef = useRef<AsciiSweepInstance | null>(null); useEffect(() => { const output = outputRef.current; const s0 = source0.current; const s1 = source1.current; const c0 = content0.current; const c1 = content1.current; if (!output || !s0 || !s1 || !c0 || !c1) return; const instance = createAsciiSweep({ slots: [ { source: s0, content: c0 }, { source: s1, content: c1 }, ], output, }); instanceRef.current = instance; return () => { instance?.destroy(); instanceRef.current = null; }; }, []); const handleSwitch = () => { const instance = instanceRef.current; if (!instance) return; instance.sweep(instance.current() === 0 ? 1 : 0); }; return ( <div className='flex w-full max-w-lg flex-col gap-4'> <div className='relative h-64 overflow-hidden rounded-xl border bg-background'> <canvas ref={source0} className='absolute inset-0 h-full w-full'> <div ref={content0} className='h-full overflow-auto p-6 text-foreground'> <p className='text-sm text-muted-foreground'>Inbox</p> <p className='mt-2 text-lg font-semibold'>Good morning, Olivia</p> <p className='mt-1 text-sm'>You have three new messages from your team.</p> </div> </canvas> <canvas ref={source1} className='absolute inset-0 h-full w-full'> <div ref={content1} className='h-full overflow-auto p-6 text-foreground'> <p className='text-sm text-muted-foreground'>Orders</p> <p className='mt-2 text-lg font-semibold'>Your order has shipped</p> <div className='mt-2'> <Badge>In transit</Badge> </div> <p className='mt-2 text-sm'>Expected delivery by Friday.</p> </div> </canvas> <canvas ref={outputRef} className='pointer-events-none absolute inset-0 h-full w-full' /> </div> <div className='flex justify-end'> <Button variant='outline' onClick={handleSwitch}> Switch panel </Button> </div> </div> );}