尚未检测到更新。GitHub 发布版本后会显示在这里。
Design WebGL orbs in the browser and export them as dependency-free React, JavaScript, HTML or TypeScript snippets.
翻译准备中
正在加载完整 README。
查看完整 README ↗Design animated WebGL orbs in the browser, then export them as drop-in snippets with no runtime dependencies.
Pick a style, material and mood, tune the shader by hand, and copy a self-contained component straight into your project. Nothing to install, no package to track. The export is a single file.
localStorage and rehydrate on returnprefers-reduced-motion like the studio, with a reducedMotion override| Format | Save as | Notes |
|---|---|---|
| React | OrbyUI.tsx | One component, react as the only peer |
| JavaScript | orby-ui.js | Mount on any element, zero dependencies |
| HTML | orby-ui.html | Open locally or drop on any static host |
| TypeScript | orby-ui.d.ts | Typings to sit beside the JS or React file |
The studio copies to your clipboard rather than downloading, so the filenames above are suggestions, save the snippet wherever suits your project.
Every export is generated in the browser from your current configuration, with
the shader inlined. Nothing is added to your package.json - the
JavaScript and HTML exports have no dependencies at all, and the React export
needs only the react you already have.
Only needed to work on OrbyUI itself - using an export requires none of this.
npm install
npm run dev # http://localhost:8080
npm run build # production build
npm run typecheck # tsc --noEmit
npm test # node:test
npm run lint # eslint
Works on Windows, macOS and Linux. dev, build and preview all route
through scripts/with-app-env.mjs, which merges .grok/app-env.json into the
environment so the dev server and the build can never disagree about a flag.
OrbyUI.tsxsrc/components/OrbyUI.tsx.import { OrbyUI } from "./components/OrbyUI";
<div style={{ width: 420, height: 420 }}>
<OrbyUI />
</div>
mood, light, body, core, reducedMotion, plus any other config key."use client" at the top of OrbyUI.tsx.<OrbyUI /> on its own is enough — don't pass mood. Don't strip
MOOD_MUL / easePulse or the pulse block unless you also replace them with
pulse = 1 and the raw config.intensity / noiseSpeed / distortion.orby-ui.jsorby-ui.js.<div id="orby-ui" style="width:420px;height:420px"></div>
<script type="module" src="./orby-ui.js"></script>
createOrbyUI(el, options), then setMood, setConfig, capture(),
destroy().mood, moodSpeed, easing and spring from options, and
don't call setMood. Same pulse-block rule as React.orby-ui.htmlorby-ui.html. Open it locally or host it as a static file.<iframe src="/orby-ui.html" style="width:420px;height:420px;border:0">,
or paste the #orby-ui div and module script into a page you already have.mood,
moodSpeed, easing and spring from the inline config; orb.setMood(...)
is optional.orby-ui.d.tsDeclarations only - no runtime.
orby-ui.js."allowJs": true in tsconfig.json.import { createOrbyUI, type OrbyUIConfig } from "./orby-ui.js";OrbyUIConfig — just omit
them. Don't delete OrbMood / setMood from the .d.ts unless you also
removed them from the JS.The studio and every export (React, JavaScript, HTML) respect
prefers-reduced-motion, and both pick up changes to the OS setting live,
without a reload. When reduced motion is active the orb:
The reducedMotion option controls this and is already in the exported config:
| Value | Behaviour |
|---|---|
"system" (default) | Follows the OS setting and updates live when it changes |
"reduce" | Always reduced, whatever the OS says |
"no-preference" | Always full motion, ignoring the OS setting |
<OrbyUI reducedMotion="reduce" />
const orb = createOrbyUI(el, { reducedMotion: "system" });
orb.setConfig({ reducedMotion: "no-preference" }); // switch at runtime
Only override the user's setting with "no-preference" if you have a good
reason, such as an explicit in-app motion toggle.
There's deliberately no studio control for this: exports always start at
"system", so the orb respects each visitor's own setting. To force a value,
change the reducedMotion line in the exported code.
| Layer | Choice |
|---|---|
| Framework | TanStack Start · React 19 |
| Styling | Tailwind v4, design tokens in src/styles.css |
| Rendering | Custom WebGL renderer — no three.js |
| State | Zustand, persisted to localStorage |
| Scrolling | Lenis |
以上为 README 的开头部分。其余内容请阅读原文。 查看完整 README ↗