Skip to content
Merged
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
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@
| 提供笔记功能 | ✅ 已完成 | 题目列表中新增笔记按钮,支持导出所有笔记为Markdown |
| 收集Anki fsrs 训练数据 | ✅ 已完成 | 待用于测试fsrs官方端口训练 |
| 接入Anki fsrs官方训练端口 | ✅ 已完成 | 目前仅支持本地复习记录训练(云同步用户可能存在影响) |
| 扩展webdev云同步服务 | ❌ 待完成 | 待接入坚果云 |
| 扩展webdav云同步服务 | ❌ 待完成 | 待接入坚果云 |
| 支持语言切换 | ❌ 待完成 | 待完成 |
| 不同网站题目数据源切换 | ❌ 待完成 | 待完成(目前仅支持力扣国际站和中国站,待兼容洛谷等) |
| 兼容火狐 | ❌ 待完成 | 待完成 |
Expand All @@ -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 |
Expand Down
55 changes: 30 additions & 25 deletions popup.html
Original file line number Diff line number Diff line change
Expand Up @@ -164,28 +164,28 @@ <h3>Add Review Card</h3>
<!-- footer -->
<div class="footer">
<!-- GitHub Star -->
<!-- 先放一个占位符 -->
<div id="github-star-container"
data-bs-toggle="tooltip"
data-bs-placement="top"
title="A star from you would make our day! 🌟">
<a href="https://github.com/xiaohajiayou/Leetcode-Mastery-Scheduler"
<a href="https://github.com/xiaohajiayou/Leetcode-Mastery-Scheduler"
target="_blank"
style="text-decoration: none; display: inline-block; margin-right: 15px;">
<img alt="GitHub"
src="https://img.shields.io/badge/GitHub-%20Star%20Us-color%3D%2523%234a9d9c?style=flat&color=%234a9d9c
"
height="20"
style="margin: 0; vertical-align: middle;">
</a>
</div>
style="text-decoration: none;"
data-bs-toggle="tooltip"
data-bs-placement="top"
title="🌟 Star us please! / 点个星星吧!求求了~"
>
<button type="button" class="btn custom-btn github-star-btn">
<div class="btn-content">
<i class="fas fa-star"></i>
<span>Star Us</span>
</div>
</button>
</a>

<!-- 将 GitHub iframe 加载逻辑放在单独的脚本文件中 -->

<!-- 反馈按钮 -->
<a href="https://github.com/xiaohajiayou/Leetcode-Mastery-Scheduler/issues"
target="_blank"
style="text-decoration: none;"
data-bs-toggle="tooltip"
data-bs-placement="top"
title="💡 Report issue"
>
<button type="button" class="btn custom-btn feedback-btn-review">
<div class="btn-content">
Expand Down Expand Up @@ -402,15 +402,21 @@ <h3>Add Review Card</h3>
<div id="github-problems"
data-bs-toggle="tooltip"
data-bs-placement="top"
title="A star from you would make our day! 🌟">
>

<a href="https://github.com/xiaohajiayou/Leetcode-Mastery-Scheduler"
target="_blank"
style="text-decoration: none; display: inline-block; margin-right: 15px;">
<img alt="GitHub"
src="https://img.shields.io/badge/GitHub-%20Star%20Us-color%3D%2523%234a9d9c?style=flat&color=%234a9d9c
"
height="20"
style="margin: 0; vertical-align: middle;">
style="text-decoration: none;"
data-bs-toggle="tooltip"
data-bs-placement="top"
title="🌟 Star us please! / 点个星星吧!求求了~"
>
<button type="button" class="btn custom-btn github-star-btn">
<div class="btn-content">
<i class="fas fa-star"></i>
<span>Star Us</span>
</div>
</button>
</a>
</div>

Expand Down Expand Up @@ -607,7 +613,6 @@ <h5 class="problem-title mb-2">
<script type="text/javascript" src="lib/fontawesome.js"></script>
<script src="dist/popup.js"></script>

<!-- 直接引用外部脚本文件 -->
<script src="dist/loadGithubStar.js"></script>

</body>
</html>
5 changes: 4 additions & 1 deletion src/popup/delegate/fsrsDelegate.js
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down
46 changes: 42 additions & 4 deletions src/popup/popup.css
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down