diff --git a/docs/assets/fonts/fontutti.woff2 b/docs/assets/fonts/fontutti.woff2 new file mode 100644 index 0000000..e66fd55 --- /dev/null +++ b/docs/assets/fonts/fontutti.woff2 @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:de92acf3cc37a5bf3e334084d3c243feef91db193cb02d58fce29ceb0ec8a9d0 +size 28412 diff --git a/docs/getting-started/installation.md b/docs/getting-started/installation.md index 4507f64..b0d1268 100644 --- a/docs/getting-started/installation.md +++ b/docs/getting-started/installation.md @@ -1,19 +1,36 @@ # 安装与首次配置 -AnyImage 的安装分为两步:先安装 Blender Extension,再安装独立运行环境和默认模型。第二步只需在首次使用或环境版本发生变化时执行。 +页面会按当前系统显示对应的安装包,按住按钮拖到 Blender 窗口任意位置即可安装。首次拖入会提示添加 AnyImage 扩展仓库,确认后重新拖入一次,之后升级同样直接拖入。 -## 安装 Blender Extension - -1. 下载与你的系统匹配的 ZIP 文件: - - `AnyImage.v版本号.windows-x64.zip` - - `AnyImage.v版本号.macos-arm64.zip` - - `AnyImage.v版本号.linux-x64.zip` -2. 打开 Blender,进入 **Edit > Preferences > Extensions**。 -3. 点击右上角菜单,选择 **Install from Disk**。 -4. 选择下载的 ZIP 文件并完成安装。 - -!!! warning - 不要解压扩展包。Blender 需要直接安装 ZIP 文件,并且安装包必须与你的操作系统匹配。 +
+
+
+ +
Windows – 78.3 MB
+
+ …或下载后通过 Install from Disk 安装 +
+
+
+ +
macOS - Apple Silicon – 57.5 MB
+
+ …或下载后通过 Install from Disk 安装 +
+
+
+ +
Linux – 71.0 MB
+
+ …或下载后通过 Install from Disk 安装 +
+
## 检查扩展偏好设置 diff --git a/docs/index.md b/docs/index.md index 2f745cb..59ad437 100644 --- a/docs/index.md +++ b/docs/index.md @@ -10,3 +10,34 @@ AnyImage 是一款 Blender 扩展,可以粘贴和编辑图片、创建普通 P - 用 **Cutout** 从套索选区生成 Surface、Balloon 与两种 Depth Shape - 用 **Frame** 从当前视角重新取景并合并 Image Empty,用 **Mask** 的 Lasso、Brush 或 Polyline 编辑 Alpha;Brush 拖动时以红色或灰色填充预览准确范围,释放后提交;用 **Rectify** 校正透视 - 用 **Remove Background / Upscale** 处理单图、视频和序列帧 + + +
+
+
+ +
Windows – 78.3 MB
+
+ …或下载后通过 Install from Disk 安装 +
+
+
+ +
macOS - Apple Silicon – 57.5 MB
+
+ …或下载后通过 Install from Disk 安装 +
+
+
+ +
Linux – 71.0 MB
+
+ …或下载后通过 Install from Disk 安装 +
+
\ No newline at end of file diff --git a/docs/javascripts/extra.js b/docs/javascripts/extra.js new file mode 100644 index 0000000..1aa1f9d --- /dev/null +++ b/docs/javascripts/extra.js @@ -0,0 +1,41 @@ +/** + * 首页的扩展安装按钮:按系统只留一个平台,并把下载地址拖进 Blender。 + */ +const INSTALL_PLATFORMS = { win: "windows", mac: "macos", lin: "linux" }; + +function initInstallDrag() { + const container = document.querySelector(".anyimage-install"); + + if (!container) { + return; + } + + // navigator.platform 的取值由浏览器决定,只取前三个字符做粗略匹配。 + const detectedPlatform = INSTALL_PLATFORMS[navigator.platform.toLowerCase().slice(0, 3)]; + + container.querySelectorAll(".anyimage-install-item").forEach(function (item) { + const matches = !detectedPlatform || item.dataset.platform.startsWith(detectedPlatform); + item.classList.toggle("is-active", matches); + item.hidden = !matches; + }); + + container.querySelectorAll(".anyimage-install-button").forEach(function (button) { + const group = button.closest(".anyimage-install-group"); + + button.addEventListener("dragstart", function (event) { + event.dataTransfer.setData("text/plain", button.dataset.installUrl); + event.dataTransfer.effectAllowed = "copy"; + group.classList.add("is-dragging"); + }); + + button.addEventListener("dragend", function () { + group.classList.remove("is-dragging"); + }); + }); +} + +if (document.readyState === "loading") { + document.addEventListener("DOMContentLoaded", initInstallDrag); +} else { + initInstallDrag(); +} diff --git a/docs/stylesheets/extra.css b/docs/stylesheets/extra.css index 76c0982..fbc455b 100644 --- a/docs/stylesheets/extra.css +++ b/docs/stylesheets/extra.css @@ -25,4 +25,109 @@ :root { --md-text-font: "LXGW WenKai"; --md-code-font: "LXGW WenKai Mono"; -} \ No newline at end of file +} + +/* 首页的扩展安装拖拽组件,数值取自 extensions.blender.org 的按钮。 */ +@font-face { + font-family: "fontutti"; + src: url("../assets/fonts/fontutti.woff2") format("woff2"); + font-style: normal; + font-weight: normal; +} + +.anyimage-install { + font-size: 14px; + line-height: 1.4286; +} + +.anyimage-install-item { + margin-bottom: 1.6rem; +} + +.anyimage-install [class^="i-"]:before, +.anyimage-install [class*=" i-"]:before { + display: inline-block; + width: 1em; + margin: 0 0.2em; + font-family: "fontutti"; + font-style: normal; + font-variant: normal; + font-weight: normal; + line-height: 1em; + text-align: center; + text-decoration: inherit; + text-transform: none; + -webkit-font-smoothing: antialiased; +} + +.anyimage-install .i-move:before { + content: "\e8d5"; +} + +.anyimage-install-item.is-active ~ .anyimage-install-item.is-active { + border-top: 1px solid var(--md-default-fg-color--lightest); + padding-top: 1.6rem; +} + +.anyimage-install-group { + border: 2px solid transparent; + border-radius: 6px; + margin-bottom: 8px; +} + +.anyimage-install-group.is-dragging { + opacity: 0.5; +} + +.anyimage-install-button { + display: inline-block; + width: 100%; + margin-bottom: 8px; + padding: 8px 16px; + border: none; + border-radius: 6px; + background-color: rgba(0, 153, 255, 0.1); + color: #0099ff; + font-family: inherit; + font-size: 14px; + font-weight: 500; + line-height: 24px; + outline: 2px dashed currentColor; + outline-offset: -2px; + text-align: center; + text-decoration: none; + transition: background-color 150ms, color 150ms ease-out; + user-select: none; + vertical-align: middle; + white-space: nowrap; +} + +.anyimage-install-button:hover { + background-color: rgba(0, 153, 255, 0.2); + cursor: move; +} + +.anyimage-install-platform { + text-align: center; +} + +.anyimage-install-platform strong { + font-weight: 600; +} + +.anyimage-install-platform-rest { + font-weight: 400; +} + +.anyimage-install small.anyimage-install-note { + display: block; + width: 100%; + font-size: 12px; + opacity: 1; + text-align: center; +} + +.anyimage-install-note a { + color: #0099ff; + text-decoration: underline; +} diff --git a/mkdocs.yml b/mkdocs.yml index d2a41be..72d5397 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -82,6 +82,9 @@ extra: extra_css: - stylesheets/extra.css +extra_javascript: + - javascripts/extra.js + copyright: Copyright © 2026 OmooLab plugins: