| 1145 | observer.observe(trigger); |
| 1146 | } |
| 1147 | function handleCardClick(result) { |
| 1148 | const episodeMatch = result.filename.match(/\[P(\d+)\]/); |
| 1149 | const timeMatch = result.timestamp.match(/^(\d+)m(\d+)s$/); |
| 1150 | if (episodeMatch && timeMatch) { |
| 1151 | const episodeNum = parseInt(episodeMatch[1], 10); |
| 1152 | const minutes = parseInt(timeMatch[1]); |
| 1153 | const seconds = parseInt(timeMatch[2]); |
| 1154 | const totalSeconds = minutes * 60 + seconds; |
| 1155 | for (const [url, filename] of Object.entries(mapping)) |
| 1156 | if (filename === result.filename) { |
| 1157 | const videoUrl = `https://www.bilibili.com${url}?t=${totalSeconds}`; |
| 1158 | window.open(videoUrl, "_blank"); |
| 1159 | break; |
| 1160 | } |
| 1161 | } |
| 1162 | } |
| 1163 | function enableKeywordTags() { |
| 1164 | const keywordsContainer = document.getElementById("keywordsContainer"); |
| 1165 | keywordsContainer.querySelectorAll('.keyword-tag').forEach(tag => { |