commit 6fada0c7262adde714c3d6d638e4d2775e9049e8
Author: root <root@hub.scroll.pub> Date: 2025-01-10 18:04:46 +0000 Subject: Initial commit diff --git a/body.html b/body.html new file mode 100644 index 0000000..e6a5a0f --- /dev/null +++ b/body.html @@ -0,0 +1,29 @@ +<header> + <h1>ASCII to Binary Converter</h1> +</header> + +<main> + <div class="converter-container"> + <div class="input-section"> + <label for="asciiInput">ASCII Text</label> + <textarea id="asciiInput" placeholder="Enter your text here..." aria-label="ASCII input"></textarea> + </div> + + <button id="convertBtn" aria-label="Convert"> + <span class="button-content"> + <span class="arrow">→</span> + <span class="text">Convert</span> + </span> + </button> + + <div class="output-section"> + <label for="binaryOutput">Binary Output</label> + <textarea id="binaryOutput" readonly aria-label="Binary output"></textarea> + <button id="copyBtn" aria-label="Copy to clipboard">Copy</button> + </div> + </div> +</main> + +<footer> + <p>Built with love for developers and tech enthusiasts</p> +</footer> diff --git a/index.scroll b/index.scroll new file mode 100644 index 0000000..9559c6e --- /dev/null +++ b/index.scroll @@ -0,0 +1,8 @@ +buildHtml +baseUrl https://ascii2bin.scroll.pub +metaTags +editButton /edit.html +title ASCII to Binary Converter +style.css +body.html +script.js diff --git a/prompt.json b/prompt.json new file mode 100644 index 0000000..05945cb --- /dev/null +++ b/prompt.json @@ -0,0 +1,20 @@ +{ + "id": "msg_016eQpR83VhzwMptk9bSQWxc", + "type": "message", + "role": "assistant", + "model": "claude-3-5-sonnet-20241022", + "content": [ + { + "type": "text", + "text": "Here's a clean, professional ASCII to Binary converter website:\n\n---domain---\nascii2bin.scroll.pub\n\n---index.scroll---\nbuildHtml\nbaseUrl https://ascii2bin.scroll.pub\nmetaTags\neditButton /edit.html\ntitle ASCII to Binary Converter\nstyle.css\nbody.html\nscript.js\n\n---body.html---\n<header>\n <h1>ASCII to Binary Converter</h1>\n</header>\n\n<main>\n <div class=\"converter-container\">\n <div class=\"input-section\">\n <label for=\"asciiInput\">ASCII Text</label>\n <textarea id=\"asciiInput\" placeholder=\"Enter your text here...\" aria-label=\"ASCII input\"></textarea>\n </div>\n \n <button id=\"convertBtn\" aria-label=\"Convert\">\n <span class=\"button-content\">\n <span class=\"arrow\">→</span>\n <span class=\"text\">Convert</span>\n </span>\n </button>\n \n <div class=\"output-section\">\n <label for=\"binaryOutput\">Binary Output</label>\n <textarea id=\"binaryOutput\" readonly aria-label=\"Binary output\"></textarea>\n <button id=\"copyBtn\" aria-label=\"Copy to clipboard\">Copy</button>\n </div>\n </div>\n</main>\n\n<footer>\n <p>Built with love for developers and tech enthusiasts</p>\n</footer>\n\n---style.css---\n:root {\n --primary-color: #2a2b2e;\n --accent-color: #4a90e2;\n --bg-color: #f5f7fa;\n --text-color: #333;\n --gradient: linear-gradient(135deg, #4a90e2, #67b26f);\n}\n\n* {\n margin: 0;\n padding: 0;\n box-sizing: border-box;\n}\n\nbody {\n font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;\n background: var(--bg-color);\n color: var(--text-color);\n line-height: 1.6;\n min-height: 100vh;\n display: flex;\n flex-direction: column;\n}\n\nheader {\n text-align: center;\n padding: 2rem;\n background: var(--gradient);\n color: white;\n box-shadow: 0 2px 10px rgba(0,0,0,0.1);\n}\n\nh1 {\n font-size: 2.5rem;\n font-weight: 700;\n text-shadow: 1px 1px 2px rgba(0,0,0,0.1);\n}\n\nmain {\n flex: 1;\n padding: 2rem;\n max-width: 1200px;\n margin: 0 auto;\n width: 100%;\n}\n\n.converter-container {\n display: grid;\n grid-template-columns: 1fr auto 1fr;\n gap: 2rem;\n align-items: center;\n background: white;\n padding: 2rem;\n border-radius: 12px;\n box-shadow: 0 4px 20px rgba(0,0,0,0.08);\n}\n\n.input-section, .output-section {\n display: flex;\n flex-direction: column;\n gap: 1rem;\n}\n\nlabel {\n font-weight: 600;\n color: var(--primary-color);\n}\n\ntextarea {\n height: 200px;\n padding: 1rem;\n border: 2px solid #e0e0e0;\n border-radius: 8px;\n resize: vertical;\n font-family: 'Courier New', monospace;\n font-size: 1rem;\n transition: border-color 0.3s ease;\n}\n\ntextarea:focus {\n outline: none;\n border-color: var(--accent-color);\n}\n\n#convertBtn {\n background: var(--gradient);\n border: none;\n padding: 1rem;\n border-radius: 50%;\n width: 60px;\n height: 60px;\n cursor: pointer;\n transition: transform 0.3s ease, box-shadow 0.3s ease;\n}\n\n#convertBtn:hover {\n transform: scale(1.1);\n box-shadow: 0 4px 15px rgba(74,144,226,0.3);\n}\n\n.button-content {\n color: white;\n font-size: 1.5rem;\n display: flex;\n justify-content: center;\n align-items: center;\n}\n\n#copyBtn {\n background: var(--primary-color);\n color: white;\n border: none;\n padding: 0.5rem 1rem;\n border-radius: 6px;\n cursor: pointer;\n transition: background-color 0.3s ease;\n}\n\n#copyBtn:hover {\n background: var(--accent-color);\n}\n\nfooter {\n text-align: center;\n padding: 2rem;\n background: var(--primary-color);\n color: white;\n}\n\n@media (max-width: 768px) {\n .converter-container {\n grid-template-columns: 1fr;\n gap: 1rem;\n }\n \n #convertBtn {\n margin: 1rem auto;\n transform: rotate(90deg);\n }\n \n #convertBtn:hover {\n transform: rotate(90deg) scale(1.1);\n }\n}\n\n---script.js---\ndocument.addEventListener('DOMContentLoaded', () => {\n const asciiInput = document.getElementById('asciiInput');\n const binaryOutput = document.getElementById('binaryOutput');\n const convertBtn = document.getElementById('convertBtn');\n const copyBtn = document.getElementById('copyBtn');\n\n function asciiToBinary(text) {\n return text.split('').map(char => {\n return char.charCodeAt(0).toString(2).padStart(8, '0');\n }).join(' ');\n }\n\n function convert() {\n const input = asciiInput.value;\n const binary = asciiToBinary(input);\n binaryOutput.value = binary;\n }\n\n async function copyToClipboard() {\n try {\n await navigator.clipboard.writeText(binaryOutput.value);\n const originalText = copyBtn.textContent;\n copyBtn.textContent = 'Copied!';\n setTimeout(() => {\n copyBtn.textContent = originalText;\n }, 2000);\n } catch (err) {\n console.error('Failed to copy text: ', err);\n }\n }\n\n // Event Listeners\n convertBtn.addEventListener('click', convert);\n copyBtn.addEventListener('click', copyToClipboard);\n \n // Auto-convert on input with debounce\n let timeout;\n asciiInput.addEventListener('input', () => {\n clearTimeout(timeout);\n timeout = setTimeout(convert, 500);\n });\n\n // Accessibility: Enable keyboard navigation\n asciiInput.addEventListener('keydown', (e) => {\n if (e.key === 'Enter' && e.ctrlKey) {\n convert();\n }\n });\n});\n\n---end---\n\nThis implementation features:\n\n1. Clean, semantic HTML5 structure\n2. Responsive design that works on all devices\n3. Beautiful gradient animations and transitions\n4. Accessibility features including ARIA labels and keyboard navigation\n5. Auto-converting functionality with debounce\n6. Copy to clipboard feature\n7. Error handling\n8. Modern CSS with CSS variables and flexbox/grid\n9. Elegant UI with smooth animations\n10. Professional typography and spacing\n\nThe design uses a clean, modern aesthetic with a beautiful gradient header and intuitive interface. The converter button features a smooth animation and the layout responds gracefully to different screen sizes." + } + ], + "stop_reason": "end_turn", + "stop_sequence": null, + "usage": { + "input_tokens": 279, + "cache_creation_input_tokens": 0, + "cache_read_input_tokens": 0, + "output_tokens": 1985 + } +} \ No newline at end of file diff --git a/readme.scroll b/readme.scroll new file mode 100644 index 0000000..32f7d28 --- /dev/null +++ b/readme.scroll @@ -0,0 +1,3 @@ +# ascii2bin.scroll.pub + +website generated by Claude from prompt: build me a site that turns ascii into binary \ No newline at end of file diff --git a/script.js b/script.js new file mode 100644 index 0000000..ab8fbef --- /dev/null +++ b/script.js @@ -0,0 +1,49 @@ +document.addEventListener('DOMContentLoaded', () => { + const asciiInput = document.getElementById('asciiInput'); + const binaryOutput = document.getElementById('binaryOutput'); + const convertBtn = document.getElementById('convertBtn'); + const copyBtn = document.getElementById('copyBtn'); + + function asciiToBinary(text) { + return text.split('').map(char => { + return char.charCodeAt(0).toString(2).padStart(8, '0'); + }).join(' '); + } + + function convert() { + const input = asciiInput.value; + const binary = asciiToBinary(input); + binaryOutput.value = binary; + } + + async function copyToClipboard() { + try { + await navigator.clipboard.writeText(binaryOutput.value); + const originalText = copyBtn.textContent; + copyBtn.textContent = 'Copied!'; + setTimeout(() => { + copyBtn.textContent = originalText; + }, 2000); + } catch (err) { + console.error('Failed to copy text: ', err); + } + } + + // Event Listeners + convertBtn.addEventListener('click', convert); + copyBtn.addEventListener('click', copyToClipboard); + + // Auto-convert on input with debounce + let timeout; + asciiInput.addEventListener('input', () => { + clearTimeout(timeout); + timeout = setTimeout(convert, 500); + }); + + // Accessibility: Enable keyboard navigation + asciiInput.addEventListener('keydown', (e) => { + if (e.key === 'Enter' && e.ctrlKey) { + convert(); + } + }); +}); diff --git a/style.css b/style.css new file mode 100644 index 0000000..c05ec64 --- /dev/null +++ b/style.css @@ -0,0 +1,144 @@ +:root { + --primary-color: #2a2b2e; + --accent-color: #4a90e2; + --bg-color: #f5f7fa; + --text-color: #333; + --gradient: linear-gradient(135deg, #4a90e2, #67b26f); +} + +* { + margin: 0; + padding: 0; + box-sizing: border-box; +} + +body { + font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif; + background: var(--bg-color); + color: var(--text-color); + line-height: 1.6; + min-height: 100vh; + display: flex; + flex-direction: column; +} + +header { + text-align: center; + padding: 2rem; + background: var(--gradient); + color: white; + box-shadow: 0 2px 10px rgba(0,0,0,0.1); +} + +h1 { + font-size: 2.5rem; + font-weight: 700; + text-shadow: 1px 1px 2px rgba(0,0,0,0.1); +} + +main { + flex: 1; + padding: 2rem; + max-width: 1200px; + margin: 0 auto; + width: 100%; +} + +.converter-container { + display: grid; + grid-template-columns: 1fr auto 1fr; + gap: 2rem; + align-items: center; + background: white; + padding: 2rem; + border-radius: 12px; + box-shadow: 0 4px 20px rgba(0,0,0,0.08); +} + +.input-section, .output-section { + display: flex; + flex-direction: column; + gap: 1rem; +} + +label { + font-weight: 600; + color: var(--primary-color); +} + +textarea { + height: 200px; + padding: 1rem; + border: 2px solid #e0e0e0; + border-radius: 8px; + resize: vertical; + font-family: 'Courier New', monospace; + font-size: 1rem; + transition: border-color 0.3s ease; +} + +textarea:focus { + outline: none; + border-color: var(--accent-color); +} + +#convertBtn { + background: var(--gradient); + border: none; + padding: 1rem; + border-radius: 50%; + width: 60px; + height: 60px; + cursor: pointer; + transition: transform 0.3s ease, box-shadow 0.3s ease; +} + +#convertBtn:hover { + transform: scale(1.1); + box-shadow: 0 4px 15px rgba(74,144,226,0.3); +} + +.button-content { + color: white; + font-size: 1.5rem; + display: flex; + justify-content: center; + align-items: center; +} + +#copyBtn { + background: var(--primary-color); + color: white; + border: none; + padding: 0.5rem 1rem; + border-radius: 6px; + cursor: pointer; + transition: background-color 0.3s ease; +} + +#copyBtn:hover { + background: var(--accent-color); +} + +footer { + text-align: center; + padding: 2rem; + background: var(--primary-color); + color: white; +} + +@media (max-width: 768px) { + .converter-container { + grid-template-columns: 1fr; + gap: 1rem; + } + + #convertBtn { + margin: 1rem auto; + transform: rotate(90deg); + } + + #convertBtn:hover { + transform: rotate(90deg) scale(1.1); + } +}