Download Modified Interactive
`);
// Update the zipFiles map with the modified HTML content
window.zipFiles.set('index.html', htmlContent);
// Create a Blob for the modified ZIP file
createModifiedZip(zip);
} else {
alert('The ZIP file does not contain index.html');
}
}
// Function to create a new ZIP file with modified content
function createModifiedZip(zip) {
// Create a new JSZip instance
const newZip = new JSZip();
// Add all files from the original ZIP to the new ZIP
window.zipFiles.forEach(function (content, path) {
newZip.file(path, content);
});
// Generate the new ZIP file and provide a download link
newZip.generateAsync({ type: 'blob' }).then(function (blob) {
// Update the download button with the new ZIP file
const downloadButton = document.getElementById('downloadButton');
downloadButton.href = URL.createObjectURL(blob);
downloadButton.style.display = 'inline';
});
}