diff --git a/assets/css/custom.css b/assets/css/custom.css new file mode 100644 index 0000000..c215739 --- /dev/null +++ b/assets/css/custom.css @@ -0,0 +1,103 @@ +/* General Styles */ +body { + font-family: 'Montserrat', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif; + background-color: #f8f9fa; +} + +.brand-red { + color: #e5322d; +} + +.btn-brand { + background-color: #e5322d; + color: white; + font-weight: bold; + padding: 0.75rem 1.5rem; + border-radius: 0.5rem; + transition: background-color 0.3s ease; +} + +.btn-brand:hover { + background-color: #c42a25; + color: white; +} + +/* Tool Grid on index.php */ +.tool-card { + border: 1px solid #e0e0e0; + border-radius: 0.75rem; + transition: transform 0.2s ease, box-shadow 0.2s ease; + text-decoration: none; + color: inherit; +} + +.tool-card:hover { + transform: translateY(-5px); + box-shadow: 0 8px 25px rgba(0,0,0,0.1); + color: inherit; +} + +.tool-card .tool-icon { + width: 64px; + height: 64px; + margin-bottom: 1rem; + color: #e5322d; +} + +.tool-card h3 { + font-weight: 600; + color: #333; +} + +.tool-card p { + color: #666; +} + +/* Uploader on merge.php */ +#drop-area { + border: 3px dashed #ddd; + border-radius: 1rem; + padding: 4rem; + text-align: center; + cursor: pointer; + transition: border-color 0.3s ease, background-color 0.3s ease; +} + +#drop-area.highlight { + border-color: #e5322d; + background-color: #fef8f8; +} + +#drop-area .upload-icon { + font-size: 4rem; + color: #e5322d; +} + +#file-list { + margin-top: 2rem; +} + +.file-item { + display: flex; + align-items: center; + padding: 0.75rem; + background-color: #fff; + border: 1px solid #e0e0e0; + border-radius: 0.5rem; + margin-bottom: 0.5rem; +} + +.file-item .file-icon { + font-size: 1.5rem; + color: #e5322d; + margin-right: 1rem; +} + +.file-item .file-name { + flex-grow: 1; +} + +.file-item .file-size { + color: #666; + margin-left: 1rem; +} \ No newline at end of file diff --git a/assets/js/main.js b/assets/js/main.js new file mode 100644 index 0000000..65556f1 --- /dev/null +++ b/assets/js/main.js @@ -0,0 +1,73 @@ +document.addEventListener('DOMContentLoaded', () => { + const dropArea = document.getElementById('drop-area'); + const fileInput = document.getElementById('fileInput'); + const fileList = document.getElementById('file-list'); + + if (dropArea) { + // Prevent default drag behaviors + ['dragenter', 'dragover', 'dragleave', 'drop'].forEach(eventName => { + dropArea.addEventListener(eventName, preventDefaults, false); + document.body.addEventListener(eventName, preventDefaults, false); + }); + + // Highlight drop area when item is dragged over it + ['dragenter', 'dragover'].forEach(eventName => { + dropArea.addEventListener(eventName, () => dropArea.classList.add('highlight'), false); + }); + + ['dragleave', 'drop'].forEach(eventName => { + dropArea.addEventListener(eventName, () => dropArea.classList.remove('highlight'), false); + }); + + // Handle dropped files + dropArea.addEventListener('drop', handleDrop, false); + + // Handle file selection via button + dropArea.addEventListener('click', () => { + fileInput.click(); + }); + + fileInput.addEventListener('change', function() { + handleFiles(this.files); + }); + + function preventDefaults(e) { + e.preventDefault(); + e.stopPropagation(); + } + + function handleDrop(e) { + let dt = e.dataTransfer; + let files = dt.files; + handleFiles(files); + } + + function handleFiles(files) { + files = [...files]; + files.forEach(file => { + // We only want PDF files + if (file.type === "application/pdf") { + renderFile(file); + } + }); + } + + function renderFile(file) { + const reader = new FileReader(); + reader.readAsDataURL(file); + reader.onloadend = function() { + const fileItem = document.createElement('div'); + fileItem.classList.add('file-item'); + + const fileSize = (file.size / 1024 / 1024).toFixed(2) + ' MB'; + + fileItem.innerHTML = ` + + ${file.name} + ${fileSize} + `; + fileList.appendChild(fileItem); + } + } + } +}); \ No newline at end of file diff --git a/index.php b/index.php index 7205f3d..e900c41 100644 --- a/index.php +++ b/index.php @@ -1,150 +1,79 @@ - +?> - - - New Style - - - - - - - - - - - - - - - - - - - + + + PDF Swiss Army - Your Online PDF Toolkit + + + + + + + + + + + + + + -
-
-

Analyzing your requirements and generating your website…

-
- Loading… -
-

AI is collecting your requirements and applying the first changes.

-

This page will update automatically as the plan is implemented.

-

Runtime: PHP — UTC

-
-
- + + + +
+
+

The PDF Toolkit You Need

+

A complete suite of online tools to handle your PDF files with ease. Secure, fast, and free.

+
+
+ +
+
+ 'Merge PDF', 'desc' => 'Combine multiple PDFs into one single document.', 'icon' => 'bi-files', 'url' => 'merge.php', 'status' => 'active'], + ['name' => 'Split PDF', 'desc' => 'Extract pages from a PDF file or save each page as a separate PDF.', 'icon' => 'bi-scissors', 'url' => 'split.php', 'status' => 'active'], + ['name' => 'Compress PDF', 'desc' => 'Reduce the file size of your PDF while optimizing for quality.', 'icon' => 'bi-file-earmark-zip-fill', 'url' => '#', 'status' => 'inactive'], + ['name' => 'PDF to Word', 'desc' => 'Convert your PDF files to editable DOCX documents.', 'icon' => 'bi-file-earmark-word-fill', 'url' => '#', 'status' => 'inactive'], + ['name' => 'PDF to PowerPoint', 'desc' => 'Convert PDFs to editable PPTX slideshows.', 'icon' => 'bi-file-earmark-ppt-fill', 'url' => '#', 'status' => 'inactive'], + ['name' => 'PDF to Excel', 'desc' => 'Pull data straight from PDFs into XLSX spreadsheets.', 'icon' => 'bi-file-earmark-excel-fill', 'url' => '#', 'status' => 'inactive'], + ['name' => 'Word to PDF', 'desc' => 'Convert DOCX documents to PDF with ease.', 'icon' => 'bi-file-earmark-word-fill', 'url' => '#', 'status' => 'inactive'], + ['name' => 'PowerPoint to PDF', 'desc' => 'Convert PPTX slideshows to PDF format.', 'icon' => 'bi-file-earmark-ppt-fill', 'url' => '#', 'status' => 'inactive'], + ['name' => 'Excel to PDF', 'desc' => 'Convert XLSX spreadsheets to PDF format.', 'icon' => 'bi-file-earmark-excel-fill', 'url' => '#', 'status' => 'inactive'], + ['name' => 'Edit PDF', 'desc' => 'Add text, images, shapes or freehand annotations to a PDF.', 'icon' => 'bi-pencil-fill', 'url' => '#', 'status' => 'inactive'], + ['name' => 'PDF to JPG', 'desc' => 'Extract all images from a PDF or convert pages to JPG.', 'icon' => 'bi-file-earmark-image-fill', 'url' => '#', 'status' => 'inactive'], + ['name' => 'JPG to PDF', 'desc' => 'Convert JPG images to PDF in seconds.', 'icon' => 'bi-file-earmark-image-fill', 'url' => '#', 'status' => 'inactive'], + ]; + ?> + + + + +
+
+ + + - + \ No newline at end of file diff --git a/merge.php b/merge.php new file mode 100644 index 0000000..50feb31 --- /dev/null +++ b/merge.php @@ -0,0 +1,69 @@ + + + + + + Merge PDF - PDF Swiss Army + + + + + + + + + + + + + + + + + + + +
+
+

Merge PDF files

+

Combine multiple PDFs into a single document.

+
+ +
+
+
+ +
+ +

Drag & drop files here

+

or

+ +
+
+ +
+ +
+ +
+ +
+
+
+
+ + + + + + diff --git a/split.php b/split.php new file mode 100644 index 0000000..c524aab --- /dev/null +++ b/split.php @@ -0,0 +1,56 @@ + + + + + + Split PDF - PDF Toolkit + + + + + + + + + + + +
+
+
+
+

Split PDF

+

Select a PDF file to extract pages from. The server-side logic is not yet implemented.

+
+ +
+
+
+ +

Drag & drop a PDF file here

+

or

+ + +
+
+
+
+
+
+
+ + + + + + +