摘要: Electron 桌面寵物,透過 Claude Code hooks 即時反映工作狀態(思考、等待授權、失敗、完成),並支援 16 方向追視游標。 根本原因: 專案尚未納入版控,需要建立初始 repo 以便後續追蹤與協作。 影響: 建立 main 分支的第一個版本,包含完整可執行的程式碼與內附寵物「小念」。 修法: 納入以下內容: - main.js / preload.js:Electron 主程序、透明置頂視窗、系統匣選單、HTTP 事件伺服器、游標輪詢與拖曳 - renderer/:Codex V2 spritesheet 幀動畫播放器、session 狀態機、氣泡、alpha 點穿判定 - hook/claude-pet-hook.js:Claude Code hook 端,stdin → POST /event,永遠 exit 0 - lib/、scripts/:hooks 安裝/移除、Windows 開機自動啟動 - pets/xiao-nian:內附寵物包(pet.json + spritesheet.webp) - README.md、docs/states.png:使用說明與狀態總覽圖 Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
68 lines
1.2 KiB
CSS
68 lines
1.2 KiB
CSS
html, body {
|
|
margin: 0;
|
|
height: 100%;
|
|
background: transparent;
|
|
overflow: hidden;
|
|
user-select: none;
|
|
-webkit-user-select: none;
|
|
cursor: default;
|
|
font-family: "Segoe UI", "Microsoft JhengHei", "PingFang TC", system-ui, sans-serif;
|
|
}
|
|
|
|
#stage {
|
|
position: absolute;
|
|
inset: 0;
|
|
display: flex;
|
|
flex-direction: column;
|
|
align-items: center;
|
|
justify-content: flex-end;
|
|
padding-bottom: 8px;
|
|
}
|
|
|
|
#bubble {
|
|
position: relative;
|
|
max-width: calc(100% - 12px);
|
|
margin-bottom: 10px;
|
|
padding: 6px 11px;
|
|
background: rgba(255, 255, 255, 0.97);
|
|
color: #222;
|
|
border-radius: 12px;
|
|
font-size: 13px;
|
|
line-height: 1.35;
|
|
box-shadow: 0 2px 10px rgba(0, 0, 0, 0.28);
|
|
white-space: nowrap;
|
|
overflow: hidden;
|
|
text-overflow: ellipsis;
|
|
transition: opacity 0.18s ease, transform 0.18s ease;
|
|
cursor: pointer;
|
|
}
|
|
|
|
#bubble::after {
|
|
content: "";
|
|
position: absolute;
|
|
left: 50%;
|
|
bottom: -6px;
|
|
transform: translateX(-50%);
|
|
border: 6px solid transparent;
|
|
border-top-color: rgba(255, 255, 255, 0.97);
|
|
border-bottom: 0;
|
|
}
|
|
|
|
#bubble.hidden {
|
|
opacity: 0;
|
|
transform: translateY(4px);
|
|
pointer-events: none;
|
|
}
|
|
|
|
#sprite {
|
|
display: block;
|
|
}
|
|
|
|
#sprite.grab {
|
|
cursor: grab;
|
|
}
|
|
|
|
#sprite.grabbing {
|
|
cursor: grabbing;
|
|
}
|