Add portal/admin PWA icons and freeze the game home entry.
Ship brand favicons and install-to-home manifests for nomadro.cn and admin, improve admin mobile drawer UX, and keep the game module forced off. Co-authored-by: Cursor <cursoragent@cursor.com>
@ -2,7 +2,26 @@
|
||||
<html lang="zh-CN">
|
||||
<head>
|
||||
<meta charset="UTF-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
<meta
|
||||
name="viewport"
|
||||
content="width=device-width, initial-scale=1.0, viewport-fit=cover, maximum-scale=1"
|
||||
/>
|
||||
<meta name="theme-color" content="#0e1512" media="(prefers-color-scheme: dark)" />
|
||||
<meta name="theme-color" content="#0e1512" />
|
||||
<meta name="color-scheme" content="dark" />
|
||||
<meta name="description" content="Nomadro 微信 / 抖音小程序管理后台" />
|
||||
<meta name="application-name" content="Nomadro Admin" />
|
||||
<meta name="apple-mobile-web-app-capable" content="yes" />
|
||||
<meta name="apple-mobile-web-app-status-bar-style" content="black-translucent" />
|
||||
<meta name="apple-mobile-web-app-title" content="Nomadro" />
|
||||
<meta name="mobile-web-app-capable" content="yes" />
|
||||
<meta name="format-detection" content="telephone=no" />
|
||||
<link rel="manifest" href="/manifest.webmanifest" />
|
||||
<link rel="icon" href="/favicon.ico" sizes="any" />
|
||||
<link rel="icon" type="image/svg+xml" href="/favicon.svg" />
|
||||
<link rel="icon" type="image/png" sizes="32x32" href="/favicon-32x32.png" />
|
||||
<link rel="icon" type="image/png" sizes="16x16" href="/favicon-16x16.png" />
|
||||
<link rel="apple-touch-icon" href="/apple-touch-icon.png" />
|
||||
<title>Nomadro Admin</title>
|
||||
<link rel="preconnect" href="https://fonts.googleapis.com" />
|
||||
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
|
||||
|
||||
BIN
apps/admin/public/apple-touch-icon.png
Normal file
|
After Width: | Height: | Size: 2.6 KiB |
BIN
apps/admin/public/favicon-16x16.png
Normal file
|
After Width: | Height: | Size: 295 B |
BIN
apps/admin/public/favicon-32x32.png
Normal file
|
After Width: | Height: | Size: 502 B |
BIN
apps/admin/public/favicon.ico
Normal file
|
After Width: | Height: | Size: 317 B |
20
apps/admin/public/favicon.svg
Normal file
@ -0,0 +1,20 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 64 64" role="img" aria-label="Nomadro Admin">
|
||||
<defs>
|
||||
<linearGradient id="g" x1="8" y1="4" x2="56" y2="60" gradientUnits="userSpaceOnUse">
|
||||
<stop offset="0%" stop-color="#7be0a4"/>
|
||||
<stop offset="55%" stop-color="#3f9d68"/>
|
||||
<stop offset="100%" stop-color="#246b45"/>
|
||||
</linearGradient>
|
||||
<linearGradient id="shine" x1="12" y1="6" x2="40" y2="36" gradientUnits="userSpaceOnUse">
|
||||
<stop offset="0%" stop-color="#fff" stop-opacity="0.35"/>
|
||||
<stop offset="100%" stop-color="#fff" stop-opacity="0"/>
|
||||
</linearGradient>
|
||||
</defs>
|
||||
<rect width="64" height="64" rx="14" fill="#0e1512"/>
|
||||
<rect x="4" y="4" width="56" height="56" rx="12" fill="url(#g)"/>
|
||||
<rect x="4" y="4" width="56" height="56" rx="12" fill="url(#shine)"/>
|
||||
<path
|
||||
d="M18 44V20h7.2l7.6 15.2L40.4 20H47.6v24h-6.2V29.2L35.2 44h-6.4L22.6 29.2V44H18z"
|
||||
fill="#062012"
|
||||
/>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 938 B |
BIN
apps/admin/public/icon-192.png
Normal file
|
After Width: | Height: | Size: 2.7 KiB |
BIN
apps/admin/public/icon-512.png
Normal file
|
After Width: | Height: | Size: 8.6 KiB |
38
apps/admin/public/manifest.webmanifest
Normal file
@ -0,0 +1,38 @@
|
||||
{
|
||||
"name": "Nomadro Admin",
|
||||
"short_name": "Nomadro",
|
||||
"description": "Nomadro 微信 / 抖音小程序管理后台",
|
||||
"start_url": "/",
|
||||
"scope": "/",
|
||||
"display": "standalone",
|
||||
"orientation": "any",
|
||||
"background_color": "#0e1512",
|
||||
"theme_color": "#0e1512",
|
||||
"lang": "zh-CN",
|
||||
"icons": [
|
||||
{
|
||||
"src": "/favicon.svg",
|
||||
"sizes": "any",
|
||||
"type": "image/svg+xml",
|
||||
"purpose": "any"
|
||||
},
|
||||
{
|
||||
"src": "/icon-192.png",
|
||||
"sizes": "192x192",
|
||||
"type": "image/png",
|
||||
"purpose": "any"
|
||||
},
|
||||
{
|
||||
"src": "/icon-512.png",
|
||||
"sizes": "512x512",
|
||||
"type": "image/png",
|
||||
"purpose": "any"
|
||||
},
|
||||
{
|
||||
"src": "/apple-touch-icon.png",
|
||||
"sizes": "180x180",
|
||||
"type": "image/png",
|
||||
"purpose": "any"
|
||||
}
|
||||
]
|
||||
}
|
||||
@ -1,46 +1,104 @@
|
||||
import { NavLink, Outlet, useNavigate } from 'react-router-dom'
|
||||
import { useEffect, useState } from 'react'
|
||||
import { NavLink, Outlet, useLocation, useNavigate } from 'react-router-dom'
|
||||
import { clearToken } from '../api'
|
||||
|
||||
/** 微信小程序后台壳层 — 仅 /wechat/*,不碰抖音 */
|
||||
const NAV = [
|
||||
{ to: '/wechat', end: true, label: '概览' },
|
||||
{ to: '/wechat/books/default', end: false, label: '书籍与试读%' },
|
||||
{ to: '/wechat/nav', end: false, label: '导航' },
|
||||
{ to: '/wechat/vip', end: false, label: 'VIP' },
|
||||
{ to: '/wechat/shop', end: false, label: '电商' },
|
||||
{ to: '/wechat/memo', end: false, label: '知识社群' },
|
||||
{ to: '/wechat/users', end: false, label: '读者' },
|
||||
{ to: '/wechat/orders', end: false, label: '订单' },
|
||||
{ to: '/wechat/events', end: false, label: '埋点' },
|
||||
{ to: '/wechat/checklist', end: false, label: '部署检查清单' },
|
||||
] as const
|
||||
|
||||
function titleFromPath(pathname: string) {
|
||||
const hit = NAV.find((n) => (n.end ? pathname === n.to : pathname.startsWith(n.to)))
|
||||
return hit?.label || '微信后台'
|
||||
}
|
||||
|
||||
/** 微信小程序后台壳层 — 仅 /wechat/*,不碰抖音;移动端抽屉导航 */
|
||||
export default function Layout() {
|
||||
const nav = useNavigate()
|
||||
return (
|
||||
<div className="shell">
|
||||
<aside className="side">
|
||||
<div className="logo">
|
||||
<span className="logo-mark">N</span>
|
||||
<div>
|
||||
<div className="logo-title">Nomadro</div>
|
||||
<div className="logo-sub">微信小程序后台</div>
|
||||
</div>
|
||||
const { pathname } = useLocation()
|
||||
const [open, setOpen] = useState(false)
|
||||
|
||||
useEffect(() => {
|
||||
setOpen(false)
|
||||
}, [pathname])
|
||||
|
||||
useEffect(() => {
|
||||
document.body.style.overflow = open ? 'hidden' : ''
|
||||
return () => {
|
||||
document.body.style.overflow = ''
|
||||
}
|
||||
}, [open])
|
||||
|
||||
function logout() {
|
||||
clearToken()
|
||||
nav('/login')
|
||||
}
|
||||
|
||||
const side = (
|
||||
<>
|
||||
<div className="logo">
|
||||
<img className="logo-mark-img" src="/apple-touch-icon.png" width={42} height={42} alt="" />
|
||||
<div>
|
||||
<div className="logo-title">Nomadro</div>
|
||||
<div className="logo-sub">微信小程序后台</div>
|
||||
</div>
|
||||
<nav className="nav">
|
||||
<NavLink to="/wechat" end>
|
||||
概览
|
||||
</div>
|
||||
<nav className="nav" aria-label="微信后台导航">
|
||||
{NAV.map((item) => (
|
||||
<NavLink key={item.to} to={item.to} end={item.end} onClick={() => setOpen(false)}>
|
||||
{item.label}
|
||||
</NavLink>
|
||||
<NavLink to="/wechat/books/default">书籍与试读%</NavLink>
|
||||
<NavLink to="/wechat/nav">导航</NavLink>
|
||||
<NavLink to="/wechat/vip">VIP</NavLink>
|
||||
<NavLink to="/wechat/shop">电商</NavLink>
|
||||
<NavLink to="/wechat/memo">知识社群</NavLink>
|
||||
<NavLink to="/wechat/users">读者</NavLink>
|
||||
<NavLink to="/wechat/orders">订单</NavLink>
|
||||
<NavLink to="/wechat/events">埋点</NavLink>
|
||||
<NavLink to="/wechat/checklist">部署检查清单</NavLink>
|
||||
</nav>
|
||||
<button type="button" className="ghost-btn" onClick={() => nav('/')}>
|
||||
← 切换平台
|
||||
</button>
|
||||
))}
|
||||
</nav>
|
||||
<button type="button" className="ghost-btn" onClick={() => nav('/')}>
|
||||
← 切换平台
|
||||
</button>
|
||||
<button type="button" className="ghost-btn" onClick={logout}>
|
||||
退出登录
|
||||
</button>
|
||||
</>
|
||||
)
|
||||
|
||||
return (
|
||||
<div className={`shell${open ? ' shell--nav-open' : ''}`}>
|
||||
<header className="topbar">
|
||||
<button
|
||||
type="button"
|
||||
className="ghost-btn"
|
||||
onClick={() => {
|
||||
clearToken()
|
||||
nav('/login')
|
||||
}}
|
||||
className="topbar-menu"
|
||||
aria-label={open ? '关闭菜单' : '打开菜单'}
|
||||
aria-expanded={open}
|
||||
onClick={() => setOpen((v) => !v)}
|
||||
>
|
||||
退出登录
|
||||
<span />
|
||||
<span />
|
||||
<span />
|
||||
</button>
|
||||
<div className="topbar-brand">
|
||||
<img src="/favicon-32x32.png" width={28} height={28} alt="" />
|
||||
<div>
|
||||
<div className="topbar-title">Nomadro</div>
|
||||
<div className="topbar-sub">{titleFromPath(pathname)}</div>
|
||||
</div>
|
||||
</div>
|
||||
<button type="button" className="topbar-action" onClick={() => nav('/')}>
|
||||
平台
|
||||
</button>
|
||||
</header>
|
||||
|
||||
{open && (
|
||||
<button type="button" className="nav-scrim" aria-label="关闭菜单" onClick={() => setOpen(false)} />
|
||||
)}
|
||||
|
||||
<aside className="side" aria-hidden={!open}>
|
||||
{side}
|
||||
</aside>
|
||||
<main className="main">
|
||||
<Outlet />
|
||||
|
||||
@ -31,8 +31,13 @@ export default function Login() {
|
||||
<div className="login-page">
|
||||
<div className="login-bg" />
|
||||
<form className="login-card" onSubmit={onSubmit}>
|
||||
<h1>Nomadro Admin</h1>
|
||||
<p>微信 / 抖音小程序后台入口 · admin.nomadro.cn(非 nomadro.cn/admin)</p>
|
||||
<div className="login-brand">
|
||||
<img src="/apple-touch-icon.png" width={56} height={56} alt="Nomadro" />
|
||||
<div>
|
||||
<h1>Nomadro Admin</h1>
|
||||
<p>微信 / 抖音小程序后台 · 可添加到手机桌面</p>
|
||||
</div>
|
||||
</div>
|
||||
<label>
|
||||
用户名
|
||||
<input value={username} onChange={(e) => setUsername(e.target.value)} autoComplete="username" />
|
||||
@ -44,10 +49,14 @@ export default function Login() {
|
||||
value={password}
|
||||
onChange={(e) => setPassword(e.target.value)}
|
||||
autoComplete="current-password"
|
||||
enterKeyHint="go"
|
||||
/>
|
||||
</label>
|
||||
{err && <div className="error">{err}</div>}
|
||||
<button disabled={loading}>{loading ? '登录中…' : '进入控制台'}</button>
|
||||
<p className="login-install-hint">
|
||||
iPhone:Safari 分享 →「添加到主屏幕」· Android:浏览器菜单 →「安装应用 / 添加到主屏幕」
|
||||
</p>
|
||||
</form>
|
||||
</div>
|
||||
)
|
||||
|
||||
@ -293,21 +293,11 @@ export default function Vip() {
|
||||
</div>
|
||||
<div className="vip-row">
|
||||
<div>
|
||||
<strong>Nomad Day 3D 入口</strong>
|
||||
<p className="vip-hint">关闭后首页不展示 3D 卡片</p>
|
||||
<strong>数字游民 · 游戏入口</strong>
|
||||
<p className="vip-hint">已冻结隐藏,首页不展示;请勿开启</p>
|
||||
</div>
|
||||
<button
|
||||
type="button"
|
||||
className={draft.gameEnabled ? 'primary-link' : 'ghost-btn'}
|
||||
disabled={busy}
|
||||
onClick={() =>
|
||||
void save(
|
||||
{ gameEnabled: !draft.gameEnabled },
|
||||
draft.gameEnabled ? '3D 入口已关闭' : '3D 入口已开启',
|
||||
)
|
||||
}
|
||||
>
|
||||
{draft.gameEnabled ? '已开启' : '已关闭'}
|
||||
<button type="button" className="ghost-btn" disabled>
|
||||
已冻结
|
||||
</button>
|
||||
</div>
|
||||
{cfg?.updatedAt ? (
|
||||
|
||||
@ -1,4 +1,5 @@
|
||||
import { NavLink, Outlet, useNavigate } from 'react-router-dom'
|
||||
import { useEffect, useState } from 'react'
|
||||
import { NavLink, Outlet, useLocation, useNavigate } from 'react-router-dom'
|
||||
import { clearToken } from '../../api'
|
||||
import './douyin.css'
|
||||
|
||||
@ -9,12 +10,64 @@ const NAV = [
|
||||
{ to: '/douyin/docs', end: false, ico: '✓', label: '开发与验收' },
|
||||
] as const
|
||||
|
||||
/** 抖音定制壳 — 加群弹窗集成在「首页与入口」 */
|
||||
function titleFromPath(pathname: string) {
|
||||
const hit = NAV.find((n) => (n.end ? pathname === n.to : pathname.startsWith(n.to)))
|
||||
return hit?.label || '抖音控制台'
|
||||
}
|
||||
|
||||
/** 抖音定制壳 — 加群弹窗集成在「首页与入口」;移动端抽屉导航 */
|
||||
export default function DouyinLayout() {
|
||||
const nav = useNavigate()
|
||||
const { pathname } = useLocation()
|
||||
const [open, setOpen] = useState(false)
|
||||
|
||||
useEffect(() => {
|
||||
setOpen(false)
|
||||
}, [pathname])
|
||||
|
||||
useEffect(() => {
|
||||
document.body.style.overflow = open ? 'hidden' : ''
|
||||
return () => {
|
||||
document.body.style.overflow = ''
|
||||
}
|
||||
}, [open])
|
||||
|
||||
function logout() {
|
||||
clearToken()
|
||||
nav('/login')
|
||||
}
|
||||
|
||||
return (
|
||||
<div className="dy-shell">
|
||||
<aside className="dy-side">
|
||||
<div className={`dy-shell${open ? ' dy-shell--nav-open' : ''}`}>
|
||||
<header className="dy-topbar">
|
||||
<button
|
||||
type="button"
|
||||
className="dy-topbar-menu"
|
||||
aria-label={open ? '关闭菜单' : '打开菜单'}
|
||||
aria-expanded={open}
|
||||
onClick={() => setOpen((v) => !v)}
|
||||
>
|
||||
<span />
|
||||
<span />
|
||||
<span />
|
||||
</button>
|
||||
<div className="dy-topbar-brand">
|
||||
<span className="dy-topbar-mark">抖</span>
|
||||
<div>
|
||||
<div className="dy-topbar-title">抖音控制台</div>
|
||||
<div className="dy-topbar-sub">{titleFromPath(pathname)}</div>
|
||||
</div>
|
||||
</div>
|
||||
<button type="button" className="dy-topbar-action" onClick={() => nav('/')}>
|
||||
平台
|
||||
</button>
|
||||
</header>
|
||||
|
||||
{open && (
|
||||
<button type="button" className="dy-nav-scrim" aria-label="关闭菜单" onClick={() => setOpen(false)} />
|
||||
)}
|
||||
|
||||
<aside className="dy-side" aria-hidden={!open}>
|
||||
<div className="dy-logo">
|
||||
<span className="dy-mark">抖</span>
|
||||
<div>
|
||||
@ -28,9 +81,9 @@ export default function DouyinLayout() {
|
||||
与微信数据隔离
|
||||
</div>
|
||||
|
||||
<nav className="dy-nav">
|
||||
<nav className="dy-nav" aria-label="抖音后台导航">
|
||||
{NAV.map((item) => (
|
||||
<NavLink key={item.to} to={item.to} end={item.end}>
|
||||
<NavLink key={item.to} to={item.to} end={item.end} onClick={() => setOpen(false)}>
|
||||
<span className="dy-nav-ico" aria-hidden>
|
||||
{item.ico}
|
||||
</span>
|
||||
@ -44,14 +97,7 @@ export default function DouyinLayout() {
|
||||
<button type="button" className="dy-ghost" onClick={() => nav('/')}>
|
||||
← 切换平台
|
||||
</button>
|
||||
<button
|
||||
type="button"
|
||||
className="dy-ghost"
|
||||
onClick={() => {
|
||||
clearToken()
|
||||
nav('/login')
|
||||
}}
|
||||
>
|
||||
<button type="button" className="dy-ghost" onClick={logout}>
|
||||
退出登录
|
||||
</button>
|
||||
</div>
|
||||
|
||||
@ -38,6 +38,11 @@
|
||||
|
||||
.dy-shell * { box-sizing: border-box; }
|
||||
|
||||
.dy-topbar,
|
||||
.dy-nav-scrim {
|
||||
display: none;
|
||||
}
|
||||
|
||||
/* —— 侧栏 —— */
|
||||
.dy-side {
|
||||
position: sticky;
|
||||
@ -1075,19 +1080,138 @@
|
||||
@keyframes dy-spin { to { transform: rotate(360deg); } }
|
||||
|
||||
@media (max-width: 960px) {
|
||||
.dy-shell { grid-template-columns: 1fr; }
|
||||
.dy-side {
|
||||
position: relative;
|
||||
height: auto;
|
||||
border-right: none;
|
||||
border-bottom: 1px solid var(--dy-line);
|
||||
.dy-shell {
|
||||
grid-template-columns: 1fr;
|
||||
grid-template-rows: auto 1fr;
|
||||
}
|
||||
|
||||
.dy-topbar {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 12px;
|
||||
position: sticky;
|
||||
top: 0;
|
||||
z-index: 40;
|
||||
min-height: 56px;
|
||||
padding: 10px 14px;
|
||||
padding-top: max(10px, env(safe-area-inset-top, 0px));
|
||||
border-bottom: 1px solid var(--dy-line);
|
||||
background: rgba(5, 5, 7, 0.94);
|
||||
backdrop-filter: blur(14px);
|
||||
}
|
||||
.dy-topbar-menu {
|
||||
width: 44px;
|
||||
height: 44px;
|
||||
border-radius: 12px;
|
||||
border: 1px solid var(--dy-line-strong);
|
||||
background: rgba(255, 255, 255, 0.04);
|
||||
color: var(--dy-text);
|
||||
display: grid;
|
||||
place-content: center;
|
||||
gap: 5px;
|
||||
padding: 0;
|
||||
flex-shrink: 0;
|
||||
}
|
||||
.dy-topbar-menu span {
|
||||
display: block;
|
||||
width: 18px;
|
||||
height: 2px;
|
||||
border-radius: 2px;
|
||||
background: currentColor;
|
||||
}
|
||||
.dy-topbar-brand {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 10px;
|
||||
min-width: 0;
|
||||
flex: 1;
|
||||
}
|
||||
.dy-topbar-mark {
|
||||
width: 28px;
|
||||
height: 28px;
|
||||
border-radius: 8px;
|
||||
display: grid;
|
||||
place-items: center;
|
||||
font-size: 12px;
|
||||
font-weight: 800;
|
||||
font-family: var(--dy-font);
|
||||
background: linear-gradient(145deg, #fe2c55, #2dd4bf);
|
||||
color: #fff;
|
||||
flex-shrink: 0;
|
||||
}
|
||||
.dy-topbar-title {
|
||||
font-family: var(--dy-font);
|
||||
font-size: 15px;
|
||||
line-height: 1.2;
|
||||
}
|
||||
.dy-topbar-sub {
|
||||
color: var(--dy-muted);
|
||||
font-size: 12px;
|
||||
white-space: nowrap;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
}
|
||||
.dy-topbar-action {
|
||||
flex-shrink: 0;
|
||||
min-height: 40px;
|
||||
padding: 8px 12px;
|
||||
border-radius: 10px;
|
||||
border: 1px solid var(--dy-line-strong);
|
||||
background: rgba(255, 255, 255, 0.04);
|
||||
color: var(--dy-text);
|
||||
font-weight: 600;
|
||||
font-size: 13px;
|
||||
}
|
||||
|
||||
.dy-nav-scrim {
|
||||
display: block;
|
||||
position: fixed;
|
||||
inset: 0;
|
||||
z-index: 45;
|
||||
border: 0;
|
||||
background: rgba(0, 0, 0, 0.6);
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.dy-side {
|
||||
position: fixed;
|
||||
top: 0;
|
||||
left: 0;
|
||||
bottom: 0;
|
||||
width: min(300px, 86vw);
|
||||
height: auto;
|
||||
z-index: 50;
|
||||
border-right: 1px solid var(--dy-line);
|
||||
border-bottom: none;
|
||||
transform: translateX(-105%);
|
||||
transition: transform 0.22s ease;
|
||||
padding-top: max(22px, env(safe-area-inset-top, 0px));
|
||||
padding-bottom: max(18px, env(safe-area-inset-bottom, 0px));
|
||||
overflow-y: auto;
|
||||
-webkit-overflow-scrolling: touch;
|
||||
}
|
||||
.dy-shell--nav-open .dy-side {
|
||||
transform: translateX(0);
|
||||
}
|
||||
|
||||
.dy-nav {
|
||||
flex-direction: column;
|
||||
flex-wrap: nowrap;
|
||||
}
|
||||
.dy-nav a {
|
||||
flex: none;
|
||||
min-height: 44px;
|
||||
}
|
||||
.dy-main {
|
||||
padding: 18px 14px max(28px, env(safe-area-inset-bottom, 0px));
|
||||
}
|
||||
.dy-nav { flex-direction: row; flex-wrap: wrap; }
|
||||
.dy-nav a { flex: 1 1 140px; }
|
||||
.dy-main { padding: 20px 16px 100px; }
|
||||
.dy-grid2, .dy-grid3, .dy-grid4, .dy-quick, .dy-preview-wrap, .dy-book-layout {
|
||||
grid-template-columns: 1fr;
|
||||
}
|
||||
.dy-phone { position: relative; top: 0; width: 100%; max-width: 240px; margin: 0 auto; }
|
||||
.dy-chap-list { position: relative; top: 0; max-height: none; }
|
||||
.dy-ghost, .dy-btn, input, textarea, button {
|
||||
min-height: 44px;
|
||||
font-size: 16px;
|
||||
}
|
||||
}
|
||||
@ -13,6 +13,10 @@
|
||||
|
||||
* { box-sizing: border-box; }
|
||||
html, body, #root { min-height: 100%; margin: 0; }
|
||||
html {
|
||||
-webkit-text-size-adjust: 100%;
|
||||
-webkit-tap-highlight-color: transparent;
|
||||
}
|
||||
body {
|
||||
font-family: var(--font-body);
|
||||
color: var(--text);
|
||||
@ -20,14 +24,26 @@ body {
|
||||
radial-gradient(900px 500px at 0% 0%, rgba(70, 150, 100, 0.22), transparent 55%),
|
||||
radial-gradient(700px 400px at 100% 0%, rgba(180, 150, 60, 0.12), transparent 50%),
|
||||
var(--bg);
|
||||
padding:
|
||||
env(safe-area-inset-top, 0)
|
||||
env(safe-area-inset-right, 0)
|
||||
env(safe-area-inset-bottom, 0)
|
||||
env(safe-area-inset-left, 0);
|
||||
}
|
||||
|
||||
a { color: inherit; text-decoration: none; }
|
||||
button, a, input, textarea, select { touch-action: manipulation; }
|
||||
|
||||
.shell {
|
||||
display: grid;
|
||||
grid-template-columns: 260px 1fr;
|
||||
min-height: 100vh;
|
||||
min-height: 100dvh;
|
||||
}
|
||||
|
||||
.topbar,
|
||||
.nav-scrim {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.side {
|
||||
@ -41,11 +57,17 @@ a { color: inherit; text-decoration: none; }
|
||||
}
|
||||
|
||||
.logo { display: flex; gap: 12px; align-items: center; }
|
||||
.logo-mark {
|
||||
.logo-mark,
|
||||
.logo-mark-img {
|
||||
width: 42px; height: 42px; border-radius: 12px;
|
||||
display: grid; place-items: center;
|
||||
background: linear-gradient(135deg, #3f9d68, #7be0a4);
|
||||
color: #062012; font-family: var(--font-display); font-weight: 800;
|
||||
flex-shrink: 0;
|
||||
}
|
||||
.logo-mark-img {
|
||||
object-fit: cover;
|
||||
box-shadow: 0 4px 14px rgba(63, 157, 104, 0.35);
|
||||
}
|
||||
.logo-title { font-family: var(--font-display); font-size: 20px; }
|
||||
.logo-sub { color: var(--muted); font-size: 12px; }
|
||||
@ -53,6 +75,9 @@ a { color: inherit; text-decoration: none; }
|
||||
.nav { display: flex; flex-direction: column; gap: 8px; flex: 1; }
|
||||
.nav a {
|
||||
padding: 12px 14px; border-radius: 12px; color: var(--muted);
|
||||
min-height: 44px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
.nav a.active, .nav a:hover {
|
||||
background: rgba(94, 196, 120, 0.12);
|
||||
@ -65,10 +90,14 @@ a { color: inherit; text-decoration: none; }
|
||||
color: var(--muted);
|
||||
border-radius: 12px;
|
||||
padding: 10px 12px;
|
||||
min-height: 44px;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.main { padding: 32px 36px 60px; }
|
||||
.main {
|
||||
padding: 32px 36px 60px;
|
||||
min-width: 0;
|
||||
}
|
||||
.page-head {
|
||||
display: flex; justify-content: space-between; align-items: end; gap: 16px;
|
||||
margin-bottom: 24px;
|
||||
@ -137,8 +166,25 @@ a { color: inherit; text-decoration: none; }
|
||||
padding: 28px;
|
||||
display: flex; flex-direction: column; gap: 14px;
|
||||
}
|
||||
.login-card h1 { font-family: var(--font-display); margin: 0; }
|
||||
.login-brand {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 14px;
|
||||
margin-bottom: 4px;
|
||||
}
|
||||
.login-brand img {
|
||||
border-radius: 14px;
|
||||
box-shadow: 0 8px 24px rgba(63, 157, 104, 0.35);
|
||||
flex-shrink: 0;
|
||||
}
|
||||
.login-card h1 { font-family: var(--font-display); margin: 0; font-size: 22px; }
|
||||
.login-card p { margin: 0; color: var(--muted); font-size: 14px; }
|
||||
.login-install-hint {
|
||||
margin: 4px 0 0 !important;
|
||||
font-size: 12px !important;
|
||||
line-height: 1.5;
|
||||
opacity: 0.85;
|
||||
}
|
||||
label { display: flex; flex-direction: column; gap: 8px; font-size: 13px; color: var(--muted); }
|
||||
input, textarea, button {
|
||||
font: inherit;
|
||||
@ -421,7 +467,153 @@ th, td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--lin
|
||||
}
|
||||
|
||||
@media (max-width: 960px) {
|
||||
.shell { grid-template-columns: 1fr; }
|
||||
.side { border-right: none; border-bottom: 1px solid var(--line); }
|
||||
.shell {
|
||||
grid-template-columns: 1fr;
|
||||
grid-template-rows: auto 1fr;
|
||||
}
|
||||
|
||||
.topbar {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 12px;
|
||||
position: sticky;
|
||||
top: 0;
|
||||
z-index: 40;
|
||||
min-height: 56px;
|
||||
padding: 10px 14px;
|
||||
padding-top: max(10px, env(safe-area-inset-top, 0px));
|
||||
border-bottom: 1px solid var(--line);
|
||||
background: rgba(10, 18, 14, 0.92);
|
||||
backdrop-filter: blur(14px);
|
||||
}
|
||||
.topbar-menu {
|
||||
width: 44px;
|
||||
height: 44px;
|
||||
border-radius: 12px;
|
||||
border: 1px solid var(--line);
|
||||
background: rgba(255, 255, 255, 0.04);
|
||||
display: grid;
|
||||
place-content: center;
|
||||
gap: 5px;
|
||||
padding: 0;
|
||||
flex-shrink: 0;
|
||||
}
|
||||
.topbar-menu span {
|
||||
display: block;
|
||||
width: 18px;
|
||||
height: 2px;
|
||||
border-radius: 2px;
|
||||
background: var(--text);
|
||||
}
|
||||
.topbar-brand {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 10px;
|
||||
min-width: 0;
|
||||
flex: 1;
|
||||
}
|
||||
.topbar-brand img {
|
||||
border-radius: 8px;
|
||||
flex-shrink: 0;
|
||||
}
|
||||
.topbar-title {
|
||||
font-family: var(--font-display);
|
||||
font-size: 15px;
|
||||
line-height: 1.2;
|
||||
}
|
||||
.topbar-sub {
|
||||
color: var(--muted);
|
||||
font-size: 12px;
|
||||
white-space: nowrap;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
}
|
||||
.topbar-action {
|
||||
flex-shrink: 0;
|
||||
min-height: 40px;
|
||||
padding: 8px 12px;
|
||||
border-radius: 10px;
|
||||
border: 1px solid var(--line);
|
||||
background: rgba(255, 255, 255, 0.04);
|
||||
color: var(--text);
|
||||
font-weight: 600;
|
||||
font-size: 13px;
|
||||
}
|
||||
|
||||
.nav-scrim {
|
||||
display: block;
|
||||
position: fixed;
|
||||
inset: 0;
|
||||
z-index: 45;
|
||||
border: 0;
|
||||
background: rgba(0, 0, 0, 0.55);
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.side {
|
||||
position: fixed;
|
||||
top: 0;
|
||||
left: 0;
|
||||
bottom: 0;
|
||||
width: min(300px, 86vw);
|
||||
z-index: 50;
|
||||
border-right: 1px solid var(--line);
|
||||
border-bottom: none;
|
||||
transform: translateX(-105%);
|
||||
transition: transform 0.22s ease;
|
||||
padding-top: max(24px, env(safe-area-inset-top, 0px));
|
||||
padding-bottom: max(20px, env(safe-area-inset-bottom, 0px));
|
||||
overflow-y: auto;
|
||||
-webkit-overflow-scrolling: touch;
|
||||
background: rgba(10, 18, 14, 0.98);
|
||||
}
|
||||
.shell--nav-open .side {
|
||||
transform: translateX(0);
|
||||
}
|
||||
|
||||
.main {
|
||||
padding: 18px 14px max(28px, env(safe-area-inset-bottom, 0px));
|
||||
}
|
||||
.page-head {
|
||||
flex-direction: column;
|
||||
align-items: stretch;
|
||||
}
|
||||
.page-head h1 { font-size: 24px; }
|
||||
.primary-link {
|
||||
text-align: center;
|
||||
min-height: 44px;
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
}
|
||||
.stat-grid, .unlock-hero, .grid-2, .platform-grid { grid-template-columns: 1fr; }
|
||||
.stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
|
||||
.panel { padding: 16px; border-radius: 16px; }
|
||||
.table-wrap {
|
||||
margin: 0 -4px;
|
||||
-webkit-overflow-scrolling: touch;
|
||||
}
|
||||
table { font-size: 12px; min-width: 520px; }
|
||||
th, td { padding: 12px 8px; }
|
||||
input, textarea, button, .ghost-btn {
|
||||
min-height: 44px;
|
||||
font-size: 16px; /* iOS 避免自动放大 */
|
||||
}
|
||||
.login-card {
|
||||
width: min(420px, calc(100vw - 28px));
|
||||
padding: 22px 18px;
|
||||
}
|
||||
.platform-page { padding: 20px 14px max(24px, env(safe-area-inset-bottom, 0px)); }
|
||||
.platform-brand { margin-bottom: 20px; }
|
||||
.platform-brand h1 { font-size: 22px; }
|
||||
.platform-card { min-height: 160px; }
|
||||
.vip-row {
|
||||
flex-direction: column;
|
||||
align-items: stretch;
|
||||
}
|
||||
.vip-actions button { flex: 1 1 auto; }
|
||||
}
|
||||
|
||||
@media (max-width: 420px) {
|
||||
.stat-grid { grid-template-columns: 1fr; }
|
||||
}
|
||||
|
||||
@ -199,9 +199,11 @@ def write_vip_config(patch: dict[str, Any]) -> dict[str, Any]:
|
||||
modules["vip"] = vip
|
||||
|
||||
if "gameEnabled" in patch and isinstance(patch["gameEnabled"], bool):
|
||||
game = dict(modules.get("game") or {"title": "Nomad Day 3D", "note": "WebGL 数字游民一日"})
|
||||
game["enabled"] = patch["gameEnabled"]
|
||||
game.setdefault("title", "Nomad Day 3D")
|
||||
# 游戏入口已冻结:强制关闭,忽略开启请求
|
||||
game = dict(modules.get("game") or {"title": "数字游民", "note": "冻结隐藏 · 勿开入口"})
|
||||
game["enabled"] = False
|
||||
game["title"] = "数字游民"
|
||||
game["note"] = "冻结隐藏 · 勿开入口"
|
||||
modules["game"] = game
|
||||
|
||||
if "joinGroupAction" in patch:
|
||||
|
||||
@ -123,7 +123,7 @@ export const DEFAULT_REMOTE_CONFIG: NomadroRemoteConfig = {
|
||||
destinations: { enabled: true, title: '目的地' },
|
||||
meetups: { enabled: true, title: '活动' },
|
||||
vip: { enabled: false, title: '会员中心' },
|
||||
game: { enabled: false, title: 'Nomad Day 3D', note: '默认隐藏入口' },
|
||||
game: { enabled: false, title: '数字游民', note: '冻结隐藏 · 勿开入口' },
|
||||
},
|
||||
flags: {
|
||||
payEnabled: true,
|
||||
|
||||
@ -17,7 +17,7 @@ import { usePageShare, markPageShare } from '@/utils/pageShare'
|
||||
import { getSafeAreaMetrics } from '@/utils/safeArea'
|
||||
import { usePageTrack } from '@/hooks/usePageTrack'
|
||||
import './index.scss'
|
||||
type PortalId = 'nav' | 'book' | 'community' | 'vip' | 'game'
|
||||
type PortalId = 'nav' | 'book' | 'community' | 'vip'
|
||||
|
||||
type Portal = {
|
||||
id: PortalId
|
||||
@ -31,7 +31,6 @@ const PORTALS: Portal[] = [
|
||||
{ id: 'nav', moduleKey: 'nav', emoji: '🧭', name: '出海导航', main: false },
|
||||
{ id: 'book', moduleKey: 'book', emoji: '📖', name: '数字游民', main: false },
|
||||
{ id: 'community', moduleKey: 'community', emoji: '🌏', name: '旅居社群', main: true },
|
||||
{ id: 'game', moduleKey: 'game', emoji: '🕹️', name: 'Nomad 3D', main: false },
|
||||
]
|
||||
|
||||
const INTERNAL_PORTALS: Record<PortalId, string> = {
|
||||
@ -39,7 +38,6 @@ const INTERNAL_PORTALS: Record<PortalId, string> = {
|
||||
book: '/pages/book/index',
|
||||
community: '/pages/community/index',
|
||||
vip: '/pages/vip/index',
|
||||
game: '/pages/game/index',
|
||||
}
|
||||
|
||||
const isH5 = process.env.TARO_ENV === 'h5'
|
||||
@ -409,9 +407,7 @@ function IndexPage() {
|
||||
{portals.map((portal) => (
|
||||
<Box
|
||||
key={portal.id}
|
||||
className={`hub-portal-card${portal.main ? ' hub-portal-card--main' : ''}${
|
||||
portal.id === 'game' ? ' hub-portal-card--game' : ''
|
||||
}`}
|
||||
className={`hub-portal-card${portal.main ? ' hub-portal-card--main' : ''}`}
|
||||
onClick={() => goPath(INTERNAL_PORTALS[portal.id])}
|
||||
>
|
||||
<Box className="hub-portal-ico" aria-hidden>
|
||||
|
||||
@ -36,8 +36,8 @@
|
||||
},
|
||||
"game": {
|
||||
"enabled": false,
|
||||
"title": "Nomad Day 3D",
|
||||
"note": "default hidden"
|
||||
"title": "数字游民",
|
||||
"note": "冻结隐藏 · 勿开入口"
|
||||
}
|
||||
},
|
||||
"flags": {
|
||||
|
||||
BIN
public/apple-touch-icon.png
Normal file
|
After Width: | Height: | Size: 3.5 KiB |
BIN
public/favicon-16x16.png
Normal file
|
After Width: | Height: | Size: 431 B |
BIN
public/favicon-32x32.png
Normal file
|
After Width: | Height: | Size: 759 B |
BIN
public/favicon.ico
Normal file
|
After Width: | Height: | Size: 453 B |
18
public/favicon.svg
Normal file
@ -0,0 +1,18 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 64 64" role="img" aria-label="nomadro">
|
||||
<defs>
|
||||
<linearGradient id="g" x1="8" y1="6" x2="56" y2="58" gradientUnits="userSpaceOnUse">
|
||||
<stop offset="0%" stop-color="#FF6B6B"/>
|
||||
<stop offset="50%" stop-color="#FFE66D"/>
|
||||
<stop offset="100%" stop-color="#4ECDC4"/>
|
||||
</linearGradient>
|
||||
<radialGradient id="glow" cx="50%" cy="55%" r="45%">
|
||||
<stop offset="0%" stop-color="#4ECDC4" stop-opacity="0.28"/>
|
||||
<stop offset="100%" stop-color="#4ECDC4" stop-opacity="0"/>
|
||||
</radialGradient>
|
||||
</defs>
|
||||
<rect width="64" height="64" rx="14" fill="#0a0e17"/>
|
||||
<circle cx="32" cy="34" r="22" fill="url(#glow)"/>
|
||||
<circle cx="32" cy="32" r="20" fill="none" stroke="url(#g)" stroke-width="3.2"/>
|
||||
<path d="M18 34c5-9 23-9 28 0" fill="none" stroke="url(#g)" stroke-width="2.8" stroke-linecap="round"/>
|
||||
<circle cx="44" cy="20" r="4" fill="url(#g)"/>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 933 B |
BIN
public/icon-192.png
Normal file
|
After Width: | Height: | Size: 4.0 KiB |
BIN
public/icon-512.png
Normal file
|
After Width: | Height: | Size: 11 KiB |
38
public/manifest.webmanifest
Normal file
@ -0,0 +1,38 @@
|
||||
{
|
||||
"name": "nomadro",
|
||||
"short_name": "nomadro",
|
||||
"description": "随处工作,自由生活 · 出海导航 · 数字游民小册 · 旅居社群",
|
||||
"start_url": "/",
|
||||
"scope": "/",
|
||||
"display": "standalone",
|
||||
"orientation": "any",
|
||||
"background_color": "#0a0e17",
|
||||
"theme_color": "#0a0e17",
|
||||
"lang": "zh-CN",
|
||||
"icons": [
|
||||
{
|
||||
"src": "/favicon.svg",
|
||||
"sizes": "any",
|
||||
"type": "image/svg+xml",
|
||||
"purpose": "any"
|
||||
},
|
||||
{
|
||||
"src": "/icon-192.png",
|
||||
"sizes": "192x192",
|
||||
"type": "image/png",
|
||||
"purpose": "any"
|
||||
},
|
||||
{
|
||||
"src": "/icon-512.png",
|
||||
"sizes": "512x512",
|
||||
"type": "image/png",
|
||||
"purpose": "any"
|
||||
},
|
||||
{
|
||||
"src": "/apple-touch-icon.png",
|
||||
"sizes": "180x180",
|
||||
"type": "image/png",
|
||||
"purpose": "any"
|
||||
}
|
||||
]
|
||||
}
|
||||
|
Before Width: | Height: | Size: 25 KiB After Width: | Height: | Size: 453 B |
@ -27,6 +27,7 @@ export const metadata: Metadata = {
|
||||
metadataBase: new URL("https://nomadro.cn"),
|
||||
title: "nomadro",
|
||||
description: "数字游民入口 · 出海导航 · 数字游民小册 · 旅居社群",
|
||||
applicationName: "nomadro",
|
||||
keywords: [
|
||||
"数字游民",
|
||||
"远程工作",
|
||||
@ -41,7 +42,24 @@ export const metadata: Metadata = {
|
||||
type: "website",
|
||||
url: "https://nomadro.cn",
|
||||
},
|
||||
icons: [{ rel: "icon", url: "/favicon.ico" }],
|
||||
manifest: "/manifest.webmanifest",
|
||||
appleWebApp: {
|
||||
capable: true,
|
||||
title: "nomadro",
|
||||
statusBarStyle: "black-translucent",
|
||||
},
|
||||
icons: {
|
||||
icon: [
|
||||
{ url: "/favicon.ico", sizes: "any" },
|
||||
{ url: "/favicon.svg", type: "image/svg+xml" },
|
||||
{ url: "/favicon-32x32.png", sizes: "32x32", type: "image/png" },
|
||||
{ url: "/favicon-16x16.png", sizes: "16x16", type: "image/png" },
|
||||
],
|
||||
apple: [{ url: "/apple-touch-icon.png", sizes: "180x180", type: "image/png" }],
|
||||
},
|
||||
other: {
|
||||
"mobile-web-app-capable": "yes",
|
||||
},
|
||||
};
|
||||
|
||||
const outfit = Outfit({
|
||||
|
||||
36
src/app/manifest.ts
Normal file
@ -0,0 +1,36 @@
|
||||
import type { MetadataRoute } from "next";
|
||||
|
||||
export default function manifest(): MetadataRoute.Manifest {
|
||||
return {
|
||||
name: "nomadro",
|
||||
short_name: "nomadro",
|
||||
description: "随处工作,自由生活 · 出海导航 · 数字游民小册 · 旅居社群",
|
||||
start_url: "/",
|
||||
display: "standalone",
|
||||
background_color: "#0a0e17",
|
||||
theme_color: "#0a0e17",
|
||||
lang: "zh-CN",
|
||||
icons: [
|
||||
{
|
||||
src: "/favicon.svg",
|
||||
sizes: "any",
|
||||
type: "image/svg+xml",
|
||||
},
|
||||
{
|
||||
src: "/icon-192.png",
|
||||
sizes: "192x192",
|
||||
type: "image/png",
|
||||
},
|
||||
{
|
||||
src: "/icon-512.png",
|
||||
sizes: "512x512",
|
||||
type: "image/png",
|
||||
},
|
||||
{
|
||||
src: "/apple-touch-icon.png",
|
||||
sizes: "180x180",
|
||||
type: "image/png",
|
||||
},
|
||||
],
|
||||
};
|
||||
}
|
||||
@ -96,7 +96,7 @@ export type NomadroRemoteConfig = {
|
||||
meetups: ModuleToggle;
|
||||
destinations: ModuleToggle;
|
||||
home: ModuleToggle;
|
||||
/** 微信 H5/weapp 首页 Nomad Day 3D 入口;默认隐藏 */
|
||||
/** 微信 H5/weapp 游戏入口;冻结隐藏,勿开 */
|
||||
game?: ModuleToggle;
|
||||
};
|
||||
flags: {
|
||||
@ -303,7 +303,7 @@ export const DEFAULT_REMOTE_CONFIG: NomadroRemoteConfig = {
|
||||
destinations: { enabled: true, title: "目的地" },
|
||||
meetups: { enabled: true, title: "活动" },
|
||||
vip: { enabled: false, title: "会员中心", note: "deep link only" },
|
||||
game: { enabled: false, title: "Nomad Day 3D", note: "默认隐藏入口" },
|
||||
game: { enabled: false, title: "数字游民", note: "冻结隐藏 · 勿开入口" },
|
||||
},
|
||||
flags: {
|
||||
payEnabled: true,
|
||||
|
||||