可视化追踪减肥进度,支持图表展示、进度对比、数据导出、中英文双语、macOS/Windows/Linux 跨平台。
text
weight-tracker/
├── SKILL.md
└── assets/
├── jianfei.html # 主页面
├── config.json # 用户配置
├── weight_history.json # 体重数据
└── setup.sh # 跨平台初始化向导
bash
cd <skill-directory>/assets
chmod +x setup.sh
./setup.sh
向导会自动检测平台(macOS/Windows/Linux),并引导配置:
macOS:
bash
cd <jianfei.html目录>
python3 -m http.server <PORT>
Windows (PowerShell):
powershell
cd <jianfei.html目录>
python -m http.server <PORT>
Linux:
bash
cd <jianfei.html目录>
python3 -m http.server <PORT>
浏览器访问: http://localhost:<PORT>/jianfei.html
json
{
"title": "Weight Tracker",
"language": "en",
"port": 8080,
"startWeight": 70,
"targetWeight": 60,
"startDate": "2026-01-01",
"endDate": "2026-03-31",
"startDateLabel": "01/01",
"endDateLabel": "03/31"
}
关键字段:
language: zh = 中文界面, en = 英文界面port: 本地服务器端口号startDate / endDate: 减肥周期(YYYY-MM-DD 格式)json
{
"records": [
{"date": "2026-03-29", "weight": 68.5}
]
}
修改 config.json 中的 language 字段为 zh 或 en,然后刷新页面即可切换界面语言。
weight_history.jsonrecords 数组启动本地服务器 bash
cd <jianfei.html目录>
# macOS
python3 -m http.server <PORT>
# Windows (PowerShell)
python -m http.server <PORT>
# Linux
python3 -m http.server <PORT>
打开浏览器
http://localhost:<PORT>/jianfei.html调整视口
截图
关闭浏览器并停止服务器 ⭐重要
bash
# macOS
lsof -ti :<PORT> | xargs kill
# Linux
fuser -k <PORT>/tcp 2>/dev/null || kill $(lsof -ti:<PORT>) 2>/dev/null
# Windows (PowerShell)
netstat -ano | findstr :<PORT>
taskkill /PID <PID> /F
W 键:导出当前数据为 JSON 文件用户应将文件放在自己的目录下,例如:
text
~/Desktop/weight-tracker/
├── jianfei.html
├── config.json
├── weight_history.json
└── setup.sh