commit 13e1b8d61f8e1d7c40d6c318ce0508a85fffde43
Author: root <root@hub.scroll.pub> Date: 2024-12-28 03:50:32 +0000 Subject: Initial commit diff --git a/body.html b/body.html new file mode 100644 index 0000000..24c3655 --- /dev/null +++ b/body.html @@ -0,0 +1,45 @@ +<header> + <h1>CRUD Calculator</h1> + <p>Calculate, Store, Retrieve - All in One Place</p> +</header> + +<main> + <section id="calculator"> + <div class="display"> + <input type="text" id="result" readonly> + </div> + <div class="buttons"> + <button onclick="clearDisplay()">C</button> + <button onclick="appendToDisplay('/')">/</button> + <button onclick="appendToDisplay('*')">*</button> + <button onclick="appendToDisplay('-')">-</button> + <button onclick="appendToDisplay('7')">7</button> + <button onclick="appendToDisplay('8')">8</button> + <button onclick="appendToDisplay('9')">9</button> + <button onclick="appendToDisplay('+')">+</button> + <button onclick="appendToDisplay('4')">4</button> + <button onclick="appendToDisplay('5')">5</button> + <button onclick="appendToDisplay('6')">6</button> + <button onclick="calculate()">=</button> + <button onclick="appendToDisplay('1')">1</button> + <button onclick="appendToDisplay('2')">2</button> + <button onclick="appendToDisplay('3')">3</button> + <button onclick="appendToDisplay('0')">0</button> + <button onclick="appendToDisplay('.')">.</button> + </div> + </section> + + <section id="storage"> + <h2>Store & Retrieve Calculations</h2> + <div class="storage-controls"> + <input type="text" id="variableName" placeholder="Enter variable name"> + <button onclick="storeCalculation()">Store</button> + <button onclick="retrieveCalculation()">Retrieve</button> + </div> + <div id="storedVariables"></div> + </section> +</main> + +<footer> + <p>Your calculations, always at your fingertips</p> +</footer> \ No newline at end of file diff --git a/index.scroll b/index.scroll new file mode 100644 index 0000000..5cc1c6b --- /dev/null +++ b/index.scroll @@ -0,0 +1,8 @@ +buildHtml +baseUrl https://crudcalc.scroll.pub +metaTags +editButton /edit.html +title CRUD Calculator - Store and Retrieve Your Work +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..eb6a2ef --- /dev/null +++ b/prompt.json @@ -0,0 +1,25 @@ +{ + "id": "71c8b719-4023-4969-aede-ed9bd30d72ec", + "object": "chat.completion", + "created": 1735357812, + "model": "deepseek-chat", + "choices": [ + { + "index": 0, + "message": { + "role": "assistant", + "content": "---domain---\ncrudcalc.scroll.pub\n---index.scroll---\nbuildHtml\nbaseUrl https://crudcalc.scroll.pub\nmetaTags\neditButton /edit.html\ntitle CRUD Calculator - Store and Retrieve Your Work\nstyle.css\nbody.html\nscript.js\n---body.html---\n<header>\n <h1>CRUD Calculator</h1>\n <p>Calculate, Store, Retrieve - All in One Place</p>\n</header>\n\n<main>\n <section id=\"calculator\">\n <div class=\"display\">\n <input type=\"text\" id=\"result\" readonly>\n </div>\n <div class=\"buttons\">\n <button onclick=\"clearDisplay()\">C</button>\n <button onclick=\"appendToDisplay('/')\">/</button>\n <button onclick=\"appendToDisplay('*')\">*</button>\n <button onclick=\"appendToDisplay('-')\">-</button>\n <button onclick=\"appendToDisplay('7')\">7</button>\n <button onclick=\"appendToDisplay('8')\">8</button>\n <button onclick=\"appendToDisplay('9')\">9</button>\n <button onclick=\"appendToDisplay('+')\">+</button>\n <button onclick=\"appendToDisplay('4')\">4</button>\n <button onclick=\"appendToDisplay('5')\">5</button>\n <button onclick=\"appendToDisplay('6')\">6</button>\n <button onclick=\"calculate()\">=</button>\n <button onclick=\"appendToDisplay('1')\">1</button>\n <button onclick=\"appendToDisplay('2')\">2</button>\n <button onclick=\"appendToDisplay('3')\">3</button>\n <button onclick=\"appendToDisplay('0')\">0</button>\n <button onclick=\"appendToDisplay('.')\">.</button>\n </div>\n </section>\n\n <section id=\"storage\">\n <h2>Store & Retrieve Calculations</h2>\n <div class=\"storage-controls\">\n <input type=\"text\" id=\"variableName\" placeholder=\"Enter variable name\">\n <button onclick=\"storeCalculation()\">Store</button>\n <button onclick=\"retrieveCalculation()\">Retrieve</button>\n </div>\n <div id=\"storedVariables\"></div>\n </section>\n</main>\n\n<footer>\n <p>Your calculations, always at your fingertips</p>\n</footer>\n---style.css---\n:root {\n --primary-color: #4CAF50;\n --secondary-color: #45a049;\n --background-color: #f4f4f4;\n --text-color: #333;\n --button-color: #e0e0e0;\n --button-hover: #ccc;\n}\n\nbody {\n font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;\n margin: 0;\n padding: 0;\n background-color: var(--background-color);\n color: var(--text-color);\n line-height: 1.6;\n}\n\nheader {\n background-color: var(--primary-color);\n color: white;\n padding: 2rem;\n text-align: center;\n}\n\nmain {\n max-width: 800px;\n margin: 2rem auto;\n padding: 0 1rem;\n}\n\n#calculator {\n background: white;\n padding: 2rem;\n border-radius: 8px;\n box-shadow: 0 2px 5px rgba(0,0,0,0.1);\n margin-bottom: 2rem;\n}\n\n.display input {\n width: 100%;\n padding: 1rem;\n font-size: 1.5rem;\n text-align: right;\n border: 1px solid var(--button-color);\n border-radius: 4px;\n margin-bottom: 1rem;\n}\n\n.buttons {\n display: grid;\n grid-template-columns: repeat(4, 1fr);\n gap: 1rem;\n}\n\n.buttons button {\n padding: 1.5rem;\n font-size: 1.2rem;\n border: none;\n border-radius: 4px;\n background-color: var(--button-color);\n cursor: pointer;\n transition: background-color 0.3s;\n}\n\n.buttons button:hover {\n background-color: var(--button-hover);\n}\n\n#storage {\n background: white;\n padding: 2rem;\n border-radius: 8px;\n box-shadow: 0 2px 5px rgba(0,0,0,0.1);\n}\n\n.storage-controls {\n display: flex;\n gap: 1rem;\n margin-bottom: 1rem;\n}\n\n.storage-controls input {\n flex: 1;\n padding: 0.5rem;\n border: 1px solid var(--button-color);\n border-radius: 4px;\n}\n\n.storage-controls button {\n padding: 0.5rem 1rem;\n background-color: var(--primary-color);\n color: white;\n border: none;\n border-radius: 4px;\n cursor: pointer;\n transition: background-color 0.3s;\n}\n\n.storage-controls button:hover {\n background-color: var(--secondary-color);\n}\n\n#storedVariables {\n background: var(--background-color);\n padding: 1rem;\n border-radius: 4px;\n min-height: 50px;\n}\n\nfooter {\n text-align: center;\n padding: 1rem;\n background-color: var(--primary-color);\n color: white;\n margin-top: 2rem;\n}\n\n@media (max-width: 600px) {\n .buttons {\n grid-template-columns: repeat(3, 1fr);\n }\n}\n---script.js---\nlet storedVariables = {};\n\nfunction appendToDisplay(value) {\n document.getElementById('result').value += value;\n}\n\nfunction clearDisplay() {\n document.getElementById('result').value = '';\n}\n\nfunction calculate() {\n try {\n const result = eval(document.getElementById('result').value);\n document.getElementById('result').value = result;\n } catch (error) {\n document.getElementById('result').value = 'Error';\n }\n}\n\nfunction storeCalculation() {\n const varName = document.getElementById('variableName').value;\n const value = document.getElementById('result').value;\n \n if (varName && value) {\n storedVariables[varName] = value;\n updateStoredVariablesDisplay();\n document.getElementById('variableName').value = '';\n clearDisplay();\n }\n}\n\nfunction retrieveCalculation() {\n const varName = document.getElementById('variableName').value;\n if (storedVariables[varName]) {\n document.getElementById('result').value = storedVariables[varName];\n }\n}\n\nfunction updateStoredVariablesDisplay() {\n const display = document.getElementById('storedVariables');\n display.innerHTML = '';\n \n for (const [key, value] of Object.entries(storedVariables)) {\n const item = document.createElement('div');\n item.textContent = `${key}: ${value}`;\n display.appendChild(item);\n }\n}\n---end---" + }, + "logprobs": null, + "finish_reason": "stop" + } + ], + "usage": { + "prompt_tokens": 253, + "completion_tokens": 1530, + "total_tokens": 1783, + "prompt_cache_hit_tokens": 0, + "prompt_cache_miss_tokens": 253 + }, + "system_fingerprint": "fp_f1afce2943" +} \ No newline at end of file diff --git a/readme.scroll b/readme.scroll new file mode 100644 index 0000000..38a419d --- /dev/null +++ b/readme.scroll @@ -0,0 +1,2 @@ +# crudcalc.scroll.pub +Website generated by DeepSeek from prompt: I want a crud calculator that allows you to store your work and retrieve it as a variable \ No newline at end of file diff --git a/script.js b/script.js new file mode 100644 index 0000000..b02a1c6 --- /dev/null +++ b/script.js @@ -0,0 +1,48 @@ +let storedVariables = {}; + +function appendToDisplay(value) { + document.getElementById('result').value += value; +} + +function clearDisplay() { + document.getElementById('result').value = ''; +} + +function calculate() { + try { + const result = eval(document.getElementById('result').value); + document.getElementById('result').value = result; + } catch (error) { + document.getElementById('result').value = 'Error'; + } +} + +function storeCalculation() { + const varName = document.getElementById('variableName').value; + const value = document.getElementById('result').value; + + if (varName && value) { + storedVariables[varName] = value; + updateStoredVariablesDisplay(); + document.getElementById('variableName').value = ''; + clearDisplay(); + } +} + +function retrieveCalculation() { + const varName = document.getElementById('variableName').value; + if (storedVariables[varName]) { + document.getElementById('result').value = storedVariables[varName]; + } +} + +function updateStoredVariablesDisplay() { + const display = document.getElementById('storedVariables'); + display.innerHTML = ''; + + for (const [key, value] of Object.entries(storedVariables)) { + const item = document.createElement('div'); + item.textContent = `${key}: ${value}`; + display.appendChild(item); + } +} \ No newline at end of file diff --git a/style.css b/style.css new file mode 100644 index 0000000..0008437 --- /dev/null +++ b/style.css @@ -0,0 +1,123 @@ +:root { + --primary-color: #4CAF50; + --secondary-color: #45a049; + --background-color: #f4f4f4; + --text-color: #333; + --button-color: #e0e0e0; + --button-hover: #ccc; +} + +body { + font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; + margin: 0; + padding: 0; + background-color: var(--background-color); + color: var(--text-color); + line-height: 1.6; +} + +header { + background-color: var(--primary-color); + color: white; + padding: 2rem; + text-align: center; +} + +main { + max-width: 800px; + margin: 2rem auto; + padding: 0 1rem; +} + +#calculator { + background: white; + padding: 2rem; + border-radius: 8px; + box-shadow: 0 2px 5px rgba(0,0,0,0.1); + margin-bottom: 2rem; +} + +.display input { + width: 100%; + padding: 1rem; + font-size: 1.5rem; + text-align: right; + border: 1px solid var(--button-color); + border-radius: 4px; + margin-bottom: 1rem; +} + +.buttons { + display: grid; + grid-template-columns: repeat(4, 1fr); + gap: 1rem; +} + +.buttons button { + padding: 1.5rem; + font-size: 1.2rem; + border: none; + border-radius: 4px; + background-color: var(--button-color); + cursor: pointer; + transition: background-color 0.3s; +} + +.buttons button:hover { + background-color: var(--button-hover); +} + +#storage { + background: white; + padding: 2rem; + border-radius: 8px; + box-shadow: 0 2px 5px rgba(0,0,0,0.1); +} + +.storage-controls { + display: flex; + gap: 1rem; + margin-bottom: 1rem; +} + +.storage-controls input { + flex: 1; + padding: 0.5rem; + border: 1px solid var(--button-color); + border-radius: 4px; +} + +.storage-controls button { + padding: 0.5rem 1rem; + background-color: var(--primary-color); + color: white; + border: none; + border-radius: 4px; + cursor: pointer; + transition: background-color 0.3s; +} + +.storage-controls button:hover { + background-color: var(--secondary-color); +} + +#storedVariables { + background: var(--background-color); + padding: 1rem; + border-radius: 4px; + min-height: 50px; +} + +footer { + text-align: center; + padding: 1rem; + background-color: var(--primary-color); + color: white; + margin-top: 2rem; +} + +@media (max-width: 600px) { + .buttons { + grid-template-columns: repeat(3, 1fr); + } +} \ No newline at end of file