scaffold-art-script
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseScaffolding Art Blocks Projects
搭建Art Blocks项目
Always Fetch the Generator Spec First
始终先获取生成器规范
Before any art script work, fetch this MCP resource:
artblocks://generator-specIt contains the authoritative reference for: structure, hash-based PRNG patterns, FLEX dependency types (IPFS, Arweave, ONCHAIN, Dependency Registry), supported script types and library versions, HTML structure requirements, and . It also includes the step-by-step conversion guide for porting existing scripts.
tokenDatawindow.$features在进行任何艺术脚本工作之前,请获取此MCP资源:
artblocks://generator-spec它包含以下内容的权威参考:结构、基于哈希的PRNG模式、FLEX依赖项类型(IPFS、Arweave、ONCHAIN、依赖项注册表)、支持的脚本类型和库版本、HTML结构要求以及。它还包含移植现有脚本的分步转换指南。
tokenDatawindow.$featuresScaffolding a New Project
搭建新项目
Use to generate a ready-to-run + starter art script.
scaffold_artblocks_projectindex.html使用生成可直接运行的 + 初始艺术脚本。
scaffold_artblocks_projectindex.htmlParameters
参数
| Param | Options / Notes |
|---|---|
| |
| p5.js: |
| |
| |
| |
Note on Three.js v0.167.0: uses ES module import maps instead of a global tag. This affects script type detection on-chain — see the generator spec for details.
<script>| 参数 | 选项/说明 |
|---|---|
| |
| p5.js: |
| |
| |
| |
关于Three.js v0.167.0的说明:使用ES模块导入映射而非全局标签。这会影响链上的脚本类型检测——详情请参阅生成器规范。
<script>Other supported script types
其他支持的脚本类型
scaffold_artblocks_projectartblocks://generator-specscaffold_artblocks_projectartblocks://generator-specConverting an Existing Script
转换现有脚本
When a user has an existing piece to convert to Art Blocks format:
- Fetch — it contains a detailed step-by-step conversion guide
artblocks://generator-spec - Use with the matching
scaffold_artblocks_projectto get the correct HTML shellscriptType - Walk through conversion:
Conversion checklist:
- Replace with hash-based PRNG derived from
Math.random()tokenData.hash - Replace hardcoded canvas dimensions with /
window.innerWidthwindow.innerHeight - Ensure the initial render is deterministic from the hash alone — same hash must always produce the same initial visual output
- Interactive elements (mouse, keyboard, touch) are allowed and encouraged, but must not change the initial render. Interaction should only modify the view after the artwork has loaded deterministically.
- Remove any time-based variation (,
Date.now()) that affects the initial render (time-based animation after load is fine)setTimeout - Extract visual traits into (optional but recommended for reveals) — features must be set synchronously before or during initial render
window.$features - Verify determinism: reload the page with the same and confirm identical initial output
tokenData.hash
当用户需要将现有作品转换为Art Blocks格式时:
- 获取— 它包含详细的分步转换指南
artblocks://generator-spec - 使用匹配的
scriptType获取正确的HTML框架scaffold_artblocks_project - 按以下步骤完成转换:
转换检查清单:
- 将替换为从
Math.random()派生的基于哈希的PRNGtokenData.hash - 将硬编码的画布尺寸替换为/
window.innerWidthwindow.innerHeight - 确保初始渲染仅由哈希决定——相同的哈希必须始终产生相同的初始视觉输出
- 允许并鼓励使用交互元素(鼠标、键盘、触摸),但不得更改初始渲染。交互只能在艺术品确定性加载完成后修改视图。
- 移除任何影响初始渲染的基于时间的变化(、
Date.now())(加载完成后的基于时间的动画是允许的)setTimeout - 将视觉特征提取到中(可选但推荐用于作品展示)——特征必须在初始渲染之前或期间同步设置
window.$features - 验证确定性:使用相同的重新加载页面,确认初始输出完全一致
tokenData.hash
When to Enable Each Flag
各标志的启用场景
| Flag | Enable when... |
|---|---|
| Script has distinct visual categories worth exposing as traits |
| Script will have configurable on-chain parameters after minting (PMP) |
| Script loads external assets from IPFS or Arweave |
| 标志 | 启用场景... |
|---|---|
| 脚本具有值得作为特征暴露的不同视觉类别时 |
| 脚本在铸造后具有可配置的链上参数(PMP)时 |
| 脚本从IPFS或Arweave加载外部资源时 |