diff --git a/README.md b/README.md index 06c2ea0..57f494b 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,7 @@ # Nomadro +> **Hub `.com` 已发布**:`20261128T165939Z`(本地 2026-11-29),门户 [nomadro.com/hub](https://nomadro.com/hub) + Hub API + [admin.nomadro.com](https://admin.nomadro.com/) 中文轨。构建 `OfO3HMXd-HIAPfsB7UgKC`;[检查、发布与回滚记录](docs/hub-audit-2026-11-29.md)。未同步 `.cn`、VIP hackrobot 或小程序。 + > **管理后台域名铁律(永远禁止混淆)** > > | 域名 | 是什么 | 不是什么 | @@ -257,6 +259,11 @@ pnpm typecheck pnpm clean # 清 .next / dist ``` +测试入口(公众号关注卡片 / 非微信浏览器还原): + +- 本地:`http://localhost:3000/test/wechat-card` +- 局域网(手机同网访问):`http://<你的局域网IP>:3000/test/wechat-card` + API 首次: ```bash diff --git a/src/app/test/wechat-card/page.tsx b/src/app/test/wechat-card/page.tsx new file mode 100644 index 0000000..ec4775b --- /dev/null +++ b/src/app/test/wechat-card/page.tsx @@ -0,0 +1,71 @@ +"use client"; + +import styles from "./wechat-card.module.css"; + +const FALLBACK_LINK = "https://mp.weixin.qq.com/"; +// 公众号标识(你提供:nomadro) +const WECHAT_OFFICIAL_ACCOUNT_ID = "nomadro"; + +function openWechatProfile() { + const ua = navigator.userAgent.toLowerCase(); + const isWechat = ua.includes("micromessenger"); + + if (isWechat && WECHAT_OFFICIAL_ACCOUNT_ID) { + // 微信内优先尝试拉起公众号主页;失败再回退 H5 链接 + window.location.href = `weixin://profile/${WECHAT_OFFICIAL_ACCOUNT_ID}`; + window.setTimeout(() => { + window.location.href = FALLBACK_LINK; + }, 1200); + return; + } + + window.location.href = FALLBACK_LINK; +} + +export default function WechatCardTestPage() { + return ( +
+
+

微信公众号关注卡片测试

+

+ 非微信浏览器(如 Chrome)下的视觉还原预览。 +

+ + +
+
+ ); +} diff --git a/src/app/test/wechat-card/wechat-card.module.css b/src/app/test/wechat-card/wechat-card.module.css new file mode 100644 index 0000000..6e2ed1f --- /dev/null +++ b/src/app/test/wechat-card/wechat-card.module.css @@ -0,0 +1,161 @@ +.page { + min-height: 100vh; + padding: 32px 16px; + background: radial-gradient(circle at 20% 0%, #1b2440 0%, #0c0c0f 45%, #060608 100%); + color: #e5e7eb; +} + +.panel { + width: 100%; + max-width: 760px; + margin: 0 auto; + padding: 20px; + border-radius: 18px; + background: rgba(17, 24, 39, 0.75); + border: 1px solid rgba(148, 163, 184, 0.2); + box-shadow: 0 10px 32px rgba(0, 0, 0, 0.35); +} + +.title { + margin: 0; + font-size: 24px; + line-height: 1.25; +} + +.subtitle { + margin: 10px 0 22px; + font-size: 14px; + color: #cbd5e1; +} + +.cardRoot { + display: block; + width: 100%; + max-width: 420px; + color: inherit; + text-decoration: none; + text-align: left; + background: transparent; + border: 0; + padding: 0; + cursor: pointer; +} + +.cardInner { + overflow: hidden; + border-radius: 12px; + background: #f5f6f7; + color: #111827; + border: 1px solid #ebeef2; + transition: transform 0.18s ease, box-shadow 0.18s ease; +} + +.cardRoot:hover .cardInner, +.cardRoot:focus-visible .cardInner { + transform: translateY(-1px); + box-shadow: 0 8px 20px rgba(0, 0, 0, 0.16); +} + +.cardBody { + padding: 14px 14px 12px; +} + +.profile { + display: flex; + align-items: center; + gap: 10px; +} + +.avatarWrap { + width: 48px; + height: 48px; + flex: 0 0 auto; +} + +.avatar { + width: 100%; + height: 100%; + border-radius: 999px; + object-fit: cover; +} + +.profileBody { + min-width: 0; + flex: 1; +} + +.nicknameRow { + display: flex; + align-items: center; + gap: 4px; +} + +.nickname { + font-size: 24px; + line-height: 1.1; + font-weight: 700; + letter-spacing: 0.01em; +} + +.verify { + color: #f59e0b; + font-size: 14px; +} + +.desc { + margin-top: 2px; + font-size: 15px; + line-height: 1.3; + color: #4b5563; + white-space: nowrap; + overflow: hidden; + text-overflow: ellipsis; +} + +.tips { + margin-top: 2px; + font-size: 15px; + color: #6b7280; +} + +.arrow { + color: #9ca3af; + font-size: 24px; + line-height: 1; + margin-left: 4px; +} + +.cardFooter { + padding: 10px 14px 12px; + border-top: 1px solid #ebeef2; + color: #9ca3af; + font-size: 12px; +} + +@media (max-width: 640px) { + .page { + padding: 18px 12px; + } + + .panel { + padding: 14px; + border-radius: 14px; + } + + .title { + font-size: 19px; + } + + .cardRoot { + max-width: none; + } + + .nickname { + font-size: 20px; + } + + .desc, + .tips { + font-size: 14px; + } +}