Files
fitness-coach/miniprogram/utils/icon-name.js
wm b94eb706ff feat: Kinetic Dark 设计语言 + Lucide 图标迁移 + 首页轻量个性化
- 建立 Lucide 子集 iconfont(49 字形),全站 emoji 替换为 fc-icon 组件
- 重塑 Design Token(冷中性近黑底 + Volt 荧光绿 #B6F24E),消除硬编码颜色
- 首页登录后个性化:我的计划 / 我的收藏 / 今日推荐(纯前端复用现有 API)
- 后端 DEFAULT_EMOJI→Lucide 名,PALETTE 对齐 Kinetic Dark 语义色板
- 修复 person-standing 缺失字形;14 个官方组合 seed emoji 全部映射到现有字形
2026-07-22 21:38:56 +08:00

20 lines
1.1 KiB
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

// emoji → Lucide 图标名 映射(后端历史数据里仍可能带 emoji 的字段,如 plan.emoji / collection.emoji
const EMOJI_TO_ICON = {
'✨': 'sparkles', '💪': 'accessibility', '🏋️': 'dumbbell', '📋': 'clipboard-list',
'🗂️': 'folder-open', '👤': 'user', '🏃': 'person-standing', '🔥': 'flame',
'❤️': 'heart', '⭐': 'star', '🎯': 'target', '🧘': 'activity', '🥗': 'activity',
'🏠': 'home', '📚': 'layout-grid', '📝': 'clipboard-list', '💡': 'sparkles',
'🚀': 'trending-up', '⏱️': 'clock', '🏆': 'trophy', '🥇': 'medal',
// 官方训练组合 seed emoji后端 collections.ts→ 全部映射到现有字形
'⚡': 'zap', '🌟': 'star', '🌱': 'trending-up', '🌸': 'sparkles',
'📈': 'trending-up', '🦵': 'dumbbell', '🦾': 'dumbbell', '🪢': 'activity'
};
// 旧 emoji → lucide 名;已是 lucide 名则直接透传;未知返回 fallback
function iconName(v, fallback) {
if (!v) return fallback || 'folder-open';
return EMOJI_TO_ICON[v] || v;
}
module.exports = { EMOJI_TO_ICON, iconName };