Spaces:
Running
Running
File size: 34,700 Bytes
c15b8b7 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 | <!DOCTYPE html>
<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> |