commit 45ab79d597d8be0326322f3598006937a4c4aff3
Author: root <root@hub.scroll.pub> Date: 2025-01-08 04:51:29 +0000 Subject: Initial commit diff --git a/body.html b/body.html new file mode 100644 index 0000000..bbfaeef --- /dev/null +++ b/body.html @@ -0,0 +1,30 @@ +<header> + <h1>FileShare</h1> + <p>Simple, secure file sharing for everyone</p> +</header> + +<main> + <section class="upload-section"> + <div class="dropzone" id="dropzone"> + <p>Drag & drop files here or</p> + <label for="file-input" class="upload-button">Choose Files</label> + <input type="file" id="file-input" multiple> + </div> + <div class="progress-container" id="progress-container"> + <div class="progress-bar" id="progress-bar"></div> + </div> + </section> + + <section class="share-section" id="share-section" hidden> + <h2>Your File is Ready!</h2> + <div class="share-link"> + <input type="text" id="share-url" readonly> + <button id="copy-button">Copy Link</button> + </div> + <p class="expiration">Link expires in 24 hours</p> + </section> +</main> + +<footer> + <p>Made with ❤️ on Ubuntu</p> +</footer> \ No newline at end of file diff --git a/index.scroll b/index.scroll new file mode 100644 index 0000000..03bed21 --- /dev/null +++ b/index.scroll @@ -0,0 +1,8 @@ +buildHtml +baseUrl https://fileshare.scroll.pub +metaTags +editButton /edit.html +title FileShare - Simple & Secure File Sharing +style.css +body.html +script.js \ No newline at end of file diff --git a/prompt.json b/prompt.json new file mode 100644 index 0000000..1002e9c --- /dev/null +++ b/prompt.json @@ -0,0 +1,25 @@ +{ + "id": "2103a0d9-c1c0-4caa-b986-68032bbc605a", + "object": "chat.completion", + "created": 1736311860, + "model": "deepseek-chat", + "choices": [ + { + "index": 0, + "message": { + "role": "assistant", + "content": "---domain---\nfileshare.scroll.pub\n---index.scroll---\nbuildHtml\nbaseUrl https://fileshare.scroll.pub\nmetaTags\neditButton /edit.html\ntitle FileShare - Simple & Secure File Sharing\nstyle.css\nbody.html\nscript.js\n---body.html---\n<header>\n <h1>FileShare</h1>\n <p>Simple, secure file sharing for everyone</p>\n</header>\n\n<main>\n <section class=\"upload-section\">\n <div class=\"dropzone\" id=\"dropzone\">\n <p>Drag & drop files here or</p>\n <label for=\"file-input\" class=\"upload-button\">Choose Files</label>\n <input type=\"file\" id=\"file-input\" multiple>\n </div>\n <div class=\"progress-container\" id=\"progress-container\">\n <div class=\"progress-bar\" id=\"progress-bar\"></div>\n </div>\n </section>\n\n <section class=\"share-section\" id=\"share-section\" hidden>\n <h2>Your File is Ready!</h2>\n <div class=\"share-link\">\n <input type=\"text\" id=\"share-url\" readonly>\n <button id=\"copy-button\">Copy Link</button>\n </div>\n <p class=\"expiration\">Link expires in 24 hours</p>\n </section>\n</main>\n\n<footer>\n <p>Made with ❤️ on Ubuntu</p>\n</footer>\n---style.css---\n:root {\n --primary-color: #2563eb;\n --secondary-color: #1e40af;\n --background-color: #f8fafc;\n --text-color: #1e293b;\n --border-radius: 8px;\n --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);\n}\n\n* {\n margin: 0;\n padding: 0;\n box-sizing: border-box;\n}\n\nbody {\n font-family: system-ui, -apple-system, sans-serif;\n line-height: 1.5;\n color: var(--text-color);\n background-color: var(--background-color);\n min-height: 100vh;\n display: flex;\n flex-direction: column;\n}\n\nheader {\n text-align: center;\n padding: 2rem;\n background-color: white;\n box-shadow: var(--shadow);\n}\n\nh1 {\n font-size: 2.5rem;\n color: var(--primary-color);\n}\n\n.upload-section {\n max-width: 800px;\n margin: 2rem auto;\n padding: 0 1rem;\n}\n\n.dropzone {\n border: 2px dashed var(--primary-color);\n border-radius: var(--border-radius);\n padding: 3rem;\n text-align: center;\n background-color: white;\n transition: all 0.2s ease;\n cursor: pointer;\n}\n\n.dropzone:hover {\n background-color: #f0f4f8;\n transform: translateY(-2px);\n}\n\n.dropzone.dragover {\n background-color: #dbeafe;\n border-color: var(--secondary-color);\n}\n\n.upload-button {\n display: inline-block;\n background-color: var(--primary-color);\n color: white;\n padding: 0.75rem 1.5rem;\n border-radius: var(--border-radius);\n cursor: pointer;\n transition: background-color 0.2s ease;\n}\n\n.upload-button:hover {\n background-color: var(--secondary-color);\n}\n\n#file-input {\n display: none;\n}\n\n.progress-container {\n margin-top: 1rem;\n height: 8px;\n background-color: #e2e8f0;\n border-radius: var(--border-radius);\n overflow: hidden;\n display: none;\n}\n\n.progress-bar {\n height: 100%;\n width: 0;\n background-color: var(--primary-color);\n transition: width 0.3s ease;\n}\n\n.share-section {\n max-width: 800px;\n margin: 2rem auto;\n padding: 0 1rem;\n text-align: center;\n}\n\n.share-link {\n display: flex;\n gap: 0.5rem;\n margin: 1rem 0;\n}\n\n#share-url {\n flex: 1;\n padding: 0.75rem;\n border: 1px solid #cbd5e1;\n border-radius: var(--border-radius);\n}\n\n#copy-button {\n background-color: var(--primary-color);\n color: white;\n border: none;\n padding: 0.75rem 1.5rem;\n border-radius: var(--border-radius);\n cursor: pointer;\n transition: background-color 0.2s ease;\n}\n\n#copy-button:hover {\n background-color: var(--secondary-color);\n}\n\n.expiration {\n color: #64748b;\n font-size: 0.875rem;\n}\n\nfooter {\n margin-top: auto;\n text-align: center;\n padding: 1rem;\n background-color: white;\n box-shadow: var(--shadow);\n}\n\n@media (max-width: 600px) {\n .share-link {\n flex-direction: column;\n }\n \n #copy-button {\n width: 100%;\n }\n}\n---script.js---\nconst dropzone = document.getElementById('dropzone');\nconst fileInput = document.getElementById('file-input');\nconst progressContainer = document.getElementById('progress-container');\nconst progressBar = document.getElementById('progress-bar');\nconst shareSection = document.getElementById('share-section');\nconst shareUrl = document.getElementById('share-url');\nconst copyButton = document.getElementById('copy-button');\n\n// Handle file drag and drop\ndropzone.addEventListener('dragover', (e) => {\n e.preventDefault();\n dropzone.classList.add('dragover');\n});\n\ndropzone.addEventListener('dragleave', () => {\n dropzone.classList.remove('dragover');\n});\n\ndropzone.addEventListener('drop', (e) => {\n e.preventDefault();\n dropzone.classList.remove('dragover');\n handleFiles(e.dataTransfer.files);\n});\n\n// Handle file selection\nfileInput.addEventListener('change', () => {\n handleFiles(fileInput.files);\n});\n\n// Handle file upload\nfunction handleFiles(files) {\n if (files.length === 0) return;\n \n const formData = new FormData();\n for (const file of files) {\n formData.append('files', file);\n }\n \n progressContainer.style.display = 'block';\n \n const xhr = new XMLHttpRequest();\n xhr.open('POST', '/upload', true);\n \n xhr.upload.onprogress = (e) => {\n if (e.lengthComputable) {\n const percent = (e.loaded / e.total) * 100;\n progressBar.style.width = `${percent}%`;\n }\n };\n \n xhr.onload = () => {\n if (xhr.status === 200) {\n const response = JSON.parse(xhr.responseText);\n shareUrl.value = response.downloadUrl;\n shareSection.hidden = false;\n progressContainer.style.display = 'none';\n } else {\n alert('Upload failed. Please try again.');\n }\n };\n \n xhr.send(formData);\n}\n\n// Handle copy link\ncopyButton.addEventListener('click', () => {\n shareUrl.select();\n document.execCommand('copy');\n copyButton.textContent = 'Copied!';\n setTimeout(() => {\n copyButton.textContent = 'Copy Link';\n }, 2000);\n});\n---end---" + }, + "logprobs": null, + "finish_reason": "stop" + } + ], + "usage": { + "prompt_tokens": 258, + "completion_tokens": 1617, + "total_tokens": 1875, + "prompt_cache_hit_tokens": 0, + "prompt_cache_miss_tokens": 258 + }, + "system_fingerprint": "fp_3a5770e1b4" +} \ No newline at end of file diff --git a/readme.scroll b/readme.scroll new file mode 100644 index 0000000..9733de6 --- /dev/null +++ b/readme.scroll @@ -0,0 +1,3 @@ +# fileshare.scroll.pub + +website generated by DeepSeek from prompt: i want to create a website to upload files for sharing these files with others. i have my server installed ubuntu system. \ No newline at end of file diff --git a/script.js b/script.js new file mode 100644 index 0000000..b082cbf --- /dev/null +++ b/script.js @@ -0,0 +1,73 @@ +const dropzone = document.getElementById('dropzone'); +const fileInput = document.getElementById('file-input'); +const progressContainer = document.getElementById('progress-container'); +const progressBar = document.getElementById('progress-bar'); +const shareSection = document.getElementById('share-section'); +const shareUrl = document.getElementById('share-url'); +const copyButton = document.getElementById('copy-button'); + +// Handle file drag and drop +dropzone.addEventListener('dragover', (e) => { + e.preventDefault(); + dropzone.classList.add('dragover'); +}); + +dropzone.addEventListener('dragleave', () => { + dropzone.classList.remove('dragover'); +}); + +dropzone.addEventListener('drop', (e) => { + e.preventDefault(); + dropzone.classList.remove('dragover'); + handleFiles(e.dataTransfer.files); +}); + +// Handle file selection +fileInput.addEventListener('change', () => { + handleFiles(fileInput.files); +}); + +// Handle file upload +function handleFiles(files) { + if (files.length === 0) return; + + const formData = new FormData(); + for (const file of files) { + formData.append('files', file); + } + + progressContainer.style.display = 'block'; + + const xhr = new XMLHttpRequest(); + xhr.open('POST', '/upload', true); + + xhr.upload.onprogress = (e) => { + if (e.lengthComputable) { + const percent = (e.loaded / e.total) * 100; + progressBar.style.width = `${percent}%`; + } + }; + + xhr.onload = () => { + if (xhr.status === 200) { + const response = JSON.parse(xhr.responseText); + shareUrl.value = response.downloadUrl; + shareSection.hidden = false; + progressContainer.style.display = 'none'; + } else { + alert('Upload failed. Please try again.'); + } + }; + + xhr.send(formData); +} + +// Handle copy link +copyButton.addEventListener('click', () => { + shareUrl.select(); + document.execCommand('copy'); + copyButton.textContent = 'Copied!'; + setTimeout(() => { + copyButton.textContent = 'Copy Link'; + }, 2000); +}); \ No newline at end of file diff --git a/style.css b/style.css new file mode 100644 index 0000000..e866f0a --- /dev/null +++ b/style.css @@ -0,0 +1,153 @@ +:root { + --primary-color: #2563eb; + --secondary-color: #1e40af; + --background-color: #f8fafc; + --text-color: #1e293b; + --border-radius: 8px; + --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1); +} + +* { + margin: 0; + padding: 0; + box-sizing: border-box; +} + +body { + font-family: system-ui, -apple-system, sans-serif; + line-height: 1.5; + color: var(--text-color); + background-color: var(--background-color); + min-height: 100vh; + display: flex; + flex-direction: column; +} + +header { + text-align: center; + padding: 2rem; + background-color: white; + box-shadow: var(--shadow); +} + +h1 { + font-size: 2.5rem; + color: var(--primary-color); +} + +.upload-section { + max-width: 800px; + margin: 2rem auto; + padding: 0 1rem; +} + +.dropzone { + border: 2px dashed var(--primary-color); + border-radius: var(--border-radius); + padding: 3rem; + text-align: center; + background-color: white; + transition: all 0.2s ease; + cursor: pointer; +} + +.dropzone:hover { + background-color: #f0f4f8; + transform: translateY(-2px); +} + +.dropzone.dragover { + background-color: #dbeafe; + border-color: var(--secondary-color); +} + +.upload-button { + display: inline-block; + background-color: var(--primary-color); + color: white; + padding: 0.75rem 1.5rem; + border-radius: var(--border-radius); + cursor: pointer; + transition: background-color 0.2s ease; +} + +.upload-button:hover { + background-color: var(--secondary-color); +} + +#file-input { + display: none; +} + +.progress-container { + margin-top: 1rem; + height: 8px; + background-color: #e2e8f0; + border-radius: var(--border-radius); + overflow: hidden; + display: none; +} + +.progress-bar { + height: 100%; + width: 0; + background-color: var(--primary-color); + transition: width 0.3s ease; +} + +.share-section { + max-width: 800px; + margin: 2rem auto; + padding: 0 1rem; + text-align: center; +} + +.share-link { + display: flex; + gap: 0.5rem; + margin: 1rem 0; +} + +#share-url { + flex: 1; + padding: 0.75rem; + border: 1px solid #cbd5e1; + border-radius: var(--border-radius); +} + +#copy-button { + background-color: var(--primary-color); + color: white; + border: none; + padding: 0.75rem 1.5rem; + border-radius: var(--border-radius); + cursor: pointer; + transition: background-color 0.2s ease; +} + +#copy-button:hover { + background-color: var(--secondary-color); +} + +.expiration { + color: #64748b; + font-size: 0.875rem; +} + +footer { + margin-top: auto; + text-align: center; + padding: 1rem; + background-color: white; + box-shadow: var(--shadow); +} + +@media (max-width: 600px) { + .share-link { + flex-direction: column; + } + + #copy-button { + width: 100%; + } +} \ No newline at end of file