PDF Creator with Preview
body {
font-family: Arial, sans-serif;
background-color: #f4f4f4;
margin: 0;
padding: 0;
display: flex;
justify-content: center;
align-items: center;
height: 100vh;
}
.container {
background-color: #fff;
padding: 20px;
border-radius: 8px;
box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
width: 800px;
}
h1 {
text-align: center;
margin-bottom: 20px;
}
.content {
display: flex;
gap: 20px;
}
.preview-section {
flex: 1;
text-align: center;
}
.preview-animation {
margin-bottom: 20px;
}
.convert-button {
padding: 10px 20px;
background-color: #28a745;
color: #fff;
border: none;
border-radius: 4px;
cursor: pointer;
font-size: 16px;
}
.convert-button:hover {
background-color: #218838;
}
.options-section {
flex: 1;
}
form label {
display: block;
margin-bottom: 5px;
font-weight: bold;
}
form input, form select, form textarea {
width: 100%;
padding: 8px;
margin-bottom: 10px;
border: 1px solid #ccc;
border-radius: 4px;
}
document.getElementById('convertToPdf').addEventListener('click', function() {
const websiteUrl = document.getElementById('websiteUrl').value;
const screenSize = document.getElementById('screenSize').value;
const pageSize = document.getElementById('pageSize').value;
const oneLongPage = document.getElementById('oneLongPage').checked;
const orientation = document.getElementById('orientation').value;
const pageMargin = document.getElementById('pageMargin').value;
const htmlSettings = document.getElementById('htmlSettings').value;
// Simulate a preview animation
const previewAnimation = document.getElementById('previewAnimation');
previewAnimation.innerHTML = '

';
// Simulate PDF generation (replace with actual logic)
setTimeout(() => {
previewAnimation.innerHTML = '
PDF Generated Successfully!
';
alert('PDF Generated with the following settings:\n' +
`Website URL: ${websiteUrl}\n` +
`Screen Size: ${screenSize}\n` +
`Page Size: ${pageSize}\n` +
`One Long Page: ${oneLongPage ? 'Yes' : 'No'}\n` +
`Orientation: ${orientation}\n` +
`Page Margin: ${pageMargin}\n` +
`HTML Settings: ${htmlSettings}`);
}, 2000);
});