commit 9154d75a6961ae89aa38c918098a9abb2fd548d3
Author: root <root@hub.scroll.pub>
Date: 2024-12-28 06:00:09 +0000
Subject: Initial commit
diff --git a/body.html b/body.html
new file mode 100644
index 0000000..c41bbae
--- /dev/null
+++ b/body.html
@@ -0,0 +1,17 @@
+<main class="container">
+ <h1>Binary ↔ Decimal Converter</h1>
+ <div class="converter">
+ <div class="input-group">
+ <label for="binary">Binary:</label>
+ <input type="text" id="binary" placeholder="Enter binary number" maxlength="8">
+ <small class="error" id="binary-error"></small>
+ </div>
+ <div class="input-group">
+ <label for="decimal">Decimal:</label>
+ <input type="number" id="decimal" placeholder="Enter decimal number">
+ </div>
+ </div>
+</main>
+<footer>
+ <p>Simple and fast binary to decimal conversion</p>
+</footer>
\ No newline at end of file
diff --git a/index.scroll b/index.scroll
new file mode 100644
index 0000000..8764545
--- /dev/null
+++ b/index.scroll
@@ -0,0 +1,8 @@
+buildHtml
+baseUrl https://bin2dec.scroll.pub
+metaTags
+editButton /edit.html
+title Binary ↔ Decimal Converter
+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..6b7455c
--- /dev/null
+++ b/prompt.json
@@ -0,0 +1,25 @@
+{
+ "id": "9392e1cb-96d5-4778-bb99-e31be4e78489",
+ "object": "chat.completion",
+ "created": 1735365596,
+ "model": "deepseek-chat",
+ "choices": [
+ {
+ "index": 0,
+ "message": {
+ "role": "assistant",
+ "content": "---domain---\nbin2dec.scroll.pub\n---index.scroll---\nbuildHtml\nbaseUrl https://bin2dec.scroll.pub\nmetaTags\neditButton /edit.html\ntitle Binary ↔ Decimal Converter\nstyle.css\nbody.html\nscript.js\n---body.html---\n<main class=\"container\">\n <h1>Binary ↔ Decimal Converter</h1>\n <div class=\"converter\">\n <div class=\"input-group\">\n <label for=\"binary\">Binary:</label>\n <input type=\"text\" id=\"binary\" placeholder=\"Enter binary number\" maxlength=\"8\">\n <small class=\"error\" id=\"binary-error\"></small>\n </div>\n <div class=\"input-group\">\n <label for=\"decimal\">Decimal:</label>\n <input type=\"number\" id=\"decimal\" placeholder=\"Enter decimal number\">\n </div>\n </div>\n</main>\n<footer>\n <p>Simple and fast binary to decimal conversion</p>\n</footer>\n---style.css---\n:root {\n --primary: #2563eb;\n --primary-hover: #1d4ed8;\n --background: #f8fafc;\n --text: #1e293b;\n --error: #dc2626;\n}\n\n* {\n margin: 0;\n padding: 0;\n box-sizing: border-box;\n}\n\nbody {\n font-family: 'Segoe UI', system-ui, sans-serif;\n line-height: 1.5;\n background-color: var(--background);\n color: var(--text);\n min-height: 100vh;\n display: flex;\n flex-direction: column;\n}\n\n.container {\n max-width: 800px;\n margin: 2rem auto;\n padding: 0 1rem;\n flex: 1;\n}\n\nh1 {\n text-align: center;\n font-size: 2.5rem;\n margin-bottom: 2rem;\n color: var(--primary);\n}\n\n.converter {\n background: white;\n padding: 2rem;\n border-radius: 12px;\n box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);\n}\n\n.input-group {\n margin-bottom: 1.5rem;\n}\n\nlabel {\n display: block;\n margin-bottom: 0.5rem;\n font-weight: 500;\n}\n\ninput {\n width: 100%;\n padding: 0.75rem;\n border: 1px solid #e2e8f0;\n border-radius: 8px;\n font-size: 1rem;\n transition: border-color 0.2s;\n}\n\ninput:focus {\n outline: none;\n border-color: var(--primary);\n}\n\n.error {\n color: var(--error);\n margin-top: 0.25rem;\n display: none;\n}\n\nfooter {\n text-align: center;\n padding: 1rem;\n background: white;\n margin-top: auto;\n box-shadow: 0 -1px 3px rgba(0, 0, 0, 0.1);\n}\n\n@media (max-width: 600px) {\n h1 {\n font-size: 2rem;\n }\n \n .converter {\n padding: 1.5rem;\n }\n}\n---script.js---\nconst binaryInput = document.getElementById('binary');\nconst decimalInput = document.getElementById('decimal');\nconst binaryError = document.getElementById('binary-error');\n\nconst validateBinary = (value) => {\n return /^[01]+$/.test(value);\n};\n\nconst binaryToDecimal = (binary) => {\n return parseInt(binary, 2);\n};\n\nconst decimalToBinary = (decimal) => {\n return (decimal >>> 0).toString(2);\n};\n\nbinaryInput.addEventListener('input', (e) => {\n const value = e.target.value;\n \n if (value === '') {\n decimalInput.value = '';\n binaryError.style.display = 'none';\n return;\n }\n\n if (!validateBinary(value)) {\n binaryError.textContent = 'Please enter a valid binary number (0s and 1s only)';\n binaryError.style.display = 'block';\n return;\n }\n\n binaryError.style.display = 'none';\n decimalInput.value = binaryToDecimal(value);\n});\n\ndecimalInput.addEventListener('input', (e) => {\n const value = e.target.value;\n \n if (value === '') {\n binaryInput.value = '';\n return;\n }\n\n binaryInput.value = decimalToBinary(value);\n});\n---end---"
+ },
+ "logprobs": null,
+ "finish_reason": "stop"
+ }
+ ],
+ "usage": {
+ "prompt_tokens": 258,
+ "completion_tokens": 979,
+ "total_tokens": 1237,
+ "prompt_cache_hit_tokens": 0,
+ "prompt_cache_miss_tokens": 258
+ },
+ "system_fingerprint": "fp_f1afce2943"
+}
\ No newline at end of file
diff --git a/readme.scroll b/readme.scroll
new file mode 100644
index 0000000..76236a9
--- /dev/null
+++ b/readme.scroll
@@ -0,0 +1,2 @@
+# bin2dec.scroll.pub
+Website generated by DeepSeek from prompt: I want make a simple website has only one home page, people on this page can convert binary to decimal and vice versa
\ No newline at end of file
diff --git a/script.js b/script.js
new file mode 100644
index 0000000..7e63d18
--- /dev/null
+++ b/script.js
@@ -0,0 +1,45 @@
+const binaryInput = document.getElementById('binary');
+const decimalInput = document.getElementById('decimal');
+const binaryError = document.getElementById('binary-error');
+
+const validateBinary = (value) => {
+ return /^[01]+$/.test(value);
+};
+
+const binaryToDecimal = (binary) => {
+ return parseInt(binary, 2);
+};
+
+const decimalToBinary = (decimal) => {
+ return (decimal >>> 0).toString(2);
+};
+
+binaryInput.addEventListener('input', (e) => {
+ const value = e.target.value;
+
+ if (value === '') {
+ decimalInput.value = '';
+ binaryError.style.display = 'none';
+ return;
+ }
+
+ if (!validateBinary(value)) {
+ binaryError.textContent = 'Please enter a valid binary number (0s and 1s only)';
+ binaryError.style.display = 'block';
+ return;
+ }
+
+ binaryError.style.display = 'none';
+ decimalInput.value = binaryToDecimal(value);
+});
+
+decimalInput.addEventListener('input', (e) => {
+ const value = e.target.value;
+
+ if (value === '') {
+ binaryInput.value = '';
+ return;
+ }
+
+ binaryInput.value = decimalToBinary(value);
+});
\ No newline at end of file
diff --git a/style.css b/style.css
new file mode 100644
index 0000000..3bce926
--- /dev/null
+++ b/style.css
@@ -0,0 +1,92 @@
+:root {
+ --primary: #2563eb;
+ --primary-hover: #1d4ed8;
+ --background: #f8fafc;
+ --text: #1e293b;
+ --error: #dc2626;
+}
+
+* {
+ margin: 0;
+ padding: 0;
+ box-sizing: border-box;
+}
+
+body {
+ font-family: 'Segoe UI', system-ui, sans-serif;
+ line-height: 1.5;
+ background-color: var(--background);
+ color: var(--text);
+ min-height: 100vh;
+ display: flex;
+ flex-direction: column;
+}
+
+.container {
+ max-width: 800px;
+ margin: 2rem auto;
+ padding: 0 1rem;
+ flex: 1;
+}
+
+h1 {
+ text-align: center;
+ font-size: 2.5rem;
+ margin-bottom: 2rem;
+ color: var(--primary);
+}
+
+.converter {
+ background: white;
+ padding: 2rem;
+ border-radius: 12px;
+ box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
+}
+
+.input-group {
+ margin-bottom: 1.5rem;
+}
+
+label {
+ display: block;
+ margin-bottom: 0.5rem;
+ font-weight: 500;
+}
+
+input {
+ width: 100%;
+ padding: 0.75rem;
+ border: 1px solid #e2e8f0;
+ border-radius: 8px;
+ font-size: 1rem;
+ transition: border-color 0.2s;
+}
+
+input:focus {
+ outline: none;
+ border-color: var(--primary);
+}
+
+.error {
+ color: var(--error);
+ margin-top: 0.25rem;
+ display: none;
+}
+
+footer {
+ text-align: center;
+ padding: 1rem;
+ background: white;
+ margin-top: auto;
+ box-shadow: 0 -1px 3px rgba(0, 0, 0, 0.1);
+}
+
+@media (max-width: 600px) {
+ h1 {
+ font-size: 2rem;
+ }
+
+ .converter {
+ padding: 1.5rem;
+ }
+}
\ No newline at end of file