Skip to content

Commit

Permalink
Fix
Browse files Browse the repository at this point in the history
  • Loading branch information
XHXIAIEIN committed Jun 7, 2024
1 parent 8baad61 commit 7bc8b63
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions script.js
Original file line number Diff line number Diff line change
Expand Up @@ -159,13 +159,13 @@ document.addEventListener('DOMContentLoaded', () => {
const totalScreenshots = Math.ceil(photos.length / imagesPerCapture);
const format = imageFormat.value;
const quality = parseInt(imageQuality.value) / 100;

captureButton.style.display = 'none';
showProgress(progressContainer, progressText, '正在截图...', true);

const formattedDate = formatDate(new Date());
linksContainer.innerHTML = '';

if (totalScreenshots <= fileThreshold) {
await processImages(photos, imagesPerCapture, UI, false, format, quality);
showProgress(progressContainer, progressText, '截图完成', false);
Expand All @@ -184,12 +184,12 @@ document.addEventListener('DOMContentLoaded', () => {
}
}).then(content => {
saveAs(content, `Screenshots_${formattedDate}.zip`);
addDownloadLink(linksContainer, imgData, fileName);
showProgress(progressContainer, progressText, '完成', false);
});
}
}


async function processImages(photos, imagesPerCapture, UI, addToZip, format, quality, zip = null) {
const { progressText, linksContainer } = UI;
for (let i = 0; i < photos.length; i += imagesPerCapture) {
Expand All @@ -202,7 +202,7 @@ document.addEventListener('DOMContentLoaded', () => {
}
updateProgress(progressText, (i + imagesPerCapture) / photos.length, '正在截图...', true);
}
}
}

async function captureAndSaveImage(photos, fileName, UI, format, quality) {
const { columnsInput, rowGapInput, columnGapInput, maxWidthInput, paddingXInput, paddingYInput, bgColorInput, pageBorderRadiusInput } = UI;
Expand Down

0 comments on commit 7bc8b63

Please sign in to comment.