Changes to bin2dec.scroll.pub

root
root
25 days ago
Initial commit
body.html
Changed around line 1
+
+

Binary ↔ Decimal Converter

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

Simple and fast binary to decimal conversion

+
index.scroll
Changed around line 1
+ buildHtml
+ baseUrl https://bin2dec.scroll.pub
+ metaTags
+ editButton /edit.html
+ title Binary ↔ Decimal Converter
+ style.css
+ body.html
+ script.js
prompt.json
Changed around line 1
+ {
+ "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
\n

Binary ↔ Decimal Converter

\n
\n
\n \n \n \n
\n
\n \n \n
\n
\n
\n
\n

Simple and fast binary to decimal conversion

\n
\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"
+ }
readme.scroll
Changed around line 1
+ # 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
script.js
Changed around line 1
+ 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);
+ });
style.css
Changed around line 1
+ :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;
+ }
+ }