|
| 1 | +# A/时差保安 (Timezone Guard) |
| 2 | + |
| 3 | +[English](README.md) | [简体中文](README.zh-CN.md) |
| 4 | + |
| 5 | +One clock, one verdict: is it a reasonable time to message someone in another time zone? The verdict |
| 6 | +follows the **other** city's local time, because what matters is whether *they* are awake. |
| 7 | + |
| 8 | +Author: [FineCat](https://github.com/LiuChen19960902) · Version: `1.0.1` |
| 9 | + |
| 10 | + |
| 11 | + |
| 12 | +*The page itself is in Chinese. This screenshot is the light theme, taken while Los Angeles was at |
| 13 | +20:23 (the evening band); the dark theme is below.* |
| 14 | + |
| 15 | + |
| 16 | + |
| 17 | +## What it answers |
| 18 | + |
| 19 | +**Whether to speak up right now.** |
| 20 | + |
| 21 | +The verdict reads the **target city's local time**, not yours — it is their convenience that |
| 22 | +matters. Your own city is shown for reference only. The thresholds are the same for every city, |
| 23 | +regardless of hemisphere or local habits. |
| 24 | + |
| 25 | +| Target local time | Band | Verdict | |
| 26 | +| --- | --- | --- | |
| 27 | +| 09:00–18:00 | Day (green) | Now is fine | |
| 28 | +| 18:00–22:00 | Evening (yellow) | Keep it short | |
| 29 | +| 06:00–09:00 | Early morning (yellow) | Don't go deep | |
| 30 | +| 22:00–06:00 | Night (red) | Go to sleep, don't send | |
| 31 | + |
| 32 | +## What is on the page |
| 33 | + |
| 34 | +- **One verdict** — a 24 px status-coloured headline, the single subject of the page. Colour is |
| 35 | + never the only carrier of meaning; text and shape carry it too. |
| 36 | +- **Two clocks** — the target city on top, your own below, each with its date and short time zone |
| 37 | + name (PDT, GMT+8, and so on). 12-hour and 24-hour formats are both available. |
| 38 | +- **A 24-cell strip** — one cell per hour of the target city's day, drawn as a sun, a half sun on |
| 39 | + the horizon, or a moon. The current hour is filled with the verdict colour, and the four |
| 40 | + thresholds land exactly on cell boundaries. |
| 41 | +- **A one-line tip** — under the verdict, one line reads "their band + time range + one sentence |
| 42 | + of advice", and below it an optional time-difference note appears when your own side is the |
| 43 | + later one. No message templates, no copy button, and nothing is pushed into a chat box. |
| 44 | +- **Every time zone** — all 418 time zones the runtime knows about are covered, and in the tables |
| 45 | + shipped with this package each one has a Chinese name (the count follows the runtime's own time |
| 46 | + zone database; a zone the runtime adds later and the shipped tables do not know yet falls back |
| 47 | + to its English name). Country-level entries such as "China (default)" are there too. Either |
| 48 | + city can be changed on its own, and the ⇄ in the title swaps the two in one click. |
| 49 | + |
| 50 | +Times and offsets are computed locally with the browser's `Intl` and the runtime's own time zone |
| 51 | +database, so daylight saving time is handled for you. **No network, no account, no push, not a |
| 52 | +calendar.** |
| 53 | + |
| 54 | +## Install |
| 55 | + |
| 56 | +Copy the whole directory, **including the hidden `.minimax-plugin` directory**, into the MiniMax |
| 57 | +Code plugins directory: |
| 58 | + |
| 59 | +| System | Target path | |
| 60 | +| --- | --- | |
| 61 | +| Windows | `C:\Users\<you>\.minimax\plugins\timezone-guard` | |
| 62 | +| macOS | `/Users/<you>/.minimax/plugins/timezone-guard` | |
| 63 | +| Linux | `/home/<you>/.minimax/plugins/timezone-guard` | |
| 64 | + |
| 65 | +`.minimax` is a hidden directory: on Windows enable "Hidden items" in File Explorer, on macOS press |
| 66 | +`Cmd + Shift + .`. If your client uses a custom data directory, put the package in that |
| 67 | +directory's `plugins/` folder instead. |
| 68 | + |
| 69 | +Then restart MiniMax Code, confirm the plugin is recognised and enabled, and ask the Agent to open |
| 70 | +"A/时差保安" — or say "打开A/时差保安,看看洛杉矶现在该不该开口". |
| 71 | + |
| 72 | +To update, close the app and exit MiniMax Code first, then replace the whole plugin directory. |
| 73 | + |
| 74 | +## Tested environment |
| 75 | + |
| 76 | +MiniMax Code desktop **3.1.4** on Windows 11 Home (10.0.26300, x64). This package was developed |
| 77 | +and tested against 3.1.4. |
| 78 | + |
| 79 | +Requires MiniMax Code **3.1.2** or later: the package declares `surface.window` (the size of the |
| 80 | +popped-out window), so older clients cannot install it at all. |
| 81 | + |
| 82 | +Checked inside the client: install and open; the verdict switches correctly across its four time |
| 83 | +bands (day, early morning, evening, night); either city can be changed on its own, and the ⇄ in |
| 84 | +the title swaps the pair with one click (checked with a mouse click and with Enter / Space — both |
| 85 | +clocks, the time difference, the hour strip, the verdict and the two city inputs all follow the |
| 86 | +swap and persist); the city list |
| 87 | +covers every time zone the runtime knows about (418 on the tested runtime), each with a Chinese |
| 88 | +name and no dead entry; the 12/24-hour toggle persists; both the light and the dark theme render |
| 89 | +correctly; the page renders at the panel's default width. |
| 90 | + |
| 91 | +Layout was additionally measured against this package's own client files in Chromium 155 at 400 / |
| 92 | +460 / 560 / 680 / 1100 / 1440 CSS pixels wide: no horizontal overflow, no double scrollbar, no |
| 93 | +stray whitespace under the card. |
| 94 | + |
| 95 | +**Not verified:** macOS and Linux; popping the page out into its own window (`surface.window`) was |
| 96 | +never exercised — the page is a single responsive column either way. |
| 97 | + |
| 98 | +## Data & access |
| 99 | + |
| 100 | +- **Files read** — only the four static files inside its own package directory: |
| 101 | + `miniapp/client/index.html`, `styles.css`, `cities.js`, `app.js`. Nothing outside the package is |
| 102 | + read, and the disk is never scanned. |
| 103 | +- **Files written** — none. `context.dataDir` is not used and nothing is written anywhere. |
| 104 | +- **Browser storage** — interface preferences only, under the key `timezone-guard.prefs.v1`: the |
| 105 | + selected pair of cities, the theme, and the 12/24-hour format. No session and no content data. |
| 106 | +- **Network** — none. The page loads its assets from the plugin's own loopback server; there is no |
| 107 | + telemetry, and no remote font, icon, or script. |
| 108 | +- **Processes** — none spawned. |
| 109 | +- **Agent turns** — none. The package declares no `agentAccess` and starts no Agent turn. |
| 110 | +- **Credentials** — no API key, no account, no configuration of any kind. |
| 111 | + |
| 112 | +## Files |
| 113 | + |
| 114 | +```text |
| 115 | +.minimax-plugin/plugin.json Plugin manifest |
| 116 | +package.json Mini App declaration |
| 117 | +miniapp/miniapp.json Payload roots, Node entry, page route |
| 118 | +miniapp/client/index.html The page served at /dashboard, including the SVG sprite |
| 119 | +miniapp/client/styles.css Visual layer |
| 120 | +miniapp/client/app.js Time zone logic, verdict, city picker, 24-hour strip |
| 121 | +miniapp/client/cities.js City list and Chinese names for every time zone |
| 122 | +miniapp/node/server.mjs Node entry: start(context) → { dispose } |
| 123 | +miniapp/node/miniapp-api.ts Type declarations for the runtime context |
| 124 | +docs/preview.png Screenshot of the page, light theme |
| 125 | +docs/preview-dark.png Screenshot of the page, dark theme |
| 126 | +icon.png Plugin icon |
| 127 | +``` |
| 128 | + |
| 129 | +The page is plain HTML, CSS, and JavaScript — no framework, no CDN, no build step, fully offline. |
| 130 | +The Node entry only serves `/dashboard` and those four files on the port the Host assigns. There |
| 131 | +are **no third-party runtime dependencies**: the Node side uses built-in modules only, and the |
| 132 | +browser side uses native APIs only. |
| 133 | + |
| 134 | +## License |
| 135 | + |
| 136 | +[MIT](./LICENSE). |
0 commit comments