bible-strong-avatar-lab README

项目的 README,来自 github.com/smontlouis/bible-strong-avatar-lab。合并为一个 markdown 文件:README.md。

Bible Strong Avatar Lab

Bible Strong Avatar Lab is a browser-based studio for procedural 2D avatars, and the engine that animates them. It combines 3D-inspired geometry with SVG rendering: you build a character, watch it play a shared catalogue of states, clips, faces and gestures, and export it for your own product.

Website: avatars.bible-strong.app · Source: GitHub

The application runs entirely in the browser. The library of avatars is stored locally; no account or backend is required.

What you can do

How the Studio works

The stage is on the left and the inspector on the right, with a player at the bottom that says what plays and holds the face and the gestures laid over it. The inspector has five tabs:

  1. Avatars — the library: pick, create, duplicate, import or delete an avatar, and build its body, colours and face.
  2. Pose — place the avatar by hand. Letting it go joins back to the clip where it waited.
  3. States — play a state of the catalogue, see the clips it draws and by which rule, and choose whether it hands over to the next state.
  4. Clips — play one clip alone and read it on its timeline.
  5. Export — download the character, copy the instructions for an integration, or open Photo Mode.

The library is saved automatically in browser local storage. An avatar of the first version keeps only its character: its expressions and animations are not read.

The character and the catalogue

A character is what an avatar is, apart from what it does: its body, colours, outline, nose, mouth, the build of its eyes and its perspective. Every character plays the same catalogue: about fifty states, the clips they draw, nine faces, three gestures and thirteen spinner patterns. The words are defined in CONTEXT.md.

Export

The character file

Export downloads the character as <name>.avatar.json. The three renderers read it, and also read an .avatar.json of the first version, of which they keep only the character.

Runtime packages

Four MIT-licensed npm packages render a character. Choose by target:

Target Package
React DOM, React Native Web @bible-strong/avatar-react
React Native (iOS, Android) @bible-strong/avatar-react-native
Browser without React @bible-strong/avatar-web
Your own renderer, or a test @bible-strong/avatar-core

The three renderers depend on avatar-core for reading files, the engine and geometry, and share one vocabulary: createAvatar for a file known at build time, then state, lookAt, muted, settleAfterMs, gestures and the rest over the shared catalogue.

Each package README is written to be followed step by step, by a person or by a coding agent: setup, a minimal example, every prop, every error with its fix, and a checklist to verify the integration. It ships in the npm tarball, so it is readable in node_modules. The Studio's Export tab shows the install and a minimal example for each integration, and Copy instructions for AI copies that package's README, with the avatar's file and names in its examples.

For agents

The Studio serves its documentation as plain text for coding agents, built from the sources it describes: /llms.txt (the index), /llms-full.txt (every guide in one file), /docs/avatar-*.md (the package READMEs), /characters/*.avatar.json (the Studio's own characters), /catalogue/clips.json and /catalogue/states.json. /clip-authoring.md teaches how to write a clip and hand it to the Studio as a link (#clip=…), which opens it as a draft; the draft lives in the address, so a person and an agent sharing a tab work on the same clip. src/agentDocs/ makes these pages.

Photo Mode

Photo Mode exports the avatar on the stage as SVG or PNG. You can choose the resolution and use a transparent, solid, linear-gradient or radial-gradient background.

Getting started

Requirements

Install and run

pnpm install
pnpm dev

Open http://localhost:5173.

Available commands

Command Purpose
pnpm dev Start Vite in development mode.
pnpm typecheck Run TypeScript in strict, no-emit mode.
pnpm test Run the Vitest suite once.
pnpm test:watch Run Vitest in watch mode.
pnpm build Create a production build in dist/.
pnpm preview Serve the production build locally.
pnpm format Format the repository with Prettier.
pnpm check Run formatting, type checking, tests, and the production build.

Validation

Before opening a pull request, run the complete local check:

pnpm check

The GitHub Actions workflow runs the same command on every push and pull request.

Production build and deployment

Create the static production bundle:

pnpm build

The deployable site is written to dist/. Serve it locally before publishing:

pnpm preview

The application is a client-only Vite site with no server runtime or environment variables. The build uses relative asset paths, so the contents of dist/ can be hosted at a domain root or a subpath, including a GitHub Pages project URL. Any static host that serves index.html can deploy it.

Vercel Web Analytics and Speed Insights are integrated in the React entry point. Enable both products in the Vercel project dashboard, then redeploy so their collection routes become available.

Technical overview

Geometry, the catalogue and the engine live in packages/avatar-core and remain framework-independent. React state stores durable editor data; what changes at every frame is drawn without going through React state.

Repository map

Path Responsibility
packages/ The runtime packages: core engine and its React, web and native renderers.
src/app/ Application shell and global styles.
src/components/ui/ Reusable interface primitives.
src/features/editor/ The Studio: avatar library, body construction, stage, photo mode, and tests.
src/i18n/ Localized interface copy and translation tests.
src/lib/ Small shared utilities without product-domain ownership.
docs/adr/ Accepted architecture decisions.
legacy/ Self-contained HTML prototypes that preceded the React application.

Persistence and privacy

There is no remote backend in this repository. The avatar library and interface language preference are stored in the browser's local storage. Exported files are generated locally in the browser. Clearing site data removes the local library, so saving each character as JSON is the recommended backup mechanism.

The library keeps the storage key and the shape of the first version, whose expressions and animations are no longer read.

Contributing

Keep domain calculations outside React components, keep what changes at every frame out of React state, and add focused tests for domain changes.

English, French, and Simplified Chinese interface copy must stay synchronized across src/i18n/index.ts and src/i18n/zh.ts.

For the domain vocabulary, invariants, and architecture boundaries, read CONTEXT.md.

License

The repository holds two things under two licenses.

What License
The runtime packages under packages/ (@bible-strong/avatar-*) MIT
The Studio: everything else in this repository GNU AGPL v3.0

The packages are what you install to show an avatar in your own product. Use them in any project, open or closed, commercial or not; keep the copyright notice.

The Studio is the editor served at avatars.bible-strong.app. You may use, study, modify and redistribute it. If you distribute it or offer a modified version to users over a network, you must make the corresponding source available under the same license and keep the notices.

What you create with the Studio is yours: an exported .avatar.json and the pictures carry no license obligation from this project.

See each LICENSE file for the complete and legally authoritative terms.

bible-strong-avatar-lab (smontlouis/bible-strong-avatar-lab)

正在搜索数据库…

这是什么?Bible Strong Avatar Lab 是一个基于浏览器的制作工作室,用于构建程序化 2D 虚拟形象:你设计身体、眼睛和表情,把它们串联成动画,然后导出结果供你自己的应用使用。
这是设计工具,还是渲染库?两者都是:Studio 是用于设计虚拟形象的 Web 应用,导出的 .avatar.json 可与独立的 npm 包(@bible-strong/avatar-react 或 @bible-strong/avatar-web)配合,在你自己的 React 或原生 JS 项目中渲染。
怎么在本地把 Studio 跑起来?克隆仓库,用 pnpm 安装依赖,然后运行 `pnpm dev`,它会重新生成独立引擎并启动 Vite 开发服务器。
我需要先安装 Node 和 pnpm 吗?需要:Node.js 22.12 或更新版本,以及仓库 packageManager 字段中声明的 pnpm 10.34。
依赖项目格式保持稳定可靠吗?不可靠——项目 JSON 格式明确是预发布阶段的 schema,除非日后加入迁移机制,否则只保证与当前 schema 的兼容性。
我可以在任意浏览器上使用它,还是需要特定的操作系统?它是一个纯客户端的 Vite Web 应用,没有服务器运行时,因此无论什么操作系统,都能在任何现代浏览器中运行。
我的虚拟形象数据存储在哪里?所有内容都保存在浏览器的本地存储中——没有账号、后端或服务器,因此清除站点数据会清空你的项目,除非你已导出 JSON 备份。
在自己的应用里实际怎么使用导出的虚拟形象?安装 @bible-strong/avatar-react(纯 JS/ESM 则用 @bible-strong/avatar-web),导入导出的 .avatar.json 并传给 createAvatar;两个包都依赖 @bible-strong/avatar-core 提供校验、播放和几何计算。
Studio 如何避免编辑一个虚拟形象时破坏共享相同表情的其他形象?虚拟形象起初共用一个基础行为库,但对某个形象的表情或动画的第一次编辑会把该库复制为该形象专属的库,因此后续修改互不影响(写时复制)。
我可以只截取虚拟形象的快照图片,而不导出完整动画吗?可以。Photo Mode 可以按所选分辨率将当前渲染的虚拟形象导出为 SVG 或 PNG,背景可选透明、纯色、线性渐变或径向渐变。
Studio 界面支持哪些语言?英语、法语和简体中文,在 src/i18n/index.ts 和 src/i18n/zh.ts 之间保持同步。
大小
8.8 MB
星标
1.2K
时长
3个月
提交 · 90 天