Skip to content

Commit 882d823

Browse files
authored
Add files via upload
1 parent 217bd2d commit 882d823

1 file changed

Lines changed: 6 additions & 7 deletions

File tree

3code_mobile.html

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -198,14 +198,15 @@
198198
}
199199

200200
#candidate-display {
201+
/* 修正 1: 調整最小高度 */
201202
display: flex;
202203
align-items: center;
203204
padding: 8px;
204205
gap: 12px;
205206
white-space: nowrap;
206207
overflow-x: scroll;
207208
-webkit-overflow-scrolling: touch;
208-
min-height: 48px;
209+
min-height: 60px; /* 從 48px 調整為 60px */
209210
background-color: #fff;
210211
box-shadow: 0 1px 0 var(--border-color);
211212
}
@@ -215,13 +216,14 @@
215216
}
216217

217218
#candidate-display span {
219+
/* 修正 2: 調整字型大小 */
218220
cursor: pointer;
219221
padding: 5px 8px;
220222
border-radius: 4px;
221223
transition: all 0.2s;
222224
user-select: none;
223225
white-space: nowrap;
224-
font-size: 1.2rem;
226+
font-size: 1.4rem; /* 從 1.2rem 調整為 1.4rem */
225227
flex-shrink: 0;
226228
text-align: center;
227229
}
@@ -383,8 +385,7 @@
383385
// --- 長按相關狀態 ---
384386
let longPressTimer = null;
385387
let longPressCommitted = false;
386-
// *** 修正點 2:延長長按時限,更容易觸發 ***
387-
const LONG_PRESS_TIMEOUT = 750; // 500ms -> 750ms
388+
const LONG_PRESS_TIMEOUT = 750;
388389

389390
// --- 游標 HTML 定義 ---
390391
const CURSOR_HTML = '<span id="main-cursor" class="cursor">\u200c</span>';
@@ -880,7 +881,6 @@
880881
if (keyElement.handlePressDown) {
881882
keyElement.removeEventListener('touchstart', keyElement.handlePressDown);
882883
keyElement.removeEventListener('touchend', keyElement.handlePressUp);
883-
keyElement.removeEventListener('touchmove', keyElement.handlePressCancel); // 移除舊的 touchmove 綁定
884884
keyElement.removeEventListener('touchcancel', keyElement.handlePressCancel);
885885
keyElement.removeEventListener('mousedown', keyElement.handlePressDown);
886886
keyElement.removeEventListener('mouseup', keyElement.handlePressUp);
@@ -959,8 +959,7 @@
959959
keyElement.addEventListener('touchstart', handlePressDown);
960960
keyElement.addEventListener('touchend', handlePressUp);
961961
keyElement.addEventListener('touchcancel', handlePressCancel); // 處理觸摸中斷
962-
// *** 核心修正:移除此行,讓輕微的 touchmove 不會取消長按計時器 ***
963-
// keyElement.addEventListener('touchmove', handlePressCancel); // <--- 原有的問題代碼
962+
// *** 核心修正:移除 touchmove 綁定 ***
964963

965964
// Mouse Events (用於桌面測試)
966965
keyElement.addEventListener('mousedown', handlePressDown);

0 commit comments

Comments
 (0)