Skip to content

Commit b882b5a

Browse files
committed
Initial release: Codex Pet Pause
0 parents  commit b882b5a

140 files changed

Lines changed: 30867 additions & 0 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.env.e2e

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
VITE_NEKO_E2E=1

.env.pages

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
VITE_BASE_PATH=/codex-pet-pause/

.github/workflows/deploy-pages.yml

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
name: Deploy to GitHub Pages
2+
3+
on:
4+
push:
5+
branches: [main]
6+
workflow_dispatch:
7+
8+
permissions:
9+
contents: read
10+
pages: write
11+
id-token: write
12+
13+
concurrency:
14+
group: pages
15+
cancel-in-progress: false
16+
17+
jobs:
18+
deploy:
19+
environment:
20+
name: github-pages
21+
url: ${{ steps.deployment.outputs.page_url }}
22+
runs-on: ubuntu-latest
23+
steps:
24+
- uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4
25+
- uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4
26+
with:
27+
node-version: 22
28+
cache: npm
29+
- run: npm ci
30+
- run: npm run typecheck
31+
- run: npm run test:run
32+
- run: npm run build:pages
33+
- run: npm run verify:deployment:pages
34+
- run: npm run check:release-dist
35+
- uses: actions/configure-pages@983d7736d9b0ae728b81ab479565c72886d7745b # v5
36+
- uses: actions/upload-pages-artifact@56afc609e74202658d3ffba0e8f6dda462b719fa # v3
37+
with:
38+
path: dist
39+
- id: deployment
40+
uses: actions/deploy-pages@d6db90164ac5ed86f2b6aed7e0febac5b3c0c03e # v4

.gitignore

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
.superpowers/
2+
.worktrees/
3+
.superpowers/
4+
node_modules/
5+
dist/
6+
.e2e-dist/
7+
playwright-report/
8+
test-results/
9+
*.tsbuildinfo

LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2026 ccofallen
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

README.md

Lines changed: 90 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,90 @@
1+
# Codex Pet Pause
2+
3+
[简体中文](README.zh-CN.md)
4+
5+
> A playful, local-first break reminder PWA hosted by a pet that lives in your computer.
6+
7+
![Codex Pet Pause dashboard](docs/assets/codex-pet-pause.png)
8+
9+
## Why Codex Pet Pause?
10+
11+
Codex Pet Pause makes gentle breaks feel less mechanical. A companion on your desktop helps you schedule small moments to look away, drink water, stand up, or take a fuller break—without an account, server, or cloud sync.
12+
13+
## Features
14+
15+
- Four preset reminders (look away, drink water, stand up and move, and take a full break), plus configurable custom reminders.
16+
- Reminder actions for doing an activity now, starting an optional action timer, completing it, postponing it, or skipping it.
17+
- An interactive built-in cat, Momo, that can be petted and accompanies your reminders.
18+
- Local Codex v1 and v2 pet import, alongside the built-in cat.
19+
- Local-only persistence for settings, reminders, pet data, and activity history; no account, backend, or telemetry is required.
20+
- Optional browser notifications and reminder sound, with useful in-page reminders when notifications are unavailable.
21+
- Offline PWA behavior after the app shell has been cached.
22+
- English and Simplified Chinese UI, plus light, dark, and system themes.
23+
- Keyboard navigation and considered focus management for interactive controls and dialogs.
24+
- Reduced-motion support and a setting to disable interface animations.
25+
26+
## Codex pet compatibility
27+
28+
Codex Pet Pause accepts compatible Codex pet v1 and v2 files. A compatible pet commonly contains `pet.json` and `spritesheet.webp`; select the matching pair from the same pet directory when importing. Pets are imported locally into this browser and are never uploaded by this application.
29+
30+
## Quick start
31+
32+
Requirements: Node.js 22.12.0 or later and npm.
33+
34+
For contributor setup:
35+
36+
```bash
37+
npm install
38+
npm run dev
39+
```
40+
41+
For a reproducible production build and local preview:
42+
43+
```bash
44+
npm ci
45+
npm run build
46+
npm run preview
47+
```
48+
49+
## Development
50+
51+
Run the available checks with:
52+
53+
```bash
54+
npm run typecheck
55+
npm run test:run
56+
npm run test:e2e
57+
npm run check
58+
```
59+
60+
Before the first end-to-end run, install Chromium for Playwright:
61+
62+
```bash
63+
npx playwright install chromium
64+
```
65+
66+
## Deployment
67+
68+
The project is a static Vite PWA. The public GitHub Pages target is [ccofallen.github.io/codex-pet-pause](https://ccofallen.github.io/codex-pet-pause/); use the root-path build for most other static hosts. Production notifications and PWA installation require HTTPS.
69+
70+
See the [English deployment guide](docs/DEPLOYMENT.md) for GitHub Pages, Vercel, Netlify, and generic static-server instructions.
71+
72+
## Privacy and browser limitations
73+
74+
- Codex Pet Pause is frontend-only. It has no account system, backend, cloud sync, or telemetry.
75+
- Settings, reminders, the built-in cat, locally imported pets, and activity history stay in this browser's local storage and IndexedDB. Activity history is retained for up to 90 days.
76+
- Browser storage or notification support can be unavailable; in that case the app provides the supported in-page experience and may use a temporary session whose settings do not survive refresh.
77+
- Background timing, system notifications, sound, and offline availability depend on browser capabilities, permissions, caching, and power-saving policies.
78+
- **Reminders stop when the page or browser is fully closed.**
79+
80+
## Contributing
81+
82+
Issues and pull requests are welcome. Please keep changes focused, cover behavior with the appropriate checks, and avoid adding private pets, local data, credentials, build output, or generated browser artifacts to the repository.
83+
84+
## Acknowledgements
85+
86+
The built-in cat reminder sound, “Exploring curious kittens meowing,” is attributed to [ElevenLabs](https://elevenlabs.io/zh/sound-effects/kittens-meowing). See the [public asset provenance](docs/ASSET-PROVENANCE.md) for its source, checksum, and usage caveat.
87+
88+
## License
89+
90+
Codex Pet Pause is released under the [MIT License](LICENSE).

README.zh-CN.md

Lines changed: 90 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,90 @@
1+
# Codex Pet Pause
2+
3+
[English](README.md)
4+
5+
> 一款由住在你电脑里的宠物陪伴、轻松有趣且本地优先的休息提醒 PWA。
6+
7+
![Codex Pet Pause 仪表盘](docs/assets/codex-pet-pause.png)
8+
9+
## 为什么选择 Codex Pet Pause?
10+
11+
Codex Pet Pause 让温和的休息不再机械。一位桌面伙伴会帮助你安排望向远处、喝水、起身活动或完整休息的小片刻;无需账号、服务器或云端同步。
12+
13+
## 功能
14+
15+
- 四种预设提醒(目视远方、喝水、起身活动、完整休息),以及可配置的自定义提醒。
16+
- 提醒行动:现在开始、启动可选的行动倒计时、完成、稍后提醒或跳过。
17+
- 可互动的内置猫咪 Momo:可以摸摸它,它会陪伴你的提醒。
18+
- 在内置猫咪之外,本地导入 Codex v1 和 v2 宠物。
19+
- 设置、提醒、宠物数据和活动历史仅保存在本地;无需账号、后端或遥测。
20+
- 可选浏览器通知和提醒音效;通知不可用时仍提供网页内提醒。
21+
- 应用外壳完成缓存后可离线作为 PWA 使用。
22+
- 英语和简体中文界面,以及日间、夜间和跟随系统主题。
23+
- 为交互控件和对话框提供键盘导航与细致的焦点管理。
24+
- 支持减少动态效果,并可关闭界面动画。
25+
26+
## Codex 宠物兼容性
27+
28+
Codex Pet Pause 支持兼容的 Codex 宠物 v1 和 v2 文件。兼容宠物通常包含 `pet.json``spritesheet.webp`;导入时请从同一宠物目录选择相匹配的一对文件。宠物仅导入到当前浏览器本地,本应用永远不会上传它们。
29+
30+
## 快速开始
31+
32+
环境要求:Node.js 22.12.0 或更高版本,以及 npm。
33+
34+
贡献者本地启动:
35+
36+
```bash
37+
npm install
38+
npm run dev
39+
```
40+
41+
可复现的生产构建和本地预览:
42+
43+
```bash
44+
npm ci
45+
npm run build
46+
npm run preview
47+
```
48+
49+
## 开发
50+
51+
可运行以下检查:
52+
53+
```bash
54+
npm run typecheck
55+
npm run test:run
56+
npm run test:e2e
57+
npm run check
58+
```
59+
60+
首次运行端到端测试前,请为 Playwright 安装 Chromium:
61+
62+
```bash
63+
npx playwright install chromium
64+
```
65+
66+
## 部署
67+
68+
本项目是静态 Vite PWA。公开的 GitHub Pages 地址为 [ccofallen.github.io/codex-pet-pause](https://ccofallen.github.io/codex-pet-pause/);多数其他静态托管服务应使用根路径构建。生产环境的通知和 PWA 安装需要 HTTPS。
69+
70+
请参阅[中文部署指南](docs/DEPLOYMENT.zh-CN.md),其中包含 GitHub Pages、Vercel、Netlify 和通用静态服务器的说明。
71+
72+
## 隐私与浏览器限制
73+
74+
- Codex Pet Pause 完全在前端运行,没有账号系统、后端、云同步或遥测。
75+
- 设置、提醒、内置猫咪、本地导入宠物和活动历史会保留在当前浏览器的本地存储与 IndexedDB 中。活动历史最多保留 90 天。
76+
- 浏览器存储或通知功能可能不可用;此时应用会提供受支持的网页内体验,并可能使用刷新后不会保留设置的临时会话。
77+
- 后台计时、系统通知、音效和离线可用性取决于浏览器能力、权限、缓存与节能策略。
78+
- **网页或浏览器完全关闭后,提醒会停止。**
79+
80+
## 贡献
81+
82+
欢迎提交 issue 和 pull request。请让改动保持聚焦,并为行为运行相应检查;不要将私有宠物、本机数据、凭据、构建产物或生成的浏览器文件加入仓库。
83+
84+
## 致谢
85+
86+
内置猫咪提醒音效“Exploring curious kittens meowing”归属 [ElevenLabs](https://elevenlabs.io/zh/sound-effects/kittens-meowing)。其来源、校验和与使用注意事项请参见[公开资源来源说明](docs/ASSET-PROVENANCE.md)
87+
88+
## 许可证
89+
90+
Codex Pet Pause 以 [MIT 许可证](LICENSE)发布。

docs/ASSET-PROVENANCE.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# Built-in cat sound provenance
2+
3+
## Source and attribution
4+
5+
The bundled reminder sound, **“Exploring curious kittens meowing,”** is from [ElevenLabs Sound Effects](https://elevenlabs.io/zh/sound-effects/kittens-meowing). Codex Pet Pause credits ElevenLabs for this sound effect in the application and in both project READMEs.
6+
7+
## Integrity
8+
9+
The approved release asset is `public/assets/cat/meow.wav`.
10+
11+
- Approved SHA-256: e69e2ae9983517b3b72b99060d8f71e8a9c8165732b0abf2da6c7da85b668143
12+
13+
The release check verifies that the shipped sound has this exact checksum.
14+
15+
## Usage note
16+
17+
This sound was obtained from ElevenLabs Sound Effects. Availability of a download does not by itself grant every use: anyone redistributing the sound or using it commercially must ensure that their use is permitted by their ElevenLabs account agreement and the applicable [ElevenLabs terms](https://elevenlabs.io/terms-of-use-eu). Keep the ElevenLabs attribution when required by those terms.

docs/DEPLOYMENT.md

Lines changed: 103 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,103 @@
1+
# Deploying Codex Pet Pause
2+
3+
[简体中文](DEPLOYMENT.zh-CN.md)
4+
5+
## Requirements
6+
7+
Use Node.js `>=22.12.0` and npm. Start from a clean checkout so the lockfile is respected:
8+
9+
```bash
10+
npm ci
11+
```
12+
13+
## Build once, host anywhere
14+
15+
For a normal site served from the domain root, create the production files with:
16+
17+
```bash
18+
npm run build
19+
```
20+
21+
Upload the contents of `dist/` to any static host. This is a static Vite PWA: no application server or database is required.
22+
23+
## GitHub Pages
24+
25+
This repository includes [the Pages deployment workflow](../.github/workflows/deploy-pages.yml). On every push to `main`, it installs dependencies, runs checks, builds the Pages variant, verifies it, and deploys `dist/`.
26+
27+
In the repository, open **Settings → Pages** and choose **GitHub Actions** as the source. After the workflow succeeds, the site is available at [https://ccofallen.github.io/codex-pet-pause/](https://ccofallen.github.io/codex-pet-pause/).
28+
29+
GitHub Pages hosts this project below `/codex-pet-pause/`, so its workflow runs:
30+
31+
```bash
32+
npm run build:pages
33+
```
34+
35+
That build sets the matching `/codex-pet-pause/` base. Do not upload a root-path build to that subpath.
36+
37+
## Vercel
38+
39+
Create a Vercel project from this repository. Use the following project settings:
40+
41+
- Build Command: `npm run build`
42+
- Output Directory: `dist`
43+
44+
This root-path build is appropriate when the project is served at the domain root. If you intentionally serve it under a Vercel subpath, follow the subpath guidance in [Nginx and other static servers](#nginx-and-other-static-servers) instead.
45+
46+
## Netlify
47+
48+
Create a Netlify site from this repository. Set:
49+
50+
- Build command: `npm run build`
51+
- Publish directory: `dist`
52+
53+
For a root deployment, Netlify can publish the generated files directly. A subpath deployment needs both a matching build base and host-side fallback, as described below.
54+
55+
## Nginx and other static servers
56+
57+
For a root deployment, copy the contents of `dist/` to the server's static directory and configure the single-page-app fallback:
58+
59+
```nginx
60+
location / {
61+
try_files $uri $uri/ /index.html;
62+
}
63+
```
64+
65+
The block above is for a root deployment only. To host at a custom subpath such as `/breaks/`, build with a matching `VITE_BASE_PATH` through a Vite mode or equivalent configuration, then serve the same prefix with a matching Nginx `location` and fallback. For example, place `VITE_BASE_PATH=/breaks/` in the environment file used by the chosen Vite mode, rebuild, and make the fallback resolve to that subpath's `index.html`. A root build with a subpath fallback—or a subpath build served at the root—will request the wrong asset and navigation paths.
66+
67+
Other static servers need the same two pieces: publish the files from `dist/`, and rewrite client-side routes to the `index.html` for the exact prefix being served.
68+
69+
## Windows, Linux, and macOS notes
70+
71+
The npm commands in this guide work in PowerShell, Command Prompt, macOS Terminal, and Linux shells:
72+
73+
```bash
74+
npm ci
75+
npm run build
76+
```
77+
78+
Prefer a Vite mode or an environment file for `VITE_BASE_PATH` so the configuration is portable; inline environment-variable syntax differs between Windows and POSIX shells. Use forward slashes in the base path, for example `/breaks/`.
79+
80+
## Updating an existing deployment
81+
82+
Pull the intended revision, reinstall dependencies, rebuild, and replace the previously published `dist/` files:
83+
84+
```bash
85+
npm ci
86+
npm run build
87+
```
88+
89+
For GitHub Pages, push the revision to `main` and let the included workflow rebuild and deploy it. Keep the same build base as the published URL; use `npm run build:pages` only for the `/codex-pet-pause/` Pages target.
90+
91+
## HTTPS, notifications, and PWA behavior
92+
93+
Production deployments must use HTTPS. Browsers require a secure context for reliable notifications, service workers, and PWA installation; `localhost` is the local-development exception. Users must also grant notification permission, and browser or operating-system power-saving policies can delay background work.
94+
95+
Reminders run only while the app remains open in a browser context. Closing the tab or browser stops reminders; the PWA does not keep a background reminder process running after the browser has closed.
96+
97+
## Troubleshooting
98+
99+
- **Assets or pages return 404 under a subpath:** rebuild with a `VITE_BASE_PATH` that exactly matches the served prefix and configure that prefix's static location and SPA fallback.
100+
- **Direct navigation returns a server 404:** add the root `try_files` fallback above, or its equivalent for the deployed subpath.
101+
- **Notifications do not appear:** confirm HTTPS, grant permission in the browser, and check system notification and focus settings.
102+
- **An older version remains visible:** refresh after the deployment has finished and clear the site's cached data or unregister its service worker if necessary.
103+
- **The Pages URL is wrong:** confirm Settings → Pages uses GitHub Actions and that the Pages workflow built with `/codex-pet-pause/`.

0 commit comments

Comments
 (0)