@lokiyou/pi-nano-footer 0.5.0 → 0.7.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/index.ts +10 -5
  2. package/package.json +1 -1
package/index.ts CHANGED
@@ -81,12 +81,17 @@ Editor.prototype.render = function (width: number): string[] {
81
81
  const rgb = extractRGB(saved);
82
82
  if (rgb) {
83
83
  const [r, g, b] = rgb;
84
- // 呼吸亮度:sin 周期 ~800ms,亮度范围 40%~100%
85
- // performance.now() 保证时间连续的呼吸曲线
86
- const t = 0.5 + 0.5 * Math.sin(performance.now() / 400);
87
- const bright = 0.4 + 0.6 * t;
84
+ // 呼吸发光:纯 sin 曲线,无 clamping,像自然呼吸
85
+ // - 暗处 ~18% 亮度,亮处 100% + 白色辉光
86
+ // 周期 ~900ms(接近自然呼吸节奏)
87
+ const t = 0.5 + 0.5 * Math.sin(performance.now() / 450);
88
+ const bright = 0.18 + 0.82 * t; // 18%~100%
89
+ const glow = t * 0.4; // 0~0.4 白色 blend,无 clamping
90
+ const nr = Math.round(Math.min(255, r * bright + (255 - r) * glow));
91
+ const ng = Math.round(Math.min(255, g * bright + (255 - g) * glow));
92
+ const nb = Math.round(Math.min(255, b * bright + (255 - b) * glow));
88
93
  this.borderColor = (str: string) =>
89
- `\x1b[38;2;${Math.round(r * bright)};${Math.round(g * bright)};${Math.round(b * bright)}m${str}\x1b[0m`;
94
+ `\x1b[38;2;${nr};${ng};${nb}m${str}\x1b[0m`;
90
95
  }
91
96
  try {
92
97
  return origRender.call(this, width);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lokiyou/pi-nano-footer",
3
- "version": "0.5.0",
3
+ "version": "0.7.0",
4
4
  "description": "超轻量 powerline 风格 footer for Pi Coding Agent — 输入框脉冲发光,霓虹配色,实时显示模型、目录、上下文、token 和费用",
5
5
  "type": "module",
6
6
  "keywords": [