feat(home): 新增设计中枢首页(工作区/素材/技能/审计分区 + 搜索 + 快捷键 + 最近访问),品牌区可回首页,默认入口切为 home.html

This commit is contained in:
sgp
2026-11-04 18:11:04 +08:00
parent bfd41bcaa2
commit a14670e65a
13 changed files with 977 additions and 26 deletions
+1 -1
View File
@@ -30,7 +30,7 @@ http.createServer((req, res) => {
return; return;
} }
let p = decodeURIComponent(req.url.split('?')[0]); let p = decodeURIComponent(req.url.split('?')[0]);
if (p === '/') p = '/_design-test/zhenfang-logo-picker.html'; if (p === '/') p = '/home.html';
let file = path.join(ROOT, p); let file = path.join(ROOT, p);
if (!fs.existsSync(file) && fs.existsSync(path.join(ROOT, '_design-test', p))) { if (!fs.existsSync(file) && fs.existsSync(path.join(ROOT, '_design-test', p))) {
file = path.join(ROOT, '_design-test', p); // 允许直接用 /xxx.html 访问 _design-test 下的产物 file = path.join(ROOT, '_design-test', p); // 允许直接用 /xxx.html 访问 _design-test 下的产物
+2 -2
View File
@@ -12,11 +12,11 @@
<!-- ===== 顶部工具栏 ===== --> <!-- ===== 顶部工具栏 ===== -->
<header class="topbar"> <header class="topbar">
<div class="topbar-left"> <div class="topbar-left">
<div class="brand"> <a class="brand" href="home.html" title="返回设计中枢">
<img class="brand-icon" src="logo/logo-mark.svg" alt="画个标" width="20" height="20"> <img class="brand-icon" src="logo/logo-mark.svg" alt="画个标" width="20" height="20">
<span class="brand-name">画个标</span> <span class="brand-name">画个标</span>
<span class="brand-tag">✨ 头像设计</span> <span class="brand-tag">✨ 头像设计</span>
</div> </a>
<input id="project-name" class="project-name" value="我的品牌" maxlength="30" title="项目名称"> <input id="project-name" class="project-name" value="我的品牌" maxlength="30" title="项目名称">
</div> </div>
<div class="topbar-right"> <div class="topbar-right">
+556
View File
@@ -0,0 +1,556 @@
/* 画个标 · 设计中枢(home.html 专属样式)
复用主站设计变量:浅色底 / 靛蓝主色 / 8-14px 圆角 / 轻阴影 */
:root {
--primary: #4f46e5;
--primary-dark: #4338ca;
--bg: #f3f4f6;
--panel: #ffffff;
--border: #e5e7eb;
--text: #1f2937;
--text-dim: #6b7280;
--text-faint: #9ca3af;
--hover: #eef2ff;
--radius: 12px;
--shadow: 0 1px 3px rgba(0, 0, 0, .06);
--shadow-hover: 0 10px 28px -12px rgba(31, 41, 55, .28);
--font: "PingFang SC", "Microsoft YaHei", "Segoe UI", sans-serif;
--mono: ui-monospace, "SFMono-Regular", "JetBrains Mono", Consolas, monospace;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
min-height: 100vh;
font-family: var(--font);
color: var(--text);
background: var(--bg);
background-image:
radial-gradient(900px 420px at 12% -12%, rgba(79, 70, 229, .09), transparent 62%),
radial-gradient(700px 360px at 92% 0%, rgba(14, 165, 233, .07), transparent 60%);
background-repeat: no-repeat;
-webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
h1, h2, h3, p, ul { margin: 0; }
ul { padding: 0; list-style: none; }
kbd {
display: inline-flex;
align-items: center;
justify-content: center;
min-width: 18px;
height: 18px;
padding: 0 4px;
font-family: var(--mono);
font-size: 11px;
color: var(--text-dim);
background: #f9fafb;
border: 1px solid var(--border);
border-bottom-width: 2px;
border-radius: 4px;
}
/* ============ 顶栏 ============ */
.hub-top {
position: sticky;
top: 0;
z-index: 20;
display: flex;
align-items: center;
gap: 20px;
height: 60px;
padding: 0 24px;
background: rgba(255, 255, 255, .82);
backdrop-filter: saturate(180%) blur(12px);
border-bottom: 1px solid var(--border);
}
.hub-brand {
display: flex;
align-items: center;
gap: 9px;
flex-shrink: 0;
}
.hub-brand-icon { display: block; border-radius: 6px; }
.hub-brand-name {
font-size: 16px;
font-weight: 700;
letter-spacing: .2px;
}
.hub-brand-tag {
padding: 2px 7px;
font-size: 11px;
color: var(--primary);
background: var(--hover);
border-radius: 999px;
white-space: nowrap;
}
/* 搜索框:首页的主入口,放宽、聚焦时给 ring */
.hub-search {
position: relative;
display: flex;
align-items: center;
flex: 1;
max-width: 460px;
height: 36px;
padding: 0 10px 0 12px;
background: #f9fafb;
border: 1px solid var(--border);
border-radius: 9px;
transition: background .15s, border-color .15s, box-shadow .15s;
}
.hub-search:focus-within {
background: #fff;
border-color: var(--primary);
box-shadow: 0 0 0 3px rgba(79, 70, 229, .12);
}
.hub-search-icon {
margin-right: 7px;
font-size: 16px;
line-height: 1;
color: var(--text-faint);
}
.hub-search input {
flex: 1;
min-width: 0;
height: 100%;
padding: 0;
font-family: inherit;
font-size: 13px;
color: var(--text);
background: transparent;
border: 0;
outline: none;
}
.hub-search input::placeholder { color: var(--text-faint); }
.hub-kbd { flex-shrink: 0; margin-left: 6px; }
.hub-top-actions {
display: flex;
align-items: center;
gap: 12px;
margin-left: auto;
flex-shrink: 0;
}
/* API 状态 */
.api-status {
display: inline-flex;
align-items: center;
gap: 6px;
padding: 4px 9px;
font-size: 11px;
color: var(--text-dim);
background: #f9fafb;
border: 1px solid var(--border);
border-radius: 999px;
white-space: nowrap;
}
.api-dot {
width: 6px;
height: 6px;
border-radius: 50%;
background: var(--text-faint);
}
.api-status.is-ok .api-dot { background: #10b981; box-shadow: 0 0 0 3px rgba(16, 185, 129, .14); }
.api-status.is-ok { color: #047857; border-color: #a7f3d0; background: #ecfdf5; }
.api-status.is-down .api-dot { background: #f59e0b; }
.hub-btn {
display: inline-flex;
align-items: center;
gap: 6px;
height: 34px;
padding: 0 14px;
font-size: 13px;
font-weight: 500;
color: var(--text);
background: #fff;
border: 1px solid var(--border);
border-radius: 8px;
transition: border-color .15s, background .15s, transform .15s;
}
.hub-btn:hover { border-color: #c7d2fe; background: var(--hover); }
.hub-btn.primary {
color: #fff;
background: linear-gradient(135deg, var(--primary), var(--primary-dark));
border-color: transparent;
box-shadow: 0 4px 14px -6px rgba(79, 70, 229, .7);
}
.hub-btn.primary:hover {
filter: brightness(1.06);
transform: translateY(-1px);
}
/* ============ 主体 ============ */
.hub-main {
width: 100%;
max-width: 1180px;
margin: 0 auto;
padding: 34px 24px 56px;
}
.hub-hero { margin-bottom: 30px; }
.hub-hero h1 {
font-size: 30px;
font-weight: 700;
letter-spacing: -.3px;
line-height: 1.25;
}
.hub-hero-sub {
max-width: 720px;
margin-top: 9px;
font-size: 13.5px;
line-height: 1.75;
color: var(--text-dim);
}
.hub-hero-sub b {
font-weight: 600;
color: var(--text);
font-variant-numeric: tabular-nums;
}
/* 最近访问 */
.hub-recent {
display: flex;
align-items: center;
flex-wrap: wrap;
gap: 8px;
margin-top: 16px;
}
.recent-label {
font-size: 11px;
color: var(--text-faint);
letter-spacing: .5px;
}
.recent-chip {
display: inline-flex;
align-items: center;
gap: 5px;
padding: 5px 11px;
font-size: 12px;
color: var(--text-dim);
background: #fff;
border: 1px solid var(--border);
border-radius: 999px;
transition: color .15s, border-color .15s, background .15s;
}
.recent-chip:hover {
color: var(--primary);
background: var(--hover);
border-color: #c7d2fe;
}
/* ============ 区块 ============ */
.hub-section { margin-bottom: 28px; }
.hub-section-head {
display: flex;
align-items: baseline;
gap: 10px;
margin-bottom: 12px;
}
.hub-section-head h2 {
font-size: 14px;
font-weight: 650;
letter-spacing: .2px;
}
.hub-section-head span {
font-size: 11.5px;
color: var(--text-faint);
}
/* ============ 工作台卡片 ============ */
.hub-workspaces {
display: grid;
grid-template-columns: repeat(4, minmax(0, 1fr));
gap: 14px;
}
.ws-card {
position: relative;
display: flex;
flex-direction: column;
min-height: 196px;
padding: 18px;
background: var(--panel);
border: 1px solid var(--border);
border-radius: 14px;
box-shadow: var(--shadow);
overflow: hidden;
transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
/* 顶部一条细的品类色带 */
.ws-card::before {
content: "";
position: absolute;
inset: 0 0 auto 0;
height: 3px;
background: var(--ws);
opacity: .85;
}
.ws-card:hover {
transform: translateY(-3px);
border-color: color-mix(in srgb, var(--ws) 36%, var(--border));
box-shadow: var(--shadow-hover);
}
.ws-card:focus-visible,
.hub-item:focus-visible,
.audit-chip:focus-visible,
.recent-chip:focus-visible,
.hub-btn:focus-visible {
outline: 2px solid var(--primary);
outline-offset: 2px;
}
.ws-top {
display: flex;
align-items: flex-start;
justify-content: space-between;
margin-bottom: 14px;
}
.ws-emoji {
display: inline-flex;
align-items: center;
justify-content: center;
width: 38px;
height: 38px;
font-size: 19px;
background: color-mix(in srgb, var(--ws) 11%, #fff);
border-radius: 10px;
transition: transform .18s ease;
}
.ws-card:hover .ws-emoji { transform: scale(1.06) rotate(-3deg); }
.ws-arrow {
font-size: 15px;
color: var(--text-faint);
transition: transform .18s ease, color .18s ease;
}
.ws-card:hover .ws-arrow {
color: var(--ws);
transform: translateX(3px);
}
.ws-card h3 {
font-size: 15.5px;
font-weight: 650;
letter-spacing: .1px;
}
.ws-card p {
margin-top: 6px;
font-size: 12.5px;
line-height: 1.65;
color: var(--text-dim);
}
.ws-tags {
display: flex;
flex-wrap: wrap;
gap: 5px;
margin-top: auto;
padding-top: 14px;
}
.ws-tags li {
padding: 2px 7px;
font-size: 10.5px;
color: var(--text-dim);
background: #f9fafb;
border: 1px solid var(--border);
border-radius: 999px;
white-space: nowrap;
}
/* ============ 两列区 ============ */
.hub-cols {
display: grid;
grid-template-columns: repeat(2, minmax(0, 1fr));
gap: 18px;
}
.hub-list {
background: var(--panel);
border: 1px solid var(--border);
border-radius: 14px;
box-shadow: var(--shadow);
overflow: hidden;
}
.hub-item {
display: flex;
align-items: center;
gap: 12px;
padding: 13px 15px;
border-bottom: 1px solid #f1f3f5;
transition: background .15s;
}
.hub-item:last-child { border-bottom: 0; }
.hub-item:hover { background: #fafbff; }
.hi-emoji {
display: inline-flex;
align-items: center;
justify-content: center;
width: 32px;
height: 32px;
font-size: 15px;
background: #f5f7ff;
border-radius: 9px;
flex-shrink: 0;
}
.hi-body {
display: flex;
flex-direction: column;
gap: 2px;
min-width: 0;
flex: 1;
}
.hi-title {
font-size: 13px;
font-weight: 600;
}
.hi-desc {
font-size: 11.5px;
line-height: 1.5;
color: var(--text-dim);
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
.hi-meta {
flex-shrink: 0;
font-size: 11.5px;
color: var(--text-faint);
font-variant-numeric: tabular-nums;
}
.hi-meta b {
font-weight: 600;
color: var(--text-dim);
}
/* ============ 审计条 ============ */
.hub-audits {
display: flex;
flex-wrap: wrap;
gap: 8px;
}
.audit-chip {
display: inline-flex;
align-items: center;
gap: 6px;
padding: 7px 12px;
font-size: 12px;
color: var(--text-dim);
background: #fff;
border: 1px solid var(--border);
border-radius: 8px;
transition: color .15s, border-color .15s, background .15s;
}
.audit-chip:hover {
color: var(--text);
background: var(--hover);
border-color: #c7d2fe;
}
/* ============ 空状态 / 页脚 ============ */
.hub-empty {
margin-top: 10px;
padding: 28px 16px;
text-align: center;
font-size: 13px;
color: var(--text-dim);
background: #fff;
border: 1px dashed var(--border);
border-radius: 12px;
}
.hub-foot {
display: flex;
justify-content: space-between;
gap: 16px;
flex-wrap: wrap;
max-width: 1180px;
margin: 0 auto;
padding: 18px 24px 30px;
font-size: 11.5px;
color: var(--text-faint);
border-top: 1px solid var(--border);
}
.hub-foot-dim { display: inline-flex; align-items: center; gap: 3px; }
.is-hidden { display: none !important; }
/* ============ 响应式 ============ */
@media (max-width: 1080px) {
.hub-workspaces { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.hub-brand-tag { display: none; }
}
@media (max-width: 860px) {
.hub-cols { grid-template-columns: 1fr; }
.hub-top { gap: 12px; padding: 0 16px; }
.hub-search { max-width: none; }
.hub-btn.primary { padding: 0 11px; font-size: 12px; }
.api-status { display: none; }
}
@media (max-width: 680px) {
.hub-main { padding: 24px 16px 40px; }
.hub-hero h1 { font-size: 24px; }
.hub-workspaces { grid-template-columns: 1fr; }
.ws-card { min-height: 0; }
.hub-kbd { display: none; }
.hub-foot { padding: 16px; }
}
@media (prefers-reduced-motion: reduce) {
* { transition: none !important; }
.ws-card:hover { transform: none; }
.hub-btn.primary:hover { transform: none; }
.ws-card:hover .ws-emoji { transform: none; }
.ws-card:hover .ws-arrow { transform: none; }
}
+15 -1
View File
@@ -31,7 +31,8 @@ server {
add_header Content-Security-Policy "default-src 'self'; script-src 'self' 'unsafe-inline' 'unsafe-eval'; style-src 'self' 'unsafe-inline' https://fonts.googleapis.com; font-src 'self' https://fonts.gstatic.com; connect-src 'self' https://api.deepseek.com; img-src 'self' data: blob:;" always; add_header Content-Security-Policy "default-src 'self'; script-src 'self' 'unsafe-inline' 'unsafe-eval'; style-src 'self' 'unsafe-inline' https://fonts.googleapis.com; font-src 'self' https://fonts.gstatic.com; connect-src 'self' https://api.deepseek.com; img-src 'self' data: blob:;" always;
root /opt/drawlogo; root /opt/drawlogo;
index index.html; # 默认入口:设计中枢首页(home.html),找不到时回落到 LOGO 工作台
index home.html index.html;
# 静态资源长期缓存(带 ?v= 版本号的 JS/CSS) # 静态资源长期缓存(带 ?v= 版本号的 JS/CSS)
location ~* \.(js|css|woff2|ttf|svg|png|jpg|jpeg|gif|ico)$ { location ~* \.(js|css|woff2|ttf|svg|png|jpg|jpeg|gif|ico)$ {
@@ -49,6 +50,19 @@ server {
try_files $uri $uri/ $uri/index.html =404; try_files $uri $uri/ $uri/index.html =404;
} }
# 素材 API 反代(必须 ^~:否则 /api/.../*.svg 会被上面的 \.svg$ 正则截走)
location ^~ /api/ {
proxy_pass http://127.0.0.1:7891;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_connect_timeout 10s;
proxy_read_timeout 30s;
proxy_send_timeout 15s;
client_max_body_size 1m;
}
access_log /var/log/nginx/drawlogo_zhuig_access.log; access_log /var/log/nginx/drawlogo_zhuig_access.log;
error_log /var/log/nginx/drawlogo_zhuig_error.log; error_log /var/log/nginx/drawlogo_zhuig_error.log;
} }
+2 -2
View File
@@ -35,11 +35,11 @@
<!-- ===== 顶部工具栏 ===== --> <!-- ===== 顶部工具栏 ===== -->
<header class="topbar"> <header class="topbar">
<div class="topbar-left"> <div class="topbar-left">
<div class="brand"> <a class="brand" href="home.html" title="返回设计中枢">
<img class="brand-icon" src="logo/logo-mark.svg" alt="画个标" width="20" height="20"> <img class="brand-icon" src="logo/logo-mark.svg" alt="画个标" width="20" height="20">
<span class="brand-name">画个标</span> <span class="brand-name">画个标</span>
<span class="brand-tag">😀 动态表情设计</span> <span class="brand-tag">😀 动态表情设计</span>
</div> </a>
<input id="project-name" class="project-name" value="我的表情" maxlength="30" title="项目名称"> <input id="project-name" class="project-name" value="我的表情" maxlength="30" title="项目名称">
</div> </div>
<div class="topbar-right"> <div class="topbar-right">
+381
View File
@@ -0,0 +1,381 @@
<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="icon" type="image/svg+xml" href="logo/favicon.svg">
<title>画个标 · 设计中枢</title>
<link rel="stylesheet" href="css/home.css?v=20261104a">
</head>
<body>
<header class="hub-top">
<a class="hub-brand" href="home.html" aria-label="画个标 设计中枢">
<img class="hub-brand-icon" src="logo/logo-mark.svg" alt="" width="24" height="24">
<span class="hub-brand-name">画个标</span>
<span class="hub-brand-tag">设计中枢</span>
</a>
<div class="hub-search" role="search">
<span class="hub-search-icon" aria-hidden="true">⌕</span>
<input id="hub-search" type="search" placeholder="搜索工作区、素材、技能…" autocomplete="off" aria-label="搜索">
<kbd class="hub-kbd">/</kbd>
</div>
<div class="hub-top-actions">
<span id="api-status" class="api-status is-idle" title="素材 API 状态">
<i class="api-dot"></i><span class="api-text">API</span>
</span>
<a class="hub-btn primary" href="index.html" data-nav>进入设计工作台 <span aria-hidden="true">→</span></a>
</div>
</header>
<main class="hub-main">
<section class="hub-hero">
<h1>今天想设计什么?</h1>
<p class="hub-hero-sub">四套工作台共享同一套素材与技能:<b data-stat="icons">37 万</b>图标、<b data-stat="posters">1,582</b> 个海报素材、<b data-stat="skills">130</b> 个设计技能。</p>
<div id="hub-recent" class="hub-recent" aria-live="polite"></div>
</section>
<section class="hub-section" data-group>
<div class="hub-section-head">
<h2>设计工作台</h2>
<span>从一个想法到可交付成品</span>
</div>
<div class="hub-workspaces">
<a class="ws-card" href="index.html" data-nav data-k="logo 标志 标识 品牌 brand 智能设计 方案 导出 svg png" style="--ws:#4f46e5">
<div class="ws-top">
<span class="ws-emoji" aria-hidden="true">🎯</span>
<span class="ws-arrow" aria-hidden="true">→</span>
</div>
<h3>LOGO 设计</h3>
<p>品牌标识全链路:布局、配色、字体、图标,多套方案对比评审。</p>
<ul class="ws-tags">
<li>4 类布局池</li>
<li>26 项评审</li>
<li>SVG / PNG</li>
</ul>
</a>
<a class="ws-card" href="avatar.html" data-nav data-k="头像 avatar 圆形 微信 qq 抖音 app 图标 dicebear 风格" style="--ws:#0ea5e9">
<div class="ws-top">
<span class="ws-emoji" aria-hidden="true">🖼</span>
<span class="ws-arrow" aria-hidden="true">→</span>
</div>
<h3>头像设计</h3>
<p>纯图形标识,圆形安全区预览,多平台规格一键导出。</p>
<ul class="ws-tags">
<li>55 种风格</li>
<li>6 平台规格</li>
<li>圆形裁切</li>
</ul>
</a>
<a class="ws-card" href="poster.html" data-nav data-k="海报 poster 画布 版式 排版 印刷 字体 配色" style="--ws:#f59e0b">
<div class="ws-top">
<span class="ws-emoji" aria-hidden="true">📰</span>
<span class="ws-arrow" aria-hidden="true">→</span>
</div>
<h3>海报设计</h3>
<p>多规格画布,AI 生成多套方案,字体、配色、装饰素材直取。</p>
<ul class="ws-tags">
<li>1,582 素材</li>
<li>64 技能</li>
<li>CMYK 提示</li>
</ul>
</a>
<a class="ws-card" href="emoji.html" data-nav data-k="表情 emoji 动图 gif webm 动画 贴纸 sticker" style="--ws:#ec4899">
<div class="ws-top">
<span class="ws-emoji" aria-hidden="true">😀</span>
<span class="ws-arrow" aria-hidden="true">→</span>
</div>
<h3>动态表情</h3>
<p>一张底图 × 全部动画类型,预览与导出逐帧一致。</p>
<ul class="ws-tags">
<li>11 种动画</li>
<li>12 技能</li>
<li>GIF / WebM</li>
</ul>
</a>
</div>
</section>
<div class="hub-cols">
<section class="hub-section" data-group>
<div class="hub-section-head">
<h2>素材与资源</h2>
<span>检索 · 预览 · 协议可查</span>
</div>
<div class="hub-list">
<a class="hub-item" href="materials.html" data-nav data-k="素材库 预览 logo 头像 海报 浏览">
<span class="hi-emoji" aria-hidden="true">🗃</span>
<span class="hi-body">
<span class="hi-title">素材库</span>
<span class="hi-desc">行式预览 LOGO / 头像 / 海报素材,快速浏览大致样式</span>
</span>
<span class="hi-meta">预览</span>
</a>
<a class="hub-item" href="sources.html" data-nav data-k="图标 素材中心 来源 协议 许可 icon 图标库">
<span class="hi-emoji" aria-hidden="true">📚</span>
<span class="hi-body">
<span class="hi-title">图标素材中心</span>
<span class="hi-desc">来源、协议、构建信息可查,支持按源定向浏览</span>
</span>
<span class="hi-meta"><b data-stat="sources">224</b> 源</span>
</a>
<a class="hub-item" href="poster-sources.html" data-nav data-k="海报 素材 字体 配色 背景 装饰 poster">
<span class="hi-emoji" aria-hidden="true">🎨</span>
<span class="hi-body">
<span class="hi-title">海报素材中心</span>
<span class="hi-desc">配色、字体、背景、装饰四类素材,含字体文件</span>
</span>
<span class="hi-meta"><b data-stat="poster-sources">25</b> 源</span>
</a>
</div>
</section>
<section class="hub-section" data-group>
<div class="hub-section-head">
<h2>技能与接口</h2>
<span>设计方法与程序化调用</span>
</div>
<div class="hub-list">
<a class="hub-item" href="skills.html" data-nav data-k="技能 共享 skill 评审 布局 配色 字体 导出">
<span class="hi-emoji" aria-hidden="true">🧩</span>
<span class="hi-body">
<span class="hi-title">共享技能中心</span>
<span class="hi-desc">7 类设计技能,可逐个自测运行,按流水线组织</span>
</span>
<span class="hi-meta"><b data-stat="shared-skills">54</b> 个</span>
</a>
<a class="hub-item" href="poster-skills.html" data-nav data-k="海报 技能 skill 版式 网格 层级 印刷 创意">
<span class="hi-emoji" aria-hidden="true">🎬</span>
<span class="hi-body">
<span class="hi-title">海报技能中心</span>
<span class="hi-desc">版式、网格、层级、印刷、创意、AI 八类</span>
</span>
<span class="hi-meta"><b data-stat="poster-skills">64</b> 个</span>
</a>
<a class="hub-item hub-item-api" href="https://drawlogo.zhuig.com/api/v1/health" target="_blank" rel="noopener" data-k="api 接口 素材 api key 调用 开放">
<span class="hi-emoji" aria-hidden="true">🔌</span>
<span class="hi-body">
<span class="hi-title">素材 API</span>
<span class="hi-desc">图标 / 海报检索与 SVG 直链,HTTPS + Key 鉴权</span>
</span>
<span class="hi-meta" id="api-meta">检测中</span>
</a>
</div>
</section>
</div>
<section class="hub-section" data-group>
<div class="hub-section-head">
<h2>质量与运维</h2>
<span>每批素材入库后的像素级体检</span>
</div>
<div class="hub-audits">
<a class="audit-chip" href="audit-pixels.html" data-nav data-k="审计 图标 像素 audit pixels 空白">
<span aria-hidden="true">🔍</span> 图标像素审计
</a>
<a class="audit-chip" href="audit-posters.html" data-nav data-k="审计 海报 像素 audit posters">
<span aria-hidden="true">🖼</span> 海报像素审计
</a>
<a class="audit-chip" href="audit-emojis.html" data-nav data-k="审计 表情 逐帧 emoji audit 帧">
<span aria-hidden="true">🎞</span> 表情逐帧审计
</a>
<a class="audit-chip" href="audit-render.html" data-nav data-k="审计 渲染 render 通用">
<span aria-hidden="true">🧪</span> 通用渲染审计
</a>
</div>
</section>
<p id="hub-empty" class="hub-empty" hidden>没有匹配的结果,试试「海报」「图标」「技能」或按 <kbd>Esc</kbd> 清空。</p>
</main>
<footer class="hub-foot">
<span>画个标 · AI 驱动设计系统</span>
<span class="hub-foot-dim">按 <kbd>1</kbd>–<kbd>4</kbd> 直达工作台 · 按 <kbd>/</kbd> 搜索</span>
</footer>
<script>
(function () {
'use strict';
var $ = function (s, r) { return (r || document).querySelector(s); };
var $$ = function (s, r) { return Array.prototype.slice.call((r || document).querySelectorAll(s)); };
/* ---------- 最近访问 ---------- */
var LS_RECENT = 'hgb_hub_recent';
function readRecent() {
try {
var list = JSON.parse(localStorage.getItem(LS_RECENT) || '[]');
return Array.isArray(list) ? list : [];
} catch (e) { return []; }
}
function pushRecent(href, title, emoji) {
if (!href || href.indexOf('http') === 0) return;
var list = readRecent().filter(function (x) { return x.href !== href; });
list.unshift({ href: href, title: title, emoji: emoji, ts: Date.now() });
try { localStorage.setItem(LS_RECENT, JSON.stringify(list.slice(0, 6))); } catch (e) { /* ignore */ }
}
function renderRecent() {
var box = $('#hub-recent');
if (!box) return;
var list = readRecent().slice(0, 4);
if (!list.length) { box.hidden = true; return; }
box.hidden = false;
box.innerHTML = '<span class="recent-label">最近</span>' + list.map(function (x) {
return '<a class="recent-chip" href="' + x.href + '">' +
'<span aria-hidden="true">' + (x.emoji || '↗') + '</span>' + x.title + '</a>';
}).join('');
}
// 记录点击(最近访问)
$$('a[data-nav]').forEach(function (a) {
a.addEventListener('click', function () {
var title = (a.querySelector('h3') || a.querySelector('.hi-title') || a).textContent.trim();
var emoji = (a.querySelector('.ws-emoji') || a.querySelector('.hi-emoji') || {}).textContent || '';
pushRecent(a.getAttribute('href'), title.replace(/\s+/g, ' ').slice(0, 14), emoji.trim());
});
});
renderRecent();
/* ---------- 搜索过滤 ---------- */
var input = $('#hub-search');
var empty = $('#hub-empty');
function visibleCards() {
return $$('[data-group] a, [data-group] .audit-chip');
}
function applyFilter() {
var q = (input.value || '').trim().toLowerCase();
var any = false;
visibleCards().forEach(function (el) {
var text = (el.textContent + ' ' + (el.getAttribute('data-k') || '')).toLowerCase();
var hit = !q || text.indexOf(q) !== -1;
el.classList.toggle('is-hidden', !hit);
if (hit) any = true;
});
// 整组无结果则隐藏该区块
$$('[data-group]').forEach(function (g) {
var items = $$('a', g);
var hit = items.some(function (el) { return !el.classList.contains('is-hidden'); });
g.classList.toggle('is-hidden', !hit);
});
$$('.hub-audits').forEach(function (g) {
var hit = $$('a', g).some(function (el) { return !el.classList.contains('is-hidden'); });
g.classList.toggle('is-hidden', !hit);
});
empty.hidden = any;
}
if (input) {
input.addEventListener('input', applyFilter);
input.addEventListener('keydown', function (e) {
if (e.key === 'Escape') { input.value = ''; applyFilter(); input.blur(); }
});
}
/* ---------- 键盘 ---------- */
var WORKSPACES = ['index.html', 'avatar.html', 'poster.html', 'emoji.html'];
document.addEventListener('keydown', function (e) {
var tag = (e.target.tagName || '').toLowerCase();
var typing = tag === 'input' || tag === 'textarea' || e.target.isContentEditable;
// / 或 Ctrl/Cmd+K → 聚焦搜索
if (!typing && (e.key === '/' || ((e.metaKey || e.ctrlKey) && e.key.toLowerCase() === 'k'))) {
e.preventDefault();
if (input) { input.focus(); input.select(); }
return;
}
// Esc 清空
if (typing && e.key === 'Escape' && e.target === input) {
input.value = ''; applyFilter(); input.blur();
return;
}
// 1-4 直达工作台
if (!typing && !e.metaKey && !e.ctrlKey && !e.altKey && /^[1-4]$/.test(e.key)) {
var href = WORKSPACES[Number(e.key) - 1];
if (href) window.location.href = href;
}
});
/* ---------- API 状态 ---------- */
var statusEl = $('#api-status');
var apiMeta = $('#api-meta');
function setApi(state, text) {
if (statusEl) {
statusEl.classList.remove('is-idle', 'is-ok', 'is-down');
statusEl.classList.add(state === 'ok' ? 'is-ok' : state === 'down' ? 'is-down' : 'is-idle');
var t = statusEl.querySelector('.api-text');
if (t) t.textContent = text;
}
if (apiMeta) apiMeta.textContent = state === 'ok' ? '在线' : state === 'down' ? '未连接' : '本地';
}
// 本地静态预览没有 /api/ 服务,直接跳过探测,避免控制台出现 ERR_ABORTED
var IS_LOCAL = /^(localhost|127\.0\.0\.1|\[::1\])$/.test(location.hostname);
if (IS_LOCAL) {
setApi('idle', '本地');
} else {
fetch('/api/v1/health', { method: 'GET' })
.then(function (r) { return r.ok ? r.json() : Promise.reject(); })
.then(function (d) { setApi(d && d.ok ? 'ok' : 'down', 'API 在线'); })
.catch(function () { setApi('down', 'API'); });
}
/* ---------- 真实数字(渐进增强,失败静默) ---------- */
function setStat(key, value) {
var el = document.querySelector('[data-stat="' + key + '"]');
if (el && value) el.textContent = value;
}
fetch('js/data/manifest/icons.json')
.then(function (r) { return r.ok ? r.json() : Promise.reject(); })
.then(function (m) {
if (!m) return;
setStat('icons', (m.total || 0).toLocaleString('zh-CN'));
setStat('sources', m.sources ? m.sources.length : 0);
})
.catch(function () { /* ignore */ });
fetch('js/data/manifest/posters.json')
.then(function (r) { return r.ok ? r.json() : Promise.reject(); })
.then(function (m) {
if (!m) return;
setStat('posters', (m.total || 0).toLocaleString('zh-CN'));
setStat('poster-sources', m.sources ? m.sources.length : 0);
})
.catch(function () { /* ignore */ });
fetch('js/data/manifest/skills.json')
.then(function (r) { return r.ok ? r.json() : Promise.reject(); })
.then(function (m) {
if (!m) return;
var shared = m.shared ? m.shared.total : 0;
var poster = m.poster ? m.poster.total : 0;
var sticker = m.sticker ? m.sticker.total : 0;
setStat('shared-skills', shared);
setStat('poster-skills', poster);
setStat('skills', shared + poster + sticker);
})
.catch(function () { /* ignore */ });
})();
</script>
</body>
</html>
+2 -2
View File
@@ -12,11 +12,11 @@
<!-- ===== 顶部工具栏 ===== --> <!-- ===== 顶部工具栏 ===== -->
<header class="topbar"> <header class="topbar">
<div class="topbar-left"> <div class="topbar-left">
<div class="brand"> <a class="brand" href="home.html" title="返回设计中枢">
<img class="brand-icon" src="logo/logo-mark.svg" alt="画个标" width="20" height="20"> <img class="brand-icon" src="logo/logo-mark.svg" alt="画个标" width="20" height="20">
<span class="brand-name">画个标</span> <span class="brand-name">画个标</span>
<span class="brand-tag">✨ 智能设计</span> <span class="brand-tag">✨ 智能设计</span>
</div> </a>
<input id="project-name" class="project-name" value="我的品牌" maxlength="30" title="项目名称"> <input id="project-name" class="project-name" value="我的品牌" maxlength="30" title="项目名称">
</div> </div>
<div class="topbar-right"> <div class="topbar-right">
+3 -3
View File
@@ -14,7 +14,7 @@
/* ===== 顶栏 ===== */ /* ===== 顶栏 ===== */
.topbar { display: flex; align-items: center; justify-content: space-between; padding: 0 20px; height: 54px; background: linear-gradient(90deg, #1e1b4b, #312e81); color: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.15); position: sticky; top: 0; z-index: 20; } .topbar { display: flex; align-items: center; justify-content: space-between; padding: 0 20px; height: 54px; background: linear-gradient(90deg, #1e1b4b, #312e81); color: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.15); position: sticky; top: 0; z-index: 20; }
.topbar .brand { display: flex; align-items: center; gap: 10px; } .topbar .brand { display: flex; align-items: center; gap: 10px; color: inherit; text-decoration: none; }
.topbar .brand .icon { font-size: 20px; } .topbar .brand .icon { font-size: 20px; }
.topbar .brand .name { font-size: 17px; font-weight: 700; letter-spacing: 1px; } .topbar .brand .name { font-size: 17px; font-weight: 700; letter-spacing: 1px; }
.topbar .brand .tag { font-size: 11px; color: #c7d2fe; background: rgba(255,255,255,.12); padding: 2px 8px; border-radius: 20px; } .topbar .brand .tag { font-size: 11px; color: #c7d2fe; background: rgba(255,255,255,.12); padding: 2px 8px; border-radius: 20px; }
@@ -84,11 +84,11 @@
<body> <body>
<!-- ===== 顶部工具栏 ===== --> <!-- ===== 顶部工具栏 ===== -->
<header class="topbar"> <header class="topbar">
<div class="brand"> <a class="brand" href="home.html" title="返回设计中枢">
<img class="icon" src="logo/logo-mark.svg" alt="画个标" width="20" height="20"> <img class="icon" src="logo/logo-mark.svg" alt="画个标" width="20" height="20">
<span class="name">画个标</span> <span class="name">画个标</span>
<span class="tag">素材库</span> <span class="tag">素材库</span>
</div> </a>
<nav class="nav"> <nav class="nav">
<a href="index.html" title="LOGO 设计工作台">🎨 LOGO</a> <a href="index.html" title="LOGO 设计工作台">🎨 LOGO</a>
<a href="avatar.html" title="头像设计工作台">🖼 头像</a> <a href="avatar.html" title="头像设计工作台">🖼 头像</a>
+3 -3
View File
@@ -11,7 +11,7 @@
a { color: #4f46e5; text-decoration: none; } a { color: #4f46e5; text-decoration: none; }
a:hover { text-decoration: underline; } a:hover { text-decoration: underline; }
.topbar { display: flex; align-items: center; justify-content: space-between; padding: 0 20px; height: 54px; background: linear-gradient(90deg, #1e1b4b, #312e81); color: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.15); position: sticky; top: 0; z-index: 20; } .topbar { display: flex; align-items: center; justify-content: space-between; padding: 0 20px; height: 54px; background: linear-gradient(90deg, #1e1b4b, #312e81); color: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.15); position: sticky; top: 0; z-index: 20; }
.topbar .brand { display: flex; align-items: center; gap: 10px; } .topbar .brand { display: flex; align-items: center; gap: 10px; color: inherit; text-decoration: none; }
.topbar .brand .icon { font-size: 20px; } .topbar .brand .icon { font-size: 20px; }
.topbar .brand .name { font-size: 17px; font-weight: 700; letter-spacing: 1px; } .topbar .brand .name { font-size: 17px; font-weight: 700; letter-spacing: 1px; }
.topbar .brand .tag { font-size: 11px; color: #c7d2fe; background: rgba(255,255,255,.12); padding: 2px 8px; border-radius: 20px; } .topbar .brand .tag { font-size: 11px; color: #c7d2fe; background: rgba(255,255,255,.12); padding: 2px 8px; border-radius: 20px; }
@@ -30,11 +30,11 @@
<body> <body>
<!-- ===== 顶部工具栏 ===== --> <!-- ===== 顶部工具栏 ===== -->
<header class="topbar"> <header class="topbar">
<div class="brand"> <a class="brand" href="home.html" title="返回设计中枢">
<img class="icon" src="logo/logo-mark.svg" alt="画个标" width="20" height="20"> <img class="icon" src="logo/logo-mark.svg" alt="画个标" width="20" height="20">
<span class="name">画个标</span> <span class="name">画个标</span>
<span class="tag">海报技能中心</span> <span class="tag">海报技能中心</span>
</div> </a>
<nav class="nav"> <nav class="nav">
<a href="index.html" title="LOGO 设计工作台">🎨 LOGO</a> <a href="index.html" title="LOGO 设计工作台">🎨 LOGO</a>
<a href="avatar.html" title="头像设计工作台">🖼 头像</a> <a href="avatar.html" title="头像设计工作台">🖼 头像</a>
+3 -3
View File
@@ -11,7 +11,7 @@
a { color: #4f46e5; text-decoration: none; } a { color: #4f46e5; text-decoration: none; }
a:hover { text-decoration: underline; } a:hover { text-decoration: underline; }
.topbar { display: flex; align-items: center; justify-content: space-between; padding: 0 20px; height: 54px; background: linear-gradient(90deg, #1e1b4b, #312e81); color: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.15); position: sticky; top: 0; z-index: 20; } .topbar { display: flex; align-items: center; justify-content: space-between; padding: 0 20px; height: 54px; background: linear-gradient(90deg, #1e1b4b, #312e81); color: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.15); position: sticky; top: 0; z-index: 20; }
.topbar .brand { display: flex; align-items: center; gap: 10px; } .topbar .brand { display: flex; align-items: center; gap: 10px; color: inherit; text-decoration: none; }
.topbar .brand .icon { font-size: 20px; } .topbar .brand .icon { font-size: 20px; }
.topbar .brand .name { font-size: 17px; font-weight: 700; letter-spacing: 1px; } .topbar .brand .name { font-size: 17px; font-weight: 700; letter-spacing: 1px; }
.topbar .brand .tag { font-size: 11px; color: #c7d2fe; background: rgba(255,255,255,.12); padding: 2px 8px; border-radius: 20px; } .topbar .brand .tag { font-size: 11px; color: #c7d2fe; background: rgba(255,255,255,.12); padding: 2px 8px; border-radius: 20px; }
@@ -44,11 +44,11 @@
<body> <body>
<!-- ===== 顶部工具栏 ===== --> <!-- ===== 顶部工具栏 ===== -->
<header class="topbar"> <header class="topbar">
<div class="brand"> <a class="brand" href="home.html" title="返回设计中枢">
<img class="icon" src="logo/logo-mark.svg" alt="画个标" width="20" height="20"> <img class="icon" src="logo/logo-mark.svg" alt="画个标" width="20" height="20">
<span class="name">画个标</span> <span class="name">画个标</span>
<span class="tag">海报素材中心</span> <span class="tag">海报素材中心</span>
</div> </a>
<nav class="nav"> <nav class="nav">
<a href="index.html" title="LOGO 设计工作台">🎨 LOGO</a> <a href="index.html" title="LOGO 设计工作台">🎨 LOGO</a>
<a href="avatar.html" title="头像设计工作台">🖼 头像</a> <a href="avatar.html" title="头像设计工作台">🖼 头像</a>
+3 -3
View File
@@ -11,7 +11,7 @@
a { color: #4f46e5; text-decoration: none; } a { color: #4f46e5; text-decoration: none; }
a:hover { text-decoration: underline; } a:hover { text-decoration: underline; }
.topbar { display: flex; align-items: center; justify-content: space-between; padding: 0 20px; height: 54px; background: linear-gradient(90deg, #1e1b4b, #312e81); color: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.15); position: sticky; top: 0; z-index: 20; } .topbar { display: flex; align-items: center; justify-content: space-between; padding: 0 20px; height: 54px; background: linear-gradient(90deg, #1e1b4b, #312e81); color: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.15); position: sticky; top: 0; z-index: 20; }
.topbar .brand { display: flex; align-items: center; gap: 10px; } .topbar .brand { display: flex; align-items: center; gap: 10px; color: inherit; text-decoration: none; }
.topbar .brand .icon { font-size: 20px; } .topbar .brand .icon { font-size: 20px; }
.topbar .brand .name { font-size: 17px; font-weight: 700; letter-spacing: 1px; } .topbar .brand .name { font-size: 17px; font-weight: 700; letter-spacing: 1px; }
.topbar .brand .tag { font-size: 11px; color: #c7d2fe; background: rgba(255,255,255,.12); padding: 2px 8px; border-radius: 20px; } .topbar .brand .tag { font-size: 11px; color: #c7d2fe; background: rgba(255,255,255,.12); padding: 2px 8px; border-radius: 20px; }
@@ -46,11 +46,11 @@
<body> <body>
<!-- ===== 顶部工具栏 ===== --> <!-- ===== 顶部工具栏 ===== -->
<header class="topbar"> <header class="topbar">
<div class="brand"> <a class="brand" href="home.html" title="返回设计中枢">
<img class="icon" src="logo/logo-mark.svg" alt="画个标" width="20" height="20"> <img class="icon" src="logo/logo-mark.svg" alt="画个标" width="20" height="20">
<span class="name">画个标</span> <span class="name">画个标</span>
<span class="tag">✨ 海报设计</span> <span class="tag">✨ 海报设计</span>
</div> </a>
<nav class="nav"> <nav class="nav">
<a href="index.html" title="LOGO 设计工作台">🎨 LOGO</a> <a href="index.html" title="LOGO 设计工作台">🎨 LOGO</a>
<a href="avatar.html" title="头像设计工作台">🖼 头像</a> <a href="avatar.html" title="头像设计工作台">🖼 头像</a>
+3 -3
View File
@@ -23,7 +23,7 @@
color: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.15); color: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.15);
position: sticky; top: 0; z-index: 20; position: sticky; top: 0; z-index: 20;
} }
.topbar .brand { display: flex; align-items: center; gap: 10px; } .topbar .brand { display: flex; align-items: center; gap: 10px; color: inherit; text-decoration: none; }
.topbar .brand .icon { font-size: 20px; } .topbar .brand .icon { font-size: 20px; }
.topbar .brand .name { font-size: 17px; font-weight: 700; letter-spacing: 1px; } .topbar .brand .name { font-size: 17px; font-weight: 700; letter-spacing: 1px; }
.topbar .brand .tag { .topbar .brand .tag {
@@ -137,11 +137,11 @@
</head> </head>
<body> <body>
<div class="topbar"> <div class="topbar">
<div class="brand"> <a class="brand" href="home.html" title="返回设计中枢">
<img class="icon" src="logo/logo-mark.svg" alt="画个标" width="20" height="20"> <img class="icon" src="logo/logo-mark.svg" alt="画个标" width="20" height="20">
<span class="name">画个标</span> <span class="name">画个标</span>
<span class="tag">技能中心</span> <span class="tag">技能中心</span>
</div> </a>
<button class="btn-back" onclick="location.href='index.html'">← 返回设计工作台</button> <button class="btn-back" onclick="location.href='index.html'">← 返回设计工作台</button>
</div> </div>
+3 -3
View File
@@ -23,7 +23,7 @@
color: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.15); color: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.15);
position: sticky; top: 0; z-index: 20; position: sticky; top: 0; z-index: 20;
} }
.topbar .brand { display: flex; align-items: center; gap: 10px; } .topbar .brand { display: flex; align-items: center; gap: 10px; color: inherit; text-decoration: none; }
.topbar .brand .icon { font-size: 20px; } .topbar .brand .icon { font-size: 20px; }
.topbar .brand .name { font-size: 17px; font-weight: 700; letter-spacing: 1px; } .topbar .brand .name { font-size: 17px; font-weight: 700; letter-spacing: 1px; }
.topbar .brand .tag { .topbar .brand .tag {
@@ -122,11 +122,11 @@
</head> </head>
<body> <body>
<div class="topbar"> <div class="topbar">
<div class="brand"> <a class="brand" href="home.html" title="返回设计中枢">
<img class="icon" src="logo/logo-mark.svg" alt="画个标" width="20" height="20"> <img class="icon" src="logo/logo-mark.svg" alt="画个标" width="20" height="20">
<span class="name">画个标</span> <span class="name">画个标</span>
<span class="tag">素材中心</span> <span class="tag">素材中心</span>
</div> </a>
<button class="btn-back" onclick="location.href='materials.html'">🗃 素材库</button> <button class="btn-back" onclick="location.href='materials.html'">🗃 素材库</button>
<button class="btn-back" onclick="location.href='index.html'">← 返回设计工作台</button> <button class="btn-back" onclick="location.href='index.html'">← 返回设计工作台</button>
</div> </div>