Spaces:
Running
Running
Download index.html from Ajtrax/multitools: direct link, hf CLI and curl.
- Browser
- Download file 34.7 kB
-
https://huggingface.co/spaces/Ajtrax/multitools/resolve/main/index.html
- Command line
-
hf download hf://spaces/Ajtrax/multitools/index.html
-
curl -L -o index.html https://huggingface.co/spaces/Ajtrax/multitools/resolve/main/index.html
34.7 kB
| <html lang="en"> | |
| <head> | |
| <meta charset="UTF-8"> | |
| <meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
| <title>MultiTools - All-in-One Online Tools</title> | |
| <script src="https://cdn.tailwindcss.com"></script> | |
| <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css"> | |
| <style> | |
| .tool-card:hover { | |
| transform: translateY(-5px); | |
| box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1); | |
| } | |
| .category-btn.active { | |
| background-color: #3b82f6; | |
| color: white; | |
| } | |
| .file-drop-area { | |
| border: 2px dashed #cbd5e0; | |
| transition: all 0.3s; | |
| } | |
| .file-drop-area.active { | |
| border-color: #3b82f6; | |
| background-color: #f0f7ff; | |
| } | |
| .progress-bar { | |
| transition: width 0.3s ease; | |
| } | |
| .tool-section { | |
| display: none; | |
| } | |
| .tool-section.active { | |
| display: block; | |
| animation: fadeIn 0.3s ease; | |
| } | |
| @keyframes fadeIn { | |
| from { opacity: 0; } | |
| to { opacity: 1; } | |
| } | |
| </style> | |
| </head> | |
| <body class="bg-gray-50 min-h-screen"> | |
| <!-- Header --> | |
| <header class="bg-white shadow-sm"> | |
| <div class="container mx-auto px-4 py-4 flex justify-between items-center"> | |
| <div class="flex items-center"> | |
| <i class="fas fa-tools text-blue-500 text-2xl mr-2"></i> | |
| <h1 class="text-xl font-bold text-gray-800">Multi<span class="text-blue-500">Tools</span></h1> | |
| </div> | |
| <nav class="hidden md:flex space-x-6"> | |
| <a href="#" class="text-gray-600 hover:text-blue-500">Home</a> | |
| <a href="#" class="text-gray-600 hover:text-blue-500">Tools</a> | |
| <a href="#" class="text-gray-600 hover:text-blue-500">About</a> | |
| <a href="#" class="text-gray-600 hover:text-blue-500">Contact</a> | |
| </nav> | |
| <div class="flex items-center space-x-4"> | |
| <button class="bg-blue-500 hover:bg-blue-600 text-white px-4 py-2 rounded-md transition"> | |
| Sign In | |
| </button> | |
| <button class="md:hidden text-gray-600"> | |
| <i class="fas fa-bars text-xl"></i> | |
| </button> | |
| </div> | |
| </div> | |
| </header> | |
| <!-- Hero Section --> | |
| <section class="bg-gradient-to-r from-blue-500 to-indigo-600 text-white py-16"> | |
| <div class="container mx-auto px-4 text-center"> | |
| <h2 class="text-4xl font-bold mb-4">All Your Online Tools in One Place</h2> | |
| <p class="text-xl mb-8 max-w-2xl mx-auto">Convert, edit, compress, and more - completely free and no registration required!</p> | |
| <div class="relative max-w-xl mx-auto"> | |
| <input type="text" placeholder="Search for tools..." class="w-full py-3 px-4 rounded-full text-gray-800 focus:outline-none focus:ring-2 focus:ring-blue-300"> | |
| <button class="absolute right-2 top-1/2 transform -translate-y-1/2 bg-blue-600 hover:bg-blue-700 text-white p-2 rounded-full"> | |
| <i class="fas fa-search"></i> | |
| </button> | |
| </div> | |
| </div> | |
| </section> | |
| <!-- Categories --> | |
| <section class="py-8 bg-white"> | |
| <div class="container mx-auto px-4"> | |
| <div class="flex overflow-x-auto space-x-2 pb-2 scrollbar-hide"> | |
| <button class="category-btn active px-4 py-2 rounded-full bg-blue-100 text-blue-600 whitespace-nowrap" data-category="all"> | |
| All Tools | |
| </button> | |
| <button class="category-btn px-4 py-2 rounded-full bg-gray-100 text-gray-600 hover:bg-gray-200 whitespace-nowrap" data-category="pdf"> | |
| PDF Tools | |
| </button> | |
| <button class="category-btn px-4 py-2 rounded-full bg-gray-100 text-gray-600 hover:bg-gray-200 whitespace-nowrap" data-category="image"> | |
| Image Tools | |
| </button> | |
| <button class="category-btn px-4 py-2 rounded-full bg-gray-100 text-gray-600 hover:bg-gray-200 whitespace-nowrap" data-category="video"> | |
| Video Tools | |
| </button> | |
| <button class="category-btn px-4 py-2 rounded-full bg-gray-100 text-gray-600 hover:bg-gray-200 whitespace-nowrap" data-category="document"> | |
| Document Tools | |
| </button> | |
| <button class="category-btn px-4 py-2 rounded-full bg-gray-100 text-gray-600 hover:bg-gray-200 whitespace-nowrap" data-category="other"> | |
| Other Tools | |
| </button> | |
| </div> | |
| </div> | |
| </section> | |
| <!-- Tools Grid --> | |
| <section class="py-12 bg-gray-50"> | |
| <div class="container mx-auto px-4"> | |
| <h3 class="text-2xl font-bold mb-8 text-gray-800">Popular Tools</h3> | |
| <div class="grid grid-cols-1 sm:grid-cols-2 md:grid-cols-3 lg:grid-cols-4 gap-6"> | |
| <!-- PDF Tools --> | |
| <div class="tool-card bg-white rounded-lg shadow-md p-6 transition cursor-pointer" data-category="pdf" data-tool="pdf-to-word"> | |
| <div class="flex items-center mb-4"> | |
| <div class="bg-blue-100 p-3 rounded-full mr-4"> | |
| <i class="fas fa-file-pdf text-blue-500 text-xl"></i> | |
| </div> | |
| <h4 class="font-semibold text-gray-800">PDF to Word</h4> | |
| </div> | |
| <p class="text-gray-600 text-sm">Convert your PDF documents to editable Word files.</p> | |
| </div> | |
| <div class="tool-card bg-white rounded-lg shadow-md p-6 transition cursor-pointer" data-category="pdf" data-tool="compress-pdf"> | |
| <div class="flex items-center mb-4"> | |
| <div class="bg-blue-100 p-3 rounded-full mr-4"> | |
| <i class="fas fa-file-export text-blue-500 text-xl"></i> | |
| </div> | |
| <h4 class="font-semibold text-gray-800">Compress PDF</h4> | |
| </div> | |
| <p class="text-gray-600 text-sm">Reduce PDF file size while keeping quality.</p> | |
| </div> | |
| <!-- Image Tools --> | |
| <div class="tool-card bg-white rounded-lg shadow-md p-6 transition cursor-pointer" data-category="image" data-tool="image-compressor"> | |
| <div class="flex items-center mb-4"> | |
| <div class="bg-green-100 p-3 rounded-full mr-4"> | |
| <i class="fas fa-image text-green-500 text-xl"></i> | |
| </div> | |
| <h4 class="font-semibold text-gray-800">Image Compressor</h4> | |
| </div> | |
| <p class="text-gray-600 text-sm">Compress JPG, PNG, SVG or GIF files.</p> | |
| </div> | |
| <div class="tool-card bg-white rounded-lg shadow-md p-6 transition cursor-pointer" data-category="image" data-tool="image-converter"> | |
| <div class="flex items-center mb-4"> | |
| <div class="bg-green-100 p-3 rounded-full mr-4"> | |
| <i class="fas fa-exchange-alt text-green-500 text-xl"></i> | |
| </div> | |
| <h4 class="font-semibold text-gray-800">Image Converter</h4> | |
| </div> | |
| <p class="text-gray-600 text-sm">Convert between JPG, PNG, SVG, and more.</p> | |
| </div> | |
| <!-- Video Tools --> | |
| <div class="tool-card bg-white rounded-lg shadow-md p-6 transition cursor-pointer" data-category="video" data-tool="video-compressor"> | |
| <div class="flex items-center mb-4"> | |
| <div class="bg-purple-100 p-3 rounded-full mr-4"> | |
| <i class="fas fa-video text-purple-500 text-xl"></i> | |
| </div> | |
| <h4 class="font-semibold text-gray-800">Video Compressor</h4> | |
| </div> | |
| <p class="text-gray-600 text-sm">Reduce video file size without losing quality.</p> | |
| </div> | |
| <div class="tool-card bg-white rounded-lg shadow-md p-6 transition cursor-pointer" data-category="video" data-tool="video-converter"> | |
| <div class="flex items-center mb-4"> | |
| <div class="bg-purple-100 p-3 rounded-full mr-4"> | |
| <i class="fas fa-exchange-alt text-purple-500 text-xl"></i> | |
| </div> | |
| <h4 class="font-semibold text-gray-800">Video Converter</h4> | |
| </div> | |
| <p class="text-gray-600 text-sm">Convert between MP4, AVI, MOV, and more.</p> | |
| </div> | |
| <!-- Document Tools --> | |
| <div class="tool-card bg-white rounded-lg shadow-md p-6 transition cursor-pointer" data-category="document" data-tool="word-to-pdf"> | |
| <div class="flex items-center mb-4"> | |
| <div class="bg-red-100 p-3 rounded-full mr-4"> | |
| <i class="fas fa-file-word text-red-500 text-xl"></i> | |
| </div> | |
| <h4 class="font-semibold text-gray-800">Word to PDF</h4> | |
| </div> | |
| <p class="text-gray-600 text-sm">Convert Word documents to PDF files.</p> | |
| </div> | |
| <div class="tool-card bg-white rounded-lg shadow-md p-6 transition cursor-pointer" data-category="document" data-tool="excel-to-pdf"> | |
| <div class="flex items-center mb-4"> | |
| <div class="bg-red-100 p-3 rounded-full mr-4"> | |
| <i class="fas fa-file-excel text-red-500 text-xl"></i> | |
| </div> | |
| <h4 class="font-semibold text-gray-800">Excel to PDF</h4> | |
| </div> | |
| <p class="text-gray-600 text-sm">Convert Excel spreadsheets to PDF files.</p> | |
| </div> | |
| <!-- Other Tools --> | |
| <div class="tool-card bg-white rounded-lg shadow-md p-6 transition cursor-pointer" data-category="other" data-tool="qr-generator"> | |
| <div class="flex items-center mb-4"> | |
| <div class="bg-yellow-100 p-3 rounded-full mr-4"> | |
| <i class="fas fa-qrcode text-yellow-500 text-xl"></i> | |
| </div> | |
| <h4 class="font-semibold text-gray-800">QR Generator</h4> | |
| </div> | |
| <p class="text-gray-600 text-sm">Create QR codes for URLs, text, and more.</p> | |
| </div> | |
| <div class="tool-card bg-white rounded-lg shadow-md p-6 transition cursor-pointer" data-category="other" data-tool="password-generator"> | |
| <div class="flex items-center mb-4"> | |
| <div class="bg-yellow-100 p-3 rounded-full mr-4"> | |
| <i class="fas fa-key text-yellow-500 text-xl"></i> | |
| </div> | |
| <h4 class="font-semibold text-gray-800">Password Generator</h4> | |
| </div> | |
| <p class="text-gray-600 text-sm">Generate strong, secure passwords.</p> | |
| </div> | |
| </div> | |
| </div> | |
| </section> | |
| <!-- Tool Sections (Hidden by default) --> | |
| <div class="container mx-auto px-4 py-12"> | |
| <!-- PDF to Word Tool --> | |
| <div id="pdf-to-word-tool" class="tool-section bg-white rounded-xl shadow-lg p-6 max-w-4xl mx-auto"> | |
| <div class="flex justify-between items-center mb-6"> | |
| <h3 class="text-2xl font-bold text-gray-800">PDF to Word Converter</h3> | |
| <button class="close-tool text-gray-500 hover:text-gray-700"> | |
| <i class="fas fa-times text-xl"></i> | |
| </button> | |
| </div> | |
| <div class="file-drop-area p-8 text-center rounded-lg mb-6" id="pdf-drop-area"> | |
| <i class="fas fa-file-pdf text-4xl text-blue-500 mb-4"></i> | |
| <h4 class="text-xl font-semibold mb-2">Drag & Drop your PDF here</h4> | |
| <p class="text-gray-500 mb-4">or</p> | |
| <label for="pdf-upload" class="bg-blue-500 hover:bg-blue-600 text-white px-6 py-2 rounded-md cursor-pointer transition"> | |
| Select PDF File | |
| </label> | |
| <input type="file" id="pdf-upload" class="hidden" accept=".pdf"> | |
| </div> | |
| <div class="options mb-6"> | |
| <h4 class="font-semibold mb-3">Conversion Options</h4> | |
| <div class="grid grid-cols-1 md:grid-cols-2 gap-4"> | |
| <div class="flex items-center"> | |
| <input type="checkbox" id="ocr-option" class="mr-2"> | |
| <label for="ocr-option">Use OCR (for scanned PDFs)</label> | |
| </div> | |
| <div class="flex items-center"> | |
| <input type="checkbox" id="keep-layout" class="mr-2" checked> | |
| <label for="keep-layout">Keep original layout</label> | |
| </div> | |
| </div> | |
| </div> | |
| <button id="convert-btn" class="w-full bg-blue-500 hover:bg-blue-600 text-white py-3 px-4 rounded-md font-medium transition"> | |
| Convert to Word | |
| </button> | |
| <div id="progress-container" class="mt-6 hidden"> | |
| <div class="flex justify-between mb-1"> | |
| <span class="text-sm font-medium">Conversion Progress</span> | |
| <span id="progress-percent" class="text-sm font-medium">0%</span> | |
| </div> | |
| <div class="w-full bg-gray-200 rounded-full h-2.5"> | |
| <div id="progress-bar" class="progress-bar bg-blue-600 h-2.5 rounded-full" style="width: 0%"></div> | |
| </div> | |
| </div> | |
| <div id="result-container" class="mt-6 hidden"> | |
| <div class="bg-green-50 border border-green-200 rounded-lg p-4 flex justify-between items-center"> | |
| <div class="flex items-center"> | |
| <i class="fas fa-file-word text-green-500 text-2xl mr-3"></i> | |
| <div> | |
| <h4 class="font-medium">converted-file.docx</h4> | |
| <p class="text-sm text-gray-500">1.2 MB • Ready to download</p> | |
| </div> | |
| </div> | |
| <button class="bg-green-500 hover:bg-green-600 text-white px-4 py-2 rounded-md transition"> | |
| <i class="fas fa-download mr-2"></i> Download | |
| </button> | |
| </div> | |
| </div> | |
| </div> | |
| <!-- Image Compressor Tool --> | |
| <div id="image-compressor-tool" class="tool-section bg-white rounded-xl shadow-lg p-6 max-w-4xl mx-auto"> | |
| <div class="flex justify-between items-center mb-6"> | |
| <h3 class="text-2xl font-bold text-gray-800">Image Compressor</h3> | |
| <button class="close-tool text-gray-500 hover:text-gray-700"> | |
| <i class="fas fa-times text-xl"></i> | |
| </button> | |
| </div> | |
| <div class="file-drop-area p-8 text-center rounded-lg mb-6" id="image-drop-area"> | |
| <i class="fas fa-image text-4xl text-green-500 mb-4"></i> | |
| <h4 class="text-xl font-semibold mb-2">Drag & Drop your images here</h4> | |
| <p class="text-gray-500 mb-4">or</p> | |
| <label for="image-upload" class="bg-green-500 hover:bg-green-600 text-white px-6 py-2 rounded-md cursor-pointer transition"> | |
| Select Image Files | |
| </label> | |
| <input type="file" id="image-upload" class="hidden" accept="image/*" multiple> | |
| </div> | |
| <div class="options mb-6"> | |
| <h4 class="font-semibold mb-3">Compression Settings</h4> | |
| <div class="grid grid-cols-1 md:grid-cols-3 gap-4"> | |
| <div> | |
| <label class="block mb-1">Quality</label> | |
| <input type="range" id="quality-slider" min="10" max="100" value="80" class="w-full"> | |
| <div class="flex justify-between text-xs text-gray-500"> | |
| <span>Low</span> | |
| <span id="quality-value">80%</span> | |
| <span>High</span> | |
| </div> | |
| </div> | |
| <div> | |
| <label class="block mb-1">Resize</label> | |
| <div class="flex"> | |
| <input type="number" id="width-input" placeholder="Width" class="w-1/2 border rounded-l px-2 py-1"> | |
| <input type="number" id="height-input" placeholder="Height" class="w-1/2 border rounded-r px-2 py-1 border-l-0"> | |
| </div> | |
| </div> | |
| <div> | |
| <label class="block mb-1">Format</label> | |
| <select id="format-select" class="w-full border rounded px-2 py-1"> | |
| <option value="original">Original</option> | |
| <option value="jpeg">JPEG</option> | |
| <option value="png">PNG</option> | |
| <option value="webp">WebP</option> | |
| </select> | |
| </div> | |
| </div> | |
| </div> | |
| <button id="compress-btn" class="w-full bg-green-500 hover:bg-green-600 text-white py-3 px-4 rounded-md font-medium transition"> | |
| Compress Images | |
| </button> | |
| <div id="image-results" class="mt-6 space-y-4 hidden"> | |
| <div class="border rounded-lg p-4"> | |
| <div class="flex flex-col md:flex-row md:items-center"> | |
| <div class="flex-1"> | |
| <div class="flex items-center mb-2"> | |
| <i class="fas fa-image text-gray-500 mr-2"></i> | |
| <span class="font-medium">example.jpg</span> | |
| </div> | |
| <div class="flex justify-between text-sm text-gray-500"> | |
| <span>Original: 1.5 MB</span> | |
| <span>Compressed: 0.4 MB</span> | |
| <span>73% smaller</span> | |
| </div> | |
| </div> | |
| <button class="mt-2 md:mt-0 bg-green-500 hover:bg-green-600 text-white px-4 py-2 rounded-md transition"> | |
| <i class="fas fa-download mr-2"></i> Download | |
| </button> | |
| </div> | |
| </div> | |
| </div> | |
| </div> | |
| </div> | |
| <!-- Features Section --> | |
| <section class="py-16 bg-white"> | |
| <div class="container mx-auto px-4"> | |
| <h3 class="text-3xl font-bold text-center mb-12 text-gray-800">Why Choose MultiTools?</h3> | |
| <div class="grid grid-cols-1 md:grid-cols-3 gap-8"> | |
| <div class="text-center p-6"> | |
| <div class="bg-blue-100 p-4 rounded-full inline-block mb-4"> | |
| <i class="fas fa-bolt text-blue-500 text-3xl"></i> | |
| </div> | |
| <h4 class="text-xl font-semibold mb-3">Fast Processing</h4> | |
| <p class="text-gray-600">Our tools work in your browser for instant results without waiting in queues.</p> | |
| </div> | |
| <div class="text-center p-6"> | |
| <div class="bg-green-100 p-4 rounded-full inline-block mb-4"> | |
| <i class="fas fa-lock text-green-500 text-3xl"></i> | |
| </div> | |
| <h4 class="text-xl font-semibold mb-3">Secure & Private</h4> | |
| <p class="text-gray-600">Files stay on your device and are never uploaded to our servers.</p> | |
| </div> | |
| <div class="text-center p-6"> | |
| <div class="bg-purple-100 p-4 rounded-full inline-block mb-4"> | |
| <i class="fas fa-dollar-sign text-purple-500 text-3xl"></i> | |
| </div> | |
| <h4 class="text-xl font-semibold mb-3">100% Free</h4> | |
| <p class="text-gray-600">All tools are completely free with no hidden charges or watermarks.</p> | |
| </div> | |
| </div> | |
| </div> | |
| </section> | |
| <!-- Footer --> | |
| <footer class="bg-gray-800 text-white py-12"> | |
| <div class="container mx-auto px-4"> | |
| <div class="grid grid-cols-1 md:grid-cols-4 gap-8"> | |
| <div> | |
| <h4 class="text-xl font-bold mb-4 flex items-center"> | |
| <i class="fas fa-tools text-blue-400 mr-2"></i> | |
| MultiTools | |
| </h4> | |
| <p class="text-gray-400">Your all-in-one solution for online file conversion, compression, and editing.</p> | |
| </div> | |
| <div> | |
| <h5 class="font-semibold text-lg mb-4">Tools</h5> | |
| <ul class="space-y-2"> | |
| <li><a href="#" class="text-gray-400 hover:text-white transition">PDF Tools</a></li> | |
| <li><a href="#" class="text-gray-400 hover:text-white transition">Image Tools</a></li> | |
| <li><a href="#" class="text-gray-400 hover:text-white transition">Video Tools</a></li> | |
| <li><a href="#" class="text-gray-400 hover:text-white transition">Document Tools</a></li> | |
| </ul> | |
| </div> | |
| <div> | |
| <h5 class="font-semibold text-lg mb-4">Company</h5> | |
| <ul class="space-y-2"> | |
| <li><a href="#" class="text-gray-400 hover:text-white transition">About Us</a></li> | |
| <li><a href="#" class="text-gray-400 hover:text-white transition">Blog</a></li> | |
| <li><a href="#" class="text-gray-400 hover:text-white transition">Careers</a></li> | |
| <li><a href="#" class="text-gray-400 hover:text-white transition">Contact</a></li> | |
| </ul> | |
| </div> | |
| <div> | |
| <h5 class="font-semibold text-lg mb-4">Legal</h5> | |
| <ul class="space-y-2"> | |
| <li><a href="#" class="text-gray-400 hover:text-white transition">Terms of Service</a></li> | |
| <li><a href="#" class="text-gray-400 hover:text-white transition">Privacy Policy</a></li> | |
| <li><a href="#" class="text-gray-400 hover:text-white transition">Cookie Policy</a></li> | |
| </ul> | |
| </div> | |
| </div> | |
| <div class="border-t border-gray-700 mt-8 pt-8 flex flex-col md:flex-row justify-between items-center"> | |
| <p class="text-gray-400 mb-4 md:mb-0">© 2023 MultiTools. All rights reserved.</p> | |
| <div class="flex space-x-4"> | |
| <a href="#" class="text-gray-400 hover:text-white transition"> | |
| <i class="fab fa-facebook-f"></i> | |
| </a> | |
| <a href="#" class="text-gray-400 hover:text-white transition"> | |
| <i class="fab fa-twitter"></i> | |
| </a> | |
| <a href="#" class="text-gray-400 hover:text-white transition"> | |
| <i class="fab fa-instagram"></i> | |
| </a> | |
| <a href="#" class="text-gray-400 hover:text-white transition"> | |
| <i class="fab fa-github"></i> | |
| </a> | |
| </div> | |
| </div> | |
| </div> | |
| </footer> | |
| <script> | |
| // Category filtering | |
| const categoryBtns = document.querySelectorAll('.category-btn'); | |
| const toolCards = document.querySelectorAll('.tool-card'); | |
| categoryBtns.forEach(btn => { | |
| btn.addEventListener('click', () => { | |
| // Update active state | |
| categoryBtns.forEach(b => b.classList.remove('active')); | |
| btn.classList.add('active'); | |
| const category = btn.dataset.category; | |
| // Filter tools | |
| toolCards.forEach(card => { | |
| if (category === 'all' || card.dataset.category === category) { | |
| card.style.display = 'block'; | |
| } else { | |
| card.style.display = 'none'; | |
| } | |
| }); | |
| }); | |
| }); | |
| // Tool selection | |
| const toolSections = document.querySelectorAll('.tool-section'); | |
| toolCards.forEach(card => { | |
| card.addEventListener('click', () => { | |
| const toolId = card.dataset.tool; | |
| // Hide all tool sections | |
| toolSections.forEach(section => { | |
| section.classList.remove('active'); | |
| }); | |
| // Show selected tool | |
| document.getElementById(`${toolId}-tool`).classList.add('active'); | |
| // Scroll to tool | |
| document.getElementById(`${toolId}-tool`).scrollIntoView({ | |
| behavior: 'smooth' | |
| }); | |
| }); | |
| }); | |
| // Close tool | |
| const closeButtons = document.querySelectorAll('.close-tool'); | |
| closeButtons.forEach(btn => { | |
| btn.addEventListener('click', () => { | |
| toolSections.forEach(section => { | |
| section.classList.remove('active'); | |
| }); | |
| }); | |
| }); | |
| // File drop areas | |
| const setupFileDropArea = (dropAreaId, inputId) => { | |
| const dropArea = document.getElementById(dropAreaId); | |
| const fileInput = document.getElementById(inputId); | |
| ['dragenter', 'dragover', 'dragleave', 'drop'].forEach(eventName => { | |
| dropArea.addEventListener(eventName, preventDefaults, false); | |
| }); | |
| function preventDefaults(e) { | |
| e.preventDefault(); | |
| e.stopPropagation(); | |
| } | |
| ['dragenter', 'dragover'].forEach(eventName => { | |
| dropArea.addEventListener(eventName, highlight, false); | |
| }); | |
| ['dragleave', 'drop'].forEach(eventName => { | |
| dropArea.addEventListener(eventName, unhighlight, false); | |
| }); | |
| function highlight() { | |
| dropArea.classList.add('active'); | |
| } | |
| function unhighlight() { | |
| dropArea.classList.remove('active'); | |
| } | |
| dropArea.addEventListener('drop', handleDrop, false); | |
| fileInput.addEventListener('change', handleFiles, false); | |
| function handleDrop(e) { | |
| const dt = e.dataTransfer; | |
| const files = dt.files; | |
| fileInput.files = files; | |
| handleFiles(); | |
| } | |
| function handleFiles() { | |
| if (fileInput.files.length) { | |
| const fileName = fileInput.files[0].name; | |
| dropArea.querySelector('h4').textContent = fileName; | |
| } | |
| } | |
| }; | |
| setupFileDropArea('pdf-drop-area', 'pdf-upload'); | |
| setupFileDropArea('image-drop-area', 'image-upload'); | |
| // PDF to Word conversion simulation | |
| document.getElementById('convert-btn').addEventListener('click', () => { | |
| const progressContainer = document.getElementById('progress-container'); | |
| const progressBar = document.getElementById('progress-bar'); | |
| const progressPercent = document.getElementById('progress-percent'); | |
| const resultContainer = document.getElementById('result-container'); | |
| progressContainer.classList.remove('hidden'); | |
| let progress = 0; | |
| const interval = setInterval(() => { | |
| progress += Math.random() * 10; | |
| if (progress > 100) progress = 100; | |
| progressBar.style.width = `${progress}%`; | |
| progressPercent.textContent = `${Math.floor(progress)}%`; | |
| if (progress === 100) { | |
| clearInterval(interval); | |
| setTimeout(() => { | |
| resultContainer.classList.remove('hidden'); | |
| }, 500); | |
| } | |
| }, 200); | |
| }); | |
| // Image quality slider | |
| const qualitySlider = document.getElementById('quality-slider'); | |
| const qualityValue = document.getElementById('quality-value'); | |
| qualitySlider.addEventListener('input', () => { | |
| qualityValue.textContent = `${qualitySlider.value}%`; | |
| }); | |
| // Image compression simulation | |
| document.getElementById('compress-btn').addEventListener('click', () => { | |
| const imageResults = document.getElementById('image-results'); | |
| imageResults.classList.remove('hidden'); | |
| // Simulate multiple image results | |
| const resultsContainer = document.getElementById('image-results'); | |
| resultsContainer.innerHTML = ''; | |
| const files = document.getElementById('image-upload').files; | |
| if (files.length === 0) { | |
| // Demo content if no files selected | |
| const demoFiles = [ | |
| { name: 'example1.jpg', original: '1.5 MB', compressed: '0.4 MB', reduction: '73%' }, | |
| { name: 'vacation.png', original: '3.2 MB', compressed: '1.1 MB', reduction: '66%' }, | |
| { name: 'screenshot.png', original: '0.8 MB', compressed: '0.3 MB', reduction: '63%' } | |
| ]; | |
| demoFiles.forEach(file => { | |
| const fileElement = document.createElement('div'); | |
| fileElement.className = 'border rounded-lg p-4'; | |
| fileElement.innerHTML = ` | |
| <div class="flex flex-col md:flex-row md:items-center"> | |
| <div class="flex-1"> | |
| <div class="flex items-center mb-2"> | |
| <i class="fas fa-image text-gray-500 mr-2"></i> | |
| <span class="font-medium">${file.name}</span> | |
| </div> | |
| <div class="flex justify-between text-sm text-gray-500"> | |
| <span>Original: ${file.original}</span> | |
| <span>Compressed: ${file.compressed}</span> | |
| <span>${file.reduction} smaller</span> | |
| </div> | |
| </div> | |
| <button class="mt-2 md:mt-0 bg-green-500 hover:bg-green-600 text-white px-4 py-2 rounded-md transition"> | |
| <i class="fas fa-download mr-2"></i> Download | |
| </button> | |
| </div> | |
| `; | |
| resultsContainer.appendChild(fileElement); | |
| }); | |
| } else { | |
| // Real files processing simulation | |
| Array.from(files).forEach(file => { | |
| const originalSize = (file.size / (1024 * 1024)).toFixed(1); | |
| const compressedSize = (file.size * (Math.random() * 0.5 + 0.3) / (1024 * 1024)).toFixed(1); | |
| const reduction = Math.floor((1 - compressedSize / originalSize) * 100); | |
| const fileElement = document.createElement('div'); | |
| fileElement.className = 'border rounded-lg p-4'; | |
| fileElement.innerHTML = ` | |
| <div class="flex flex-col md:flex-row md:items-center"> | |
| <div class="flex-1"> | |
| <div class="flex items-center mb-2"> | |
| <i class="fas fa-image text-gray-500 mr-2"></i> | |
| <span class="font-medium">${file.name}</span> | |
| </div> | |
| <div class="flex justify-between text-sm text-gray-500"> | |
| <span>Original: ${originalSize} MB</span> | |
| <span>Compressed: ${compressedSize} MB</span> | |
| <span>${reduction}% smaller</span> | |
| </div> | |
| </div> | |
| <button class="mt-2 md:mt-0 bg-green-500 hover:bg-green-600 text-white px-4 py-2 rounded-md transition"> | |
| <i class="fas fa-download mr-2"></i> Download | |
| </button> | |
| </div> | |
| `; | |
| resultsContainer.appendChild(fileElement); | |
| }); | |
| } | |
| }); | |
| </script> | |
| <p style="border-radius: 8px; text-align: center; font-size: 12px; color: #fff; margin-top: 16px;position: fixed; left: 8px; bottom: 8px; z-index: 10; background: rgba(0, 0, 0, 0.8); padding: 4px 8px;">Made with <img src="https://enzostvs-deepsite.hf.space/logo.svg" alt="DeepSite Logo" style="width: 16px; height: 16px; vertical-align: middle;display:inline-block;margin-right:3px;filter:brightness(0) invert(1);"><a href="https://enzostvs-deepsite.hf.space" style="color: #fff;text-decoration: underline;" target="_blank" >DeepSite</a> - 🧬 <a href="https://enzostvs-deepsite.hf.space?remix=Ajtrax/multitools" style="color: #fff;text-decoration: underline;" target="_blank" >Remix</a></p></body> | |
| </html> |