-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathreview.html
More file actions
354 lines (333 loc) · 17.7 KB
/
Copy pathreview.html
File metadata and controls
354 lines (333 loc) · 17.7 KB
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
<!doctype html>
<meta charset="utf-8" />
<title>immerse</title>
<style>
:root { --line: #e8e8e8; --dim: #888; --blue: #4a7dff; --green: #3fbf7f }
body { font: 15px/1.7 -apple-system, system-ui, sans-serif; margin: 0 auto;
padding: 28px 24px 60px; max-width: 760px; color: #1a1a1a; background: #fafafa }
h1 { font-size: 22px; margin: 0 0 4px }
h2.sub { font-size: 13px; font-weight: 400; color: var(--dim); margin: 0 0 22px }
h3 { font-size: 14px; margin: 30px 0 12px }
nav { display: flex; gap: 4px; margin-bottom: 26px; border-bottom: 1px solid var(--line) }
nav button { border: 0; background: none; font: inherit; padding: 9px 14px; cursor: pointer;
color: var(--dim); border-bottom: 2px solid transparent; margin-bottom: -1px }
nav button.on { color: #111; border-bottom-color: #111; font-weight: 600 }
.panel { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 18px }
.panel h2 { font-size: 13px; margin: 0 0 12px; color: #555; font-weight: 600 }
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
gap: 16px; margin-bottom: 20px }
.big { font-size: 32px; font-weight: 600 }
.rate { font-size: 12px; color: var(--dim); margin-left: 6px }
.row { display: flex; justify-content: space-between; font-size: 13px; margin-top: 12px }
.track { height: 6px; border-radius: 3px; background: #eee; margin-top: 4px }
.track div { height: 100%; border-radius: 3px }
button.b { font: inherit; padding: 10px 18px; border: 1px solid #ccc; border-radius: 8px;
background: #fff; cursor: pointer }
/* ---- 記憶固化 ---- */
#headline { text-align: center; color: var(--dim); margin: 0 0 16px }
.pills { display: flex; gap: 10px; justify-content: center; margin-bottom: 20px }
.pills span { font-size: 13px; padding: 5px 14px; border-radius: 999px; background: #fff;
border: 1px solid var(--line) }
.goal { background: #fff; border: 2px solid var(--blue); border-radius: 14px;
padding: 18px 20px; margin-bottom: 16px }
.goalhead { display: flex; justify-content: space-between; font-size: 13px; color: var(--dim) }
.tag { background: #eef2ff; color: var(--blue); border-radius: 999px; padding: 2px 10px }
.goalnum { margin: 10px 0 12px }
.goalnum b { font-size: 40px; font-weight: 700; margin-right: 10px }
#goalBar, #barLearning { background: var(--blue) }
#barKnown { background: var(--green) }
.goalfoot { display: flex; justify-content: space-between; align-items: center;
margin-top: 10px; font-size: 12px; color: var(--dim) }
.flame { background: #fff4e6; color: #b26a00; border-radius: 999px; padding: 4px 12px }
#forecast { display: flex; align-items: flex-end; gap: 10px; height: 78px }
#forecast .col { flex: 1; display: flex; flex-direction: column; align-items: center;
justify-content: flex-end; gap: 4px }
#forecast .bar { width: 100%; background: var(--green); border-radius: 3px; min-height: 2px }
#forecast .n, #forecast .d { font-size: 11px; color: var(--dim) }
#start { width: 100%; background: #111; color: #fff; border-color: #111; padding: 15px;
font-size: 16px; border-radius: 12px }
#start:disabled { background: #eee; color: #999; border-color: #eee; cursor: default }
#videos { display: grid; grid-template-columns: 1fr 1fr; gap: 12px }
.vcard { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 14px;
cursor: pointer }
.vcard.done { cursor: default; opacity: .6 }
.vtitle { font-size: 13px; font-weight: 600; line-height: 1.4; margin-bottom: 8px }
.vdue { font-size: 11px; padding: 3px 9px; border-radius: 999px; background: #fff2e0;
color: #b26a00 }
.vcard.done .vdue { background: #e9f7ee; color: #2f7d51 }
.vtrack { height: 5px; border-radius: 3px; background: #eee; margin: 10px 0 6px }
.vfill { height: 100%; border-radius: 3px; background: var(--green) }
.vmeta { font-size: 11px; color: var(--dim) }
.hint { font-size: 12px; color: var(--dim); margin-top: 28px }
.syncrow { display: flex; align-items: center; justify-content: space-between; gap: 12px;
margin-top: 30px; padding: 12px 14px; background: #fff; border: 1px solid var(--line);
border-radius: 10px; font-size: 12px; color: var(--dim) }
.syncrow button { font-size: 12px; padding: 6px 14px }
#clear { font-size: 12px; padding: 5px 12px; color: #a33; border-color: #e5c5c5 }
/* ---- 複習卡 ---- */
#card { background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 26px 30px }
#chead { display: flex; align-items: center; gap: 12px; font-size: 13px; color: var(--dim) }
#chead a { color: inherit; text-decoration: none }
#stamp { background: #f0f0f0; border-radius: 5px; padding: 1px 7px; font-size: 12px }
#chead label { margin-left: auto; display: flex; align-items: center; gap: 6px; cursor: pointer }
#skip, #quit, #master { padding: 4px 10px; font-size: 12px; color: var(--dim); border-radius: 6px }
#master { color: #2f7d51; border-color: #cde5d5 }
#sessKnown { background: #e9f7ee; color: #2f7d51; border-radius: 999px; padding: 3px 10px;
font-size: 12px }
#sessKnown:empty { display: none }
#front { font-size: 34px; font-weight: 700; text-align: center; margin: 34px 0 22px }
#front button, #ctx button { background: none; border: 0; cursor: pointer; font-size: 17px;
padding: 0 4px; vertical-align: middle }
#ctx { text-align: center; font-size: 18px; color: #444; line-height: 2 }
#ctx .hit { background: #e8efff; box-shadow: inset 0 0 0 1.5px var(--blue); border-radius: 6px;
padding: 3px 5px }
#zhrow { text-align: center; margin-top: 14px }
#showzh { border: 0; background: none; color: var(--dim); font-size: 13px;
text-decoration: underline }
#zh { color: #555; font-size: 15px }
.sense { white-space: pre-wrap; border-left: 2px solid var(--line); padding-left: 10px;
margin: 12px 0 }
#context { font-size: 13px; color: #888 }
#back { margin-top: 22px; border-top: 1px solid var(--line); padding-top: 18px }
#grades { display: flex; gap: 12px; margin-top: 26px; justify-content: center }
#grades button { min-width: 150px; padding: 12px }
#again { color: #c0392b; border-color: #eccac4 }
/* Keycap look, not plain digits: 「已掌握 3」 was read as "mastered: 3 words" — a shortcut
hint has to be unmistakably a key. */
kbd { font-size: 10px; color: #999; border: 1px solid #ddd; border-bottom-width: 2px;
border-radius: 4px; padding: 0 4px; background: #f7f7f7; font-family: inherit }
/* ---- 數據分析 ---- */
.ranges { display: flex; gap: 2px; float: right; margin-top: -46px }
.ranges button { border: 0; background: none; font: inherit; font-size: 13px; padding: 5px 12px;
border-radius: 7px; cursor: pointer; color: var(--dim) }
.ranges button.on { background: #fff; border: 1px solid var(--line); color: #111 }
#chart { display: flex; align-items: flex-end; gap: 2px; height: 150px; margin-top: 10px }
#chart .col { flex: 1; display: flex; flex-direction: column; justify-content: flex-end;
align-items: center; gap: 3px; min-width: 0 }
#chart .bar { width: 100%; border-radius: 2px; min-height: 2px; background: var(--blue) }
#chart .d { font-size: 9px; color: var(--dim); white-space: nowrap; overflow: hidden }
.toggles { display: flex; gap: 2px }
.toggles button { border: 1px solid var(--line); background: #fff; font: inherit;
font-size: 12px; padding: 5px 12px; border-radius: 7px; cursor: pointer;
color: var(--dim) }
.toggles button.on { background: #111; border-color: #111; color: #fff }
#heat { display: grid; grid-auto-flow: column; grid-template-rows: repeat(7, 11px); gap: 3px;
overflow-x: auto; padding-bottom: 4px }
#heat div { width: 11px; border-radius: 2px }
.chartbar { display: flex; justify-content: space-between; gap: 8px; flex-wrap: wrap }
.heatbody { display: flex; gap: 4px }
.heatdays { display: grid; grid-template-rows: repeat(7, 11px); gap: 3px; font-size: 9px;
color: var(--dim); line-height: 11px }
#heatMonths { display: grid; grid-auto-flow: column; grid-auto-columns: 14px; gap: 0;
font-size: 9px; color: var(--dim); margin: 0 0 3px 16px }
.vrow { margin-bottom: 14px }
.vhead { display: flex; justify-content: space-between; gap: 10px; font-size: 13px }
.vname { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap }
.vrow .vmeta { display: flex; justify-content: space-between }
.lrow { display: flex; justify-content: space-between; background: #fff7ed; border-radius: 8px;
padding: 7px 11px; margin-bottom: 6px; font-size: 13px }
.lcount { color: #b26a00; font-size: 11px }
.legend { display: flex; align-items: center; gap: 4px; justify-content: flex-end;
font-size: 11px; color: var(--dim); margin-bottom: 10px }
.legend i { width: 11px; height: 11px; border-radius: 2px; display: inline-block }
/* ---- 詞彙庫 ---- */
#q { width: 100%; padding: 10px 12px; font: inherit; box-sizing: border-box;
border: 1px solid var(--line); border-radius: 9px; margin-bottom: 14px }
.item { background: #fff; border: 1px solid var(--line); border-radius: 10px;
padding: 12px 14px; margin-bottom: 8px }
.itop { display: flex; align-items: baseline; gap: 10px }
.iword { font-weight: 600 }
.badge { font-size: 11px; padding: 2px 9px; border-radius: 999px }
.b-learn { background: #eef2ff; color: var(--blue) }
.b-known { background: #e9f7ee; color: #2f7d51 }
.idue { margin-left: auto; font-size: 11px; color: var(--dim) }
.idel { border: 0; background: none; cursor: pointer; color: #c99; font-size: 13px; padding: 0 2px }
.imean { font-size: 13px; color: #555; margin-top: 4px }
.isrc { font-size: 11px; color: var(--dim); margin-top: 4px }
.isrc a { color: inherit }
.libbar { display: flex; gap: 10px; align-items: center; margin-bottom: 14px; flex-wrap: wrap }
#q { flex: 1; min-width: 220px; margin: 0 }
.ghead { display: flex; justify-content: space-between; font-size: 12px; color: var(--dim);
margin: 18px 2px 8px }
.dot { width: 18px; height: 18px; border-radius: 50%; display: inline-flex; flex: 0 0 18px;
align-items: center; justify-content: center; font-size: 11px }
.d-learn { border: 2px solid #e5a33d; box-sizing: border-box }
.d-known { background: #e9f7ee; color: #2f7d51; border: 2px solid var(--green); box-sizing: border-box }
.ien { font-size: 12px; color: var(--dim); margin-top: 6px }
.isent { font-size: 12px; color: #666; font-style: italic; margin-top: 8px }
.ibtns { display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap }
.ibtns button { font: inherit; font-size: 13px; padding: 6px 14px; border-radius: 7px;
border: 1px solid var(--line); background: #fff; cursor: pointer; color: #444 }
.ibtns button.on { background: var(--blue); border-color: var(--blue); color: #fff }
.ibtns .del { margin-left: auto; color: #a33; border-color: #e5c5c5 }
</style>
<nav>
<button class="on" data-view="viewReview">記憶固化</button>
<button data-view="viewStats">數據分析</button>
<button data-view="viewLib">詞彙庫</button>
</nav>
<!-- ================= 記憶固化 ================= -->
<section id="viewReview">
<section id="home">
<h1 style="text-align:center">記憶固化</h1>
<p id="headline"></p>
<div class="pills"><span id="today"></span><span id="imm"></span></div>
<div class="goal">
<div class="goalhead"><span class="tag">🕐 每日目標</span><span id="goalOf"></span></div>
<div class="goalnum"><b id="goalMins">0</b> 今日沉浸分鐘數</div>
<div class="track"><div id="goalBar"></div></div>
<div class="goalfoot">
<span id="goalHint"></span><span id="goalStreak" class="flame"></span>
</div>
</div>
<div class="cards">
<div class="panel">
<h2>⚡ 記憶效能</h2>
<div><span id="predicted" class="big">—</span><span class="rate">預測記憶率</span></div>
<div class="row"><span>歷史答對率</span><b id="correct">—</b></div>
<div class="row"><span>學習中</span><b id="learning">0</b></div>
<div class="track"><div id="barLearning"></div></div>
<div class="row"><span>已掌握</span><b id="known">0</b></div>
<div class="track"><div id="barKnown"></div></div>
</div>
<div class="panel">
<h2>📚 詞彙量</h2>
<div><span id="total" class="big">0</span><span class="rate">總詞彙量</span></div>
<div class="row"><span>本週已掌握</span><b id="weekKnown">0</b></div>
<div class="row"><span>本週新增</span><b id="weekAdded">0</b></div>
</div>
<div class="panel">
<h2>🌱 複習預報</h2>
<div id="forecast"></div>
</div>
</div>
<button id="start" class="b">今天沒有待複習</button>
<h3>按影片複習</h3>
<div id="videos"></div>
<div id="debtSec" hidden>
<h3>🧹 單字負債</h3>
<div class="panel">
<div class="vmeta" id="debtMeta" style="margin-bottom:10px"></div>
<div id="debtList"></div>
<button id="debtAll" class="b"
style="margin-top:10px;font-size:12px;padding:6px 14px;color:#a33;border-color:#e5c5c5">
全部清理</button>
</div>
</div>
<div class="syncrow">
<span id="syncInfo">同步:—</span>
<button id="syncGo" class="b">立即同步</button>
</div>
<p class="hint">詞彙只在你於影片上按下「學習中」或「已掌握」時才進到這裡;點字查詢不會加入。</p>
<button id="clear" class="b">清空詞彙庫</button>
</section>
<section id="card" hidden>
<div id="chead">
<a id="vlink" target="_blank">▶ <span id="vtitle"></span></a>
<span id="stamp"></span>
<label><input type="checkbox" id="recall" /> 主動回憶</label>
<span id="left"></span>
<span id="sessKnown"></span>
<button id="master" class="b" title="這個字其實已經會了:移出排程,不用回影片再標">已掌握 <kbd>3</kbd></button>
<button id="skip" class="b" title="稍後再看這張,不影響排程">跳過 <kbd>→</kbd></button>
<button id="quit" class="b" title="離開複習">✕ <kbd>esc</kbd></button>
</div>
<div id="front"></div>
<div id="ctx"></div>
<div id="zhrow"><button id="showzh">顯示翻譯</button><div id="zh" hidden></div></div>
<div id="back" hidden>
<p id="contextZh"></p>
<p id="context"></p>
<div id="senses"></div>
</div>
<div id="grades">
<button id="reveal" class="b">顯示解釋 <kbd>space</kbd></button>
<button id="again" class="b">再來一次 <kbd>1</kbd></button>
<button id="got" class="b">記住了 <kbd>2</kbd></button>
</div>
</section>
</section>
<!-- ================= 數據分析 ================= -->
<section id="viewStats" hidden>
<h1>數據分析</h1>
<h2 class="sub">深度分析你的學習數據</h2>
<div class="ranges">
<button data-days="7" class="on">本週</button>
<button data-days="30">月</button>
<button data-days="365">年</button>
<button data-days="0">全部</button>
</div>
<div class="cards">
<div class="panel">
<h2>學習效率</h2>
<div id="effVal" class="big">0</div>
<div class="rate" style="margin:0">字/每小時沉浸</div>
</div>
<div class="panel">
<h2>沉浸時間</h2>
<div id="immAvg" class="big">0</div>
<div class="rate" style="margin:0">分鐘/每天平均</div>
</div>
<div class="panel">
<h2>學習天數</h2>
<div id="activeVal" class="big">0</div>
<div class="rate" style="margin:0">天有紀錄</div>
</div>
</div>
<div class="panel">
<div class="chartbar">
<div class="toggles">
<button data-metric="imm" class="on">沉浸分鐘</button>
<button data-metric="words">新增詞彙</button>
<button data-metric="rev">複習次數</button>
</div>
<div class="toggles modes">
<button data-mode="day" class="on">每日</button>
<button data-mode="cum">累計</button>
</div>
</div>
<div id="chart"></div>
</div>
<h3>沉浸習慣</h3>
<div class="panel">
<div class="legend">
少 <i style="background:#ebedf0"></i><i style="background:#c6e9d4"></i>
<i style="background:#7ccfa3"></i><i style="background:#3fbf7f"></i>
<i style="background:#2a8f5d"></i> 多
</div>
<div id="heatMonths"></div>
<div class="heatbody">
<div class="heatdays"><span></span><span>一</span><span></span><span>三</span><span></span><span>五</span><span></span></div>
<div id="heat"></div>
</div>
</div>
<div class="cards" style="margin-top:20px">
<div class="panel">
<h2>這些影片學最多</h2>
<div id="topVideos"></div>
</div>
<div class="panel">
<h2>⚠️ 頑固詞彙</h2>
<div class="vmeta" style="margin:-6px 0 10px">複習時反覆忘記的詞</div>
<div id="leeches"></div>
</div>
</div>
</section>
<!-- ================= 詞彙庫 ================= -->
<section id="viewLib" hidden>
<h1>詞彙庫</h1>
<h2 class="sub" id="libCount"></h2>
<div class="libbar">
<input id="q" type="search" placeholder="搜尋單字、解釋、句子或影片…" />
<div class="toggles filters">
<button data-status="all" class="on">全部</button>
<button data-status="learning">學習中</button>
<button data-status="known">已掌握</button>
</div>
</div>
<div id="list"></div>
</section>
<script src="merge.js"></script>
<script src="review.js"></script>
<script src="analytics.js"></script>
<script src="library.js"></script>