From b505b252f164f2bd588c4abb67ffb627ec3717ad Mon Sep 17 00:00:00 2001 From: Haco <75477391+xiaohajiayou@users.noreply.github.com> Date: Mon, 14 Apr 2025 01:30:04 +0800 Subject: [PATCH 1/2] Fix/avoid using a hard-code timezone &&Refactor: modify github star button style(#38) * Fix/avoid using a hard-code timezone (#36) * Release: v0.1.4 * Fix/avoid using a hard-code timezone --------- Co-authored-by: Haco <75477391+xiaohajiayou@users.noreply.github.com> Co-authored-by: xiaohajiayou <923390377@qq.com> * Refactor: modify github star button style * Fix/avoid using a hard-code timezone (#36) * Release: v0.1.4 * Fix/avoid using a hard-code timezone --------- Co-authored-by: Haco <75477391+xiaohajiayou@users.noreply.github.com> Co-authored-by: xiaohajiayou <923390377@qq.com> * Refactor: modify github star button style --------- Co-authored-by: ishiko --- README.md | 4 +-- popup.html | 55 ++++++++++++++++-------------- src/popup/delegate/fsrsDelegate.js | 5 ++- src/popup/popup.css | 46 ++++++++++++++++++++++--- 4 files changed, 78 insertions(+), 32 deletions(-) diff --git a/README.md b/README.md index e6b1650..f9a2046 100644 --- a/README.md +++ b/README.md @@ -84,7 +84,7 @@ | 提供笔记功能 | ✅ 已完成 | 题目列表中新增笔记按钮,支持导出所有笔记为Markdown | | 收集Anki fsrs 训练数据 | ✅ 已完成 | 待用于测试fsrs官方端口训练 | | 接入Anki fsrs官方训练端口 | ✅ 已完成 | 目前仅支持本地复习记录训练(云同步用户可能存在影响) | -| 扩展webdev云同步服务 | ❌ 待完成 | 待接入坚果云 | +| 扩展webdav云同步服务 | ❌ 待完成 | 待接入坚果云 | | 支持语言切换 | ❌ 待完成 | 待完成 | | 不同网站题目数据源切换 | ❌ 待完成 | 待完成(目前仅支持力扣国际站和中国站,待兼容洛谷等) | | 兼容火狐 | ❌ 待完成 | 待完成 | @@ -101,7 +101,7 @@ | Provide note-taking feature | ✳️ Completed | Add note button in problem list, support exporting all notes to Markdown | | Collect Anki FSRS training data | ✳️ Completed | To be used for testing FSRS official training endpoint | | Integrate Anki FSRS official training endpoint | ✳️ Completed | Currently supports training with local review records (may affect cloud sync users) | -| Expand webdev cloud sync service | ❌ Pending | To be integrated with Nutstore | +| Expand webdav cloud sync service | ❌ Pending | To be integrated with Nutstore | | Support language switching | ❌ Pending | Pending completion | | Switch data sources for different websites | ❌ Pending | Pending completion (currently only supports LeetCode international and Chinese sites, to be compatible with Luogu, etc.) | | Compatibility with Firefox | ❌ Pending | Pending completion | diff --git a/popup.html b/popup.html index f042dc0..586772a 100644 --- a/popup.html +++ b/popup.html @@ -164,28 +164,28 @@

Add Review Card

@@ -607,7 +613,6 @@
- - + \ No newline at end of file diff --git a/src/popup/delegate/fsrsDelegate.js b/src/popup/delegate/fsrsDelegate.js index e120b3b..b2d26a2 100644 --- a/src/popup/delegate/fsrsDelegate.js +++ b/src/popup/delegate/fsrsDelegate.js @@ -3,11 +3,14 @@ export const optimizeFSRSParams = async (csvContent, onProgress) => { try { const formData = new FormData(); const csvBlob = new Blob([csvContent], { type: 'text/csv' }); + // ref: https://github.com/ishiko732/fsrs-online-training/blob/73b3281e4c972bf965083dcfe61f087383b4a083/components/lib/tz.ts#L3-L4 + // Chrome > 24, Edge > 12, Firefox > 29 + const timeZone = Intl.DateTimeFormat().resolvedOptions().timeZone formData.append('file', csvBlob, 'revlog.csv'); formData.append('sse', '1'); formData.append('hour_offset', '4'); formData.append('enable_short_term', '0'); - formData.append('timezone', 'Asia/Shanghai'); + formData.append('timezone', timeZone); const response = await fetch('https://ishiko732-fsrs-online-training.hf.space/api/train', { method: 'POST', diff --git a/src/popup/popup.css b/src/popup/popup.css index bfb54d3..3e9011e 100644 --- a/src/popup/popup.css +++ b/src/popup/popup.css @@ -757,15 +757,53 @@ iframe { #github-star-container { display: flex; - align-items: center; /* 垂直居中对齐 */ - height: 30px; /* 固定高度,与按钮一致 */ + align-items: center; + height: 30px; } -/* 确保 GitHub Star 按钮的样式 */ +/* GitHub Star 按钮样式 */ .github-star-btn { + font-size: 0.875rem; + font-family: 'Courier Prime', monospace; + background: #1d2e3d; + border: 1px solid rgba(97, 218, 251, 0.3); + color: #61dafb; + border-radius: 6px; + display: flex; + align-items: center; + gap: 0.6rem; + transition: all 0.3s ease; + position: relative; + overflow: hidden; + padding: 0.35rem 0.8rem; +} + +.github-star-btn:hover { + background: #1a3244; + border-color: #61dafb; + box-shadow: 0 0 10px rgba(97, 218, 251, 0.5); + color: #61dafb; +} + +.github-star-btn .btn-content { display: flex; align-items: center; - height: 100%; /* 使其填满容器高度 */ + gap: 0.6rem; + transition: all 0.3s ease; +} + +.github-star-btn:hover .btn-content { + transform: translateX(2px); +} + +.github-star-btn i { + font-size: 0.875rem; + color: #61dafb; + transition: all 0.3s ease; +} + +.github-star-btn:hover i { + color: #61dafb; } .feedback-btn-review { From 9fec6da168c62e6b195b10c09cef1618b2fb91b2 Mon Sep 17 00:00:00 2001 From: xiaohajiayou <923390377@qq.com> Date: Mon, 14 Apr 2025 01:37:34 +0800 Subject: [PATCH 2/2] Release: v0.1.5 --- changelog.md | 20 ++++++++++++------ manifest.base.json | 2 +- package-lock.json | 2 +- package.json | 2 +- popup.html | 2 +- src/popup/popup.css | 51 +++++++++++++++++++++++++++++++-------------- 6 files changed, 53 insertions(+), 26 deletions(-) diff --git a/changelog.md b/changelog.md index 0e15123..ebb8e2a 100644 --- a/changelog.md +++ b/changelog.md @@ -1,18 +1,26 @@ # Changelog +### [0.1.5] - 2025-04-14 +---------------------- + +#### Fixed + +- Fix the issue where the timezone was fixed in the FSRS parameter optimization commit (#38) +- 修复fsrs参数优化提交中固定了时区的问题。(#38) -## [0.1.4] - 2025-04-08 +### [0.1.4] - 2025-04-08 ---------------------- -### Added +#### Added -* 新增本地 FSRS 算法参数优化,用户可以拟合最适合自己的记忆曲线。(#15) - +- Add local FSRS algorithm parameter optimization, allowing users to fit the memory curve that best suits them (#15) +- 新增本地 FSRS 算法参数优化,用户可以拟合最适合自己的记忆曲线。(#15) -### Fixed +#### Fixed -* 修复了在页面缩放时,rate 按钮消失的问题。(#32) +- Fix the issue where the rate button disappeared when the page was zoomed (#32) +- 修复了在页面缩放时,rate 按钮消失的问题。(#32) diff --git a/manifest.base.json b/manifest.base.json index 38f881b..8b848e9 100644 --- a/manifest.base.json +++ b/manifest.base.json @@ -1,7 +1,7 @@ { "manifest_version": 3, "name": "Leetcode Mastery Scheduler", - "version": "0.1.4", + "version": "0.1.5", "author": "Hacode", "description": "Leetcode-Mastery-Scheduler tracks your LeetCode progress and prompt you to review based FSRS", "homepage_url": "https://github.com/xiaohajiayou/Leetcode-Mastery-Scheduler", diff --git a/package-lock.json b/package-lock.json index 3913eae..4551fd1 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "Leetcode-Mastery-Scheduler", - "version": "0.1.4", + "version": "0.1.5", "lockfileVersion": 2, "requires": true, "packages": { diff --git a/package.json b/package.json index da24320..e0f9b80 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "Leetcode-Mastery-Scheduler", - "version": "0.1.4", + "version": "0.1.5", "description": "

\r \r
\r Practice Makes Code Accepted\r
\r

", "main": "src/popup.js", "directories": { diff --git a/popup.html b/popup.html index 586772a..20fda3b 100644 --- a/popup.html +++ b/popup.html @@ -361,7 +361,7 @@

Add Review Card

- View full changelog now(V0.1.4) + View full changelog now(V0.1.5)
diff --git a/src/popup/popup.css b/src/popup/popup.css index 3e9011e..527be61 100644 --- a/src/popup/popup.css +++ b/src/popup/popup.css @@ -299,7 +299,6 @@ display: inline-block; /* 确保渐变效果生效 */ .retrievability-icon { margin-right: 10px; color: #4a9d9c; - animation: pulse 2s infinite; } .retrievability-value { @@ -776,34 +775,54 @@ iframe { position: relative; overflow: hidden; padding: 0.35rem 0.8rem; + animation: starPulse 2s infinite; } -.github-star-btn:hover { - background: #1a3244; - border-color: #61dafb; - box-shadow: 0 0 10px rgba(97, 218, 251, 0.5); - color: #61dafb; +@keyframes starPulse { + 0% { + box-shadow: 0 0 0 0 rgba(97, 218, 251, 0.4); + } + 70% { + box-shadow: 0 0 0 10px rgba(97, 218, 251, 0); + } + 100% { + box-shadow: 0 0 0 0 rgba(97, 218, 251, 0); + } } -.github-star-btn .btn-content { - display: flex; - align-items: center; - gap: 0.6rem; +.github-star-btn i { + font-size: 0.875rem; + color: #61dafb; transition: all 0.3s ease; + animation: starTwinkle 2s infinite; } -.github-star-btn:hover .btn-content { - transform: translateX(2px); +@keyframes starTwinkle { + 0% { + transform: scale(1); + opacity: 1; + } + 50% { + transform: scale(1.2); + opacity: 0.8; + } + 100% { + transform: scale(1); + opacity: 1; + } } -.github-star-btn i { - font-size: 0.875rem; +.github-star-btn:hover { + background: #1a3244; + border-color: #61dafb; + box-shadow: 0 0 15px rgba(97, 218, 251, 0.7); color: #61dafb; - transition: all 0.3s ease; + animation: none; /* 悬停时停止脉冲动画 */ } .github-star-btn:hover i { - color: #61dafb; + animation: none; /* 悬停时停止星星闪烁动画 */ + transform: scale(1.2); } .feedback-btn-review {