tester / index.html
rohbot's picture
Remove watermarks and make the image into an editable pdf - Follow Up Deployment
dddd38d verified
Raw History Blame Contribute Delete
9.48 kB
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Watermark Remover & PDF Converter</title>
<script src="https://cdn.tailwindcss.com"></script>
<link href="https://unpkg.com/aos@2.3.1/dist/aos.css" rel="stylesheet">
<script src="https://unpkg.com/aos@2.3.1/dist/aos.js"></script>
<script src="https://unpkg.com/feather-icons"></script>
<script src="https://cdn.jsdelivr.net/npm/feather-icons/dist/feather.min.js"></script>
</head>
<body class="bg-gray-50 min-h-screen">
<div class="container mx-auto px-4 py-12">
<div class="max-w-3xl mx-auto bg-white rounded-xl shadow-md overflow-hidden" data-aos="fade-up">
<div class="p-8">
<div class="text-center mb-8">
<h1 class="text-3xl font-bold text-gray-800 mb-2">Watermark Remover & PDF Converter</h1>
<p class="text-gray-600">Upload your image to remove watermarks and convert to editable PDF</p>
</div>
<div class="border-2 border-dashed border-gray-300 rounded-lg p-8 text-center mb-8 hover:border-blue-500 transition-colors duration-300" id="dropZone">
<div class="flex flex-col items-center justify-center space-y-4">
<i data-feather="upload" class="w-12 h-12 text-blue-500"></i>
<p class="text-gray-600">Drag & drop your image here or click to browse</p>
<input type="file" id="fileInput" class="hidden" accept="image/*">
<button onclick="document.getElementById('fileInput').click()" class="px-6 py-2 bg-blue-500 text-white rounded-lg hover:bg-blue-600 transition-colors duration-300">
Select Image
</button>
</div>
</div>
<div class="grid grid-cols-1 md:grid-cols-2 gap-6 mb-8 hidden" id="previewSection">
<div class="border rounded-lg p-4">
<h3 class="font-medium text-gray-700 mb-2 flex items-center">
<i data-feather="image" class="w-4 h-4 mr-2"></i> Original Image
</h3>
<div class="h-64 bg-gray-100 rounded overflow-hidden flex items-center justify-center">
<img id="originalImage" class="max-h-full max-w-full object-contain" src="" alt="Original Image">
</div>
</div>
<div class="border rounded-lg p-4">
<h3 class="font-medium text-gray-700 mb-2 flex items-center">
<i data-feather="file-text" class="w-4 h-4 mr-2"></i> Processed PDF Preview
</h3>
<div class="h-64 bg-gray-100 rounded overflow-hidden flex items-center justify-center">
<div class="text-center p-4">
<i data-feather="file" class="w-12 h-12 text-gray-400 mx-auto mb-2"></i>
<p class="text-gray-500">PDF preview will appear here after processing</p>
</div>
</div>
</div>
</div>
<div class="flex flex-col sm:flex-row justify-center gap-4">
<button id="processBtn" class="px-6 py-3 bg-blue-500 text-white rounded-lg hover:bg-blue-600 transition-colors duration-300 flex items-center justify-center disabled:opacity-50" disabled>
<i data-feather="refresh-cw" class="w-4 h-4 mr-2 animate-spin hidden"></i>
<span>Remove Watermark & Convert to PDF</span>
</button>
<button id="downloadBtn" class="px-6 py-3 bg-green-500 text-white rounded-lg hover:bg-green-600 transition-colors duration-300 flex items-center justify-center hidden">
<i data-feather="download" class="w-4 h-4 mr-2"></i>
<span>Download PDF</span>
</button>
</div>
</div>
</div>
<div class="max-w-3xl mx-auto mt-8 bg-white rounded-xl shadow-md overflow-hidden hidden" id="featuresSection" data-aos="fade-up">
<div class="p-8">
<h2 class="text-2xl font-bold text-gray-800 mb-6">How It Works</h2>
<div class="grid grid-cols-1 md:grid-cols-3 gap-6">
<div class="text-center p-4">
<div class="w-16 h-16 bg-blue-100 rounded-full flex items-center justify-center mx-auto mb-4">
<i data-feather="upload" class="w-6 h-6 text-blue-500"></i>
</div>
<h3 class="font-medium text-gray-700 mb-2">Upload Image</h3>
<p class="text-gray-500 text-sm">Upload your watermarked image in JPG, PNG or other formats</p>
</div>
<div class="text-center p-4">
<div class="w-16 h-16 bg-blue-100 rounded-full flex items-center justify-center mx-auto mb-4">
<i data-feather="edit" class="w-6 h-6 text-blue-500"></i>
</div>
<h3 class="font-medium text-gray-700 mb-2">Remove Watermark</h3>
<p class="text-gray-500 text-sm">Our AI automatically detects and removes watermarks</p>
</div>
<div class="text-center p-4">
<div class="w-16 h-16 bg-blue-100 rounded-full flex items-center justify-center mx-auto mb-4">
<i data-feather="download" class="w-6 h-6 text-blue-500"></i>
</div>
<h3 class="font-medium text-gray-700 mb-2">Download PDF</h3>
<p class="text-gray-500 text-sm">Get your clean, editable PDF document instantly</p>
</div>
</div>
</div>
</div>
</div>
<script>
AOS.init();
feather.replace();
// Handle file selection
const fileInput = document.getElementById('fileInput');
const dropZone = document.getElementById('dropZone');
const previewSection = document.getElementById('previewSection');
const originalImage = document.getElementById('originalImage');
const processBtn = document.getElementById('processBtn');
const downloadBtn = document.getElementById('downloadBtn');
const featuresSection = document.getElementById('featuresSection');
// Show features section after initial interaction
setTimeout(() => {
featuresSection.classList.remove('hidden');
}, 1500);
// Handle drag and drop
['dragenter', 'dragover', 'dragleave', 'drop'].forEach(eventName => {
dropZone.addEventListener(eventName, preventDefaults, false);
});
function preventDefaults(e) {
e.preventDefault();
e.stopPropagation();
}
['dragenter', 'dragover'].forEach(eventName => {
dropZone.addEventListener(eventName, highlight, false);
});
['dragleave', 'drop'].forEach(eventName => {
dropZone.addEventListener(eventName, unhighlight, false);
});
function highlight() {
dropZone.classList.add('border-blue-500');
}
function unhighlight() {
dropZone.classList.remove('border-blue-500');
}
dropZone.addEventListener('drop', handleDrop, false);
fileInput.addEventListener('change', handleFiles, false);
function handleDrop(e) {
const dt = e.dataTransfer;
const files = dt.files;
handleFiles({ target: { files } });
}
function handleFiles(e) {
const files = e.target.files;
if (files.length) {
const file = files[0];
if (file.type.match('image.*')) {
const reader = new FileReader();
reader.onload = function(e) {
originalImage.src = e.target.result;
previewSection.classList.remove('hidden');
processBtn.disabled = false;
};
reader.readAsDataURL(file);
} else {
alert('Please select an image file.');
}
}
}
// Process button click handler
processBtn.addEventListener('click', function() {
// Simulate processing
processBtn.disabled = true;
const icon = processBtn.querySelector('i');
icon.classList.remove('hidden');
setTimeout(() => {
icon.classList.add('hidden');
processBtn.disabled = false;
downloadBtn.classList.remove('hidden');
alert('Watermark removed and PDF created successfully!');
}, 2000);
});
// Download button click handler
downloadBtn.addEventListener('click', function() {
alert('In a real implementation, this would download the processed PDF');
});
</script>
</body>
</html>