-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathpopup.html
613 lines (540 loc) · 32.4 KB
/
popup.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
<!DOCTYPE html>
<html>
<head>
<title>Leetcode-Mastery-Scheduler Daily Review</title>
<meta charset="utf-8">
<link href="lib/bootstrap.min.css" rel="stylesheet">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0-beta3/css/all.min.css">
<!-- 添加这一行来链接popup.css -->
<link rel="stylesheet" href="./src/popup/popup.css">
</head>
<body style="width: 300px; height: 500px; overflow-y: auto;">
<div class="low-memory-warning" id="lowMemoryWarning"></div>
<!-- 添加导航栏 -->
<div class="nav-bar">
<div class="nav-row title-row">
<span class="nav-title">Mastery</span>
</div>
<div class="nav-row title-row">
<span class="nav-title">Scheduler</span>
</div>
<div class="nav-row">
<!-- site switcher -->
<div id="switch-area">
<div class="form-check form-switch text-center justify-content-center my-3"
style=" text-align: center; display: flex;">
<input class="form-check-input custom-switch" type="checkbox" role="switch" id="switchButton">
<label class="form-check-label nav-site" for="flexSwitchCheckDefault" id="siteLabel"></label>
</div>
</div>
</div>
<div class="nav-row">
<button type="button" class="nav-btn active" data-view="reviewView">Review</button>
<button type="button" class="nav-btn" data-view="problemListView">Problems</button>
<button type="button" class="nav-btn" data-view="moreView">Settings</button>
</div>
</div>
<div class="container py-3" style="position: relative;">
<div id="reviewView" class="view active">
<!-- Header Section -->
<div class="header-section text-center">
<!-- <div style="background-image: url('image.png'); background-size: cover; background-position: center; filter: blur(1px); position: absolute; top: 0; left: 0; right: 0; bottom: 0; z-index: -1;"></div> -->
<p class="text-date">
<span id="currentDate"></span>
</p>
<!-- Progress Circle -->
<div class="completion-circle my-3">
<div class="inner-circle">
<span id="completionRate">0%</span>
</div>
</div>
<p class="mt-2">
<span id="completedCount">0</span> / <span id="totalCount">0</span> problems reviewed
</p>
<!-- Retrievability Average -->
<p class="retrievability">
<i class="fas fa-lightbulb retrievability-icon"></i>
Memory Quality: <span id="retrievabilityAverage" class="retrievability-value">0.00</span>
<i id="trendIcon" class="trend-icon"></i>
</p>
</div>
<!-- Card Limit Input -->
<div class="card-limit-input">
<span class="card-limit-label"> Today:</span>
<button class="gear-button left" data-tooltip="Decrease">
<i class="fas fa-gear"></i>
<i class="fas fa-minus direction-icon"></i>
</button>
<input type="number" id="cardLimit" min="1" max="20" readonly>
<span class="total-problems">/ 1</span>
<button class="gear-button right" data-tooltip="Increase">
<i class="fas fa-gear"></i>
<i class="fas fa-plus direction-icon"></i>
</button>
</div>
<!-- Review List Container -->
<div style="
display: flex;
flex-direction: column;">
<!-- Review List -->
<div id="reviewList" style="flex: 1;">
<!-- Review cards will be dynamically inserted here -->
</div>
<!-- 添加一个专门的容器来居中按钮 -->
<div class="add-problem-wrapper">
<button class="gear-button add-problem"
data-tooltip="Add New Problem from url"
data-bs-toggle="tooltip"
data-bs-placement="top"> <!-- 使用 top 位置 -->
<div class="add-problem-content">
<i class="fas fa-plus"></i>
</div>
</button>
</div>
<!-- 添加新建题目的弹窗 -->
<div id="addProblemDialog" class="modal" style="display: none;">
<div class="modal-content">
<h3>Add Review Card</h3>
<!-- 选项卡切换 -->
<div class="tab-container">
<div class="tab-buttons">
<button id="urlTabButton" class="tab-button active">LeetCode Card</button>
<button id="manualTabButton" class="tab-button">Blank card</button>
</div>
</div>
<!-- URL 输入表单 -->
<div id="urlTab" class="tab-content active">
<div class="form-group">
<label for="problemUrl">Leetcode URL:</label>
<input type="text" id="problemUrl" class="form-control"
placeholder="https://leetcode.com/problems/..." />
</div>
</div>
<!-- 手动输入表单 -->
<div id="manualTab" class="tab-content">
<div class="form-group">
<label for="problemName">Problem Name:</label>
<input type="text" id="problemName" class="form-control"
placeholder="例如: Two Sum" />
</div>
<div class="form-group">
<label for="problemLevel">Level:</label>
<select id="problemLevel" class="form-control">
<option value="Easy">Easy</option>
<option value="Medium">Medium</option>
<option value="Hard">Hard</option>
</select>
</div>
<div class="form-group">
<label for="customUrl">Custom URL (Optional):</label>
<input type="text" id="customUrl" class="form-control"
placeholder="https://..." />
</div>
</div>
<div class="button-group">
<button id="confirmAdd" class="btn btn-outline-warning custom-btn">Add</button>
<button id="cancelAdd" class="btn btn-outline-secondary custom-btn">Cancel</button>
</div>
</div>
</div>
<!-- 添加一个占位div,确保内容不会被footer遮挡 -->
<div style="height: 25px;"></div>
<!-- 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"
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>
<!-- 将 GitHub iframe 加载逻辑放在单独的脚本文件中 -->
<!-- 反馈按钮 -->
<a href="https://github.com/xiaohajiayou/Leetcode-Mastery-Scheduler/issues"
target="_blank"
style="text-decoration: none;"
>
<button type="button" class="btn custom-btn feedback-btn-review">
<div class="btn-content">
<i class="fas fa-comment-dots"></i>
<span>Issues</span>
</div>
</button>
</a>
</div>
</div>
</div>
<!-- 题目列表页面 -->
<div id="problemListView" class="view" style="display: none;">
<div class="container-sm m-0">
<!-- doc -->
<div class="multifont my-0 py-0 by-0" style="text-align: center;">
<small>🔗 <a target="_blank" href="https://github.com/xiaohajiayou/Leetcode-Mastery-Scheduler">Get Started</a> / <a
target="_blank" href="https://github.com/xiaohajiayou/Leetcode-Mastery-Scheduler">用法</a></small>
</div>
<!-- navbar -->
<ul class="nav nav-tabs text-center justify-content-center" id="myTab" role="tablist"
style="font-size: smaller; font-family: 'PT Mono', monospace; position: relative; z-index: 100;">
<!-- <li class="nav-item" role="presentation">
<button class="nav-link active" id="need-review-tab" data-bs-toggle="tab"
data-bs-target="#need-review-pane" type="button" role="tab" aria-controls="need-review-pane"
aria-selected="true" style="color: rgb(248, 246, 246);">Due</button>
</li> -->
<!-- 修改其他标签页的 class,使其成为默认激活的标签页 -->
<li class="nav-item" role="presentation">
<button class="nav-link active" id="no-review-tab" data-bs-toggle="tab"
data-bs-target="#no-review-pane" type="button" role="tab" aria-controls="no-review-pane"
aria-selected="true" style="color: rgb(248, 246, 246);"></button>
</li>
</ul>
<!-- tab-content -->
<div class="tab-content multifont" id="myTabContent" style="
background-color: #1d2e3d;
margin-top: 10px;
border: none !important;
margin-left: -15px;
margin-right: -15px;
padding-left: 0;
padding-right: 0;
width: calc(100% + 30px);
">
<div class="tab-pane fade show active" id="no-review-pane" role="tabpanel" aria-labelledby="no-review-tab">
<!-- 表格 -->
<table id="no-review-table" class="table table-striped table-hover table-sm" style="margin-bottom: 1rem;">
</table>
<!-- 导航栏 - 移除设置按钮并居中所有元素 -->
<nav aria-label="Page navigation"
style="
font-size: smaller;
display: flex;
justify-content: center;
text-align: center;
font-family: 'Courier Prime', monospace;
"
>
<!-- 分页控件容器和撤销按钮组合 -->
<div style="
display: flex;
">
<button type="button" class="btn btn-outline-warning custom-btn" id="prevButton1"
style="padding: 0.25rem 0.5rem; font-size: 0.875rem;margin-right: 0.5rem;"><</button>
<input type="text" class="page-input" id="pageInput1"
style="
width: 2.5rem;
height: 1.75rem;
padding: 0.25rem;
font-size: 0.875rem;
text-align: center;
border-radius: 0.25rem;
border: 1px solid #495057;
background-color: #1d2e3d;
color: #e9ecef;
"
placeholder="1"
/>
<label for="pageInput2"
class="form-label mb-0"
id="pageInputLabel1"
style="
font-size: 0.875rem;
line-height: 1.75rem;
color: #e9ecef;
margin-right: 0.25rem;
"
>/1</label>
<button type="button" class="btn btn-outline-warning custom-btn" id="nextButton1"
style="padding: 0.25rem 0.5rem; font-size: 0.875rem;margin-right: 0.5rem;margin-left: 0.5rem;">></button>
<!-- 撤销按钮 -->
<button type="button" class="btn btn-outline-warning custom-btn undo-ops-btn" id="undoOps1"
data-bs-toggle="tooltip" data-bs-title="undo latest operation" data-bs-placement="left"
style="
display: flex;
justify-content: center;
align-items: center;
padding: 0.25rem 0.5rem;
font-size: 0.875rem;
margin-left: 0.5rem;
"
>
<small class="fa-solid fa-arrow-rotate-left fa-2xs"></small>
</button>
<!-- 导出按钮 -->
<button type="button" class="btn btn-outline-warning custom-btn export-ops-btn" id="exportNotesBtn"
data-bs-toggle="tooltip" data-bs-title="export all notes" data-bs-placement="left"
style="
display: flex;
justify-content: center;
align-items: center;
padding: 0.25rem 0.5rem;
font-size: 0.875rem;
margin-left: 0.5rem;
"
>
<small class="fa-solid fa-file-export fa-2xs"></small>
</button>
</div>
</nav>
</div>
<div class="tab-pane fade" id="completed-pane" role="tabpanel" aria-labelledby="completed-tab" tabindex="0">
<table id="completed-table" class="table table-striped table-hover table-sm">
</table>
<!-- pagination -->
<nav aria-label="Page navigation example row"
style="font-size: smaller; display: flex; justify-content: space-between; align-items: center; text-align: center; font-family: 'Courier Prime', monospace;">
<button type="button" class="btn btn-outline-warning custom-btn config-btn" id="optionsBtn"
data-bs-toggle="tooltip" data-bs-title="Open Options" data-bs-placement="right"
style="display: flex; justify-content: center; align-items: center;">
<small class="fa-solid fa-gear fa-2xs my-2"></small>
</button>
<div style="display: flex; justify-content: center; align-items: center; flex-grow: 1;">
<button type="button" class="btn btn-outline-warning custom-btn" id="prevButton2"><</button>
<input type="text" id="pageInput2" style="width: 7.5%;"
placeholder="1" />
<label for="pageInput2" class="form-label mt-2 me-2" id="pageInputLabel2">/1</label>
<button type="button" class="btn btn-outline-warning custom-btn" id="nextButton2">></button>
</div>
<button type="button" class="btn btn-outline-warning custom-btn undo-ops-btn" id="undoOps2"
data-bs-toggle="tooltip" data-bs-title="undo latest operation" data-bs-placement="left"
style="display: flex; justify-content: center; align-items: center;">
<small class="fa-solid fa-arrow-rotate-left fa-2xs my-2"></small>
</button>
</nav>
</div>
</div>
<!-- 添加一个占位div,确保内容不会被footer遮挡 -->
<div style="height: 45px;"></div>
<!-- 更新概要 -->
<div class="update-summary my-0 py-0 by-0" style="text-align: center; margin-bottom: 5px;">
<small>
<div>
<span class="update-badge">NEW!</span>
支持通过复习记录优化fsrs算法参数。 / Support Optimize FSRS parameters.
</div>
<div>
<a target="_blank" href="https://github.com/xiaohajiayou/Leetcode-Mastery-Scheduler/blob/main/changelog.md">
View full changelog now(V0.1.4)
</a>
</div>
</small>
</div>
<!-- 添加一个占位div,确保内容不会被footer遮挡 -->
<div style="height: 50px;"></div>
<!-- footer -->
<div class="footer" style="
position: fixed;
bottom: 0;
left: 0;
right: 0;
background: linear-gradient(to bottom, rgba(29, 46, 61, 0.8) 0%, #1d2e3d 100%);
backdrop-filter: blur(5px);
padding: 10px;
display: flex;
align-items: center;
justify-content: center;
gap: 16px;
border-top: 1px solid rgba(255, 255, 255, 0.1);
box-shadow: 0 -4px 6px -1px rgba(0, 0, 0, 0.1);
">
<!-- GitHub Star 按钮 -->
<!-- <iframe
src="https://ghbtns.com/github-btn.html?user=xiaohajiayou&repo=Leetcode-Mastery-Scheduler&type=star&count=true"
frameborder="0"
scrolling="0"
width="100"
height="20"
title="Star us on GitHub!"
data-bs-toggle="tooltip"
data-bs-placement="top"
data-bs-title="A star from you would make our day! ✨"
style="opacity: 0.9;"
></iframe> -->
<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;">
</a>
</div>
<!-- 反馈按钮 -->
<a href="https://github.com/xiaohajiayou/Leetcode-Mastery-Scheduler/issues"
target="_blank"
style="text-decoration: none;"
>
<button type="button"
class="btn custom-btn feedback-btn"
style="
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;
"
>
<div class="btn-content"
style="
display: flex;
align-items: center;
gap: 0.6rem;
transition: all 0.3s ease;
"
>
<i class="fas fa-comment-dots"
style="
font-size: 0.875rem;
color: #61dafb;
transition: all 0.3s ease;
"
></i>
<span>Feedback</span>
</div>
</button>
</a>
</div>
</div>
</div>
<!-- 更多选项页面 -->
<div id="moreView" class="view" style="display: none;">
<div class="more-options">
<form id="optionsForm" class="options-grid">
<!-- 排序设置 -->
<div class="option-card" style="padding: 12px;">
<div style="display: flex; align-items: center; justify-content: space-between">
<div style="display: flex; align-items: center; gap: 12px;">
<i class="fas fa-sort" style="font-size: 0.95em; line-height: 1; position: relative; top: 7px;"></i>
<h4 style="margin: 0; font-size: 0.95em; line-height: 1;">Problem Sort</h4>
</div>
</div>
<div class="form-group">
<select class="form-select form-control" id="problemSorterSelect" name="problemSorterSelect" style="font-size: 0.9em;">
<!-- options.js will add sorter options -->
</select>
</div>
</div>
<!-- 云同步设置 -->
<div class="option-card" style="padding: 12px;">
<div style="display: flex; align-items: center; justify-content: space-between">
<div style="display: flex; align-items: center; gap: 12px;">
<i class="fas fa-cloud" style="font-size: 0.95em; line-height: 1; position: relative; top: 7px;""></i>
<h4 style="margin: 0; font-size: 0.95em; line-height: 1;">Cloud Sync</h4>
</div>
<div class="form-check form-switch">
<input class="form-check-input custom-switch" type="checkbox" id="syncToggle">
</div>
</div>
<div class="sync-tips" style="padding: 8px; border-radius: 4px; ">
<small style="display: block; margin-bottom: 2px; font-size: 0.8em;">1. Enable cloud sync</small>
<small style="display: block; margin-bottom: 2px; font-size: 0.8em;">2. Sign in to Chrome account</small>
<small style="display: block; font-size: 0.8em;">3. Turn on Chrome sync</small>
</div>
</div>
<!-- 主动提醒设置 -->
<div class="option-card" style="padding: 12px;">
<div style="display: flex; align-items: center; justify-content: space-between;">
<div style="display: flex; align-items: center; gap: 12px;">
<i class="fas fa-bell" style="font-size: 0.95em; line-height: 1; position: relative; top: 7px;"></i>
<h4 style="margin: 0; font-size: 0.95em; line-height: 1;">Active Reminder</h4>
</div>
<div class="form-check form-switch">
<input class="form-check-input custom-switch" type="checkbox" id="reminderToggle">
</div>
</div>
<div class="reminder-tips" style="padding: 8px; border-radius: 4px;">
<small style="display: block; margin-bottom: 2px; font-size: 0.8em;">1. Enable to receive reminders</small>
<small style="display: block; font-size: 0.8em;">2. Disable to stop all pop-up reminders</small>
</div>
</div>
<!-- FSRS参数优化卡片 -->
<div class="option-card" style="padding: 12px;">
<div style="display: flex; align-items: center; justify-content: space-between;">
<div style="display: flex; align-items: center; gap: 12px;">
<i class="fas fa-cogs" style="font-size: 0.95em; line-height: 1; position: relative; top: 7px;"></i>
<h4 style="margin: 0; font-size: 0.95em; line-height: 1;">Fsrs Param Optim</h4>
</div>
<div style="display: flex; gap: 8px;">
<button id="exportRevlogsBtn" class="btn btn-icon btn-icon-sm" data-bs-toggle="tooltip" data-bs-placement="top" title="导出记录">
<i class="fas fa-file-export" style="font-size: 0.85em;"></i>
</button>
<button id="optimizeParamsBtn" class="btn btn-icon btn-icon-sm" data-bs-toggle="tooltip" data-bs-placement="top" title="优化参数">
<i class="fas fa-magic" style="font-size: 0.85em;"></i>
</button>
</div>
</div>
<div class="fsrs-info" style="padding: 8px; border-radius: 4px;">
<small style="display: block; margin-bottom: 2px; font-size: 0.8em;" class="reminder-tips">
Current review count: <span id="revlogCount_en">0</span>
</small>
<small style="display: block; font-size: 0.8em;" class="reminder-tips">
Click to optimize FSRS parameters
</small>
<small style="display: block; font-size: 0.8em;" class="reminder-tips">
(Fit best parameters when you have enough data.)
</small>
</div>
</div>
<!-- 保存按钮 -->
<div class="save-section">
<button type="submit" class="btn btn-outline-warning custom-btn">
<i class="fas fa-save"></i> Save Settings
</button>
</div>
</form>
<!-- 保存成功提示 -->
<div id="feedbackMessage" class="alert alert-success mt-3" style="display: none;" role="alert">
设置已保存!
</div>
</div>
</div>
</div>
<!-- Review Card Template -->
<template id="reviewCardTemplate">
<div class="review-card">
<div class="d-flex justify-content-between align-items-center">
<div>
<h5 class="problem-title mb-2">
<span class="problem-name"></span>
</h5>
<div class="text-muted">
<span class="difficulty"></span> |
<span class="retrievability"></span> |
<span class="next-review"></span>
</div>
</div>
<div>
<button class="btn btn-review">
<i class="fas fa-check-circle"></i>
</button>
</div>
</div>
</div>
</template>
<script type="text/javascript" src="lib/bootstrap.bundle.min.js"></script>
<script type="text/javascript" src="lib/fontawesome.js"></script>
<script src="dist/popup.js"></script>
<!-- 直接引用外部脚本文件 -->
<script src="dist/loadGithubStar.js"></script>
</body>
</html>