diff --git a/audit-emojis.html b/audit-emojis.html index 7595991..ffbac1c 100644 --- a/audit-emojis.html +++ b/audit-emojis.html @@ -32,9 +32,9 @@ h1{font-size:16px}h2{font-size:14px;margin:14px 0 6px} - + - + - - + + @@ -335,7 +335,7 @@ - + diff --git a/emoji.html b/emoji.html index 47bbef7..5fe5903 100644 --- a/emoji.html +++ b/emoji.html @@ -215,9 +215,9 @@ - + - + diff --git a/index.html b/index.html index f5965f8..11967af 100644 --- a/index.html +++ b/index.html @@ -327,8 +327,8 @@ - - + + @@ -337,7 +337,7 @@ - + diff --git a/js/core/poster-ai.js b/js/core/poster-ai.js index 514ba82..b73483c 100644 --- a/js/core/poster-ai.js +++ b/js/core/poster-ai.js @@ -10,16 +10,20 @@ const HGB_PosterAI = (function () { function buildPrompt(opt) { const layoutList = HGB_PosterGenerator.LAYOUTS.map(l => `${l.id}:${l.name}`).join('\n'); const paletteList = HGB_PosterGenerator.PALETTES.map(p => `${p.id}:${p.name}(背景 ${p.bg})`).join('\n'); - const sys = `你是顶级的海报设计师。请基于用户提供的主题信息,从白名单中选择版式与配色,设计多套专业海报方案。 + const scaleList = HGB_PosterGenerator.TYPE_SCALES + .map(s => `${s.id}:${s.name}(标题 ${s.titleWeight} / 副标题 ${s.subWeight},标题占画布宽 ${Math.round(s.titleRatio * 1000) / 10}%)— ${s.note}`) + .join('\n'); + const sys = `你是顶级的海报设计师。请基于用户提供的主题信息,从白名单中选择版式、配色与字体层级,设计多套专业海报方案。 设计原则: 1. 标题(title)精炼有力、突出主题;副标题(subtitle)补充说明(可空)。 -2. 版式 layoutId 与配色 paletteId 必须从白名单中选择,不得编造。 -3. 多套方案尽量使用不同的版式与配色,呈现不同设计方向。 -4. 每套方案给出贴切的中文方案名(name)与设计理念(concept)。 +2. 版式 layoutId、配色 paletteId、字体层级 typeScaleId 必须从白名单中选择,不得编造。 +3. 字体层级按信息调性选择:促销/活动用强冲击,文化/品牌叙事用编辑感,政务/金融用稳健均衡,高端/极简用克制留白。 +4. 多套方案尽量使用不同的版式、配色与字体层级,呈现不同设计方向。 +5. 每套方案给出贴切的中文方案名(name)与设计理念(concept)。 只输出 JSON,不要输出任何其他文字。JSON 结构: -{ "overallConcept": "整体理念", "plans": [ { "name": "方案名", "title": "主标题", "subtitle": "副标题(可空)", "paletteId": "indigo", "layoutId": "centered", "concept": "设计理念" } ] } +{ "overallConcept": "整体理念", "plans": [ { "name": "方案名", "title": "主标题", "subtitle": "副标题(可空)", "paletteId": "indigo", "layoutId": "centered", "typeScaleId": "impact", "concept": "设计理念" } ] } 其中 plans 数组包含 ${opt.count || 5} 套方案。`; const user = `【主题信息】 - 行业/主题:${opt.industry || '通用'} @@ -33,6 +37,9 @@ ${layoutList} 【配色白名单】 ${paletteList} +【字体层级白名单】 +${scaleList} + 请设计 ${opt.count || 5} 套海报方案。`; return [ { role: 'system', content: sys }, @@ -54,6 +61,7 @@ ${paletteList} for (const p of data.plans) { if (!HGB_PosterGenerator.PALETTES.some(x => x.id === p.paletteId)) p._paletteInvalid = true; if (!HGB_PosterGenerator.LAYOUTS.some(x => x.id === p.layoutId)) p._layoutInvalid = true; + if (!HGB_PosterGenerator.TYPE_SCALES.some(x => x.id === p.typeScaleId)) p._scaleInvalid = true; } return data; } @@ -63,6 +71,7 @@ ${paletteList} const decision = HGB_PosterGenerator.defaultDecision(p.title, p.subtitle); if (!p._paletteInvalid) decision.paletteId = p.paletteId; if (!p._layoutInvalid) decision.layoutId = p.layoutId; + if (!p._scaleInvalid) decision.typeScaleId = p.typeScaleId; const elements = HGB_PosterGenerator.generate(spec, decision); return { id: 'poster_' + Date.now().toString(36) + idx.toString(36), diff --git a/js/core/poster-generator.js b/js/core/poster-generator.js index a4e5922..94c5112 100644 --- a/js/core/poster-generator.js +++ b/js/core/poster-generator.js @@ -13,6 +13,24 @@ const HGB_PosterGenerator = (function () { { id: 'minimal', name: '极简', bg: '#ffffff', primary: '#111827', accent: '#4f46e5' } ]; + /** + * 字体层级预设(白名单):AI 只能从中选择,保证标题/副标题的字号比与字重组合可控。 + * 字重限制在 400 / 700 / 800 —— 渲染器只内嵌 Noto Sans SC Regular(400) 与 Bold(700-900), + * 超出范围的权重会被浏览器合成,视觉不可控。 + */ + const TYPE_SCALES = [ + { id: 'impact', name: '强冲击', titleWeight: 800, subWeight: 400, titleRatio: 0.075, subRatio: 0.38, note: '促销/活动主视觉,超大粗标题压场' }, + { id: 'editorial', name: '编辑感', titleWeight: 700, subWeight: 400, titleRatio: 0.062, subRatio: 0.44, note: '文化/品牌叙事,标题收敛、副标题更可读' }, + { id: 'steady', name: '稳健均衡', titleWeight: 700, subWeight: 700, titleRatio: 0.068, subRatio: 0.40, note: '政务/金融等信息型海报,标题副标题同粗同稳' }, + { id: 'quiet', name: '克制留白', titleWeight: 400, subWeight: 400, titleRatio: 0.052, subRatio: 0.46, note: '高端/极简,细标题+大留白,靠空间而非字重建立层级' } + ]; + + const DEFAULT_SCALE = 'impact'; + + function scaleOf(id) { + return TYPE_SCALES.find(s => s.id === id) || TYPE_SCALES[0]; + } + function uid(p) { return p + '_' + Date.now().toString(36) + Math.random().toString(36).slice(2, 6); } function rect(id, x, y, w, h, fill) { return { id, type: 'rect', x, y, w, h, fill }; } @@ -28,9 +46,9 @@ const HGB_PosterGenerator = (function () { const cw = spec.w, ch = spec.h, els = []; els.push(rect(uid('bg'), 0, 0, cw, ch, o.palette.bg)); els.push(circle(uid('dot'), cw / 2, ch * 0.30, ch * 0.12, o.palette.accent)); - const fs = Math.round(cw * 0.075); - els.push(text(uid('title'), o.title, cw / 2, ch * 0.50, fs, 800, o.palette.primary, 'middle')); - if (o.sub) els.push(text(uid('sub'), o.sub, cw / 2, ch * 0.56, Math.round(fs * 0.38), 400, o.palette.primary, 'middle')); + const fs = Math.round(cw * o.scale.titleRatio); + els.push(text(uid('title'), o.title, cw / 2, ch * 0.50, fs, o.scale.titleWeight, o.palette.primary, 'middle')); + if (o.sub) els.push(text(uid('sub'), o.sub, cw / 2, ch * 0.56, Math.round(fs * o.scale.subRatio), o.scale.subWeight, o.palette.primary, 'middle')); els.push(rect(uid('bar'), cw / 2 - cw * 0.12, ch * 0.62, cw * 0.24, 8, o.palette.accent)); return els; } @@ -42,9 +60,9 @@ const HGB_PosterGenerator = (function () { els.push(rect(uid('bg'), 0, 0, cw, ch, o.palette.bg)); els.push(rect(uid('side'), 0, 0, cw * 0.06, ch, o.palette.accent)); const mx = cw * 0.13; - const fs = Math.round(cw * 0.08); - els.push(text(uid('title'), o.title, mx, ch * 0.44, fs, 800, o.palette.primary, 'start')); - if (o.sub) els.push(text(uid('sub'), o.sub, mx, ch * 0.52, Math.round(fs * 0.36), 400, o.palette.primary, 'start')); + const fs = Math.round(cw * o.scale.titleRatio); + els.push(text(uid('title'), o.title, mx, ch * 0.44, fs, o.scale.titleWeight, o.palette.primary, 'start')); + if (o.sub) els.push(text(uid('sub'), o.sub, mx, ch * 0.52, Math.round(fs * o.scale.subRatio), o.scale.subWeight, o.palette.primary, 'start')); els.push(rect(uid('bar'), mx, ch * 0.58, cw * 0.18, 8, o.palette.accent)); return els; } @@ -55,9 +73,9 @@ const HGB_PosterGenerator = (function () { const cw = spec.w, ch = spec.h, els = []; els.push(rect(uid('bg'), 0, 0, cw, ch, o.palette.bg)); els.push(rect(uid('band'), 0, ch * 0.18, cw, ch * 0.16, o.palette.accent)); - const fs = Math.round(cw * 0.07); - els.push(text(uid('title'), o.title, cw / 2, ch * 0.26, fs, 800, o.palette.bg, 'middle')); - if (o.sub) els.push(text(uid('sub'), o.sub, cw / 2, ch * 0.55, Math.round(fs * 0.42), 400, o.palette.primary, 'middle')); + const fs = Math.round(cw * o.scale.titleRatio); + els.push(text(uid('title'), o.title, cw / 2, ch * 0.26, fs, o.scale.titleWeight, o.palette.bg, 'middle')); + if (o.sub) els.push(text(uid('sub'), o.sub, cw / 2, ch * 0.55, Math.round(fs * o.scale.subRatio), o.scale.subWeight, o.palette.primary, 'middle')); return els; } } @@ -67,13 +85,14 @@ const HGB_PosterGenerator = (function () { function generate(spec, decision) { const palette = PALETTES.find(p => p.id === decision.paletteId) || PALETTES[0]; const layout = LAYOUTS.find(l => l.id === decision.layoutId) || LAYOUTS[0]; - const o = { palette, title: decision.title || '海报标题', sub: decision.sub || '' }; + const scale = scaleOf(decision.typeScaleId); + const o = { palette, scale, title: decision.title || '海报标题', sub: decision.sub || '' }; return layout.build(spec, o); } function defaultDecision(title, sub) { - return { paletteId: 'indigo', layoutId: 'centered', title: title || '海报标题', sub: sub || '' }; + return { paletteId: 'indigo', layoutId: 'centered', typeScaleId: DEFAULT_SCALE, title: title || '海报标题', sub: sub || '' }; } - return { PALETTES, LAYOUTS, generate, defaultDecision }; + return { PALETTES, LAYOUTS, TYPE_SCALES, scaleOf, generate, defaultDecision }; })(); diff --git a/js/data/cn-tags.js b/js/data/cn-tags.js index 1a5e492..e216779 100644 --- a/js/data/cn-tags.js +++ b/js/data/cn-tags.js @@ -18,6 +18,12 @@ "code", "camera" ], + "自动化流程": [ + "automation", + "workflow", + "robot", + "refresh" + ], "人工智能": [ "ai", "robot", @@ -87,6 +93,60 @@ "OK手势": [ "ok-hand" ], + "数字货币": [ + "crypto", + "bitcoin", + "coin", + "wallet" + ], + "边缘计算": [ + "edge", + "chip", + "network", + "server" + ], + "智能硬件": [ + "device", + "chip", + "hardware", + "cpu" + ], + "数据看板": [ + "dashboard", + "chart", + "grid", + "activity" + ], + "数据治理": [ + "governance", + "database", + "shield", + "list" + ], + "公共服务": [ + "public", + "service", + "users", + "building" + ], + "汽车服务": [ + "car", + "wrench", + "garage", + "tire" + ], + "春节祝福": [ + "red-envelope", + "lantern", + "firecracker", + "fu" + ], + "协作共赢": [ + "win-win", + "handshake", + "users", + "heart" + ], "互联网": [ "internet", "web", @@ -100,7 +160,8 @@ "robot", "bot", "ai", - "android" + "android", + "cpu" ], "打印机": [ "printer", @@ -119,7 +180,8 @@ "db", "storage", "server", - "data" + "data", + "table" ], "螺丝刀": [ "screwdriver", @@ -336,6 +398,146 @@ "南瓜灯": [ "jack-o-lantern" ], + "便利店": [ + "store", + "shop", + "convenience" + ], + "优惠券": [ + "coupon", + "ticket", + "discount", + "sale" + ], + "购物袋": [ + "shopping-bag", + "bag", + "handbag" + ], + "微服务": [ + "microservice", + "server", + "container", + "service" + ], + "云服务": [ + "cloud", + "server", + "database" + ], + "自动化": [ + "automation", + "robot", + "settings", + "workflow" + ], + "验证码": [ + "captcha", + "shield", + "check", + "grid" + ], + "区块链": [ + "blockchain", + "blocks", + "chain", + "link" + ], + "数据集": [ + "dataset", + "database", + "table", + "folder" + ], + "集装箱": [ + "container", + "box", + "package", + "ship" + ], + "流水线": [ + "assembly", + "conveyor", + "factory", + "layers" + ], + "新能源": [ + "solar", + "wind", + "battery", + "leaf" + ], + "碳中和": [ + "carbon", + "leaf", + "eco", + "recycle" + ], + "博物馆": [ + "museum", + "building", + "landmark", + "history" + ], + "直播课": [ + "live", + "video", + "presentation", + "mic" + ], + "图书馆": [ + "library", + "books", + "book", + "building" + ], + "教师节": [ + "teacher", + "apple", + "book" + ], + "母亲节": [ + "mother", + "heart", + "flower" + ], + "父亲节": [ + "father", + "heart", + "tie" + ], + "儿童节": [ + "children", + "balloon", + "toy" + ], + "感恩节": [ + "thanksgiving", + "turkey", + "leaf" + ], + "情人节": [ + "valentine", + "heart", + "rose" + ], + "复活节": [ + "easter", + "egg", + "bunny" + ], + "全球化": [ + "global", + "globe", + "world", + "plane" + ], + "可持续": [ + "sustainable", + "leaf", + "recycle", + "globe" + ], "学校": [ "school", "graduation", @@ -382,7 +584,9 @@ "knife", "meal", "cook", - "utensil" + "utensil", + "table", + "fork-knife" ], "餐饮": [ "restaurant", @@ -392,7 +596,9 @@ "meal", "cook", "coffee", - "cup" + "cup", + "utensils", + "cooking" ], "咖啡": [ "coffee", @@ -400,9 +606,7 @@ "cafe", "mug", "tea", - "hot-beverage", - "teacup", - "beverage" + "espresso" ], "银行": [ "bank", @@ -412,7 +616,10 @@ "money", "payment", "currency", - "coin" + "coin", + "building", + "credit-card", + "vault" ], "支付": [ "payment", @@ -421,7 +628,9 @@ "wallet", "qr", "money", - "cash" + "cash", + "credit-card", + "qr-code" ], "金融": [ "finance", @@ -461,7 +670,10 @@ "package", "cargo", "bus", - "train" + "train", + "transport", + "ship", + "plane" ], "房产": [ "home", @@ -548,7 +760,10 @@ "bag", "shopping", "basket", - "market" + "market", + "retail", + "tag", + "price" ], "电商": [ "shop", @@ -556,7 +771,10 @@ "shopping", "store", "bag", - "package" + "package", + "ecommerce", + "shopping-cart", + "online-shopping" ], "娱乐": [ "music", @@ -575,7 +793,9 @@ "music", "film", "play", - "mic" + "mic", + "news", + "tv" ], "体育": [ "sport", @@ -630,7 +850,8 @@ "law", "badge", "flag", - "landmark" + "landmark", + "stamp" ], "宠物": [ "pet", @@ -654,7 +875,9 @@ "fashion", "dress", "tag", - "hanger" + "hanger", + "clothing", + "tshirt" ], "食品": [ "food", @@ -679,7 +902,8 @@ "key", "security", "safe", - "protect" + "protect", + "shield-check" ], "数据": [ "data", @@ -1085,7 +1309,8 @@ "document", "agreement", "sign", - "file" + "file", + "signature" ], "印章": [ "stamp", @@ -1207,7 +1432,9 @@ "seed", "grow", "agriculture", - "farm" + "farm", + "seedling", + "sprout" ], "风力": [ "wind", @@ -1226,7 +1453,10 @@ "eco", "environment", "green", - "sustainability" + "sustainability", + "refresh", + "trash", + "leaf" ], "动物": [ "animal", @@ -1297,7 +1527,8 @@ "document", "chart", "data", - "file" + "file", + "table" ], "演示": [ "presentation", @@ -1325,28 +1556,35 @@ "user", "briefcase", "hiring", - "person" + "person", + "user-plus", + "search" ], "简历": [ "resume", "document", "briefcase", "profile", - "cv" + "cv", + "file-text", + "user" ], "培训": [ "training", "education", "learn", "presentation", - "book" + "book", + "users", + "graduation-cap" ], "证书": [ "certificate", "award", "badge", "achievement", - "diploma" + "diploma", + "ribbon" ], "奖杯": [ "trophy", @@ -1389,7 +1627,8 @@ "cpu", "processor", "hardware", - "tech" + "tech", + "microchip" ], "电路": [ "circuit", @@ -1416,7 +1655,8 @@ "check", "verify", "flask", - "experiment" + "experiment", + "clipboard-check" ], "部署": [ "deploy", @@ -1430,7 +1670,8 @@ "save", "cloud", "archive", - "storage" + "storage", + "database" ], "恢复": [ "restore", @@ -1710,7 +1951,9 @@ "kanban", "columns", "layout", - "dashboard" + "dashboard", + "grid", + "gauge" ], "大屏": [ "dashboard", @@ -1819,12 +2062,14 @@ "权限": [ "lock", "shield", - "key" + "key", + "permission" ], "仓储": [ "warehouse", "box", - "package" + "package", + "archive" ], "药品": [ "pill", @@ -1850,7 +2095,9 @@ "home", "furniture", "sofa", - "bed" + "bed", + "lamp", + "interior" ], "维修": [ "repair", @@ -1876,7 +2123,8 @@ "密码": [ "password", "lock", - "key" + "key", + "eye-off" ], "标志": [ "logo", @@ -2083,7 +2331,9 @@ "cooked-rice" ], "火锅": [ - "pot-of-food" + "hot-pot", + "pot", + "cooking" ], "便当": [ "bento-box" @@ -2312,6 +2562,945 @@ "dumpling", "lantern" ], + "茶饮": [ + "tea", + "bubble-tea", + "teacup", + "cup" + ], + "烘焙": [ + "bakery", + "bread", + "croissant", + "cake", + "cupcake" + ], + "甜品": [ + "dessert", + "ice-cream", + "cake", + "donut" + ], + "外卖": [ + "delivery", + "takeout", + "scooter", + "package" + ], + "超市": [ + "supermarket", + "shopping-cart", + "basket", + "grocery" + ], + "生鲜": [ + "fresh", + "vegetable", + "fruit", + "fish", + "meat" + ], + "酒水": [ + "wine", + "beer", + "cocktail", + "bottle", + "glass" + ], + "酒吧": [ + "bar", + "cocktail", + "beer", + "wine" + ], + "增长": [ + "growth", + "trending-up", + "chart-up", + "increase" + ], + "转化": [ + "conversion", + "funnel", + "target", + "click" + ], + "留存": [ + "retention", + "repeat", + "loyalty", + "heart" + ], + "复购": [ + "repeat", + "refresh", + "cycle", + "loyalty" + ], + "裂变": [ + "share", + "network", + "users", + "growth" + ], + "漏斗": [ + "funnel", + "filter", + "conversion" + ], + "指标": [ + "metric", + "gauge", + "chart", + "statistics" + ], + "预算": [ + "budget", + "calculator", + "wallet", + "money" + ], + "成本": [ + "cost", + "coin", + "receipt", + "calculator" + ], + "利润": [ + "profit", + "money", + "chart-up", + "dollar" + ], + "审计": [ + "audit", + "clipboard", + "checklist", + "search" + ], + "风控": [ + "risk", + "shield", + "alert", + "warning" + ], + "合规": [ + "compliance", + "shield-check", + "badge-check", + "law" + ], + "法务": [ + "law", + "gavel", + "scale", + "justice" + ], + "版权": [ + "copyright", + "license", + "certificate", + "badge" + ], + "商标": [ + "trademark", + "badge", + "certificate", + "brand" + ], + "专利": [ + "patent", + "certificate", + "document", + "badge" + ], + "接口": [ + "api", + "plug", + "connection", + "code" + ], + "容器": [ + "container", + "docker", + "box", + "package" + ], + "缓存": [ + "cache", + "database", + "storage", + "refresh" + ], + "队列": [ + "queue", + "list", + "layers", + "stack" + ], + "监控": [ + "monitor", + "activity", + "pulse", + "eye" + ], + "告警": [ + "alert", + "bell", + "warning", + "alarm" + ], + "日志": [ + "log", + "file-text", + "terminal", + "list" + ], + "发布": [ + "release", + "rocket", + "tag", + "upload" + ], + "回滚": [ + "rollback", + "undo", + "refresh", + "history" + ], + "压测": [ + "benchmark", + "gauge", + "performance", + "speed" + ], + "性能": [ + "performance", + "speed", + "gauge", + "zap" + ], + "架构": [ + "architecture", + "layers", + "sitemap", + "grid" + ], + "重构": [ + "refactor", + "refresh", + "code", + "wrench" + ], + "调试": [ + "debug", + "bug", + "terminal", + "code" + ], + "脚本": [ + "script", + "code", + "terminal", + "file-code" + ], + "组件": [ + "component", + "blocks", + "puzzle", + "box" + ], + "角色": [ + "role", + "user", + "users", + "badge" + ], + "账号": [ + "account", + "user", + "profile", + "id-card" + ], + "加密": [ + "encrypt", + "lock", + "shield", + "key" + ], + "容灾": [ + "disaster", + "shield", + "server", + "alert" + ], + "网关": [ + "gateway", + "router", + "network", + "server" + ], + "算法": [ + "algorithm", + "code", + "network", + "chart" + ], + "模型": [ + "model", + "brain", + "cube", + "layers" + ], + "标注": [ + "label", + "tag", + "edit", + "highlighter" + ], + "训练": [ + "training", + "dumbbell", + "brain", + "repeat" + ], + "推理": [ + "inference", + "brain", + "zap", + "server" + ], + "算力": [ + "compute", + "chip", + "cpu", + "server" + ], + "物联": [ + "iot", + "wifi", + "sensor", + "chip" + ], + "传感": [ + "sensor", + "radar", + "activity", + "signal" + ], + "隐私": [ + "privacy", + "eye-off", + "shield", + "lock" + ], + "水印": [ + "watermark", + "stamp", + "image", + "copyright" + ], + "溯源": [ + "trace", + "search", + "link", + "history" + ], + "校验": [ + "verify", + "check", + "badge-check", + "shield-check" + ], + "库存": [ + "inventory", + "boxes", + "package", + "clipboard-list" + ], + "分拣": [ + "sort", + "filter", + "package", + "layers" + ], + "港口": [ + "port", + "anchor", + "ship", + "crane" + ], + "跨国": [ + "global", + "globe", + "world", + "plane" + ], + "报关": [ + "customs", + "document", + "stamp", + "clipboard" + ], + "快递": [ + "courier", + "delivery", + "package", + "truck" + ], + "冷链": [ + "cold", + "snowflake", + "truck", + "package" + ], + "车间": [ + "factory", + "industry", + "gear", + "cog" + ], + "质检": [ + "quality", + "clipboard-check", + "search", + "badge-check" + ], + "机械": [ + "gear", + "cog", + "wrench", + "engine" + ], + "光伏": [ + "solar", + "sun", + "panel", + "battery" + ], + "风电": [ + "wind", + "turbine", + "fan", + "battery" + ], + "储能": [ + "battery", + "storage", + "power", + "zap" + ], + "电力": [ + "power", + "bolt", + "plug", + "zap" + ], + "养殖": [ + "farm", + "animal", + "fish", + "barn" + ], + "渔业": [ + "fish", + "fishing", + "hook", + "boat" + ], + "林业": [ + "forest", + "tree", + "evergreen", + "leaf" + ], + "灌溉": [ + "water", + "droplet", + "sprinkler", + "plant" + ], + "农机": [ + "tractor", + "farm", + "gear", + "wrench" + ], + "口腔": [ + "tooth", + "dental", + "dentist" + ], + "眼科": [ + "eye", + "glasses", + "vision" + ], + "心理": [ + "brain", + "heart", + "mind", + "chat" + ], + "康复": [ + "recovery", + "activity", + "heart-pulse", + "body" + ], + "护理": [ + "nurse", + "care", + "heart", + "bandage" + ], + "疫苗": [ + "vaccine", + "syringe", + "shield", + "virus" + ], + "检验": [ + "test-tube", + "microscope", + "flask", + "lab" + ], + "影像": [ + "scan", + "x-ray", + "image", + "monitor" + ], + "药店": [ + "pharmacy", + "pill", + "medicine", + "cross" + ], + "急救": [ + "first-aid", + "ambulance", + "heart-pulse", + "cross" + ], + "中医": [ + "herb", + "leaf", + "acupuncture", + "tea" + ], + "康养": [ + "wellness", + "spa", + "leaf", + "heart" + ], + "保险": [ + "insurance", + "shield", + "umbrella", + "heart" + ], + "证券": [ + "stock", + "chart", + "trending-up", + "candlestick" + ], + "基金": [ + "fund", + "pie-chart", + "chart", + "briefcase" + ], + "信贷": [ + "credit", + "card", + "loan", + "wallet" + ], + "结算": [ + "settlement", + "receipt", + "check", + "exchange" + ], + "汇率": [ + "exchange", + "currency", + "dollar", + "swap" + ], + "理财": [ + "finance", + "chart-up", + "piggy-bank", + "coins" + ], + "投资": [ + "invest", + "chart-up", + "rocket", + "coins" + ], + "融资": [ + "funding", + "handshake", + "coins", + "rocket" + ], + "上市": [ + "ipo", + "rocket", + "building", + "chart-up" + ], + "并购": [ + "merger", + "handshake", + "building", + "link" + ], + "社区": [ + "community", + "users", + "home", + "building" + ], + "街道": [ + "street", + "road", + "map", + "building" + ], + "文旅": [ + "tourism", + "culture", + "camera", + "map" + ], + "景区": [ + "scenic", + "map", + "mountain", + "camera" + ], + "民宿": [ + "guesthouse", + "home", + "bed", + "key" + ], + "展览": [ + "exhibition", + "frame", + "palette", + "gallery" + ], + "演出": [ + "performance", + "mic", + "theater", + "music" + ], + "非遗": [ + "heritage", + "craft", + "scissors", + "brush" + ], + "节庆": [ + "festival", + "confetti", + "lantern", + "sparkles" + ], + "课程": [ + "course", + "book", + "lesson", + "presentation" + ], + "考试": [ + "exam", + "file-check", + "pencil", + "clipboard" + ], + "研究": [ + "research", + "microscope", + "flask", + "search" + ], + "实验": [ + "experiment", + "flask", + "test-tube", + "lab" + ], + "论文": [ + "paper", + "document", + "file-text", + "book" + ], + "面试": [ + "interview", + "users", + "chat", + "briefcase" + ], + "入职": [ + "onboarding", + "user-check", + "badge", + "briefcase" + ], + "考勤": [ + "attendance", + "clock", + "calendar-check", + "user-check" + ], + "审批": [ + "approval", + "check", + "clipboard-check", + "stamp" + ], + "排班": [ + "schedule", + "calendar", + "clock", + "users" + ], + "协作": [ + "collaboration", + "users", + "share", + "handshake" + ], + "任务": [ + "task", + "clipboard-list", + "check", + "list" + ], + "流程": [ + "workflow", + "git-branch", + "flow", + "settings" + ], + "母婴": [ + "baby", + "stroller", + "bottle", + "heart" + ], + "育儿": [ + "parenting", + "baby", + "child", + "heart" + ], + "美妆": [ + "beauty", + "lipstick", + "cosmetics", + "sparkles" + ], + "护肤": [ + "skincare", + "lotion", + "droplet", + "sparkles" + ], + "美发": [ + "hair", + "scissors", + "barber" + ], + "配饰": [ + "accessory", + "watch", + "ring", + "gem" + ], + "珠宝": [ + "jewelry", + "gem", + "diamond", + "ring" + ], + "家具": [ + "furniture", + "chair", + "sofa", + "bed" + ], + "建材": [ + "construction", + "brick", + "wall", + "hammer" + ], + "装修": [ + "renovation", + "paint", + "roller", + "hammer" + ], + "保养": [ + "maintenance", + "wrench", + "settings", + "oil" + ], + "充电": [ + "charging", + "battery", + "plug", + "bolt" + ], + "律师": [ + "lawyer", + "gavel", + "scale", + "briefcase" + ], + "诉讼": [ + "lawsuit", + "gavel", + "document", + "scale" + ], + "新闻": [ + "news", + "newspaper", + "broadcast", + "rss" + ], + "出版": [ + "publish", + "book", + "printer", + "file-text" + ], + "广告": [ + "advertising", + "megaphone", + "target", + "image" + ], + "营销": [ + "marketing", + "megaphone", + "target", + "chart-up" + ], + "品牌": [ + "brand", + "badge", + "palette", + "star" + ], + "公关": [ + "pr", + "megaphone", + "handshake", + "users" + ], + "元宵": [ + "lantern", + "dumpling", + "moon" + ], + "清明": [ + "qingming", + "leaf", + "rain" + ], + "端午": [ + "dragon-boat", + "zongzi", + "leaf" + ], + "中秋": [ + "moon-cake", + "moon", + "lantern" + ], + "重阳": [ + "chrysanthemum", + "mountain", + "leaf" + ], + "七夕": [ + "valentine", + "heart", + "star" + ], + "元旦": [ + "new-year", + "confetti", + "fireworks" + ], + "国庆": [ + "national-day", + "flag", + "fireworks" + ], + "效率": [ + "efficiency", + "zap", + "speed", + "gauge" + ], + "创新": [ + "innovation", + "bulb", + "rocket", + "sparkles" + ], + "多元": [ + "diversity", + "users", + "palette", + "globe" + ], + "信任": [ + "trust", + "shield-check", + "handshake", + "heart" + ], + "品质": [ + "quality", + "badge-check", + "medal", + "star" + ], + "速度": [ + "speed", + "zap", + "rocket", + "gauge" + ], + "连接": [ + "connect", + "link", + "plug", + "network" + ], + "生态": [ + "ecosystem", + "leaf", + "globe", + "network" + ], "云": [ "cloud", "server", @@ -2401,7 +3590,8 @@ "cat", "pet", "animal", - "kitten" + "kitten", + "paw" ], "酒": [ "wine", @@ -2477,6 +3667,11 @@ "山": [ "mountain", "volcano" + ], + "鞋": [ + "shoe", + "sneaker", + "boot" ] }; }); diff --git a/js/data/manifest/BASELINE.md b/js/data/manifest/BASELINE.md index 5693134..46eb8b5 100644 --- a/js/data/manifest/BASELINE.md +++ b/js/data/manifest/BASELINE.md @@ -5,7 +5,7 @@ ## 生成时间 -2026-11-07T18:50:43.761Z +2026-11-08T02:38:04.341Z ## ① 图标库(共享,LOGO/头像/海报共用) @@ -21,10 +21,10 @@ ## ③ 技能库 -- 共享技能:54(分类:layout 10 / color 9 / typography 8 / icon 8 / ai 6 / presentation 5 / export 8) +- 共享技能:55(分类:layout 11 / color 9 / typography 8 / icon 8 / ai 6 / presentation 5 / export 8) - 海报技能:64(分类:layout 8 / color 8 / typography 8 / grid 8 / hierarchy 8 / print 8 / creative 8 / ai 8) -- 表情技能:12(分类:motion 11 / emotion 1) -- 三区覆盖(共享,按 scene/workspaces):LOGO 向 54 / 头像向 45 / 海报向 54 / 未标注 0 +- 表情技能:20(分类:motion 13 / emotion 7) +- 三区覆盖(共享,按 scene/workspaces):LOGO 向 54 / 头像向 46 / 海报向 54 / 未标注 0 - 三区覆盖(海报专属):LOGO 向 0 / 头像向 0 / 海报向 64 - 技能明细:js/data/manifest/skills.json diff --git a/js/data/manifest/skills.json b/js/data/manifest/skills.json index de52129..b20c17c 100644 --- a/js/data/manifest/skills.json +++ b/js/data/manifest/skills.json @@ -1,9 +1,9 @@ { "kind": "skills", - "generatedAt": "2026-08-23T17:18:35.193Z", + "generatedAt": "2026-11-08T02:38:00.293Z", "guide": "js/data/manifest/README.md", "shared": { - "total": 54, + "total": 55, "categories": [ { "step": 1, @@ -288,6 +288,46 @@ "poster" ] }, + { + "id": "avatar-safe-zone", + "name": "头像安全区", + "category": "layout", + "emoji": "⭕", + "scene": "头像导出前的圆/方裁切安全检查(微信/QQ/抖音等平台多为圆形裁切)", + "summary": "圆形裁切时主体直径占画布 62%-78% 最稳(平台会裁掉四角),方形 70%-88%;主体中心偏移不得超过留白的一半,否则裁切后偏边。", + "params": [ + { + "name": "crop", + "type": "string", + "required": false, + "desc": "裁切形状:'circle' 圆形(默认)/ 'square' 方形" + }, + { + "name": "subjectRatio", + "type": "number", + "required": false, + "desc": "主体直径占画布比例(默认 0.7)" + }, + { + "name": "size", + "type": "number", + "required": false, + "desc": "画布边长 px(默认 300)" + }, + { + "name": "offset", + "type": "object", + "required": false, + "desc": "主体中心相对画布中心偏移 {x,y}(px)" + } + ], + "source": "自研(平台头像裁切规范:圆形内切 + 留白安全域)", + "step": 3, + "kind": "check", + "workspaces": [ + "avatar" + ] + }, { "id": "contrast-check", "name": "对比度校验", @@ -2495,7 +2535,7 @@ ] }, "sticker": { - "total": 12, + "total": 20, "categories": null, "skills": [ { @@ -2692,6 +2732,139 @@ "workspaces": [ "emoji" ] + }, + { + "id": "motion-loop-seam", + "name": "循环接缝", + "category": "motion", + "emoji": "🔁", + "scene": "检查循环类动画(漂浮/呼吸/脉冲/旋转)首尾帧是否闭合,避免导出 GIF 时出现跳帧", + "summary": "周期动画必须满足 f(0) ≈ f(1):正弦驱动天然闭合;含位移累加或线性旋转的动画需确认整周期回到原点。", + "params": { + "type": "动画类型 id", + "cycles": "整周期内的往返次数(默认 1)", + "amplitude": "强度倍率" + }, + "source": "自研(循环动画连续性)", + "workspaces": [ + "emoji" + ] + }, + { + "id": "motion-multi-element", + "name": "多元素错峰", + "category": "motion", + "emoji": "🎚", + "scene": "表情由主图 + 装饰(星星/汗滴/符号)组成时,检查各元素是否错峰,避免整组同相抖动", + "summary": "N 个元素应按周期均匀分配相位延迟(delay = period / N),主图领先、装饰跟随 0.1-0.25 个周期。", + "params": { + "elements": "元素数量", + "duration": "周期秒(默认 1.2)", + "leadRatio": "主图领先比例(默认 0.08)" + }, + "source": "自研(分层动画错峰)", + "workspaces": [ + "emoji" + ] + }, + { + "id": "emotion-intensity", + "name": "情绪强度匹配", + "category": "emotion", + "emoji": "🌡", + "scene": "评估动画幅度/节奏是否与情绪强度一致(微笑用轻浮动,狂喜才用夸张弹跳)", + "summary": "强度 1-5 与动效幅度映射:1-2 用呼吸/淡入,3 用脉冲/浮动,4-5 才用弹跳/心跳/抖动。", + "params": { + "intensity": "情绪强度 1-5(默认 3)", + "amplitude": "动效幅度倍率(默认 1)", + "type": "动画类型 id" + }, + "source": "自研(情绪-动效映射)", + "workspaces": [ + "emoji" + ] + }, + { + "id": "emotion-context", + "name": "场景克制度", + "category": "emotion", + "emoji": "🏷", + "scene": "同一情绪在不同使用场景(聊天/弹幕/工作群/亲密关系)需要不同表达强度", + "summary": "工作场景避免强烈负向与夸张动效;弹幕需高辨识度短动效;亲密场景可夸张;聊天居中即可。", + "params": { + "scene": "场景(chat/bullet/work/intimate,默认 chat)", + "emotion": "情绪 id(如 joy/anger/sad/wow/love)", + "amplitude": "动效幅度(默认 1)" + }, + "source": "自研(场景化表情规范)", + "workspaces": [ + "emoji" + ] + }, + { + "id": "emotion-coverage", + "name": "情绪覆盖度", + "category": "emotion", + "emoji": "🎭", + "scene": "检查一套表情包的情绪分布是否失衡(全是开心 / 缺中性 / 负向过多)", + "summary": "健康的一组表情建议:正向 50%-70%、中性 15%-30%、负向 10%-25%,且必含至少 1 个中性锚点。", + "params": { + "emotions": "情绪 id 数组或 {joy:4, neutral:1} 计数对象" + }, + "source": "自研(表情包情绪配比)", + "workspaces": [ + "emoji" + ] + }, + { + "id": "emotion-clarity", + "name": "情绪可读性", + "category": "emotion", + "emoji": "👁", + "scene": "小尺寸(48-96px)下表情是否一眼可辨,装饰过多会削弱情绪识别", + "summary": "主体占画面 ≥ 60%、装饰元素 ≤ 2 个、避免细碎线条;小尺寸优先强化眼神与嘴形这类情绪特征。", + "params": { + "size": "展示尺寸 px(默认 64)", + "subjectRatio": "主体占比 0-1(默认 0.7)", + "decorations": "装饰元素数(默认 1)", + "fineLines": "细碎线条数(默认 0)" + }, + "source": "自研(小尺寸可读性)", + "workspaces": [ + "emoji" + ] + }, + { + "id": "emotion-brand-fit", + "name": "角色调性一致性", + "category": "emotion", + "emoji": "🧭", + "scene": "角色/IP/品牌有固定调性时,检查表情情绪是否越界(严谨品牌不适合夸张搞怪)", + "summary": "调性决定可用情绪集:friendly 全开、calm 去狂喜狂怒、sharp 弱化软萌、formal 仅中性+轻正向。", + "params": { + "tone": "调性(friendly/calm/sharp/formal,默认 friendly)", + "emotion": "情绪 id", + "amplitude": "动效幅度(默认 1)" + }, + "source": "自研(品牌调性-情绪白名单)", + "workspaces": [ + "emoji" + ] + }, + { + "id": "emotion-transition", + "name": "情绪跳变", + "category": "emotion", + "emoji": "↔️", + "scene": "一组表情按顺序播放或成套使用时,相邻情绪强度落差过大会显得突兀", + "summary": "相邻情绪强度差建议 ≤2;强负向与强正向之间应有中性过渡项。", + "params": { + "sequence": "情绪 id 数组(按使用顺序)" + }, + "source": "自研(情绪序列过渡)", + "workspaces": [ + "emoji" + ] } ] } diff --git a/js/skills/core.js b/js/skills/core.js index b1467ad..aeb41cf 100644 --- a/js/skills/core.js +++ b/js/skills/core.js @@ -77,7 +77,7 @@ const HGB_Skills = (function () { 'neutral-palette': 2, // ③ 方案评审(检查类) 'composition': 3, 'align-check': 3, 'negative-space': 3, 'spacing-check': 3, 'proportion-check': 3, - 'visual-balance': 3, 'focal-point': 3, 'rule-of-thirds': 3, 'circle-crop-safety': 3, + 'visual-balance': 3, 'focal-point': 3, 'rule-of-thirds': 3, 'circle-crop-safety': 3, 'avatar-safe-zone': 3, 'contrast-check': 3, 'wcag-contrast': 3, 'color-blind-check': 3, 'monochrome-check': 3, 'font-hierarchy': 3, 'text-fit': 3, 'tiny-readable': 3, 'letter-spacing-check': 3, 'line-break': 3, 'cjk-mix-check': 3, diff --git a/js/skills/layout.js b/js/skills/layout.js index 96fcc7c..634290d 100644 --- a/js/skills/layout.js +++ b/js/skills/layout.js @@ -389,6 +389,53 @@ const edge = { plan: { elements: [{ type: 'icon', iconId: 'x', x: 585, y: 300, w: 30, h: 30 }] } }; return { generated: this.run({ plan }).pass !== undefined, edge: this.run(edge).risky.length }; } + }, + + { + id: 'avatar-safe-zone', + name: '头像安全区', + category: 'layout', + emoji: '⭕', + scene: '头像导出前的圆/方裁切安全检查(微信/QQ/抖音等平台多为圆形裁切)', + summary: '圆形裁切时主体直径占画布 62%-78% 最稳(平台会裁掉四角),方形 70%-88%;主体中心偏移不得超过留白的一半,否则裁切后偏边。', + params: [ + { name: 'crop', type: 'string', required: false, desc: "裁切形状:'circle' 圆形(默认)/ 'square' 方形" }, + { name: 'subjectRatio', type: 'number', required: false, desc: '主体直径占画布比例(默认 0.7)' }, + { name: 'size', type: 'number', required: false, desc: '画布边长 px(默认 300)' }, + { name: 'offset', type: 'object', required: false, desc: '主体中心相对画布中心偏移 {x,y}(px)' } + ], + source: '自研(平台头像裁切规范:圆形内切 + 留白安全域)', + workspaces: ['avatar'], + run: function (args) { + const crop = (args.crop === 'square') ? 'square' : 'circle'; + const ratio = Number(args.subjectRatio) || 0.7; + const size = Number(args.size) || 300; + const off = args.offset || { x: 0, y: 0 }; + const dx = Number(off.x) || 0; + const dy = Number(off.y) || 0; + const range = crop === 'circle' ? [0.62, 0.78] : [0.7, 0.88]; + const pad = size * (1 - ratio) / 2; + const tips = []; + if (ratio > range[1]) tips.push('主体占比 ' + Math.round(ratio * 100) + '% 偏大(建议 ≤' + Math.round(range[1] * 100) + '%),' + (crop === 'circle' ? '圆形裁切会切到主体边缘' : '导出后显拥挤')); + if (ratio < range[0]) tips.push('主体占比 ' + Math.round(ratio * 100) + '% 偏小(建议 ≥' + Math.round(range[0] * 100) + '%),头像缩小后辨识度不足'); + const maxOff = pad * 0.5; + if (Math.abs(dx) > maxOff || Math.abs(dy) > maxOff) { + tips.push('主体中心偏移 (x' + Math.round(dx) + ', y' + Math.round(dy) + ') 超过安全留白的一半(±' + Math.round(maxOff) + 'px),裁切后偏边'); + } + if (crop === 'circle' && ratio > 0.78) tips.push('圆形裁切的安全直径约为画布的 100%,但视觉留白建议保留 12% 以上'); + return { + pass: tips.length === 0, + crop, subjectRatio: ratio, size, offset: { x: dx, y: dy }, safeRange: range, padding: Math.round(pad), + verdict: tips.length ? tips.join(';') : crop === 'circle' ? '主体在圆形裁切安全区内,四角留白充足' : '主体比例与居中位置符合方形头像规范', + suggest: tips.length ? '建议把主体缩放到画布 ' + Math.round((range[0] + range[1]) / 2 * 100) + '% 并居中' : '无需调整' + }; + }, + test: function () { + const good = this.run({ crop: 'circle', subjectRatio: 0.7, size: 300, offset: { x: 0, y: 0 } }); + const big = this.run({ crop: 'circle', subjectRatio: 0.95, size: 300 }); + const off = this.run({ crop: 'square', subjectRatio: 0.75, size: 300, offset: { x: 60, y: 0 } }); + return { good: good.pass, bigFails: big.pass === false, offsetFails: off.pass === false }; + } } ]); })(); diff --git a/js/sticker-skills/skills.js b/js/sticker-skills/skills.js index 68f8a81..cf5a2ef 100644 --- a/js/sticker-skills/skills.js +++ b/js/sticker-skills/skills.js @@ -1,5 +1,5 @@ /** - * 画个标 · 表情技能(12 个:motion 11 / emotion 1) + * 画个标 · 表情技能(20 个:motion 13 / emotion 7) * 全部为纯函数:run(args) 返回 {ok/tip/...},test() 可自跑。 * 用于表情生成后的评审/优化建议(动态节奏/物理/循环/体积/平台/情绪)。 * 来源标注「自研」或公开设计原则。 @@ -264,5 +264,244 @@ HGB_StickerSkills.register([ return { ok: smooth || eased, tip: (smooth ? '正弦驱动,平滑自然' : eased ? '含减速/压缩段,物理自然' : '线性驱动,建议叠加缓动曲线') + '(' + t + ')' }; }, test() { return this.run({ type: 'bounce' }); } + }, + + /* ---------- 第二批 motion(动效质量深化,2026-11-08) ---------- */ + { + id: 'motion-loop-seam', name: '循环接缝', category: 'motion', emoji: '🔁', + scene: '检查循环类动画(漂浮/呼吸/脉冲/旋转)首尾帧是否闭合,避免导出 GIF 时出现跳帧', + summary: '周期动画必须满足 f(0) ≈ f(1):正弦驱动天然闭合;含位移累加或线性旋转的动画需确认整周期回到原点。', + params: { type: '动画类型 id', cycles: '整周期内的往返次数(默认 1)', amplitude: '强度倍率' }, + source: '自研(循环动画连续性)', + run(args) { + const t = args.type || 'float'; + const cycles = Number(args.cycles) || 1; + const amp = Number(args.amplitude) || 1; + const periodic = ['float', 'breath', 'pulse', 'heartbeat', 'wiggle', 'bounce', 'hopspin']; + const smoothLoop = ['float', 'breath', 'pulse', 'heartbeat']; + const spinning = ['spin', 'twirl']; + const continuous = spinning.includes(t); + const closed = periodic.includes(t) || continuous; + const intCycles = Math.abs(cycles - Math.round(cycles)) < 1e-6; + const ok = closed && intCycles; + const tips = []; + if (!closed) tips.push('该动画不保证首尾闭合,建议改用正弦驱动或补首尾过渡帧'); + if (!intCycles) tips.push('往返次数需为整数(当前 ' + cycles + '),否则末帧与首帧错位'); + if (smoothLoop.includes(t) && amp > 1.4) tips.push('幅度过大时接缝更明显,建议 amplitude ≤ 1.4'); + return { + ok, type: t, cycles, amplitude: amp, + tip: tips.length ? tips.join(';') : '首尾帧闭合,循环无跳帧(' + t + ' × ' + cycles + ' 周期)' + }; + }, + test() { + return { ok: this.run({ type: 'float', cycles: 2, amplitude: 1 }).ok, bad: this.run({ type: 'float', cycles: 1.5 }).ok }; + } + }, + + { + id: 'motion-multi-element', name: '多元素错峰', category: 'motion', emoji: '🎚', + scene: '表情由主图 + 装饰(星星/汗滴/符号)组成时,检查各元素是否错峰,避免整组同相抖动', + summary: 'N 个元素应按周期均匀分配相位延迟(delay = period / N),主图领先、装饰跟随 0.1-0.25 个周期。', + params: { elements: '元素数量', duration: '周期秒(默认 1.2)', leadRatio: '主图领先比例(默认 0.08)' }, + source: '自研(分层动画错峰)', + run(args) { + const n = Math.max(1, Number(args.elements) || 3); + const d = Number(args.duration) || 1.2; + const lead = Number(args.leadRatio) || 0.08; + const step = n > 1 ? (0.85 - lead) / (n - 1) : 0; + const delays = []; + for (let i = 0; i < n; i++) delays.push(Math.round((-lead - step * i) * d * 1000) / 1000); + const samePhase = n > 1 && step * d < 0.02; + const maxDelay = Math.abs(delays[delays.length - 1] || 0); + const ok = !samePhase && maxDelay < d; + return { + ok, count: n, period: d, delays, + tip: ok + ? n + ' 个元素按 ' + (step * d).toFixed(2) + 's 间隔错峰,最长延迟 ' + maxDelay.toFixed(2) + 's 在周期内' + : '元素同相或延迟超出周期,建议减小元素数或缩短延迟步长' + }; + }, + test() { + return { ok: this.run({ elements: 3, duration: 1.2 }).ok, single: this.run({ elements: 1 }).ok }; + } + }, + + /* ---------- emotion 情绪传达(第二批,2026-11-08) ---------- */ + { + id: 'emotion-intensity', name: '情绪强度匹配', category: 'emotion', emoji: '🌡', + scene: '评估动画幅度/节奏是否与情绪强度一致(微笑用轻浮动,狂喜才用夸张弹跳)', + summary: '强度 1-5 与动效幅度映射:1-2 用呼吸/淡入,3 用脉冲/浮动,4-5 才用弹跳/心跳/抖动。', + params: { intensity: '情绪强度 1-5(默认 3)', amplitude: '动效幅度倍率(默认 1)', type: '动画类型 id' }, + source: '自研(情绪-动效映射)', + run(args) { + const intensity = Math.min(5, Math.max(1, Number(args.intensity) || 3)); + const amp = Number(args.amplitude) || 1; + const t = args.type || 'pulse'; + const strong = ['bounce', 'heartbeat', 'shake', 'hopspin', 'spin']; + const gentle = ['breath', 'fade', 'float', 'pulse', 'twirl', 'wiggle']; + const isStrong = strong.includes(t); + const expectedStrong = intensity >= 4; + const match = isStrong === expectedStrong; + const ampOk = intensity >= 4 ? amp >= 0.9 : amp <= 1.2; + const tips = []; + if (!match) tips.push(expectedStrong ? '强度 ' + intensity + ' 建议用更有力的动效(弹跳/心跳/抖动)' : '强度 ' + intensity + ' 用强动效会显得夸张,建议改呼吸/浮动/脉冲'); + if (!ampOk) tips.push(intensity >= 4 ? '幅度偏小(' + amp + '),可提到 1.0+' : '幅度偏大(' + amp + '),建议 ≤ 1.2'); + return { + ok: match && ampOk, intensity, amplitude: amp, type: t, + suggestTypes: expectedStrong ? strong : gentle, + tip: tips.length ? tips.join(';') : '情绪强度与动效力度匹配(强度 ' + intensity + ' × ' + t + ')' + }; + }, + test() { + return { ok: this.run({ intensity: 5, amplitude: 1.1, type: 'bounce' }).ok, gentle: this.run({ intensity: 1, amplitude: 0.8, type: 'breath' }).ok }; + } + }, + + { + id: 'emotion-context', name: '场景克制度', category: 'emotion', emoji: '🏷', + scene: '同一情绪在不同使用场景(聊天/弹幕/工作群/亲密关系)需要不同表达强度', + summary: '工作场景避免强烈负向与夸张动效;弹幕需高辨识度短动效;亲密场景可夸张;聊天居中即可。', + params: { scene: '场景(chat/bullet/work/intimate,默认 chat)', emotion: '情绪 id(如 joy/anger/sad/wow/love)', amplitude: '动效幅度(默认 1)' }, + source: '自研(场景化表情规范)', + run(args) { + const scene = args.scene || 'chat'; + const emotion = args.emotion || 'joy'; + const amp = Number(args.amplitude) || 1; + const cap = { chat: 1.3, bullet: 1.4, work: 0.9, intimate: 1.6 }[scene]; + const negative = ['anger', 'sad', 'disgust', 'cry'].includes(emotion); + const strongNegInWork = scene === 'work' && negative && amp > 0.8; + const bulletSlow = scene === 'bullet' && amp < 0.9; + const ok = amp <= (cap || 1.3) && !strongNegInWork && !bulletSlow; + const tips = []; + if (amp > (cap || 1.3)) tips.push(scene + ' 场景建议幅度 ≤ ' + cap); + if (strongNegInWork) tips.push('工作场景的负向情绪建议收敛到 0.8 以下或改用中性表达'); + if (bulletSlow) tips.push('弹幕场景需要更强视觉冲击,幅度建议 ≥ 0.9'); + return { + ok, scene, emotion, amplitude: amp, cap: cap || 1.3, + tip: tips.length ? tips.join(';') : scene + ' 场景下 ' + emotion + ' 的表达强度合适' + }; + }, + test() { + return { ok: this.run({ scene: 'chat', emotion: 'joy', amplitude: 1.1 }).ok, work: this.run({ scene: 'work', emotion: 'anger', amplitude: 0.6 }).ok }; + } + }, + + { + id: 'emotion-coverage', name: '情绪覆盖度', category: 'emotion', emoji: '🎭', + scene: '检查一套表情包的情绪分布是否失衡(全是开心 / 缺中性 / 负向过多)', + summary: '健康的一组表情建议:正向 50%-70%、中性 15%-30%、负向 10%-25%,且必含至少 1 个中性锚点。', + params: { emotions: '情绪 id 数组或 {joy:4, neutral:1} 计数对象' }, + source: '自研(表情包情绪配比)', + run(args) { + const src = args.emotions; + const counts = {}; + if (Array.isArray(src)) for (const e of src) counts[e] = (counts[e] || 0) + 1; + else if (src && typeof src === 'object') Object.assign(counts, src); + const total = Object.values(counts).reduce((a, b) => a + b, 0); + if (!total) return { ok: false, tip: '请提供至少一个情绪(数组或计数对象)' }; + const group = e => ['joy', 'love', 'wow', 'excited', 'happy', 'laugh'].includes(e) ? 'pos' + : ['neutral', 'calm', 'think', 'hmm'].includes(e) ? 'neu' : 'neg'; + let pos = 0, neu = 0, neg = 0; + for (const [e, n] of Object.entries(counts)) { + const g = group(e); + if (g === 'pos') pos += n; else if (g === 'neu') neu += n; else neg += n; + } + const r = { pos: pos / total, neu: neu / total, neg: neg / total }; + const tips = []; + if (r.neu < 0.15) tips.push('缺中性锚点(当前 ' + Math.round(r.neu * 100) + '%),建议补 15%-30%'); + if (r.pos > 0.8) tips.push('正向占比过高(' + Math.round(r.pos * 100) + '%),情绪层次单一'); + if (r.neg > 0.3) tips.push('负向占比过高(' + Math.round(r.neg * 100) + '%),正式场景易误用'); + return { + ok: tips.length === 0, total, + ratio: { pos: Math.round(r.pos * 100), neu: Math.round(r.neu * 100), neg: Math.round(r.neg * 100) }, + tip: tips.length ? tips.join(';') : '情绪分布均衡(正 ' + Math.round(r.pos * 100) + '% / 中 ' + Math.round(r.neu * 100) + '% / 负 ' + Math.round(r.neg * 100) + '%)' + }; + }, + test() { + return { balanced: this.run({ emotions: { joy: 6, neutral: 2, sad: 2 } }).ok, unbalanced: this.run({ emotions: { joy: 9, wow: 1 } }).ok }; + } + }, + + { + id: 'emotion-clarity', name: '情绪可读性', category: 'emotion', emoji: '👁', + scene: '小尺寸(48-96px)下表情是否一眼可辨,装饰过多会削弱情绪识别', + summary: '主体占画面 ≥ 60%、装饰元素 ≤ 2 个、避免细碎线条;小尺寸优先强化眼神与嘴形这类情绪特征。', + params: { size: '展示尺寸 px(默认 64)', subjectRatio: '主体占比 0-1(默认 0.7)', decorations: '装饰元素数(默认 1)', fineLines: '细碎线条数(默认 0)' }, + source: '自研(小尺寸可读性)', + run(args) { + const size = Number(args.size) || 64; + const ratio = Number(args.subjectRatio) || 0.7; + const deco = Number(args.decorations) || 0; + const fine = Number(args.fineLines) || 0; + const small = size <= 96; + const tips = []; + if (ratio < 0.6) tips.push('主体占比 ' + Math.round(ratio * 100) + '% 偏小,建议 ≥60%'); + if (deco > 2) tips.push('装饰 ' + deco + ' 个过多,小尺寸建议 ≤2'); + if (small && fine > 0) tips.push('小尺寸下 ' + fine + ' 条细碎线条会糊,建议简化'); + return { + ok: tips.length === 0, size, subjectRatio: ratio, decorations: deco, + tip: tips.length ? tips.join(';') : size + 'px 下主体清晰、装饰克制,情绪一眼可辨' + }; + }, + test() { + return { ok: this.run({ size: 64, subjectRatio: 0.72, decorations: 1 }).ok, noisy: this.run({ size: 64, subjectRatio: 0.5, decorations: 3 }).ok }; + } + }, + + { + id: 'emotion-brand-fit', name: '角色调性一致性', category: 'emotion', emoji: '🧭', + scene: '角色/IP/品牌有固定调性时,检查表情情绪是否越界(严谨品牌不适合夸张搞怪)', + summary: '调性决定可用情绪集:friendly 全开、calm 去狂喜狂怒、sharp 弱化软萌、formal 仅中性+轻正向。', + params: { tone: '调性(friendly/calm/sharp/formal,默认 friendly)', emotion: '情绪 id', amplitude: '动效幅度(默认 1)' }, + source: '自研(品牌调性-情绪白名单)', + run(args) { + const tone = args.tone || 'friendly'; + const emotion = args.emotion || 'joy'; + const amp = Number(args.amplitude) || 1; + const allow = { + friendly: ['joy', 'love', 'wow', 'sad', 'anger', 'neutral', 'laugh', 'think'], + calm: ['joy', 'neutral', 'think', 'calm', 'sad'], + sharp: ['anger', 'wow', 'joy', 'neutral', 'think'], + formal: ['neutral', 'joy', 'think'] + }[tone] || ['joy', 'neutral']; + const inSet = allow.includes(emotion); + const ampCap = { friendly: 1.6, calm: 0.9, sharp: 1.3, formal: 0.7 }[tone] || 1.2; + const ampOk = amp <= ampCap; + const tips = []; + if (!inSet) tips.push(tone + ' 调性不建议使用 ' + emotion + ',可用:' + allow.join('/')); + if (!ampOk) tips.push(tone + ' 调性幅度建议 ≤ ' + ampCap + '(当前 ' + amp + ')'); + return { + ok: inSet && ampOk, tone, emotion, amplitude: amp, allowed: allow, + tip: tips.length ? tips.join(';') : emotion + ' 符合 ' + tone + ' 调性,幅度 ' + amp + ' 在安全区' + }; + }, + test() { + return { ok: this.run({ tone: 'calm', emotion: 'joy', amplitude: 0.8 }).ok, bad: this.run({ tone: 'formal', emotion: 'anger', amplitude: 1.2 }).ok }; + } + }, + + { + id: 'emotion-transition', name: '情绪跳变', category: 'emotion', emoji: '↔️', + scene: '一组表情按顺序播放或成套使用时,相邻情绪强度落差过大会显得突兀', + summary: '相邻情绪强度差建议 ≤2;强负向与强正向之间应有中性过渡项。', + params: { sequence: '情绪 id 数组(按使用顺序)' }, + source: '自研(情绪序列过渡)', + run(args) { + const seq = Array.isArray(args.sequence) ? args.sequence : []; + if (seq.length < 2) return { ok: true, tip: '少于 2 个情绪,无需检查过渡' }; + const level = { neutral: 1, calm: 1, think: 2, hmm: 2, joy: 3, love: 4, laugh: 4, wow: 4, sad: 3, cry: 4, anger: 5, excited: 5 }; + const jump = []; + for (let i = 1; i < seq.length; i++) { + const a = level[seq[i - 1]] || 3, b = level[seq[i]] || 3; + if (Math.abs(a - b) >= 3) jump.push(seq[i - 1] + '→' + seq[i] + '(差' + Math.abs(a - b) + ')'); + } + return { + ok: jump.length === 0, length: seq.length, jumps: jump, + tip: jump.length ? '情绪跳变过大:' + jump.join('、') + ',建议中间插入中性/轻度情绪过渡' : '情绪过渡平滑(' + seq.length + ' 个)' + }; + }, + test() { + return { smooth: this.run({ sequence: ['joy', 'wow', 'neutral'] }).ok, jump: this.run({ sequence: ['anger', 'calm', 'joy'] }).ok }; + } } ]); diff --git a/poster.html b/poster.html index cf7b36a..8e0d737 100644 --- a/poster.html +++ b/poster.html @@ -94,10 +94,10 @@ - + - + - + - - + +