orb README

项目的 README,来自 github.com/LerSent001/orb。合并为一个 markdown 文件:README.md。

Liquid Orb Editor

English | 中文

English

A real-time liquid glass orb editor built with React, WebGPU/WGSL, and Toolcraft UI.

Live demo: https://lersent001.github.io/orb/

Features

Audio response

Use Audio response in the right-side control panel to start the microphone or select a local audio file, then adjust the sensitivity. Audio response is available for Siri Wave, Voice Membrane, Aurora Veil, Neural Plasma, Prismatic Field, and Violet Core. Other presets remain unchanged; switching to an unsupported preset stops the active audio input. Audio is analyzed locally in the browser and is never uploaded. Microphone input is not played back.

Low, mid, and high frequency bands plus overall energy drive the contour, internal distortion, highlights, and motion speed. Input is smoothed to prevent jitter. Pausing audio eases the orb back to its base appearance; stopping the input or setting sensitivity to 0 restores the original preset parameters. Audio modulation is applied after state transitions and does not overwrite presets, colors, or URL parameters. This feature modulates the existing procedural animation; it does not embed or reproduce the reference site's fluid solver.

Web and Swift exports use the same audio-to-parameter mapping. The host application supplies audio capture, frequency analysis, smoothing, and sensitivity. Pass smoothed values from 0 to 1 after applying sensitivity, and pass zero values when audio stops. Exported pages do not request microphone access automatically or bundle the currently selected audio file. Audio source and sensitivity are session-only editor settings and are not included in share links.

window.liquidOrb.setAudioBands({ low: 0.5, mid: 0.3, high: 0.1, all: 0.4 });
window.liquidOrb.setAudioBands(); // Stop audio response
LiquidOrbView(
    state: .thinking,
    audio: LiquidOrbAudio(low: 0.5, mid: 0.3, high: 0.1, all: 0.4)
)

Run node scripts/verify-audio.mjs to verify preset support, silence behavior, invalid input handling, and Web mapping parity. The script writes Swift parity fixtures to output/audio-qa/; run xcrun swift output/audio-qa/native-check.swift to verify the Swift mapping.

Maintenance status

This project is under active development. Presets, motion models, editor stability, and parity between WebGPU and SwiftUI/Metal output are continuously refined. OpenAI Codex assists with implementation, regression testing, and releases.

Local development

Requires Node.js 22, pnpm 11, and a browser with WebGPU support.

pnpm install
pnpm dev

Production build and preview:

pnpm build
pnpm preview

Project structure

License

Project code is licensed under the MIT License. Toolcraft UI code in src/toolcraft retains its original MIT copyright notice; see TOOLCRAFT_LICENSE.md.


中文

一个使用 React、WebGPU/WGSL 和 Toolcraft UI 构建的实时液态玻璃球编辑器。

在线使用:https://lersent001.github.io/orb/

功能

声音响应

在右侧「声音响应」中开启麦克风或选择本地音频,然后调节响应强度。支持 Siri 波澜、声纹薄膜、极光帷幕、神经电浆、彩色声场和紫焰流核;其余预设保持原样,切换到不支持的预设时会关闭音频输入。音频只在浏览器本地分析,不会上传,麦克风输入也不会回放。

声音按低频、中频、高频和总能量驱动轮廓、内部扭曲、高光及运动速度。输入经过平滑处理以避免画面抖动;暂停音频会让球体逐渐回落到基础效果,关闭输入或将响应强度设为 0 会恢复原始预设参数。声音映射发生在状态过渡之后,不会改写预设、颜色或 URL 参数。该功能用于调制现有的程序动画,不包含或复刻参考站的流体求解器。

Web 和 Swift 导出包含相同的声音参数映射。音频采集、频谱分析、平滑和响应强度由接入应用提供。请传入已经平滑并乘以响应强度的 0–1 数值,声音停止时传入零值。导出页面不会自动申请麦克风权限,也不会附带编辑器中当前选择的音频文件。声音来源和响应强度只在本次编辑会话中使用,不会写入分享链接。

window.liquidOrb.setAudioBands({ low: 0.5, mid: 0.3, high: 0.1, all: 0.4 });
window.liquidOrb.setAudioBands(); // 停止声音响应
LiquidOrbView(
    state: .thinking,
    audio: LiquidOrbAudio(low: 0.5, mid: 0.3, high: 0.1, all: 0.4)
)

运行 node scripts/verify-audio.mjs 可检查预设支持范围、静音行为、不合法输入和 Web 参数一致性。脚本会在 output/audio-qa/ 生成 Swift 对照文件;运行 xcrun swift output/audio-qa/native-check.swift 可检查 Swift 映射。

维护状态

本项目处于持续迭代维护中。作者持续优化预设、运动模型、编辑器稳定性,以及 WebGPU 与 SwiftUI/Metal 的输出一致性,并使用 OpenAI Codex 辅助代码实现、回归验证和发布。

本地运行

需要 Node.js 22、pnpm 11,以及支持 WebGPU 的浏览器。

pnpm install
pnpm dev

生产构建与预览:

pnpm build
pnpm preview

代码结构

许可证

项目代码使用 MIT License。src/toolcraft 中的 Toolcraft UI 代码保留其原始 MIT 版权声明,详见 TOOLCRAFT_LICENSE.md。

orb (LerSent001/orb)

正在搜索数据库…

756 ·GitHub
这是什么?Liquid Orb Editor 是一个实时编辑器,用于创建动态的液态玻璃球体效果,基于 React 和 WebGPU/WGSL 构建。你可以调整颜色、速度、形状、玻璃折射和光晕,然后把结果导出为独立网页,或导出为 iOS 应用用的 SwiftUI/Metal 代码。
这是一个可视化编辑器还是代码库?它是一个基于浏览器的可视化编辑器:你用滑块和预览来调整参数,它会为你生成开箱即用的 Web 代码或 SwiftUI/Metal 代码,而不是供你导入的库。
编辑器怎么运行?有托管的在线版本,你也可以克隆仓库后用 pnpm 在本地运行(dev/build/preview 脚本由 Vite 驱动)。
在本地运行需要安装什么?你需要 Node.js 22 和 pnpm 11,外加一个真正支持 WebGPU 的浏览器来预览和编辑球体。
它能在任何浏览器里运行吗?不能——实时预览依赖 WebGPU 支持,不支持 WebGPU 的浏览器无法渲染或编辑球体;此外项目仍在积极演进中,预设和输出一致性还在持续变动。
它自带哪些预设?它自带 12 个可编辑的动态球体预设,涵盖不同的颜色、运动风格和玻璃外观,你可以微调它们或将其作为起点。
我可以把自己做的设计分享给别人吗?可以——你的所有参数选择都编码在页面的 URL 哈希中,分享链接就能完整还原你配置的球体。
OpenAI Codex 在这里扮演什么角色?作者使用 OpenAI Codex 辅助实现代码、对 Web/SwiftUI 导出做回归验证,以及准备发布。
编辑器支持中文和英文吗?支持。它会自动检测浏览器语言来显示中文或英文界面,并且随时可以在两者之间切换。
大小
1.9 MB
星标
756
更新
提交Sep 16
时长
3个月
提交 · 90 天