Skip to content

pastetaste

Invert Lens

InteractionHeroesAmbient

A round lens that turns whatever is under it into its negative: it follows the mouse with a soft lag and drifts on its own on touch screens. One difference-blend disc, no copy of the content.

Paste it into Claude Code: it installs the component, asks for your brand and content, and places it on the page you name.

Install

Or by hand, in a Next.js project with shadcn set up. It writes components/pastetaste/invert-lens.tsx.

npx shadcn@latest add https://pastetaste.com/r/invert-lens.json

Prompt

Install the pastetaste component "Invert Lens" (invert-lens) into this Next.js project and use it.

What it is: A round lens that turns whatever is under it into its negative: it follows the mouse with a soft lag and drifts on its own on touch screens. One difference-blend disc, no copy of the content.

Before you place it, ask me (one short message, in my language; "skip" = sensible default): which page and section it goes in, my brand colour (hex), the text, labels or images it should show, and whether I want my logo or my own copy in the demo content. Then:

Steps:
1. If the project has no components.json, run: npx shadcn@latest init -y -d. Then run: npx shadcn@latest add https://pastetaste.com/r/invert-lens.json
   (it writes components/pastetaste/invert-lens.tsx; install any npm packages it reports).
2. Import it: import { InvertLens } from "@/components/pastetaste/invert-lens" (check the file for the exact named export).
3. Put it where it fits on the page I name, keep the rest of the page untouched, and pass props for my colours instead of editing the installed file.
4. It does not depend on Tailwind; colours come from CSS variables (--pt-*) or props.
5. It supports prefers-reduced-motion with a still state; do not remove it.

Props (all optional unless the type has no default):
- children: ReactNode — The content to invert (hero, poster, photo).
- size: string = 'clamp(150px, 19vw, 290px)' — Lens diameter, any CSS length.
- background: string = '#060606' — Opaque container background; the lens inverts it too.
- follow: number = 0.12 — Follow speed 0 to 1.
- idleAfter: number = 2600 — Ms without mouse movement before the lens drifts on its own.
- disabled: boolean = false — Render children only.
- className / style: string / CSSProperties — On the container.

Live preview: https://pastetaste.com/c/invert-lens
Then run the dev server, check it in the browser at desktop and mobile width, and tell me the page URL.

Props 7

PropTypeDefaultDescription
childrenReactNode-The content to invert (hero, poster, photo).
sizestring'clamp(150px, 19vw, 290px)'Lens diameter, any CSS length.
backgroundstring'#060606'Opaque container background; the lens inverts it too.
follownumber0.12Follow speed 0 to 1.
idleAfternumber2600Ms without mouse movement before the lens drifts on its own.
disabledbooleanfalseRender children only.
className / stylestring / CSSProperties-On the container.
View all →