Skip to content

🤖 Open-source, local-first alternative to Grok Bot, OpenAI dots and Claude Duet. Your own AI bots on any model: GPT, Claude, Gemini, Grok, DeepSeek, Kimi, GLM and 70+ more through one Modelflare key. Reach them in the app, WeChat or Feishu; they remember you, work in the background, run commands and use your computer. Pay per use.

feat(site): 重构下载页,版式和 Landing Page 统一

dyk987078fb5daace
diff --git a/site/README.md b/site/README.md
index c757d4f..5b01ac5 100644
--- a/site/README.md
+++ b/site/README.md
@@ -24,7 +24,7 @@ Astro 5 静态站,Preact 只用在价格表、计算器(含可搜索的模
- **换脑**:每 7 秒一道斜波扫过,扫到的脸眨一下眼、睁开就换成另一个机器人的眼睛色;右上角同时换成下一个真实模型 ID(价格快照里每家厂商取一个)。讲的是"任意模型,还是这群机器人"(内容切换)。
- **打瞌睡**:9 秒没人动,慢慢闭眼、目光耷拉;指针一动,从指针那里一圈圈醒过来(机器人的状态,同 `[data-doze]`)。睡着时不换脑。
- 只在页脚进视口、标签页可见时跑;"减少动态效果"时画一张静止的字标;无 JS 时整块不显示。配色:深色是灰面罩 + 发光的眼睛;浅色是淡彩面罩 + 墨色眼睛——每张脸的面罩用它那个角色的辉光色调进底色、从字标顶到底由浅变深,一圈极细的边,整块像一片粉彩马赛克,"换脑"时整片换色调(不用整块墨色,也不出现白底上的荧光色)。字标盒子贴着字形(宽屏 7.4:1、手机 1.3:1),画布上下各出血 16px 给探头的脸,不额外留白。
-- **附属页**:`/pricing`(价格卡、订阅制对照、价格表、计算器)、`/download`(四个平台、校验、Docker、CLI)、`/security`、`/changelog`、`/privacy`、`/licenses`。
+- **附属页**:`/pricing`(价格卡、订阅制对照、价格表、计算器)、`/download`(页头一个按系统识别的主按钮;Windows、macOS、Linux 三张卡;Docker、CLI 两张卡;校验)、`/security`、`/changelog`、`/privacy`、`/licenses`。
- **导航**(`components/Nav.astro`):通栏,和正文同一个容器——logo、下载按钮分别对齐内容的左右边线,链接居中:机器人 · 功能 · 模型 · 数据(首页锚点)· 价格(独立页)· 文档。停在顶上时透明,滚动后铺半透明底色和一根底线。一套尺寸到底:所有控件(含下载按钮)都是 32 高的胶囊,文字 14、图标 16,控件之间 2px、工具组和下载之间 12px。
- **顶部公告条**(`components/SiteBanner.astro`,内容在 `src/data/announcements.ts`):发版条(版本取自 `releases.json`,按访客系统直接下载对应安装包,发布后显示 30 天)+ 宣传 / 公告,多条时轮播、可翻页;支持时间窗、截止倒计时、按 id 记住关闭;浏览器语言和页面不一致时附带语言切换。地址加 `?banner=preview` 可预览全部条目。埋点 `banner_view` / `banner_click` / `banner_dismiss`。
diff --git a/site/src/components/CodeLine.astro b/site/src/components/CodeLine.astro
new file mode 100644
index 0000000..ae04874
--- /dev/null
+++ b/site/src/components/CodeLine.astro
@@ -0,0 +1,9 @@
+---
+// 一条能复制的命令(下载页):完整的命令在 code 里,复制按钮只有图标,点击由 client.ts 的 [data-copy-code] 处理。
+import Icon from "./Icon.astro";
+import { dict, type Lang } from "../i18n";
+interface Props { lang: Lang; code: string; track?: string; trackCommand?: string }
+const { lang, code, track, trackCommand } = Astro.props;
+const copy = dict(lang).ui.copy;
+---
+<div class="code"><code>{code}</code><button type="button" class="copy-btn" data-copy-code data-track={track} data-track-command={trackCommand} aria-label={copy} title={copy}><Icon name="copy" /></button></div>
diff --git a/site/src/components/DownloadButton.astro b/site/src/components/DownloadButton.astro
index 92d1cb6..bf3b9a2 100644
--- a/site/src/components/DownloadButton.astro
+++ b/site/src/components/DownloadButton.astro
@@ -1,19 +1,20 @@
---
// 分裂下载按钮(§12):主段按系统识别(client.ts),右段打开平台菜单。无 JS 时主段链接到 /download。
// 同一行要并排放的按钮(如 Hero 的"看演示")用 slot="after" 传进来。版本、大小与 SHA-256 在 /download 页。
-// plain:只有一颗带下载图标的按钮(导航用),没有标记和平台菜单;同样按系统换成安装包直链。
+// plain:只有一颗带下载图标的按钮(导航、下载页页头用),没有标记和平台菜单;同样按系统换成安装包直链。
+// fallback:识别不出系统、或没有 JS 时主段链到哪;缺省是 /download,下载页自己传页内锚点。
import EyesMark from "./EyesMark.astro";
import Icon from "./Icon.astro";
import { dict, href, type Lang } from "../i18n";
import { releases, PLATFORMS } from "../lib/site";
-interface Props { lang: Lang; placement: string; size?: "md" | "sm"; short?: boolean; plain?: boolean; id?: string }
-const { lang, placement, size = "md", short = false, plain = false, id } = Astro.props;
+interface Props { lang: Lang; placement: string; size?: "md" | "sm"; short?: boolean; plain?: boolean; id?: string; fallback?: string }
+const { lang, placement, size = "md", short = false, plain = false, id, fallback } = Astro.props;
const t = dict(lang);
const menuId = `dl-menu-${placement}`;
---
{plain ? (
<div class="dl dl--plain" data-dl data-placement={placement} data-short={short ? "1" : undefined}>
- <a class:list={["btn btn--primary", { "btn--sm": size === "sm" }]} id={id} href={href(lang, "/download")} data-dl-main>
+ <a class:list={["btn btn--primary", { "btn--sm": size === "sm" }]} id={id} href={fallback ?? href(lang, "/download")} data-dl-main>
<Icon name="download" size={16} />
<span class="btn-label" data-dl-label>{t.download.generic}</span>
</a>
diff --git a/site/src/components/Icon.astro b/site/src/components/Icon.astro
index 4571661..32fb3e3 100644
--- a/site/src/components/Icon.astro
+++ b/site/src/components/Icon.astro
@@ -39,17 +39,23 @@ const P = {
phone: '<path d="M6.5 3.5h3l1.5 4-2 1.5a11 11 0 0 0 6 6l1.5-2 4 1.5v3a2 2 0 0 1-2 2A16 16 0 0 1 4.5 5.5a2 2 0 0 1 2-2Z"/>',
// 外观菜单的"跟随系统"
monitor: '<rect x="3" y="4.5" width="18" height="12" rx="2"/><path d="M8.5 20h7M12 16.5V20"/>',
+ // 警示(下载页的端口提醒)
+ warn: '<path d="M12 4.5 21 19.5H3L12 4.5Z"/><path d="M12 10.5v4M12 17h.01"/>',
};
// 实心字形(16×16 画布,fill):只放品牌标志,别的图标一律用上面的线稿。
-// GitHub 标志取自 Octicons 的 mark-github(MIT);按 GitHub 的标志规范,只用来链到 GitHub
+// GitHub 标志取自 Octicons 的 mark-github(MIT);按 GitHub 的标志规范,只用来链到 GitHub。
+// 下载页的系统标志只用来指明平台:Apple、Linux 取自 Simple Icons(CC0),Windows 是四个方块,自绘。这三个的画布是 24×24。
const F = {
github: "M8 0c4.42 0 8 3.58 8 8a8.013 8.013 0 0 1-5.45 7.59c-.4.08-.55-.17-.55-.38 0-.27.01-1.13.01-2.2 0-.75-.25-1.23-.54-1.48 1.78-.2 3.65-.88 3.65-3.95 0-.88-.31-1.59-.82-2.15.08-.2.36-1.02-.08-2.12 0 0-.67-.22-2.2.82-.64-.18-1.32-.27-2-.27-.68 0-1.36.09-2 .27-1.53-1.03-2.2-.82-2.2-.82-.44 1.1-.16 1.92-.08 2.12-.51.56-.82 1.28-.82 2.15 0 3.06 1.86 3.75 3.64 3.95-.23.2-.44.55-.51 1.07-.46.21-1.61.55-2.33-.66-.15-.24-.6-.83-1.23-.82-.67.01-.27.38.01.53.34.19.73.9.82 1.13.16.45.68 1.31 2.69.94 0 .67.01 1.3.01 1.49 0 .21-.15.45-.55.38A7.995 7.995 0 0 1 0 8c0-4.42 3.58-8 8-8Z",
+ windows: "M3 3h8.5v8.5H3zM12.5 3H21v8.5h-8.5zM3 12.5h8.5V21H3zM12.5 12.5H21V21h-8.5z",
+ apple: "M12.152 6.896c-.948 0-2.415-1.078-3.96-1.04-2.04.027-3.91 1.183-4.961 3.014-2.117 3.675-.546 9.103 1.519 12.09 1.013 1.454 2.208 3.09 3.792 3.039 1.52-.065 2.09-.987 3.935-.987 1.831 0 2.35.987 3.96.948 1.637-.026 2.676-1.48 3.676-2.948 1.156-1.688 1.636-3.325 1.662-3.415-.039-.013-3.182-1.221-3.22-4.857-.026-3.04 2.48-4.494 2.597-4.559-1.429-2.09-3.623-2.324-4.39-2.376-2-.156-3.675 1.09-4.61 1.09zM15.53 3.83c.843-1.012 1.4-2.427 1.245-3.83-1.207.052-2.662.805-3.532 1.818-.78.896-1.454 2.338-1.273 3.714 1.338.104 2.715-.688 3.559-1.701",
+ linux: "M12.504 0c-.155 0-.315.008-.48.021-4.226.333-3.105 4.807-3.17 6.298-.076 1.092-.3 1.953-1.05 3.02-.885 1.051-2.127 2.75-2.716 4.521-.278.832-.41 1.684-.287 2.489a.424.424 0 00-.11.135c-.26.268-.45.6-.663.839-.199.199-.485.267-.797.4-.313.136-.658.269-.864.68-.09.189-.136.394-.132.602 0 .199.027.4.055.536.058.399.116.728.04.97-.249.68-.28 1.145-.106 1.484.174.334.535.47.94.601.81.2 1.91.135 2.774.6.926.466 1.866.67 2.616.47.526-.116.97-.464 1.208-.946.587-.003 1.23-.269 2.26-.334.699-.058 1.574.267 2.577.2.025.134.063.198.114.333l.003.003c.391.778 1.113 1.132 1.884 1.071.771-.06 1.592-.536 2.257-1.306.631-.765 1.683-1.084 2.378-1.503.348-.199.629-.469.649-.853.023-.4-.2-.811-.714-1.376v-.097l-.003-.003c-.17-.2-.25-.535-.338-.926-.085-.401-.182-.786-.492-1.046h-.003c-.059-.054-.123-.067-.188-.135a.357.357 0 00-.19-.064c.431-1.278.264-2.55-.173-3.694-.533-1.41-1.465-2.638-2.175-3.483-.796-1.005-1.576-1.957-1.56-3.368.026-2.152.236-6.133-3.544-6.139zm.529 3.405h.013c.213 0 .396.062.584.198.19.135.33.332.438.533.105.259.158.459.166.724 0-.02.006-.04.006-.06v.105a.086.086 0 01-.004-.021l-.004-.024a1.807 1.807 0 01-.15.706.953.953 0 01-.213.335.71.71 0 00-.088-.042c-.104-.045-.198-.064-.284-.133a1.312 1.312 0 00-.22-.066c.05-.06.146-.133.183-.198.053-.128.082-.264.088-.402v-.02a1.21 1.21 0 00-.061-.4c-.045-.134-.101-.2-.183-.333-.084-.066-.167-.132-.267-.132h-.016c-.093 0-.176.03-.262.132a.8.8 0 00-.205.334 1.18 1.18 0 00-.09.4v.019c.002.089.008.179.02.267-.193-.067-.438-.135-.607-.202a1.635 1.635 0 01-.018-.2v-.02a1.772 1.772 0 01.15-.768c.082-.22.232-.406.43-.533a.985.985 0 01.594-.2zm-2.962.059h.036c.142 0 .27.048.399.135.146.129.264.288.344.465.09.199.14.4.153.667v.004c.007.134.006.2-.002.266v.08c-.03.007-.056.018-.083.024-.152.055-.274.135-.393.2.012-.09.013-.18.003-.267v-.015c-.012-.133-.04-.2-.082-.333a.613.613 0 00-.166-.267.248.248 0 00-.183-.064h-.021c-.071.006-.13.04-.186.132a.552.552 0 00-.12.27.944.944 0 00-.023.33v.015c.012.135.037.2.08.334.046.134.098.2.166.268.01.009.02.018.034.024-.07.057-.117.07-.176.136a.304.304 0 01-.131.068 2.62 2.62 0 01-.275-.402 1.772 1.772 0 01-.155-.667 1.759 1.759 0 01.08-.668 1.43 1.43 0 01.283-.535c.128-.133.26-.2.418-.2zm1.37 1.706c.332 0 .733.065 1.216.399.293.2.523.269 1.052.468h.003c.255.136.405.266.478.399v-.131a.571.571 0 01.016.47c-.123.31-.516.643-1.063.842v.002c-.268.135-.501.333-.775.465-.276.135-.588.292-1.012.267a1.139 1.139 0 01-.448-.067 3.566 3.566 0 01-.322-.198c-.195-.135-.363-.332-.612-.465v-.005h-.005c-.4-.246-.616-.512-.686-.71-.07-.268-.005-.47.193-.6.224-.135.38-.271.483-.336.104-.074.143-.102.176-.131h.002v-.003c.169-.202.436-.47.839-.601.139-.036.294-.065.466-.065zm2.8 2.142c.358 1.417 1.196 3.475 1.735 4.473.286.534.855 1.659 1.102 3.024.156-.005.33.018.513.064.646-1.671-.546-3.467-1.089-3.966-.22-.2-.232-.335-.123-.335.59.534 1.365 1.572 1.646 2.757.13.535.16 1.104.021 1.67.067.028.135.06.205.067 1.032.534 1.413.938 1.23 1.537v-.043c-.06-.003-.12 0-.18 0h-.016c.151-.467-.182-.825-1.065-1.224-.915-.4-1.646-.336-1.77.465-.008.043-.013.066-.018.135-.068.023-.139.053-.209.064-.43.268-.662.669-.793 1.187-.13.533-.17 1.156-.205 1.869v.003c-.02.334-.17.838-.319 1.35-1.5 1.072-3.58 1.538-5.348.334a2.645 2.645 0 00-.402-.533 1.45 1.45 0 00-.275-.333c.182 0 .338-.03.465-.067a.615.615 0 00.314-.334c.108-.267 0-.697-.345-1.163-.345-.467-.931-.995-1.788-1.521-.63-.4-.986-.87-1.15-1.396-.165-.534-.143-1.085-.015-1.645.245-1.07.873-2.11 1.274-2.763.107-.065.037.135-.408.974-.396.751-1.14 2.497-.122 3.854a8.123 8.123 0 01.647-2.876c.564-1.278 1.743-3.504 1.836-5.268.048.036.217.135.289.202.218.133.38.333.59.465.21.201.477.335.876.335.039.003.075.006.11.006.412 0 .73-.134.997-.268.29-.134.52-.334.74-.4h.005c.467-.135.835-.402 1.044-.7zm2.185 8.958c.037.6.343 1.245.882 1.377.588.134 1.434-.333 1.791-.765l.211-.01c.315-.007.577.01.847.268l.003.003c.208.199.305.53.391.876.085.4.154.78.409 1.066.486.527.645.906.636 1.14l.003-.007v.018l-.003-.012c-.015.262-.185.396-.498.595-.63.401-1.746.712-2.457 1.57-.618.737-1.37 1.14-2.036 1.191-.664.053-1.237-.2-1.574-.898l-.005-.003c-.21-.4-.12-1.025.056-1.69.176-.668.428-1.344.463-1.897.037-.714.076-1.335.195-1.814.12-.465.308-.797.641-.984l.045-.022zm-10.814.049h.01c.053 0 .105.005.157.014.376.055.706.333 1.023.752l.91 1.664.003.003c.243.533.754 1.064 1.189 1.637.434.598.77 1.131.729 1.57v.006c-.057.744-.48 1.148-1.125 1.294-.645.135-1.52.002-2.395-.464-.968-.536-2.118-.469-2.857-.602-.369-.066-.61-.2-.723-.4-.11-.2-.113-.602.123-1.23v-.004l.002-.003c.117-.334.03-.752-.027-1.118-.055-.401-.083-.71.043-.94.16-.334.396-.4.69-.533.294-.135.64-.202.915-.47h.002v-.002c.256-.268.445-.601.668-.838.19-.201.38-.336.663-.336zm7.159-9.074c-.435.201-.945.535-1.488.535-.542 0-.97-.267-1.28-.466-.154-.134-.28-.268-.373-.335-.164-.134-.144-.333-.074-.333.109.016.129.134.199.2.096.066.215.2.36.333.292.2.68.467 1.167.467.485 0 1.053-.267 1.398-.466.195-.135.445-.334.648-.467.156-.136.149-.267.279-.267.128.016.034.134-.147.332a8.097 8.097 0 01-.69.468zm-1.082-1.583V5.64c-.006-.02.013-.042.029-.05.074-.043.18-.027.26.004.063 0 .16.067.15.135-.006.049-.085.066-.135.066-.055 0-.092-.043-.141-.068-.052-.018-.146-.008-.163-.065zm-.551 0c-.02.058-.113.049-.166.066-.047.025-.086.068-.14.068-.05 0-.13-.02-.136-.068-.01-.066.088-.133.15-.133.08-.031.184-.047.259-.005.019.009.036.03.03.05v.02h.003z",
};
const { name, size = 24, class: cls, label } = Astro.props;
const filled = name in F;
---
{filled
- ? <svg class:list={["icon", "icon--fill", cls]} width={size} height={size} viewBox="0 0 16 16" fill="currentColor"
+ ? <svg class:list={["icon", "icon--fill", cls]} width={size} height={size} viewBox={name === "github" ? "0 0 16 16" : "0 0 24 24"} fill="currentColor"
aria-hidden={label ? undefined : "true"} role={label ? "img" : undefined} aria-label={label}><path d={F[name as keyof typeof F]} /></svg>
: <svg class:list={["icon", cls]} width={size} height={size} viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"
stroke-linecap="round" stroke-linejoin="round" aria-hidden={label ? undefined : "true"} role={label ? "img" : undefined} aria-label={label}
diff --git a/site/src/i18n/en.ts b/site/src/i18n/en.ts
index f8ec3c2..9af9961 100644
--- a/site/src/i18n/en.ts
+++ b/site/src/i18n/en.ts
@@ -432,17 +432,23 @@ export const en: Dict = {
linuxHint: "chmod +x anymodel-bot-*.AppImage && ./anymodel-bot-*.AppImage",
winHint: "If Windows warns you, choose More info, then Run anyway.",
macHint: "If macOS blocks it, go to System Settings > Privacy & Security and choose Open Anyway.",
+ firstRun: "First launch",
+ yourSystem: "Your system",
verifyTitle: "Verify your download",
+ verifyLead: "Run the command for your system and compare the SHA-256 with the value listed here. If they match, the file is intact.",
verifyUnixLabel: "macOS / Linux",
verifyWin: "Get-FileHash .\\<file> -Algorithm SHA256",
verifyUnix: "shasum -a 256 <file>",
pageTitle: "Download AnyModelBot",
pageLead: "Free and open source. The app itself needs no signup; sign in to Modelflare at first launch and you're ready.",
pageDescription: "Download AnyModelBot for Windows, macOS, Linux and Docker. Free and open source, pay per use.",
+ altTitle: "Other ways to run it",
dockerTitle: "Docker",
- dockerToken: "Access token: docker exec amb cat /data/ui-token, then open http://<host>:3600/?token=<token>",
+ dockerSteps: { run: "Start the container", token: "Read the access token", open: "Open it in your browser" },
+ dockerUrl: "http://<host>:3600/?token=<token>",
cliTitle: "Command line (CLI)",
- cliBody: "Requires Node.js 22.13+ and Go 1.26.8+ (to build the bundled gateway): npm install → npm run setup → npm start.",
+ cliBody: "Run from source. Requires Node.js 22.13+ and Go 1.26.8+ (to build the bundled gateway).",
+ cliSteps: { clone: "Clone the repository", setup: "Install dependencies and build the gateway", start: "Start it, then open http://127.0.0.1:3600/" },
releases: "GitHub releases",
changelog: "Changelog",
},
diff --git a/site/src/i18n/zh.ts b/site/src/i18n/zh.ts
index b6f2944..e7f2b59 100644
--- a/site/src/i18n/zh.ts
+++ b/site/src/i18n/zh.ts
@@ -438,17 +438,23 @@ export const zh = {
linuxHint: "chmod +x anymodel-bot-*.AppImage && ./anymodel-bot-*.AppImage",
winHint: "系统提示风险时,点「更多信息 → 仍要运行」。",
macHint: "系统拦截时,到「系统设置 → 隐私与安全性」点「仍要打开」。",
+ firstRun: "首次运行",
+ yourSystem: "你的系统",
verifyTitle: "校验下载",
+ verifyLead: "用对应的命令算出安装包的 SHA-256,和这里列出的值一致,就说明文件完好。",
verifyUnixLabel: "macOS / Linux",
verifyWin: "Get-FileHash .\\<文件> -Algorithm SHA256",
verifyUnix: "shasum -a 256 <文件>",
pageTitle: "下载 AnyModelBot",
pageLead: "免费开源。App 本身无需注册,首次启动登录 Modelflare 就能用。",
pageDescription: "下载 AnyModelBot:Windows、macOS、Linux 与 Docker。免费开源,按量付费。",
+ altTitle: "其它安装方式",
dockerTitle: "Docker",
- dockerToken: "访问令牌:docker exec amb cat /data/ui-token,然后打开 http://<主机>:3600/?token=<令牌>",
+ dockerSteps: { run: "启动容器", token: "读取访问令牌", open: "在浏览器里打开" },
+ dockerUrl: "http://<主机>:3600/?token=<令牌>",
cliTitle: "命令行(CLI)",
- cliBody: "需要 Node.js 22.13+ 与 Go 1.26.8+(用于编译内置网关):npm install → npm run setup → npm start。",
+ cliBody: "从源码运行,需要 Node.js 22.13+ 与 Go 1.26.8+(用于编译内置网关)。",
+ cliSteps: { clone: "克隆仓库", setup: "安装依赖,编译内置网关", start: "启动,然后打开 http://127.0.0.1:3600/" },
releases: "GitHub 发布页",
changelog: "更新日志",
},
diff --git a/site/src/styles/components.css b/site/src/styles/components.css
index 29e14e2..fb8ed83 100644
--- a/site/src/styles/components.css
+++ b/site/src/styles/components.css
@@ -148,7 +148,9 @@
.copy-btn:hover { color: var(--text); background: var(--hover); }
.copy-btn .icon { width: 15px; height: 15px; }
.copy-btn[data-state="copied"] { color: var(--ok); }
- .warnbar { display: flex; gap: 8px; align-items: flex-start; padding: 12px 16px; border-radius: var(--r-field); background: var(--warn-wash); color: var(--text); box-shadow: inset 3px 0 0 var(--warn); font-size: var(--fs-sm); }
+ /* 警示:一个警示色图标 + 一句话,不铺色块、不加边条 */
+ .warnnote { display: flex; gap: 8px; align-items: flex-start; font-size: var(--fs-sm); line-height: 1.55; }
+ .warnnote .icon { flex: none; width: 16px; height: 16px; margin-top: 2px; color: var(--warn); }
/* —— 表格 —— */
.table { width: 100%; border-collapse: collapse; font-size: var(--fs-sm); }
diff --git a/site/src/styles/pages.css b/site/src/styles/pages.css
index 898d04f..bc5f9f9 100644
--- a/site/src/styles/pages.css
+++ b/site/src/styles/pages.css
@@ -1,48 +1,74 @@
@layer tokens, base, components, app, utilities;
/* 附属页的专用版式:下载、安全说明、开源许可、404。页面骨架(.page、.page__head、.page__section)在 components.css。 */
@layer app {
- /* —— 下载 —— */
- /* 平台是一张卡片里的四行:名称、完整校验值、大小、下载,第二行放首次运行的提示。识别出的平台描边,按钮换成主按钮(DownloadView 的脚本)。
- 校验值在桌面上能完整显示;窄屏放不下时截断,复制按钮拿到的还是完整的值 */
- .dl-page { position: relative; padding-block: clamp(32px, 4vw, 48px); }
- .dl-page__mark { position: absolute; top: clamp(32px, 4vw, 48px); right: 0; }
- .dl-page .page__head { gap: 8px; margin-bottom: 20px; padding-right: 80px; }
- .dl-page h1 { font-size: clamp(26px, 2.6vw, 34px); line-height: 1.2; }
- .dl-page .lead { font-size: var(--fs-body); }
- .dl-page .code { align-items: center; gap: 8px; padding: 3px 3px 3px 10px; border-radius: var(--r-item); }
- .dl-page .code code { padding-top: 0; }
- .dl-page .copy-btn { height: 26px; padding: 0 6px; box-shadow: none; }
- .dl-page .warnbar { padding: 6px 10px; font-size: var(--fs-xs); }
-
- .card.dl-rows { display: grid; padding: 6px; }
- .dl-row { display: grid; grid-template-columns: minmax(170px, 1fr) minmax(0, 600px) 72px auto; grid-template-areas: "name sha size btn" "hint hint hint btn"; align-items: center; gap: 4px 16px; padding: 10px 14px; border-radius: var(--r-field); }
- .dl-row + .dl-row { box-shadow: 0 -1px 0 var(--line); }
- .dl-row[data-dl-recommended] { box-shadow: inset 0 0 0 1.5px var(--accent-fg); }
- .dl-row__name { grid-area: name; font-size: var(--fs-body-sm); font-weight: 600; line-height: 1.3; letter-spacing: 0; }
- .dl-row__name .muted { font-weight: 400; }
- .dl-row__sha { grid-area: sha; }
- .dl-row__sha code { font-size: 12px; }
- .dl-row .code code { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
- .dl-row__size { grid-area: size; text-align: right; white-space: nowrap; }
- .dl-row__btn { grid-area: btn; }
- .dl-row__hint { grid-area: hint; }
- .code.dl-row__hint { justify-self: start; max-width: 100%; }
-
- /* 校验、Docker、命令行、发布页:次要信息,两栏排,小标题 */
- .dl-more { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px 32px; margin-top: 28px; }
- .dl-more > section { display: grid; align-content: start; gap: 8px; }
- .dl-more h2 { font-size: var(--fs-body-sm); font-weight: 600; line-height: 1.3; letter-spacing: 0; }
- .dl-verify { display: grid; gap: 6px; margin: 0; }
- .dl-verify > div { display: grid; grid-template-columns: 92px minmax(0, 1fr); align-items: center; gap: 8px; }
- .dl-verify dd { margin: 0; }
+ /* —— 下载 ——
+ 版式和首页同一套:居中的页头 + 一个主操作,下面是等宽的卡片。层次靠留白和细线,不靠色块、边条;品牌色只给页头的主按钮和“你的系统”。
+ 结构见 views/DownloadView.astro。 */
+ .dl-hero { display: grid; justify-items: center; margin-bottom: var(--stack-head); text-align: center; }
+ .dl-hero__mark { margin-bottom: var(--space-6); }
+ .dl-hero .lead { max-width: 34em; margin-top: var(--space-4); }
+ :lang(zh) .dl-hero .lead { max-width: 32em; }
+ .dl-hero .dl { justify-items: center; margin-top: var(--space-8); }
+ .dl-hero__meta { margin-top: var(--space-4); color: var(--text-2); font-size: var(--fs-sm); line-height: 1.6; }
+ .dl-hero__meta a { color: inherit; text-decoration: underline 1px var(--line-strong); text-underline-offset: 4px; }
+ .dl-hero__meta a:hover { color: var(--text); text-decoration-color: currentColor; }
+ /* 图标底片:和首页“在哪都找得到它”的入口同一种 */
+ .dl-ico { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 12px; color: var(--text); background: var(--grain), var(--glass-strong); box-shadow: var(--glass-ring), 0 8px 18px -12px var(--shadow-c); }
+ .dl-sub { color: var(--text-2); font-size: var(--fs-body-sm); line-height: 1.6; }
+
+ /* 平台:三张卡共用四行(图标、名称、按钮、首次运行),subgrid 让各行在卡片之间对齐 */
+ .dl-plats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); column-gap: var(--space-4); }
+ .dl-plat { display: grid; grid-row: span 4; grid-template-rows: subgrid; row-gap: 0; }
+ .dl-plat__top { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--space-3); margin-bottom: var(--space-6); }
+ .dl-plat__meta { margin-top: var(--space-1); color: var(--text-2); font-size: var(--fs-sm); line-height: 1.6; }
+ .dl-plat__btns { display: flex; flex-wrap: wrap; align-self: start; gap: var(--space-2); margin-top: var(--space-6); }
+ .dl-plat__btns .btn { flex: 1 1 148px; gap: 8px; padding-inline: 12px; }
+ .dl-plat__hint { display: grid; align-content: start; gap: var(--space-2); margin-top: var(--space-6); padding-top: var(--space-6); border-top: 1px solid var(--line); }
+ .dl-plat__tip { color: var(--text-2); font-size: var(--fs-sm); line-height: 1.6; }
+ .dl-note { max-width: 48em; margin: var(--space-6) auto 0; text-align: center; }
+
+ /* 复制按钮:代码块里只留图标,不再套一圈边 */
+ .dl-page .copy-btn { width: 32px; padding: 0; justify-content: center; box-shadow: none; }
+
+ /* 其它安装方式:两张卡,每张三步,每步一条能复制的命令 */
+ .dl-sec { margin-top: var(--stack-block); }
+ .dl-sec > .subhead { margin-bottom: var(--space-8); }
+ .dl-ways { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-4); }
+ .dl-way { display: grid; align-content: start; }
+ .dl-way .dl-ico { margin-bottom: var(--space-6); }
+ .dl-way .dl-sub { margin-top: var(--space-1); }
+ .dl-steps { display: grid; gap: var(--space-4); margin-top: var(--space-6); padding-top: var(--space-6); border-top: 1px solid var(--line); counter-reset: dl-step; }
+ .dl-steps > li { display: grid; gap: var(--space-2); counter-increment: dl-step; }
+ .dl-steps__label { display: flex; gap: var(--space-2); font-size: var(--fs-sm); line-height: 1.6; }
+ .dl-steps__label::before { content: counter(dl-step); flex: none; font-family: var(--font-mono); color: var(--text-2); }
+ .dl-way .warnnote { margin-top: var(--space-4); }
+
+ /* 校验:左边命令,右边完整的 SHA-256;宽度放得下时一行显示完,放不下就在块内换行,不截断 */
+ .dl-verify { display: grid; gap: var(--space-8) var(--space-12); }
+ .dl-verify__how { display: grid; align-content: start; gap: var(--space-4); }
+ .dl-verify__cmds { display: grid; gap: var(--space-3); }
+ .dl-verify__cmds dt { margin-bottom: var(--space-2); color: var(--text-2); font-size: var(--fs-sm); line-height: 1.6; }
+ .dl-sums { align-self: start; padding: var(--space-2) var(--space-6); }
+ .dl-sums__row { display: grid; grid-template-columns: 160px minmax(0, 1fr) auto; align-items: center; gap: var(--space-1) var(--space-4); padding-block: var(--space-3); }
+ .dl-sums__row + .dl-sums__row { border-top: 1px solid var(--line); }
+ .dl-sums__name { font-size: var(--fs-sm); font-weight: 500; line-height: 1.5; }
+ .dl-sums__name .muted { font-weight: 400; }
+ .dl-sums__hash { font-size: var(--fs-xs); line-height: 1.55; color: var(--text-2); overflow-wrap: anywhere; }
+
+ @media (min-width: 1200px) {
+ .dl-verify { grid-template-columns: minmax(0, 1fr) minmax(0, 752px); }
+ }
@media (max-width: 1023px) {
- .dl-row { grid-template-columns: minmax(0, 1fr) auto auto; grid-template-areas: "name size btn" "sha sha sha" "hint hint hint"; gap: 6px 12px; }
+ .dl-plats { grid-template-columns: minmax(0, 1fr); row-gap: var(--space-4); max-width: 560px; margin-inline: auto; }
+ .dl-plat { grid-row: auto; grid-template-rows: none; }
+ .dl-ways { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 767px) {
- .dl-more { grid-template-columns: minmax(0, 1fr); }
- .dl-page__mark { display: none; }
- .dl-page .page__head { padding-right: 0; }
+ .dl-sums { padding-inline: var(--space-4); }
+ .dl-sums__row { grid-template-columns: minmax(0, 1fr) auto; }
+ .dl-sums__hash { grid-column: 1 / -1; grid-row: 2; }
+ .dl-sums__row .copy-btn { grid-column: 2; grid-row: 1; }
}
/* —— 安全说明:对照表里 AnyModelBot 一列用正文色,最后两行(出网、可审计)加重 —— */
diff --git a/site/src/views/DownloadView.astro b/site/src/views/DownloadView.astro
index 6b00fdb..dbd013f 100644
--- a/site/src/views/DownloadView.astro
+++ b/site/src/views/DownloadView.astro
@@ -1,5 +1,12 @@
---
+// 下载页。版式和首页同一套:居中的页头 + 一个主操作,下面是等宽的卡片,层次靠留白和细线。样式在 pages.css 的"下载"。
+// 页头:标记 → 标题 → 一句话 → 按系统识别的下载按钮(client.ts 的 [data-dl])→ 版本、更新日志、发布页。
+// 平台:Windows、macOS、Linux 三张卡,结构相同(macOS 一张卡两颗按钮:Apple 芯片、Intel);识别出的系统标"你的系统"。
+// 其它安装方式:Docker、命令行两张卡,每张三步。首页的 Docker 入口链到 #docker。
+// 校验:完整的 SHA-256 只放在这一节,不进平台卡。
import Base from "../layouts/Base.astro";
+import CodeLine from "../components/CodeLine.astro";
+import DownloadButton from "../components/DownloadButton.astro";
import EyesMark from "../components/EyesMark.astro";
import Icon from "../components/Icon.astro";
import { dict, fmt, href, fmtDate, type Lang } from "../i18n";
@@ -10,80 +17,119 @@ const { lang } = Astro.props;
const t = dict(lang);
const d = t.download;
const published = fmtDate(releases.publishedAt, lang);
+// 句子里的数值单独用等宽(句子本身是无衬线),值先转义再包 span
+const mono = (x: string | number) => `<span class="mono">${String(x).replace(/[&<>"]/g, (c) => ({ "&": "&amp;", "<": "&lt;", ">": "&gt;", '"': "&quot;" })[c]!)}</span>`;
+
+type Build = (typeof PLATFORMS)[number];
+type Group = { id: "win" | "mac" | "linux"; icon: "windows" | "apple" | "linux"; builds: Build[]; tip?: string; cmd?: string };
+// id 和 lib/platform.ts 的 os 同名,页面底下的脚本靠它找到识别出的那张卡
+const groups: Group[] = [
+ { id: "win", icon: "windows", builds: ["win-x64"], tip: d.winHint },
+ { id: "mac", icon: "apple", builds: ["mac-arm64", "mac-x64"], tip: d.macHint },
+ { id: "linux", icon: "linux", builds: ["linux-x64"], cmd: d.linuxHint },
+];
+const docker = [
+ { label: d.dockerSteps.run, code: releases.platforms.docker.command, track: "docker_cmd_copy", trackCommand: "docker-run" },
+ { label: d.dockerSteps.token, code: "docker exec amb cat /data/ui-token" },
+ { label: d.dockerSteps.open, code: d.dockerUrl },
+];
+const cli = [
+ { label: d.cliSteps.clone, code: `git clone ${GITHUB_URL}.git && cd AnyModelBot` },
+ { label: d.cliSteps.setup, code: "npm install && npm run setup" },
+ { label: d.cliSteps.start, code: "npm start" },
+];
const verify = [
{ label: d.platform["win-x64"], cmd: d.verifyWin },
{ label: d.verifyUnixLabel, cmd: d.verifyUnix },
];
-// 句子里的数值单独用等宽(句子本身是无衬线),值先转义再包 span
-const mono = (x: string | number) => `<span class="mono">${String(x).replace(/[&<>"]/g, (c) => ({ "&": "&amp;", "<": "&lt;", ">": "&gt;", '"': "&quot;" })[c]!)}</span>`;
---
<Base lang={lang} path="/download" title={`${d.pageTitle} — AnyModelBot`} description={d.pageDescription}>
<div class="container page dl-page">
- <EyesMark size={64} class="dl-page__mark" lookAt="[data-dl-recommended]" />
- <header class="page__head">
+ <header class="dl-hero">
+ <EyesMark size={72} class="dl-hero__mark" lookAt="#dl-cta" />
<h1>{d.pageTitle}</h1>
<p class="lead">{d.pageLead}</p>
- <p class="small muted" set:html={fmt(d.meta, { version: mono(releases.version), publishedAt: mono(published) })} />
+ <DownloadButton lang={lang} placement="download-hero" plain id="dl-cta" fallback="#platforms" />
+ <p class="dl-hero__meta"><span set:html={fmt(d.meta, { version: mono(releases.version), publishedAt: mono(published) })} /> · <a href={href(lang, "/changelog")}>{d.changelog}</a> · <a href={`${GITHUB_URL}/releases`} target="_blank" rel="noopener">{d.releases}</a></p>
{t.hero.appUiNote && <p class="small muted">{t.hero.appUiNote}</p>}
</header>
- <ul class="card dl-rows" role="list" data-placement="download-page">
- {PLATFORMS.map((p) => {
- const b = releases.platforms[p];
- return (
- <li class="dl-row" data-dl-card={p}>
- <h2 class="dl-row__name">{d.platform[p]} <span class="muted">· {d.arch[p]}</span></h2>
- <div class="code dl-row__sha"><span class="small muted">{d.sha}</span><code data-dl-sha>{b.sha256}</code><button type="button" class="copy-btn" data-copy-code aria-label={t.ui.copy} title={t.ui.copy}><Icon name="copy" /></button></div>
- <span class="small muted mono dl-row__size">{b.sizeMB} MB</span>
- <a class="btn btn--secondary btn--sm dl-row__btn" href={b.url} download data-dl-platform={p} aria-label={`${d.generic} ${d.items[p]}`}><Icon name="download" />{d.generic}</a>
- {p.startsWith("linux") && <div class="code dl-row__hint"><code>{d.linuxHint}</code><button type="button" class="copy-btn" data-copy-code aria-label={t.ui.copy} title={t.ui.copy}><Icon name="copy" /></button></div>}
- {p.startsWith("win") && <p class="small muted dl-row__hint">{d.winHint}</p>}
- {p.startsWith("mac") && <p class="small muted dl-row__hint">{d.macHint}</p>}
- </li>
- );
- })}
+ <ul class="dl-plats" id="platforms" role="list" data-placement="download-page">
+ {groups.map((g) => (
+ <li class="card dl-plat" data-dl-card={g.id}>
+ <div class="dl-plat__top">
+ <span class="dl-ico"><Icon name={g.icon} size={22} /></span>
+ <span class="badge badge--accent" data-dl-you hidden>{d.yourSystem}</span>
+ </div>
+ <div>
+ <h2 class="h3">{d.platform[g.builds[0]]}</h2>
+ <p class="dl-plat__meta">
+ {g.builds.map((p, i) => (
+ <Fragment>{i > 0 && " · "}{d.arch[p]}{g.builds.length > 1 ? " " : " · "}<span class="mono">{releases.platforms[p].sizeMB} MB</span></Fragment>
+ ))}
+ </p>
+ </div>
+ <div class="dl-plat__btns">
+ {g.builds.map((p) => (
+ <a class="btn btn--secondary" href={releases.platforms[p].url} download data-dl-platform={p} aria-label={`${d.generic} ${d.items[p]}`}><Icon name="download" size={16} />{g.builds.length > 1 ? d.arch[p] : d.generic}</a>
+ ))}
+ </div>
+ <div class="dl-plat__hint">
+ <p class="eyebrow">{d.firstRun}</p>
+ {g.cmd ? <CodeLine lang={lang} code={g.cmd} /> : <p class="dl-plat__tip">{g.tip}</p>}
+ </div>
+ </li>
+ ))}
</ul>
- <p class="small muted page__aside">{d.macNote}</p>
-
- <div class="dl-more">
- <section aria-labelledby="verify-h">
- <h2 id="verify-h">{d.verifyTitle}</h2>
- <dl class="dl-verify">
- {verify.map((x) => (
- <div>
- <dt class="small muted">{x.label}</dt>
- <dd class="code"><code>{x.cmd}</code><button type="button" class="copy-btn" data-copy-code aria-label={t.ui.copy} title={t.ui.copy}><Icon name="copy" /></button></dd>
- </div>
- ))}
- </dl>
- </section>
+ <p class="small muted dl-note">{d.macNote}</p>
- <section id="docker" aria-labelledby="docker-h">
- <h2 id="docker-h">{d.dockerTitle}</h2>
- <div class="code"><code>{releases.platforms.docker.command}</code><button type="button" class="copy-btn" data-copy-code data-track="docker_cmd_copy" data-track-command="docker-run" aria-label={t.ui.copy} title={t.ui.copy}><Icon name="copy" /></button></div>
- <p class="small muted">{d.dockerToken}</p>
- <p class="warnbar"><b>⚠</b><span>{d.warn}</span></p>
- </section>
+ <section class="dl-sec" aria-labelledby="ways-h">
+ <h2 class="subhead" id="ways-h">{d.altTitle}</h2>
+ <div class="dl-ways">
+ <article class="card dl-way" id="docker">
+ <span class="dl-ico"><Icon name="server" size={22} /></span>
+ <h3 class="h3">{d.dockerTitle}</h3>
+ <p class="dl-sub">{t.devices.items.docker.body}</p>
+ <ol class="dl-steps" role="list">
+ {docker.map((s) => <li><p class="dl-steps__label">{s.label}</p><CodeLine lang={lang} code={s.code} track={s.track} trackCommand={s.trackCommand} /></li>)}
+ </ol>
+ <p class="warnnote"><Icon name="warn" /><span>{d.warn}</span></p>
+ </article>
+ <article class="card dl-way" id="cli">
+ <span class="dl-ico"><Icon name="terminal" size={22} /></span>
+ <h3 class="h3">{d.cliTitle}</h3>
+ <p class="dl-sub">{d.cliBody}</p>
+ <ol class="dl-steps" role="list">
+ {cli.map((s) => <li><p class="dl-steps__label">{s.label}</p><CodeLine lang={lang} code={s.code} /></li>)}
+ </ol>
+ </article>
+ </div>
+ </section>
- <section aria-labelledby="cli-h">
- <h2 id="cli-h">{d.cliTitle}</h2>
- <p class="small muted">{d.cliBody}</p>
- </section>
-
- <section aria-labelledby="rel-h">
- <h2 id="rel-h">{d.releases}</h2>
- <p class="small"><a href={`${GITHUB_URL}/releases`} target="_blank" rel="noopener">{GITHUB_URL}/releases</a> · <a href={href(lang, "/changelog")}>{d.changelog}</a></p>
- </section>
- </div>
+ <section class="dl-sec dl-verify" aria-labelledby="verify-h">
+ <div class="dl-verify__how">
+ <h2 class="subhead" id="verify-h">{d.verifyTitle}</h2>
+ <p class="dl-sub">{d.verifyLead}</p>
+ <dl class="dl-verify__cmds">
+ {verify.map((x) => <div><dt>{x.label}</dt><dd><CodeLine lang={lang} code={x.cmd} /></dd></div>)}
+ </dl>
+ </div>
+ <ul class="card dl-sums" role="list" aria-label={d.sha}>
+ {PLATFORMS.map((p) => (
+ <li class="dl-sums__row">
+ <span class="dl-sums__name">{d.platform[p]} <span class="muted">{d.arch[p]}</span></span>
+ <code class="dl-sums__hash">{releases.platforms[p].sha256}</code>
+ <button type="button" class="copy-btn" data-copy-text={releases.platforms[p].sha256} aria-label={`${t.ui.copy} ${d.sha}`} title={t.ui.copy}><Icon name="copy" /></button>
+ </li>
+ ))}
+ </ul>
+ </section>
</div>
<script>
- // 推荐平台的那一行:给 Eyes 标记一个看的目标,描边高亮,下载按钮换成主按钮
+ // 识别出的系统在它那张卡上标一下;页头的主按钮由 client.ts 换成对应的安装包
import { detectPlatform } from "../lib/platform";
- detectPlatform().then((p) => {
- const id = p.os === "win" ? "win-x64" : p.os === "mac" ? (p.arch === "x64" ? "mac-x64" : "mac-arm64") : p.os === "linux" ? "linux-x64" : null;
- const row = id ? document.querySelector(`[data-dl-card="${id}"]`) : null;
- row?.setAttribute("data-dl-recommended", "");
- row?.querySelector(".btn")?.classList.replace("btn--secondary", "btn--primary");
+ detectPlatform().then(({ os }) => {
+ document.querySelector(`[data-dl-card="${os}"] [data-dl-you]`)?.removeAttribute("hidden");
});
</script>
</Base>