### Setup and development commands Source: https://github.com/alain00/blobatar/blob/main/CONTRIBUTING.md Run these commands in the repository root to install dependencies and start the development servers. The repo uses Bun, not npm. The 'bun run check' command runs everything CI runs. ```sh bun install # bun, not npm — the repo is a Bun workspace bun run dev # the tuning grid (apps/demo) bun run site # the landing page (apps/site) bun run api # the endpoint (apps/api), builds the library first bun run test # the library's suite bun run check # everything CI runs, or close to it ``` -------------------------------- ### Development Commands (bun) Source: https://github.com/alain00/blobatar/blob/main/README.md Run these commands from the repository root to install dependencies, start the tuning grid, landing page, API endpoint, run tests, run checks, and regenerate README images. Requires bun, and the media command needs Chrome and ImageMagick. ```sh bun install bun dev # tuning grid → localhost:3001 bun site # landing page → localhost:3000 bun api # the endpoint → localhost:8787/avatar/alain bun test # library tests bun run check # tests + size budgets bun run media # redraw the README images (needs Chrome + ImageMagick) ``` -------------------------------- ### Run example checks Source: https://github.com/alain00/blobatar/blob/main/packages/flutter/example/README.md Run static analysis and tests for the example. ```sh flutter analyze flutter test ``` -------------------------------- ### Install @blobatar/preact with bun Source: https://github.com/alain00/blobatar/blob/main/packages/preact/README.md Install the package and its peer dependency using bun. ```sh bun add @blobatar/preact blobatar ``` -------------------------------- ### Install @blobatar/solid and blobatar Source: https://github.com/alain00/blobatar/blob/main/packages/solid/README.md Install the Solid adapter and the core blobatar library using bun. ```sh bun add @blobatar/solid blobatar ``` -------------------------------- ### Install React adapter Source: https://github.com/alain00/blobatar/blob/main/README.md Install the React adapter package along with the core. ```sh bun add blobatar @blobatar/react ``` -------------------------------- ### Install Solid or Preact adapter Source: https://github.com/alain00/blobatar/blob/main/README.md Install the Solid or Preact adapter package along with the core. ```sh bun add blobatar @blobatar/solid # or @blobatar/preact ``` -------------------------------- ### Install Svelte adapter Source: https://github.com/alain00/blobatar/blob/main/README.md Install the Svelte adapter package along with the core. ```sh bun add blobatar @blobatar/svelte ``` -------------------------------- ### Install Vue adapter Source: https://github.com/alain00/blobatar/blob/main/README.md Install the Vue adapter package along with the core. ```sh bun add blobatar @blobatar/vue ``` -------------------------------- ### Run the Flutter example app Source: https://github.com/alain00/blobatar/blob/main/packages/flutter/example/README.md From the repository root, navigate to the example directory, fetch dependencies, and run the app on Chrome. ```sh cd packages/flutter/example flutter pub get flutter run -d chrome ``` -------------------------------- ### Install @blobatar/svelte with bun Source: https://github.com/alain00/blobatar/blob/main/packages/svelte/README.md Install the Svelte adapter and the core blobatar library using bun. ```sh bun add @blobatar/svelte blobatar ``` -------------------------------- ### Install globally and run blobatar Source: https://github.com/alain00/blobatar/blob/main/packages/cli/README.md Install the CLI globally with npm or bun, then run it with the `blobatar` command. ```sh npm i -g @blobatar/cli # or: bun add -g @blobatar/cli blobatar alain ``` -------------------------------- ### Install Flutter package Source: https://github.com/alain00/blobatar/blob/main/README.md Install the Flutter package using flutter pub add. ```sh flutter pub add blobatar ``` -------------------------------- ### Install blobatar core Source: https://github.com/alain00/blobatar/blob/main/README.md Install the core blobatar package using bun, npm, pnpm, or yarn. ```sh bun add blobatar # npm / pnpm / yarn all work too ``` -------------------------------- ### Install @blobatar/react-native dependencies Source: https://github.com/alain00/blobatar/blob/main/packages/react-native/README.md Install the required packages using bun or npx expo. ```sh bun add @blobatar/react-native blobatar npx expo install react-native-svg # or: bun add react-native-svg ``` -------------------------------- ### Install React Native and Expo dependencies Source: https://github.com/alain00/blobatar/blob/main/README.md Install the React Native adapter and react-native-svg. For Expo, use npx expo install. ```sh bun add blobatar @blobatar/react-native npx expo install react-native-svg # or bun add react-native-svg ``` -------------------------------- ### Bun test example (index.test.ts) Source: https://github.com/alain00/blobatar/blob/main/CLAUDE.md Example test file using bun:test. Run with `bun test`. ```ts import { test, expect } from "bun:test"; test("hello world", () => { expect(1).toBe(1); }); ``` -------------------------------- ### Install additional blobatar components Source: https://github.com/alain00/blobatar/blob/main/README.md Installs five additional components built on the avatar: presence-avatar, agent-list, user-table, password-field, and group-chat. Each is a composition you own after installing. ```sh npx shadcn@latest add @blobatar/presence-avatar npx shadcn@latest add @blobatar/agent-list npx shadcn@latest add @blobatar/user-table npx shadcn@latest add @blobatar/password-field npx shadcn@latest add @blobatar/group-chat ``` -------------------------------- ### Install Reanimated dependencies Source: https://github.com/alain00/blobatar/blob/main/packages/react-native/README.md Command to install the required native animation dependencies for the animated subpath. ```sh npx expo install react-native-reanimated react-native-worklets ``` -------------------------------- ### Run development server Source: https://github.com/alain00/blobatar/blob/main/apps/api/README.md Starts the local development server. Must be run from the repository root so the library is built first. ```sh bun api # wrangler dev → localhost:8787/avatar/alain ``` -------------------------------- ### CLI usage examples Source: https://github.com/alain00/blobatar/blob/main/packages/cli/README.md Shows the various ways to invoke the CLI: output to stdout, write to a file with format from extension, specify size for PNG, set background/hue/tone/expression, and batch process from stdin. ```text blobatar SVG to stdout blobatar -o alain.svg to a file; format from the extension blobatar -o alain.png --size 512 blobatar --background circle --hue 210 --tone 0.4 --expression happy blobatar --stdin -d ./blobatars/ batch: one name per line on stdin ``` -------------------------------- ### Install @blobatar/vue and blobatar with bun Source: https://github.com/alain00/blobatar/blob/main/packages/vue/README.md Install the adapter and its peer dependency. blobatar is a peer dependency, so the adapter carries no renderer of its own. ```sh bun add @blobatar/vue blobatar ``` -------------------------------- ### Install @blobatar/react and blobatar with bun Source: https://github.com/alain00/blobatar/blob/main/packages/react/README.md Install the adapter and its peer dependency. blobatar is a peer dependency; the adapter carries no renderer of its own. ```sh bun add @blobatar/react blobatar ``` -------------------------------- ### Development commands for blobatar workspace Source: https://github.com/alain00/blobatar/blob/main/packages/blobatar/README.md Run these commands from the repo root. The package lives in a Bun workspace alongside apps/site and apps/demo. bun dev starts the tuning grid at localhost:3001, bun site starts the landing page at localhost:3000, bun test runs 94 tests, bun run size checks per-entry gzip budgets, and bun run check runs checks. ```sh bun dev # tuning grid at localhost:3001 bun site # landing page at localhost:3000 bun test # 94 tests bun run size # per-entry gzip budgets bun run check ``` -------------------------------- ### Development commands for the Flutter package Source: https://github.com/alain00/blobatar/blob/main/packages/flutter/README.md Run formatting checks, static analysis, Dart and Flutter tests, and generate documentation. Then navigate to the example directory and run its analysis and tests. ```sh cd packages/flutter flutter pub get dart format --output=none --set-exit-if-changed . dart analyze dart test test/dart flutter test test/flutter dart doc cd example flutter pub get flutter analyze flutter test ``` -------------------------------- ### Solid usage example Source: https://github.com/alain00/blobatar/blob/main/README.md Render a Blobatar component in Solid. The import is swapped from React; the rest is the same. ```tsx import { Blobatar } from "@blobatar/solid"; ; ``` -------------------------------- ### GET /avatar/ Source: https://github.com/alain00/blobatar/blob/main/apps/api/README.md Returns the full parameter list. Also any other path returns the parameter list with a 404 status. ```APIDOC ## GET /avatar/ ### Description Returns the full parameter list. Also any other path returns the parameter list with a 404 status. ### Method GET ### Endpoint /avatar/ ### Response #### Success Response (200) Returns the full parameter list. #### Response Example (Parameter list) #### Error Response (404) Returns the full parameter list with a 404 status. ``` -------------------------------- ### SVG icon examples for blobatar configurations Source: https://github.com/alain00/blobatar/blob/main/packages/blobatar/test/golden/gen2.txt Five SVG icons showing different blobatar configurations: tinted, titled, sized, configured, and astral. Each SVG is a standalone example. ```svg ``` ```svg Alain ``` ```svg ``` ```svg ``` ```svg ``` -------------------------------- ### Run blobatar with npx or bunx Source: https://github.com/alain00/blobatar/blob/main/packages/cli/README.md Run the CLI directly without installation using npx or bunx, outputting an SVG to stdout. ```sh npx @blobatar/cli alain > alain.svg # or: bunx @blobatar/cli alain ``` -------------------------------- ### Add @blobatar adapters with bun Source: https://github.com/alain00/blobatar/blob/main/packages/codemod/README.md After running the codemod, add the adapters you use. The codemod does not install anything or touch dependency versions; this is done separately with your package manager. ```sh bun add @blobatar/react # and/or @blobatar/vue ``` -------------------------------- ### Basic Blobatar usage Source: https://github.com/alain00/blobatar/blob/main/packages/react-native/README.md Example of rendering a static Blobatar component with a required size and expression. ```tsx import { happy } from "blobatar/expression"; ; ``` -------------------------------- ### Install blobatar avatar directly from repository Source: https://github.com/alain00/blobatar/blob/main/README.md Adds the avatar component directly from the GitHub repository without registering a registry. Reads the main branch, so it uses the current composition rather than the last released one. Copies the same file as the registry method. ```sh npx shadcn@latest add Alain00/blobatar/avatar ``` -------------------------------- ### AnimatedBlobatar usage examples Source: https://github.com/alain00/blobatar/blob/main/packages/react-native/README.md Examples of using AnimatedBlobatar for a single profile header and within a list grid. ```tsx import { AnimatedBlobatar } from "@blobatar/react-native/animated"; // a profile header, one large avatar // a grid: only what the list says is on screen ``` -------------------------------- ### Migrate from blobatar/vue with codemod Source: https://github.com/alain00/blobatar/blob/main/packages/vue/README.md Run the codemod to rewrite blobatar/vue specifiers, then install the new package. The codemod is safe to run twice and does not install anything. ```sh bunx blobatar-codemod . bun add @blobatar/vue ``` -------------------------------- ### BlobatarOptions configuration example Source: https://github.com/alain00/blobatar/blob/main/packages/flutter/README.md Shows a BlobatarOptions instance with custom background, hue, tone, palette, traits, normalize, contrast, and expression settings. Options are immutable and forwarded to the core without adapter-specific defaults. ```dart BlobatarOptions( background: Backdrop.circle, hue: 210, tone: 0.8, palette: const {'eye': '#ffffff'}, traits: const { 'shape': 0.99, 'eye.ratio': 0, }, normalize: true, contrast: true, expression: love, ) ``` -------------------------------- ### GET /avatar/ Source: https://github.com/alain00/blobatar/blob/main/README.md Returns the full parameter list for the avatar endpoint as plain text. ```APIDOC ## GET /avatar/ ### Description Returns the whole parameter list as plain text. This is the reference for the avatar endpoint. ### Method GET ### Endpoint https://blobatar.dev/avatar/ ### Parameters None. ### Request Example ``` https://blobatar.dev/avatar/ ``` ### Response #### Success Response (200) Returns plain text listing all parameters. #### Response Example Plain text. ``` -------------------------------- ### Install blobatar avatar via shadcn registry Source: https://github.com/alain00/blobatar/blob/main/README.md Registers the blobatar registry and adds the avatar component. The first command registers the registry, the second adds the avatar. Both commands are required for this workflow. ```sh npx shadcn@latest registry add @blobatar=https://blobatar.dev/r/{name}.json npx shadcn@latest add @blobatar/avatar ``` -------------------------------- ### Migrate from legacy blobatar/react or blobatar/vue Source: https://github.com/alain00/blobatar/blob/main/README.md Commands to migrate from deprecated subpaths. Run the codemod and install the new package. The old subpaths still work but are deprecated and will be removed in v3. ```sh bunx blobatar-codemod . bun add @blobatar/react # and/or @blobatar/vue ``` -------------------------------- ### Vue usage example Source: https://github.com/alain00/blobatar/blob/main/README.md Render a Blobatar component in Vue. The name prop is required; all other props are optional and land on the underlying element. ```html ``` -------------------------------- ### Blobatar URL examples with query parameters Source: https://github.com/alain00/blobatar/blob/main/README.md Shows URL patterns for Blobatar avatars. The path is the name (percent-encoded), and query parameters include size (or s), background, hue, tone, expression, title, and gen. ```text https://blobatar.dev/avatar/alain%40example.com?size=64&background=squircle https://blobatar.dev/avatar/team-rocket?expression=smug ``` -------------------------------- ### Derive phase offsets from seed (TypeScript) Source: https://github.com/alain00/blobatar/blob/main/packages/blobatar/docs/motion-spec.md Derives negative phase and bob offsets, and a blink period and phase from a seed. The negative sign is essential to start animations mid-cycle immediately; positive values would postpone the start and cause a delay on first hover. ```ts // Negated at the source. Emitting the positive value is the one mistake this // section exists to prevent, so do not leave the sign to the caller. const phase = -t.num("motion.phase", 0, 2800); // ms const bob = -t.num("motion.bob", 0, 3400); // ms const blink = t.num("motion.blink", 3500, 6500); // period const bph = -t.num("motion.blinkPhase", 0, blink); // ms ``` -------------------------------- ### React usage example Source: https://github.com/alain00/blobatar/blob/main/README.md Render a Blobatar component in React. The name prop is required; all other props are optional and land on the underlying element. ```tsx import { Blobatar } from "@blobatar/react"; ; ``` -------------------------------- ### Flutter usage example Source: https://github.com/alain00/blobatar/blob/main/README.md Render an AnimatedBlobatar widget in Flutter. The name prop is required; size is required. The animation and options are optional. ```dart import 'package:blobatar/flutter.dart'; AnimatedBlobatar( name: user.email, size: 64, animation: BlobatarAnimation.always, options: const BlobatarOptions( background: Backdrop.squircle, expression: happy, ), ) ``` -------------------------------- ### GET /avatar/{name} Source: https://github.com/alain00/blobatar/blob/main/README.md Renders a blobatar avatar image for a given name with configurable options. ```APIDOC ## GET /avatar/{name} ### Description Renders a blobatar avatar image for the given name. The name is percent-encoded in the path, and options are provided as query parameters. ### Method GET ### Endpoint https://blobatar.dev/avatar/{name} ### Parameters #### Path Parameters - **name** (string) - Required - The name to generate the avatar for, percent-encoded. #### Query Parameters - **size** (integer) - Optional - The size of the avatar in pixels. Alias: `s`. - **background** (string) - Optional - The background style, e.g., `squircle`. - **hue** (string) - Optional - The hue for the avatar. - **tone** (string) - Optional - The tone for the avatar. - **expression** (string) - Optional - The expression for the avatar, e.g., `smug`. - **title** (string) - Optional - The title for the avatar. - **gen** (integer) - Optional - The generation of the avatar shape vocabulary. Defaults to the current major version (gen 2). Use `gen=1` for the original six shapes. - **d** (string) - Optional - Accepted and ignored for Gravatar compatibility. - **f** (string) - Optional - Accepted and ignored for Gravatar compatibility. - **r** (string) - Optional - Accepted and ignored for Gravatar compatibility. ### Request Example ``` https://blobatar.dev/avatar/alain00?size=48 ``` ### Response #### Success Response (200) Returns an image (e.g., PNG) of the avatar. #### Response Example An image binary. ``` -------------------------------- ### Svelte usage example Source: https://github.com/alain00/blobatar/blob/main/README.md Render a Blobatar component in Svelte. Requires Svelte 5 or newer. The package ships source code, not built JavaScript. ```svelte ``` -------------------------------- ### React Native usage example Source: https://github.com/alain00/blobatar/blob/main/README.md Render a Blobatar component in React Native. The size prop is required; there is no animate prop. The name prop is required. ```tsx import { Blobatar } from "@blobatar/react-native"; ; ``` -------------------------------- ### MorphingBlobatar usage Source: https://github.com/alain00/blobatar/blob/main/packages/react-native/README.md Example of using MorphingBlobatar to animate transitions between expressions based on state. ```tsx import { MorphingBlobatar } from "@blobatar/react-native"; import { happy, sad } from "blobatar/expression"; ; ``` -------------------------------- ### Handle reduced motion accessibility Source: https://github.com/alain00/blobatar/blob/main/packages/react-native/README.md Examples of integrating AccessibilityInfo to respect system reduced motion settings. ```tsx import { AccessibilityInfo } from "react-native"; const reduce = AccessibilityInfo.useReduceMotionEnabled(); ; // or, to drop the morph as well const C = reduce ? Blobatar : MorphingBlobatar; ; ``` -------------------------------- ### lookAt() targeting examples Source: https://github.com/alain00/blobatar/blob/main/packages/blobatar/CHANGELOG.md lookAt() takes a point in client coordinates, an element, or one of two words. "rest" keeps the idle glance stood down, while null hands the blobatar back to its own life with the driver still attached. Neither is stop(), which is teardown and snaps. ```javascript g.lookAt({ x: caretX, y: caretY }); // a caret, a card, a spot in the viewport g.lookAt(button); // an element: its centre, re-read as the page moves g.lookAt("pointer"); // the cursor g.lookAt("rest"); // its own centre, held: deliberately not looking g.lookAt(null); // nothing — the eyes ease home and the idle glance comes back ``` -------------------------------- ### Emit phase as CSS custom properties (HTML) Source: https://github.com/alain00/blobatar/blob/main/packages/blobatar/docs/motion-spec.md Shows an SVG element with CSS custom properties for phase, blink period, and blink phase, all set to negative values to start animations immediately. ```html ``` -------------------------------- ### GET /avatar/ Source: https://github.com/alain00/blobatar/blob/main/apps/api/README.md Renders a blobatar for the given name. The same name always produces the same avatar. Parameters are named as the library names them, and Gravatar's d, f, and r parameters are accepted and ignored. ```APIDOC ## GET /avatar/ ### Description Renders a blobatar for the given name. The same name always produces the same avatar. Parameters are named as the library names them, and Gravatar's d, f, and r parameters are accepted and ignored. ### Method GET ### Endpoint /avatar/ ### Parameters #### Path Parameters - **name** (string) - Required - Anything that stands for somebody — a username, an email, an id, a Gravatar hash. #### Query Parameters - **size** (string) - Optional - Size parameter, also accepted as `s`. - **background** (string) - Optional - Background parameter. - **hue** (string) - Optional - Hue parameter. - **tone** (string) - Optional - Tone parameter. - **expression** (string) - Optional - Expression parameter. - **title** (string) - Optional - Title parameter. - **d** (string) - Optional - Accepted and ignored (Gravatar compatibility). - **f** (string) - Optional - Accepted and ignored (Gravatar compatibility). - **r** (string) - Optional - Accepted and ignored (Gravatar compatibility). ### Response #### Success Response (200) Returns the rendered avatar image. #### Response Example (Image data) ``` -------------------------------- ### Apply phase to animation delay (CSS) Source: https://github.com/alain00/blobatar/blob/main/packages/blobatar/docs/motion-spec.md Uses the custom property --mo-phase as the animation-delay for the .mo-breathe class, enabling the negative delay to start the animation mid-cycle. ```css .mo-breathe { animation-delay: var(--mo-phase); } ``` -------------------------------- ### Generate a blobatar SVG string with blobatar() Source: https://github.com/alain00/blobatar/blob/main/packages/blobatar/README.md Imports the core blobatar function and calls it with an email string to get an SVG string. The output is a string containing an SVG element. ```ts import { blobatar } from "blobatar"; blobatar("alain@example.com"); // => '…' ``` -------------------------------- ### Reading resolved layout with _layout Source: https://github.com/alain00/blobatar/blob/main/apps/site/docs/editor-spec.md Imports the internal _layout function from 'blobatar' and calls it with a name and traits to get the resolved geometry and palette. The layout runs in full, so containment guarantees apply; read back the resolved value to show slider limits. ```ts import { _layout } from "blobatar"; const l = _layout(name, { traits }); ``` -------------------------------- ### GET /avatar/ route Source: https://github.com/alain00/blobatar/blob/main/apps/api/README.md The single route of the Worker. can be any identifier, and the same name always renders the same blobatar. Parameters are named as the library names them (size/s, background, hue, tone, expression, title), and Gravatar's d, f, r are accepted and ignored. ```http GET /avatar/ ``` -------------------------------- ### HTML entry point with script import (index.html) Source: https://github.com/alain00/blobatar/blob/main/CLAUDE.md HTML file that imports a frontend module. Bun's bundler transpiles and bundles the imported script. ```html

Hello, world!

``` -------------------------------- ### Deploy with bun and wrangler Source: https://github.com/alain00/blobatar/blob/main/apps/api/README.md Manual deployment commands. Run from the apps/api directory. Requires bun and wrangler. ```sh bun install bunx wrangler deploy ``` -------------------------------- ### Bun.serve server with routes and WebSocket (index.ts) Source: https://github.com/alain00/blobatar/blob/main/CLAUDE.md Server using Bun.serve with routes and optional WebSocket support. HTML imports are used for the frontend. Run with `bun --hot ./index.ts`. ```ts import index from "./index.html" Bun.serve({ routes: { "/": index, "/api/users/:id": { GET: (req) => { return new Response(JSON.stringify({ id: req.params.id })); }, }, }, // optional websocket support websocket: { open: (ws) => { ws.send("Hello, world!"); }, message: (ws, message) => { ws.send(message); }, close: (ws) => { // handle close } }, development: { hmr: true, console: true, } }) ``` -------------------------------- ### Migrate to new adapter packages with bunx and bun add Source: https://github.com/alain00/blobatar/blob/main/packages/blobatar/CHANGELOG.md Commands to migrate to the new adapter packages @blobatar/react and @blobatar/vue. The old subpaths remain working but are deprecated and frozen. ```sh bunx blobatar-codemod . bun add @blobatar/react ``` -------------------------------- ### Run tests Source: https://github.com/alain00/blobatar/blob/main/apps/api/README.md Builds the library and runs the API tests. Requires the same build as the development server. ```sh bun --filter blobatar build bun --filter blobatar-api test ``` -------------------------------- ### Run the check command: bun run check Source: https://github.com/alain00/blobatar/blob/main/packages/blobatar/docs/expression-exaggeration.md Runs tests, size budgets, and the composition gate. The composition gate uses real Chrome over CDP to compare static and animated compositions and drives React through an expression change. ```bash bun run check # tests, size budgets, then the composition gate ``` -------------------------------- ### Following the pointer with createGaze Source: https://github.com/alain00/blobatar/blob/main/packages/solid/README.md Import createGaze and the required CSS files to enable gaze tracking. The gaze layer requires JavaScript and is a separate subpath. The gaze.css file is required for the eyes to move. ```tsx import { Blobatar } from "@blobatar/solid"; import { createGaze } from "@blobatar/solid/gaze"; import "blobatar/motion.css"; import "blobatar/gaze.css"; // required — the eyes hold still without it const eyes = createGaze({ travel: 3, target: "pointer" }); ; ``` -------------------------------- ### Run server with hot reload (bun --hot) Source: https://github.com/alain00/blobatar/blob/main/CLAUDE.md Command to run the server with hot reload. ```sh bun --hot ./index.ts ``` -------------------------------- ### Configure blobatar with background, hue, size, and traits Source: https://github.com/alain00/blobatar/blob/main/README.md Shows configuration options for the Blobatar component and the string API. Options are the same across every adapter and the string API. background, hue, and tone cover common cases; traits pins individual axes as 0-1 positions. ```tsx ; // Always a sun with wide eyes — colour and everything else still per name. blobatar(user.email, { traits: { shape: 0.95, "eye.ratio": 0 } }); ``` -------------------------------- ### Import and run the gaze driver on an SVG Source: https://github.com/alain00/blobatar/blob/main/packages/blobatar/CHANGELOG.md Import the motion and gaze stylesheets once, set --mo-track-travel on the blobatars that should follow the pointer, and run the driver on the . The returned driver is armed by construction; g.stop() tears it down. ```javascript import "blobatar/motion.css"; import "blobatar/gaze.css"; import { gaze } from "blobatar/gaze"; const g = gaze(svg, { target: "pointer" }); // g.stop() tears it down ``` -------------------------------- ### Preact and Solid gaze usage with useGaze and createGaze Source: https://github.com/alain00/blobatar/blob/main/packages/preact/CHANGELOG.md Shows how to use the gaze layer in Preact and Solid. Preact uses useGaze with lookAt, while Solid uses createGaze with target. Both pass a ref to the Blobatar component. ```tsx const { ref } = useGaze({ travel: 3, lookAt: "pointer" }); // Preact ; const eyes = createGaze({ travel: 3, target: "pointer" }); // Solid ; ``` -------------------------------- ### Vue: Enable animation with animate prop Source: https://github.com/alain00/blobatar/blob/main/packages/blobatar/README.md Import Blobatar from @blobatar/vue and the required motion.css. Use the animate prop with 'hover' or 'always' and bind the size with :size. ```html ``` -------------------------------- ### Import and use Blobatar with animation and expression Source: https://github.com/alain00/blobatar/blob/main/README.md Opt-in animation and expressions. Requires importing `blobatar/motion.css` for animation to work. The `animate` prop accepts values like "hover" and "always". Expressions are imported as values to ship only used poses. ```tsx import { Blobatar } from "@blobatar/react"; import { happy } from "blobatar/expression"; import "blobatar/motion.css"; // required — nothing animates without it ; ``` -------------------------------- ### Run blobatar-codemod with bunx Source: https://github.com/alain00/blobatar/blob/main/packages/codemod/README.md Use bunx to run the codemod. The first command rewrites files in place, the second prints changes without applying them (--dry-run), and the third allows specifying multiple paths. ```sh bunx blobatar-codemod . # rewrite in place bunx blobatar-codemod . --dry-run # print what would change bunx blobatar-codemod src app # or name the paths yourself ``` -------------------------------- ### List devices and run on a specific device Source: https://github.com/alain00/blobatar/blob/main/packages/flutter/example/README.md Use `flutter devices` to list available devices, then run the app on a chosen device ID. ```sh flutter devices flutter run -d ``` -------------------------------- ### Use useGaze hook for pointer tracking Source: https://github.com/alain00/blobatar/blob/main/packages/preact/README.md Import useGaze and required CSS to enable eye tracking. The hook returns a ref to pass to Blobatar's elementRef prop. ```tsx import { Blobatar } from "@blobatar/preact"; import { useGaze } from "@blobatar/preact/gaze"; import "blobatar/motion.css"; import "blobatar/gaze.css"; // required — the eyes hold still without it const { ref } = useGaze({ travel: 3, lookAt: "pointer" }); ; ``` -------------------------------- ### Import and use survey and project from blobatar/gaze Source: https://github.com/alain00/blobatar/blob/main/packages/blobatar/CHANGELOG.md Imports `project` and `survey` from `blobatar/gaze`. `survey(svg)` returns `{ marks, rx, ry }` in viewBox units or `null` for a subtree with no layout box. `project` takes a mark and travel fractions to compute a projected point. ```javascript import { project, survey } from "blobatar/gaze"; const face = survey(svg); // { marks, rx, ry } in viewBox units, or null const p = project(face.marks[0], travel / face.rx, travel / face.ry); ``` -------------------------------- ### Deploy Worker and claim custom domains Source: https://github.com/alain00/blobatar/blob/main/docs/adr/0004-one-worker-serves-blobatar-dev.md Publishes the Worker and claims both custom domains, their records, and the certificate. This command should be ready before deleting any DNS records to minimize downtime. ```bash bun run deploy ``` -------------------------------- ### Generate and verify deterministic avatars in CI with blobatar --gen Source: https://github.com/alain00/blobatar/blob/main/packages/cli/README.md Generates avatars from team.txt into assets/blobatars/ using generation 2, then fails the build if any file changed. Pinning the generation keeps output stable; without --gen, output follows the current default generation. ```sh blobatar --stdin -d assets/blobatars/ --gen 2 < team.txt git diff --exit-code assets/blobatars/ # fails the build if a face changed ``` -------------------------------- ### Import renderer only for lighter bundle Source: https://github.com/alain00/blobatar/blob/main/README.md Imports the renderer from the blobatar/blob entry point to save about a kilobyte when all you do is render. ```ts import { blobatar } from "blobatar/blob"; ``` -------------------------------- ### Basic Blobatar component usage Source: https://github.com/alain00/blobatar/blob/main/packages/svelte/README.md Import and render the Blobatar component with a name prop. ```svelte ``` -------------------------------- ### Generate a blobatar URI with blobatarUri() Source: https://github.com/alain00/blobatar/blob/main/packages/blobatar/README.md Imports blobatarUri from blobatar/uri and sets a CSS background image to the generated URI. ```ts import { blobatarUri } from "blobatar/uri"; el.style.backgroundImage = `url("${blobatarUri(user.id)}")`; ``` -------------------------------- ### Batch generate PNG avatars from CSV with blobatar --stdin Source: https://github.com/alain00/blobatar/blob/main/packages/cli/README.md Reads names from the first column of users.csv, one per line, and writes PNG avatars to ./blobatars/. Empty lines are skipped and names are trimmed. Filenames are sanitized deterministically; collisions abort the batch before any file is written. ```sh cut -d, -f1 users.csv | blobatar --stdin -d ./blobatars/ --format png ``` -------------------------------- ### Run Worker preview on Cloudflare edge Source: https://github.com/alain00/blobatar/blob/main/docs/adr/0004-one-worker-serves-blobatar-dev.md Runs the real Worker on Cloudflare's edge with no route attached, allowing verification of the site and endpoint in production conditions while Vercel is still serving. ```bash bun --filter site preview -- --remote ``` -------------------------------- ### Basic usage of Blobatar component Source: https://github.com/alain00/blobatar/blob/main/packages/preact/README.md Import and render the Blobatar component with a name prop. ```tsx import { Blobatar } from "@blobatar/preact"; function App() { return ; } ``` -------------------------------- ### Regenerate golden fixture with bun scripts/golden.ts --write Source: https://github.com/alain00/blobatar/blob/main/packages/blobatar/test/golden/gen2.txt Command to regenerate the golden fixture. Use deliberately, not as a reflex, because a diff in this file is a breaking change. ```bash bun scripts/golden.ts --write ``` -------------------------------- ### Gaze API usage across frameworks Source: https://github.com/alain00/blobatar/blob/main/README.md Shows the gaze API for each adapter: React and Preact use hooks, Vue takes a ref, Solid returns a ref, Svelte uses an action. Options are the same across frameworks. ```tsx useGaze({ travel: 3, lookAt: "pointer" }) // React → ref useGaze({ travel: 3, lookAt: "pointer" }) // Preact → elementRef useGaze(blobRef, { travel: 3, target: "pointer" }) // Vue → takes your ref createGaze({ travel: 3, target: "pointer" }) // Solid → is the ref gaze({ travel: 3, target: "pointer" }) // Svelte → {@attach} ``` -------------------------------- ### React frontend with CSS import (frontend.tsx) Source: https://github.com/alain00/blobatar/blob/main/CLAUDE.md React component that imports CSS directly. Bun's bundler handles the CSS import. ```tsx import React from "react"; import { createRoot } from "react-dom/client"; // import .css files directly and it works import './index.css'; const root = createRoot(document.body); export default function Frontend() { return

Hello, world!

; } root.render(); ``` -------------------------------- ### Gaze tracking with useGaze composable Source: https://github.com/alain00/blobatar/blob/main/packages/vue/README.md Use the useGaze composable to make the eyes track the cursor. Requires importing the gaze subpath and both motion.css and gaze.css. The composable takes a ref to the component instance and reads $el from it. ```vue ``` -------------------------------- ### Gaze follow spring parameters Source: https://github.com/alain00/blobatar/blob/main/packages/blobatar/docs/motion-spec.md Spring parameters for the gaze follow layer. Two equivalent forms are shown: stiffness/damping and Apple-style duration/bounce. This layer requires JavaScript and ships as blobatar/motion. ```text { stiffness: 120, damping: 14 } // or Apple form: { duration: 0.5, bounce: 0.15 } ``` -------------------------------- ### Import and use expression with blobatar() Source: https://github.com/alain00/blobatar/blob/main/docs/adr/0002-expressions-as-passed-in-values.md Shows how to import an expression and pass it to blobatar(). The expression is a value, not a string, and is applied as registered custom properties. ```typescript import { blobatar } from "blobatar/blob"; import { happy } from "blobatar/expression"; blobatar(seed, { expression: happy }); ```