* 更新截图进度UI * @param {number} percent 进度百分比(0-1) * @param {string} [text] 可选的文本更新
(percent, text)
| 327 | * @param {string} [text] 可选的文本更新 |
| 328 | */ |
| 329 | function updateProgressUI(percent, text) { |
| 330 | const progressContainer = document.getElementById('fehelper-screenshot-progress'); |
| 331 | if (!progressContainer) return; |
| 332 | |
| 333 | const progressBar = progressContainer.querySelector('.fh-progress-bar'); |
| 334 | const percentText = progressContainer.querySelector('.fh-progress-percent'); |
| 335 | |
| 336 | if (progressBar) { |
| 337 | const percentage = Math.min(Math.max(percent * 100, 0), 100); |
| 338 | progressBar.style.width = `${percentage}%`; |
| 339 | } |
| 340 | |
| 341 | if (percentText) { |
| 342 | percentText.textContent = `${Math.round(percent * 100)}%`; |
| 343 | } |
| 344 | |
| 345 | if (text) { |
| 346 | const textElement = progressContainer.querySelector('.fh-progress-text'); |
| 347 | if (textElement) { |
| 348 | textElement.textContent = text; |
| 349 | } |
| 350 | } |
| 351 | } |
| 352 | |
| 353 | /** |
| 354 | * 取消截图操作 |
no outgoing calls
no test coverage detected