Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions plugins/exchange-rates/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
node_modules
dist
14 changes: 14 additions & 0 deletions plugins/exchange-rates/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# Changelog

## 1.0.0 - 2026-11-11

### Added

- 以單一基準貨幣換算比較清單中的多種貨幣。金額在確認後於本機計算。
- 匯率來自 Frankfurter v2 的日更參考價,以歐元為樞紐,一次取回全表。
- 趨勢層顯示較上一個觀測日的漲跌,以及近 30 個觀測日的折線。
- 介面依系統語言使用繁體中文或英文。
- 國旗使用隨插件附帶的 SVG,執行時不向旗幟網站請求圖片。
- 插件圖示使用 SVG Repo 上標為 CC0 的歐元換匯圖。
- 比較列可由序號到符號長按拖曳排序。
- 序號到符號五欄等寬,折算金額占用剩餘寬度。
21 changes: 21 additions & 0 deletions plugins/exchange-rates/LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2026 Kazma

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
42 changes: 42 additions & 0 deletions plugins/exchange-rates/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
# 匯率換算

ZTools 插件。識別碼 `exchange-rates`,顯示名稱「匯率換算」,作者 Kazma258。

在搜尋框輸入「匯率」「貨幣」「錢」或 `money` 即可打開。選定一筆基準金額後,比較清單裡的貨幣會一起換算。

## 功能

- 基準列與比較列的金額都可以修改。在比較列確認一筆金額時,該貨幣成為新的基準,並仍留在比較列。
- 小數位數從 0 到 11。趨勢層的匯率固定顯示 6 位小數。
- 匯率資料為 Frankfurter v2 的日更中間價。更新時間顯示資料裡的觀測日。
- 深色模式第一次跟隨 ZTools 主題,手動切換後記住選擇。
- 已廢棄貨幣的勾選只影響選擇清單,不移除已經加入的列。

## 開發

需要 Node.js 20 或更新版本。

```bash
npm install
npm run dev
npm run check
npm run build
```

`npm run dev` 會在 `http://localhost:5173` 提供介面。ZTools 開發模式讀取根目錄 `plugin.json` 的 `development.main`。

`npm run build` 的成品在 `dist/`。根目錄 `plugin.json` 的 `main` 指向 `dist/index.html`,插件中心的打包腳本會把這個目錄打成發布包。`dist/plugin.json` 裡的入口則是 `index.html`、`preload.js` 和 `logo.png`。

## 授權

MIT。見 [LICENSE](LICENSE)。

## 發布前仍待補充

這些項目需要你本人完成,這次沒有代做:

- 在本機 ZTools 客戶端載入並走一次主要功能。
- 準備截圖或 GIF,放到發布說明。
- 安裝 `@ztools-center/plugin-cli` 後,在乾淨的工作區執行 `ztools publish`。
- 到 Pull Request 勾選自檢清單,並把 Draft 改成 Ready for review。
- 若要替換現在的純色 `logo.png`,換成你的圖檔即可。
12 changes: 12 additions & 0 deletions plugins/exchange-rates/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<!doctype html>
<html lang="zh-Hant">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>匯率換算</title>
</head>
<body>
<div id="app"></div>
<script type="module" src="/src/main.ts"></script>
</body>
</html>
Loading