### Install dependencies and start dev server Source: https://github.com/0xdhrv/oneko/blob/main/docs/development.md Installs dependencies and starts the local development server. Run these commands in order from the repository root. ```bash pnpm install pnpm dev ``` -------------------------------- ### Use custom sprites and thought arrays Source: https://github.com/0xdhrv/oneko/blob/main/README.md Example of providing a custom sprite source and an array of bubble texts for the cat to cycle through. ```tsx ``` -------------------------------- ### Run project checks Source: https://github.com/0xdhrv/oneko/blob/main/README.md Commands for linting, formatting, testing, and building the project. ```bash pnpm lint pnpm fmt:check pnpm test pnpm build ``` -------------------------------- ### Prepare generated skins script Source: https://github.com/0xdhrv/oneko/blob/main/docs/skins.md Command to prepare 256 × 128 PNGs with nearest-neighbor sampling and binary transparency, then embed them in the catalog. Run before `pnpm run registry:build`. ```bash node scripts/prepare-generated-skins.mjs ``` -------------------------------- ### Add oneko component via shadcn CLI Source: https://github.com/0xdhrv/oneko/blob/main/docs/development.md Adds the oneko component to a project using the shadcn CLI. The URL points to the generated registry file. ```bash npx shadcn@latest add https://oneko.dhrv.pw/r/oneko.json ``` -------------------------------- ### Oneko component with integration options Source: https://github.com/0xdhrv/oneko/blob/main/docs/oneko.md Configure the Oneko component with options for pausing, cursor following, sleep, bubble placement and scale, sound base path, and storage key. The options update without restarting the animation, except for the storage key. ```tsx ``` -------------------------------- ### Verify local endpoints with curl Source: https://github.com/0xdhrv/oneko/blob/main/docs/development.md These curl commands test local Markdown and HTML content negotiation, the llms.txt endpoint, and a non-existent page for error handling. They are intended for local verification since the CLI rejects localhost. ```bash curl -i -H 'Accept: text/markdown' http://localhost:3000/docs curl -i -H 'Accept: text/html' http://localhost:3000/docs curl -i http://localhost:3000/llms.txt curl -i http://localhost:3000/this-cat-page-does-not-exist ``` -------------------------------- ### Configure Oneko component props Source: https://github.com/0xdhrv/oneko/blob/main/README.md Basic usage of the Oneko component showing how to set skin, speed, bubble text, and behavior flags. ```tsx ``` -------------------------------- ### Render Oneko in a client component Source: https://github.com/0xdhrv/oneko/blob/main/README.md Use this client component to render the Oneko cat. It mounts itself on document.body, keeping it above your app without adding layout wrappers. For SSR-enabled apps, render this from a client-only boundary, e.g., with dynamic(..., { ssr: false }) in Next.js App Router. ```tsx "use client"; import Oneko from "@/components/oneko"; export function CatLayer() { return ; } ``` -------------------------------- ### Define avoidance and attraction zones Source: https://github.com/0xdhrv/oneko/blob/main/README.md Use the data-oneko-zone attribute on HTML elements to define areas the cat should avoid or be attracted to. ```tsx
Navigation
``` -------------------------------- ### Mark zones with data attributes Source: https://github.com/0xdhrv/oneko/blob/main/docs/oneko.md Use data-oneko-zone attributes on elements to mark them as avoid or attract zones. No extra prop is required. ```tsx
Keep the cat away from this area.
A favorite place to visit.
``` -------------------------------- ### Define zones with selectors or rectangles Source: https://github.com/0xdhrv/oneko/blob/main/docs/oneko.md Define zones using OnekoZone objects with selectors or fixed viewport rectangles. Pass them via the zones prop, and optionally set zoneAttractionChance and zoneAttractionDuration. ```tsx import Oneko, { type OnekoZone } from "@/components/oneko"; const zones: OnekoZone[] = [ { id: "checkout", type: "avoid", selector: "#checkout", padding: 12 }, { id: "cat-bed", type: "attract", selector: ".cat-bed" }, { id: "corner", type: "avoid", rect: { left: 0, top: 0, right: 160, bottom: 100 } }, ]; ; ``` -------------------------------- ### Use a custom sprite sheet with spriteSrc Source: https://github.com/0xdhrv/oneko/blob/main/docs/skins.md Uses a hosted sprite sheet instead of a built-in skin. `spriteSrc` overrides `skin` and updates without resetting position; omit it to return to the selected built-in coat. ```tsx ``` -------------------------------- ### Check public agent score with npx is-agentic Source: https://github.com/0xdhrv/oneko/blob/main/docs/development.md Run this command to inspect the latest stored public report for the Oneko site. The CLI rejects localhost URLs and returns the latest stored report without forcing a rescan; check the scanned_at timestamp before treating it as evidence. ```bash npx is-agentic https://oneko.dhrv.pw --json ``` -------------------------------- ### Use a skin with the Oneko component Source: https://github.com/0xdhrv/oneko/blob/main/docs/skins.md Sets the cat's coat to 'calico' and disables meowing. Changing `skin` swaps the coat without resetting position or activity; unknown IDs fall back to `classic`. ```tsx ``` -------------------------------- ### CatActivityState type for activity states Source: https://github.com/0xdhrv/oneko/blob/main/docs/oneko.md Defines the possible activity states used by onStateChange and liveStateRef.current.state. The union includes idle, moving, sleeping, scratching, tired, alert, and freerun states. ```ts type CatActivityState = | "idle" | "moving" | "sleeping" | "scratchSelf" | "tired" | "alert" | "scratchWallN" | "scratchWallS" | "scratchWallE" | "scratchWallW" | "freerun"; ``` -------------------------------- ### Disable meow sound with Oneko meow={false} Source: https://github.com/0xdhrv/oneko/blob/main/docs/oneko.md Disables the meow sound when the component is used. Sound files are requested from /cat-sounds/*.ogg when meow is enabled; browsers may block playback until user interaction. ```tsx ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.