diff --git a/src/main/resources/static/js/comment-cards.js b/src/main/resources/static/js/comment-cards.js index fbaeb8a..37b1dc6 100644 --- a/src/main/resources/static/js/comment-cards.js +++ b/src/main/resources/static/js/comment-cards.js @@ -229,8 +229,10 @@ if (!all || !all.length) { box.style.display = 'none'; box.innerHTML = ''; return; } const weighted = !!($('ccWeighted') && $('ccWeighted').checked); + const tlSort = ($('ccTlSort') && $('ccTlSort').value) || 'count'; const stats = computeStats(all); - const tl = computeTimeline(all); + let tl = computeTimeline(all); // 언급 많은 순 top-N 선별 + if (tlSort === 'time') tl = tl.slice().sort((a, b) => a.sec - b.sec); // 선별본을 시간순 재정렬 const words = computeWords(all, weighted); const vid = window.__videoId; @@ -247,7 +249,11 @@ + ''; // 타임라인 - html += '

⏱ 많이 언급된 타임라인

'; + html += '

⏱ 많이 언급된 타임라인

' + + '
'; if (tl.length) { const mx = tl[0].cnt; html += '
' + tl.map(t => { @@ -304,6 +310,8 @@ }); const wt = $('ccWeighted'); if (wt) wt.addEventListener('change', () => renderAnalytics(window.__all)); + const tls = $('ccTlSort'); + if (tls) tls.addEventListener('change', () => renderAnalytics(window.__all)); } /* ------------------------- 캡처/복사/저장 ------------------------- */ diff --git a/src/main/resources/templates/comment-cards.html b/src/main/resources/templates/comment-cards.html index 9226d2f..12d193f 100644 --- a/src/main/resources/templates/comment-cards.html +++ b/src/main/resources/templates/comment-cards.html @@ -58,6 +58,8 @@ .cc-an-sec h4 { font-size:13.5px; font-weight:600; color:var(--text-2); margin:0 0 .5rem; } .cc-an-sechead { display:flex; align-items:center; justify-content:space-between; gap:.6rem; } .cc-wlabel { font-size:12px; color:var(--text-2); display:flex; align-items:center; gap:.3rem; cursor:pointer; } + .cc-mini-select { background:var(--surface-2); color:var(--text); border:1px solid var(--border); + border-radius:8px; padding:.25rem .5rem; font-size:12px; cursor:pointer; } .cc-an-empty { color:var(--text-3); font-size:13px; margin:.2rem 0; } .cc-bars { display:flex; flex-direction:column; gap:.35rem; } .cc-bar-row { display:grid; grid-template-columns:76px 1fr 52px; align-items:center; gap:.5rem; font-size:12.5px; } @@ -114,7 +116,7 @@ - +