commit 483bfa93f305fbfe471090d7f3c079dba02b0283
Author: root <root@hub.scroll.pub> Date: 2024-12-30 07:36:45 +0000 Subject: Initial commit diff --git a/body.html b/body.html new file mode 100644 index 0000000..536c03b --- /dev/null +++ b/body.html @@ -0,0 +1,52 @@ +<header> + <h1>MRI Enhancement Suite</h1> + <p class="tagline">Advanced image quality enhancement for medical imaging</p> +</header> + +<main> + <section class="upload-section"> + <div class="drop-zone" id="dropZone"> + <img src="upload-icon.svg" alt="" class="upload-icon"> + <h2>Drop NII File Here</h2> + <p>or</p> + <button class="upload-btn">Select File</button> + <input type="file" id="fileInput" accept=".nii,.nii.gz" hidden> + </div> + </section> + + <section class="model-section"> + <h2>Enhancement Model</h2> + <div class="model-grid"> + <div class="model-card" data-model="super-res"> + <h3>Super Resolution</h3> + <p>4x resolution enhancement</p> + </div> + <div class="model-card" data-model="denoise"> + <h3>Denoising</h3> + <p>Advanced noise reduction</p> + </div> + <div class="model-card" data-model="contrast"> + <h3>Contrast Enhancement</h3> + <p>Improved tissue contrast</p> + </div> + </div> + </section> + + <section class="preview-section" hidden> + <h2>Preview</h2> + <div class="preview-container"> + <div class="preview-original"> + <h3>Original</h3> + <canvas id="originalCanvas"></canvas> + </div> + <div class="preview-enhanced"> + <h3>Enhanced</h3> + <canvas id="enhancedCanvas"></canvas> + </div> + </div> + </section> +</main> + +<footer> + <p>Built for medical imaging professionals</p> +</footer> diff --git a/index.scroll b/index.scroll new file mode 100644 index 0000000..7262e48 --- /dev/null +++ b/index.scroll @@ -0,0 +1,11 @@ +buildHtml +baseUrl https://enhance-mri.scroll.pub +metaTags + title MRI Enhancement Suite + description Advanced MRI image quality enhancement web application + keywords mri, image enhancement, medical imaging, ai models +editButton /edit.html +title MRI Enhancement Suite +style.css +body.html +script.js diff --git a/prompt.json b/prompt.json new file mode 100644 index 0000000..9aec231 --- /dev/null +++ b/prompt.json @@ -0,0 +1,20 @@ +{ + "id": "msg_01HhcZqtmPBwyRNQ2nP8ixa5", + "type": "message", + "role": "assistant", + "model": "claude-3-5-sonnet-20241022", + "content": [ + { + "type": "text", + "text": "I'll create a sleek webapp for MRI image enhancement. For the domain, I suggest:\n\n---domain---\nenhance-mri.scroll.pub\n\n---index.scroll---\nbuildHtml\nbaseUrl https://enhance-mri.scroll.pub\nmetaTags\n title MRI Enhancement Suite\n description Advanced MRI image quality enhancement web application\n keywords mri, image enhancement, medical imaging, ai models\neditButton /edit.html\ntitle MRI Enhancement Suite\nstyle.css\nbody.html\nscript.js\n\n---body.html---\n<header>\n <h1>MRI Enhancement Suite</h1>\n <p class=\"tagline\">Advanced image quality enhancement for medical imaging</p>\n</header>\n\n<main>\n <section class=\"upload-section\">\n <div class=\"drop-zone\" id=\"dropZone\">\n <img src=\"upload-icon.svg\" alt=\"\" class=\"upload-icon\">\n <h2>Drop NII File Here</h2>\n <p>or</p>\n <button class=\"upload-btn\">Select File</button>\n <input type=\"file\" id=\"fileInput\" accept=\".nii,.nii.gz\" hidden>\n </div>\n </section>\n\n <section class=\"model-section\">\n <h2>Enhancement Model</h2>\n <div class=\"model-grid\">\n <div class=\"model-card\" data-model=\"super-res\">\n <h3>Super Resolution</h3>\n <p>4x resolution enhancement</p>\n </div>\n <div class=\"model-card\" data-model=\"denoise\">\n <h3>Denoising</h3>\n <p>Advanced noise reduction</p>\n </div>\n <div class=\"model-card\" data-model=\"contrast\">\n <h3>Contrast Enhancement</h3>\n <p>Improved tissue contrast</p>\n </div>\n </div>\n </section>\n\n <section class=\"preview-section\" hidden>\n <h2>Preview</h2>\n <div class=\"preview-container\">\n <div class=\"preview-original\">\n <h3>Original</h3>\n <canvas id=\"originalCanvas\"></canvas>\n </div>\n <div class=\"preview-enhanced\">\n <h3>Enhanced</h3>\n <canvas id=\"enhancedCanvas\"></canvas>\n </div>\n </div>\n </section>\n</main>\n\n<footer>\n <p>Built for medical imaging professionals</p>\n</footer>\n\n---style.css---\n:root {\n --primary-color: #2a6bf2;\n --secondary-color: #1a1b4b;\n --accent-color: #4cd7f6;\n --background: #f8fafc;\n --text-color: #1a1b4b;\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.6;\n color: var(--text-color);\n background: var(--background);\n}\n\nheader {\n background: linear-gradient(135deg, var(--secondary-color), var(--primary-color));\n color: white;\n padding: 2rem;\n text-align: center;\n box-shadow: 0 4px 6px rgba(0,0,0,0.1);\n}\n\nh1 {\n font-size: 2.5rem;\n margin-bottom: 0.5rem;\n}\n\n.tagline {\n font-size: 1.2rem;\n opacity: 0.9;\n}\n\nmain {\n max-width: 1200px;\n margin: 2rem auto;\n padding: 0 1rem;\n}\n\n.drop-zone {\n border: 3px dashed var(--primary-color);\n border-radius: 1rem;\n padding: 3rem;\n text-align: center;\n background: white;\n transition: all 0.3s ease;\n cursor: pointer;\n}\n\n.drop-zone:hover {\n background: rgba(42,107,242,0.05);\n}\n\n.upload-icon {\n width: 64px;\n height: 64px;\n margin-bottom: 1rem;\n}\n\n.upload-btn {\n background: var(--primary-color);\n color: white;\n border: none;\n padding: 0.8rem 2rem;\n border-radius: 2rem;\n font-size: 1.1rem;\n cursor: pointer;\n transition: transform 0.2s ease;\n}\n\n.upload-btn:hover {\n transform: scale(1.05);\n}\n\n.model-grid {\n display: grid;\n grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));\n gap: 1.5rem;\n margin-top: 2rem;\n}\n\n.model-card {\n background: white;\n padding: 1.5rem;\n border-radius: 1rem;\n box-shadow: 0 2px 4px rgba(0,0,0,0.1);\n cursor: pointer;\n transition: all 0.3s ease;\n}\n\n.model-card:hover {\n transform: translateY(-4px);\n box-shadow: 0 4px 8px rgba(0,0,0,0.2);\n}\n\n.model-card.selected {\n border: 2px solid var(--primary-color);\n}\n\n.preview-section {\n margin-top: 3rem;\n}\n\n.preview-container {\n display: grid;\n grid-template-columns: 1fr 1fr;\n gap: 2rem;\n margin-top: 1rem;\n}\n\ncanvas {\n width: 100%;\n height: auto;\n border-radius: 0.5rem;\n background: white;\n}\n\nfooter {\n text-align: center;\n padding: 2rem;\n background: var(--secondary-color);\n color: white;\n margin-top: 4rem;\n}\n\n@media (max-width: 768px) {\n .preview-container {\n grid-template-columns: 1fr;\n }\n \n h1 {\n font-size: 2rem;\n }\n}\n\n---script.js---\ndocument.addEventListener('DOMContentLoaded', () => {\n const dropZone = document.getElementById('dropZone');\n const fileInput = document.getElementById('fileInput');\n const modelCards = document.querySelectorAll('.model-card');\n let selectedModel = null;\n\n // File upload handling\n dropZone.addEventListener('click', () => fileInput.click());\n \n dropZone.addEventListener('dragover', (e) => {\n e.preventDefault();\n dropZone.style.borderColor = 'var(--accent-color)';\n });\n\n dropZone.addEventListener('dragleave', () => {\n dropZone.style.borderColor = 'var(--primary-color)';\n });\n\n dropZone.addEventListener('drop', (e) => {\n e.preventDefault();\n dropZone.style.borderColor = 'var(--primary-color)';\n handleFile(e.dataTransfer.files[0]);\n });\n\n fileInput.addEventListener('change', (e) => {\n handleFile(e.target.files[0]);\n });\n\n // Model selection\n modelCards.forEach(card => {\n card.addEventListener('click', () => {\n modelCards.forEach(c => c.classList.remove('selected'));\n card.classList.add('selected');\n selectedModel = card.dataset.model;\n \n if (fileInput.files.length > 0) {\n processImage(fileInput.files[0], selectedModel);\n }\n });\n });\n\n function handleFile(file) {\n if (!file) return;\n \n if (!file.name.endsWith('.nii') && !file.name.endsWith('.nii.gz')) {\n alert('Please upload a valid NII file');\n return;\n }\n\n document.querySelector('.preview-section').hidden = false;\n \n if (selectedModel) {\n processImage(file, selectedModel);\n }\n }\n\n function processImage(file, model) {\n // This is a demo placeholder for image processing\n // In a real implementation, this would send the file to a backend server\n console.log(`Processing ${file.name} with model: ${model}`);\n \n // Simulate processing delay\n setTimeout(() => {\n const originalCanvas = document.getElementById('originalCanvas');\n const enhancedCanvas = document.getElementById('enhancedCanvas');\n \n // Demo visualization (replace with actual image processing)\n drawDemoImage(originalCanvas, 'original');\n drawDemoImage(enhancedCanvas, 'enhanced');\n }, 1000);\n }\n\n function drawDemoImage(canvas, type) {\n const ctx = canvas.getContext('2d');\n canvas.width = 400;\n canvas.height = 400;\n \n ctx.fillStyle = type === 'original' ? '#eee' : '#ddf';\n ctx.fillRect(0, 0, 400, 400);\n \n ctx.fillStyle = '#333';\n ctx.font = '20px sans-serif';\n ctx.textAlign = 'center';\n ctx.fillText(`${type} Image Preview`, 200, 200);\n }\n});\n\n---end---\n\nThis implementation provides a beautiful, responsive interface for uploading and enhancing MRI images. Key features include:\n\n1. Drag-and-drop file upload with visual feedback\n2. Three enhancement model options with attractive hover effects\n3. Side-by-side preview section\n4. Smooth animations and transitions\n5. Professional color scheme\n6. Mobile-responsive design\n7. Accessible semantic HTML\n8. Clean, modular JavaScript\n\nThe design uses a modern, medical-themed color palette with a gradient header and subtle shadows for depth. The interface is intuitive and provides visual feedback for all user interactions.\n\nNote: This is a frontend demo - in a real implementation, you'd need to add backend integration for actual image processing." + } + ], + "stop_reason": "end_turn", + "stop_sequence": null, + "usage": { + "input_tokens": 306, + "cache_creation_input_tokens": 0, + "cache_read_input_tokens": 0, + "output_tokens": 2556 + } +} \ No newline at end of file diff --git a/readme.scroll b/readme.scroll new file mode 100644 index 0000000..dd5ae6a --- /dev/null +++ b/readme.scroll @@ -0,0 +1,2 @@ +# enhance-mri.scroll.pub +Website generated by Claude from prompt: I want to create a webapp demo for mr image quality enhancement for my pitchdeck. I want to be able to upload nii image and select what model to use. \ No newline at end of file diff --git a/script.js b/script.js new file mode 100644 index 0000000..28024ad --- /dev/null +++ b/script.js @@ -0,0 +1,86 @@ +document.addEventListener('DOMContentLoaded', () => { + const dropZone = document.getElementById('dropZone'); + const fileInput = document.getElementById('fileInput'); + const modelCards = document.querySelectorAll('.model-card'); + let selectedModel = null; + + // File upload handling + dropZone.addEventListener('click', () => fileInput.click()); + + dropZone.addEventListener('dragover', (e) => { + e.preventDefault(); + dropZone.style.borderColor = 'var(--accent-color)'; + }); + + dropZone.addEventListener('dragleave', () => { + dropZone.style.borderColor = 'var(--primary-color)'; + }); + + dropZone.addEventListener('drop', (e) => { + e.preventDefault(); + dropZone.style.borderColor = 'var(--primary-color)'; + handleFile(e.dataTransfer.files[0]); + }); + + fileInput.addEventListener('change', (e) => { + handleFile(e.target.files[0]); + }); + + // Model selection + modelCards.forEach(card => { + card.addEventListener('click', () => { + modelCards.forEach(c => c.classList.remove('selected')); + card.classList.add('selected'); + selectedModel = card.dataset.model; + + if (fileInput.files.length > 0) { + processImage(fileInput.files[0], selectedModel); + } + }); + }); + + function handleFile(file) { + if (!file) return; + + if (!file.name.endsWith('.nii') && !file.name.endsWith('.nii.gz')) { + alert('Please upload a valid NII file'); + return; + } + + document.querySelector('.preview-section').hidden = false; + + if (selectedModel) { + processImage(file, selectedModel); + } + } + + function processImage(file, model) { + // This is a demo placeholder for image processing + // In a real implementation, this would send the file to a backend server + console.log(`Processing ${file.name} with model: ${model}`); + + // Simulate processing delay + setTimeout(() => { + const originalCanvas = document.getElementById('originalCanvas'); + const enhancedCanvas = document.getElementById('enhancedCanvas'); + + // Demo visualization (replace with actual image processing) + drawDemoImage(originalCanvas, 'original'); + drawDemoImage(enhancedCanvas, 'enhanced'); + }, 1000); + } + + function drawDemoImage(canvas, type) { + const ctx = canvas.getContext('2d'); + canvas.width = 400; + canvas.height = 400; + + ctx.fillStyle = type === 'original' ? '#eee' : '#ddf'; + ctx.fillRect(0, 0, 400, 400); + + ctx.fillStyle = '#333'; + ctx.font = '20px sans-serif'; + ctx.textAlign = 'center'; + ctx.fillText(`${type} Image Preview`, 200, 200); + } +}); diff --git a/style.css b/style.css new file mode 100644 index 0000000..71d5346 --- /dev/null +++ b/style.css @@ -0,0 +1,140 @@ +:root { + --primary-color: #2a6bf2; + --secondary-color: #1a1b4b; + --accent-color: #4cd7f6; + --background: #f8fafc; + --text-color: #1a1b4b; +} + +* { + margin: 0; + padding: 0; + box-sizing: border-box; +} + +body { + font-family: system-ui, -apple-system, sans-serif; + line-height: 1.6; + color: var(--text-color); + background: var(--background); +} + +header { + background: linear-gradient(135deg, var(--secondary-color), var(--primary-color)); + color: white; + padding: 2rem; + text-align: center; + box-shadow: 0 4px 6px rgba(0,0,0,0.1); +} + +h1 { + font-size: 2.5rem; + margin-bottom: 0.5rem; +} + +.tagline { + font-size: 1.2rem; + opacity: 0.9; +} + +main { + max-width: 1200px; + margin: 2rem auto; + padding: 0 1rem; +} + +.drop-zone { + border: 3px dashed var(--primary-color); + border-radius: 1rem; + padding: 3rem; + text-align: center; + background: white; + transition: all 0.3s ease; + cursor: pointer; +} + +.drop-zone:hover { + background: rgba(42,107,242,0.05); +} + +.upload-icon { + width: 64px; + height: 64px; + margin-bottom: 1rem; +} + +.upload-btn { + background: var(--primary-color); + color: white; + border: none; + padding: 0.8rem 2rem; + border-radius: 2rem; + font-size: 1.1rem; + cursor: pointer; + transition: transform 0.2s ease; +} + +.upload-btn:hover { + transform: scale(1.05); +} + +.model-grid { + display: grid; + grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); + gap: 1.5rem; + margin-top: 2rem; +} + +.model-card { + background: white; + padding: 1.5rem; + border-radius: 1rem; + box-shadow: 0 2px 4px rgba(0,0,0,0.1); + cursor: pointer; + transition: all 0.3s ease; +} + +.model-card:hover { + transform: translateY(-4px); + box-shadow: 0 4px 8px rgba(0,0,0,0.2); +} + +.model-card.selected { + border: 2px solid var(--primary-color); +} + +.preview-section { + margin-top: 3rem; +} + +.preview-container { + display: grid; + grid-template-columns: 1fr 1fr; + gap: 2rem; + margin-top: 1rem; +} + +canvas { + width: 100%; + height: auto; + border-radius: 0.5rem; + background: white; +} + +footer { + text-align: center; + padding: 2rem; + background: var(--secondary-color); + color: white; + margin-top: 4rem; +} + +@media (max-width: 768px) { + .preview-container { + grid-template-columns: 1fr; + } + + h1 { + font-size: 2rem; + } +}