@mingxy/opencode-mascot 0.4.27 → 0.4.28

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mingxy/opencode-mascot",
3
- "version": "0.4.27",
3
+ "version": "0.4.28",
4
4
  "description": "OpenCode TUI mascot plugin framework - customizable ASCII mascots for your terminal",
5
5
  "author": "mingxy",
6
6
  "license": "MIT",
@@ -20,10 +20,11 @@ export function HomeMascot(props: HomeMascotProps): JSX.Element {
20
20
  const initialName = names[Math.floor(Math.random() * names.length)];
21
21
 
22
22
  const cw = (typeof process !== "undefined" && process.stdout?.columns) || 80;
23
+ const ch = (typeof process !== "undefined" && process.stdout?.rows) || 24;
23
24
 
24
25
  const [currentName, setCurrentName] = createSignal(initialName);
25
- const [posX, setPosX] = createSignal(Math.floor(Math.random() * Math.max(0, cw - 20)));
26
- const [posY, setPosY] = createSignal(Math.floor(Math.random() * 3));
26
+ const [posX, setPosX] = createSignal(Math.floor(Math.random() * Math.max(0, cw - 12)));
27
+ const [posY, setPosY] = createSignal(-(Math.floor(Math.random() * Math.min(ch - 8, 15)) + 3));
27
28
  const [zBoost, setZBoost] = createSignal(false);
28
29
  let dragStartX = 0;
29
30
  let dragStartY = 0;
@@ -66,6 +67,7 @@ export function HomeMascot(props: HomeMascotProps): JSX.Element {
66
67
 
67
68
  return (
68
69
  <box
70
+ position="absolute"
69
71
  left={posX()}
70
72
  top={posY()}
71
73
  zIndex={zBoost() ? 9999 : 100}