From b28f15f75d062149fc797492f56f0f2b13444df3 Mon Sep 17 00:00:00 2001 From: tmk3ki Date: Wed, 22 Jul 2026 10:37:23 +0900 Subject: [PATCH] =?UTF-8?q?=E3=83=90=E3=82=B0=E4=BF=AE=E6=AD=A3:=20AI?= =?UTF-8?q?=E6=A4=9C=E7=B4=A2=E7=B5=90=E6=9E=9C=E8=A1=A8=E7=A4=BA=E6=99=82?= =?UTF-8?q?=E3=81=AB=E5=8B=95=E7=94=BB=E3=81=8C=E9=9D=9E=E8=A1=A8=E7=A4=BA?= =?UTF-8?q?=E3=81=AB=E3=81=AA=E3=82=8B=E5=95=8F=E9=A1=8C=E3=82=92=E4=BF=AE?= =?UTF-8?q?=E6=AD=A3(=E8=AA=A4=E3=81=A3=E3=81=A6PIP=E5=8C=96=E3=81=97?= =?UTF-8?q?=E3=81=A6=E3=81=84=E3=81=9F)=E3=80=82=E6=A4=9C=E7=B4=A2?= =?UTF-8?q?=E7=B5=90=E6=9E=9C=E3=83=BB=E4=B8=BB=E8=A6=81=E6=93=8D=E4=BD=9C?= =?UTF-8?q?=E3=81=AB=E3=82=AD=E3=83=BC=E3=83=9C=E3=83=BC=E3=83=89=E5=AF=BE?= =?UTF-8?q?=E5=BF=9C(Enter/Space/Escape)=E3=82=92=E8=BF=BD=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- web/index.html | 27 ++++++++++++++++++++++++--- 1 file changed, 24 insertions(+), 3 deletions(-) diff --git a/web/index.html b/web/index.html index 51aa617..464de71 100644 --- a/web/index.html +++ b/web/index.html @@ -81,6 +81,10 @@ .ytRow { display: flex; gap: 10px; padding: 8px; border-radius: 10px; cursor: pointer; align-items: flex-start; white-space: normal; } .ytRow:hover { background: var(--surface-3); } + .ytRow:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; background: var(--surface-3); } + .iconBtn:focus-visible, .mdSelect:focus-visible, .searchStage .searchHeader button:focus-visible { + outline: 2px solid var(--primary); outline-offset: 2px; + } .ytRow img { width: 120px; aspect-ratio: 16/9; object-fit: cover; border-radius: 8px; background: #000; flex-shrink: 0; } .ytRow .meta { min-width: 0; } .ytRow .title { font-size: 13px; line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; white-space: normal; } @@ -286,6 +290,12 @@ document.getElementById('playerWrap').addEventListener('click', () => { } }); +document.addEventListener('keydown', (e) => { + if (e.key === 'Escape' && document.getElementById('playerWrap').classList.contains('pip')) { + exitSearchMode(); + } +}); + document.getElementById('searchCancelBtn').addEventListener('click', exitSearchMode); function loadVideo(id, opts) { @@ -312,6 +322,9 @@ function decodeEntities(text) { function buildYtRow(item) { const row = document.createElement('div'); row.className = 'ytRow'; + row.tabIndex = 0; + row.setAttribute('role', 'button'); + row.setAttribute('aria-label', decodeEntities(item.title)); const title = document.createElement('div'); title.className = 'title'; title.textContent = decodeEntities(item.title); @@ -328,6 +341,12 @@ function buildYtRow(item) { row.appendChild(img); row.appendChild(meta); row.addEventListener('click', () => loadVideo(item.videoId)); + row.addEventListener('keydown', (e) => { + if (e.key === 'Enter' || e.key === ' ') { + e.preventDefault(); + loadVideo(item.videoId); + } + }); return row; } @@ -355,6 +374,7 @@ document.getElementById('loadBtn').addEventListener('click', () => { document.getElementById('urlInput').addEventListener('keydown', (e) => { if (e.key === 'Enter') document.getElementById('loadBtn').click(); + if (e.key === 'Escape') exitSearchMode(); }); const modelSelect = document.getElementById('modelSelect'); @@ -369,6 +389,10 @@ modelSelect.addEventListener('change', () => { lockIcon.classList.toggle('unlocked', modelSelect.value === 'gemini' && !!unlockCode); }); +document.getElementById('unlockInput').addEventListener('keydown', (e) => { + if (e.key === 'Enter') document.getElementById('unlockBtn').click(); +}); + document.getElementById('unlockBtn').addEventListener('click', async () => { const code = document.getElementById('unlockInput').value.trim(); if (!code) return; @@ -475,9 +499,6 @@ async function sendChatMessage(message, opts) { finalizeBubble(statusDiv, evt.reply, evt.videos); chatHistory.push({ role: 'user', text: message }); chatHistory.push({ role: 'model', text: evt.reply }); - if (evt.videos && evt.videos.length) { - setPip(true); - } if (evt.autoPlayVideoId) { loadVideo(evt.autoPlayVideoId, { notifyAI: false }); }