-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpractice.html
More file actions
167 lines (138 loc) · 7.71 KB
/
practice.html
File metadata and controls
167 lines (138 loc) · 7.71 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
<!DOCTYPE html>
<html lang="zh-TW">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
<title>Practice Room - Hexagon</title>
<style>
:root {
--bg-color: #f5f5f7;
--text-main: #1d1d1f;
--text-secondary: #8e8e93;
--card-bg: #ffffff;
--accent-color: #007aff;
--level-5: #d4af37; /* 金色 */
--level-4: #4d4d4d; /* 深灰 */
--level-3: #808080; /* 中灰 */
--level-2: #b3b3b3; /* 淺灰 */
--level-1: #e5e5ea; /* 最淺灰 */
}
* { box-sizing: border-box; margin: 0; padding: 0; font-family: -apple-system, BlinkMacSystemFont, sans-serif; }
body { background-color: var(--bg-color); padding: 20px; overflow-y: auto; }
.header-bar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 24px; }
.page-title { font-size: 24px; font-weight: bold; color: var(--text-main); }
.back-btn { padding: 8px 16px; background: #e5e5ea; border-radius: 20px; text-decoration: none; color: var(--text-main); font-weight: bold; font-size: 14px; }
/* Level 區塊設計 */
.level-container { margin-bottom: 30px; }
.level-header { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; font-size: 18px; font-weight: bold; }
.level-badge { padding: 4px 10px; border-radius: 12px; color: white; font-size: 14px; }
.badge-l5 { background-color: var(--level-5); }
.badge-l4 { background-color: var(--level-4); }
.badge-l3 { background-color: var(--level-3); }
.badge-l2 { background-color: var(--level-2); color: #333; }
.badge-l1 { background-color: var(--level-1); color: #333; }
.word-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); gap: 12px; }
.word-card {
background: var(--card-bg); padding: 16px 12px; border-radius: 12px; text-align: center;
box-shadow: 0 2px 8px rgba(0,0,0,0.05); font-weight: bold; cursor: pointer;
transition: transform 0.2s; border: 1px solid rgba(0,0,0,0.05);
}
.word-card:active { transform: scale(0.95); }
/* 測驗彈窗設計 (與你原本的 Practice Modal 相同結構) */
#test-overlay {
display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%;
background: rgba(245, 245, 247, 0.98); z-index: 200; flex-direction: column; padding: 20px;
}
#test-overlay.active { display: flex; }
.test-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; }
.speed-btn { padding: 6px 12px; border-radius: 15px; background: #e5e5ea; border: none; font-weight: bold; cursor: pointer; }
.test-display { background: var(--card-bg); border-radius: 16px; padding: 30px; text-align: center; box-shadow: 0 4px 12px rgba(0,0,0,0.08); flex: 1; }
.t-word { font-size: 40px; font-weight: bold; margin-bottom: 8px; }
.t-phonetic { font-size: 16px; color: var(--text-secondary); margin-bottom: 24px; }
.t-info { text-align: left; padding-top: 16px; border-top: 1px solid #eee; margin-top: auto; }
.t-label { font-size: 12px; color: #888; text-transform: uppercase; margin-bottom: 4px; font-weight: bold; }
.t-value { font-size: 15px; margin-bottom: 12px; line-height: 1.4; }
.test-actions { display: flex; flex-direction: column; align-items: center; gap: 20px; margin-top: 20px; padding-bottom: 20px; }
.tts-row { display: flex; gap: 10px; }
.btn-secondary { background: rgba(0,0,0,0.05); border: none; padding: 10px 20px; border-radius: 10px; font-weight: bold; cursor: pointer; }
#mic-btn { width: 70px; height: 70px; border-radius: 50%; background: var(--accent-color); color: white; border: none; font-weight: bold; font-size: 16px; box-shadow: 0 4px 12px rgba(0,122,255,0.3); }
.control-row { display: flex; align-items: center; gap: 20px; }
.close-test-btn { background: #ff3b30; color: white; border: none; padding: 10px 20px; border-radius: 20px; font-weight: bold; cursor: pointer; }
</style>
</head>
<body>
<div class="header-bar">
<div class="page-title">練習室 (Practice Room)</div>
<a href="index.html" class="back-btn">回地圖</a>
</div>
<div class="level-container" id="section-l5">
<div class="level-header"><span class="level-badge badge-l5">Level 5</span> 滿級維持</div>
<div class="word-grid" id="grid-l5">
<div class="word-card" onclick="startTest('example')">example</div>
</div>
</div>
<div class="level-container" id="section-l4">
<div class="level-header"><span class="level-badge badge-l4">Level 4</span> </div>
<div class="word-grid" id="grid-l4"></div>
</div>
<div class="level-container" id="section-l3">
<div class="level-header"><span class="level-badge badge-l3">Level 3</span> </div>
<div class="word-grid" id="grid-l3"></div>
</div>
<div class="level-container" id="section-l2">
<div class="level-header"><span class="level-badge badge-l2">Level 2</span> </div>
<div class="word-grid" id="grid-l2"></div>
</div>
<div class="level-container" id="section-l1">
<div class="level-header"><span class="level-badge badge-l1">Level 1</span> </div>
<div class="word-grid" id="grid-l1"></div>
</div>
<div id="test-overlay">
<div class="test-header">
<div style="font-weight:bold; color:var(--text-secondary);">進度: <span id="t-progress">0/3</span></div>
<button class="speed-btn" onclick="toggleSpeed()">語速: 正常</button>
</div>
<div class="test-display">
<div class="t-word" id="tw-text">Word</div>
<div class="t-phonetic" id="tw-phonetic">/wɜːrd/</div>
<div class="t-info">
<div class="t-label">POS</div>
<div class="t-value" id="tw-pos">Noun</div>
<div class="t-label">Sentence</div>
<div class="t-value" id="tw-sentence">This is an example sentence.</div>
</div>
</div>
<div class="test-actions">
<div class="tts-row">
<button class="btn-secondary">聽單字</button>
<button class="btn-secondary">聽例句</button>
</div>
<div style="font-weight:bold; height:20px;" id="mic-feedback">請點擊收音發音</div>
<div class="control-row">
<button class="close-test-btn" onclick="closeTest()">退出</button>
<button id="mic-btn">收音</button>
<button class="btn-secondary">跳過</button>
</div>
</div>
</div>
<script>
// 模擬呼叫單一單字測驗
function startTest(word) {
document.getElementById('tw-text').textContent = word;
document.getElementById('test-overlay').classList.add('active');
// 在此處銜接你原有的 Web Speech API (辨識與語音合成) 邏輯
}
function closeTest() {
document.getElementById('test-overlay').classList.remove('active');
}
function toggleSpeed() {
// 切換語速邏輯
}
/* 實際串接時的流程提示:
1. 從 Firebase 或 LocalStorage 讀取地圖資料 (grid)。
2. 根據 level 屬性 (1~5) 分類單字。
3. 將分類好的單字渲染至對應的 `#grid-lX` 容器內。
*/
</script>
</body>
</html>