commit 5d7aaa52ebd7be0e523a41eae37f38b6cedd4479
Author: root <root@hub.scroll.pub> Date: 2024-12-30 01:20:50 +0000 Subject: Initial commit diff --git a/body.html b/body.html new file mode 100644 index 0000000..6a27874 --- /dev/null +++ b/body.html @@ -0,0 +1,23 @@ +<header> + <h1>HealthLog</h1> + <p>Track your health items with ease.</p> +</header> +<main> + <section id="log-section"> + <h2>Log a Health Item</h2> + <form id="health-form"> + <label for="item-name">Item Name:</label> + <input type="text" id="item-name" name="item-name" required> + <label for="item-description">Description:</label> + <textarea id="item-description" name="item-description"></textarea> + <button type="submit">Log Item</button> + </form> + </section> + <section id="items-section"> + <h2>Logged Items</h2> + <ul id="items-list"></ul> + </section> +</main> +<footer> + <p>Your health, your data.</p> +</footer> \ No newline at end of file diff --git a/index.scroll b/index.scroll new file mode 100644 index 0000000..77c3c27 --- /dev/null +++ b/index.scroll @@ -0,0 +1,8 @@ +buildHtml +baseUrl https://healthlog.scroll.pub +metaTags +editButton /edit.html +title HealthLog - Track Your Health +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..350092b --- /dev/null +++ b/prompt.json @@ -0,0 +1,25 @@ +{ + "id": "a0aaab56-91fb-4009-8fc3-57d68a72ffab", + "object": "chat.completion", + "created": 1735521637, + "model": "deepseek-chat", + "choices": [ + { + "index": 0, + "message": { + "role": "assistant", + "content": "---domain---\nhealthlog.scroll.pub\n---index.scroll---\nbuildHtml\nbaseUrl https://healthlog.scroll.pub\nmetaTags\neditButton /edit.html\ntitle HealthLog - Track Your Health\nstyle.css\nbody.html\nscript.js\n---body.html---\n<header>\n <h1>HealthLog</h1>\n <p>Track your health items with ease.</p>\n</header>\n<main>\n <section id=\"log-section\">\n <h2>Log a Health Item</h2>\n <form id=\"health-form\">\n <label for=\"item-name\">Item Name:</label>\n <input type=\"text\" id=\"item-name\" name=\"item-name\" required>\n <label for=\"item-description\">Description:</label>\n <textarea id=\"item-description\" name=\"item-description\"></textarea>\n <button type=\"submit\">Log Item</button>\n </form>\n </section>\n <section id=\"items-section\">\n <h2>Logged Items</h2>\n <ul id=\"items-list\"></ul>\n </section>\n</main>\n<footer>\n <p>Your health, your data.</p>\n</footer>\n---style.css---\nbody {\n font-family: 'Arial', sans-serif;\n margin: 0;\n padding: 0;\n background-color: #f4f4f9;\n color: #333;\n}\n\nheader {\n background-color: #4CAF50;\n color: white;\n padding: 20px;\n text-align: center;\n}\n\nmain {\n padding: 20px;\n}\n\nsection {\n margin-bottom: 20px;\n}\n\nform {\n display: flex;\n flex-direction: column;\n}\n\nlabel {\n margin-bottom: 5px;\n}\n\ninput, textarea {\n margin-bottom: 10px;\n padding: 10px;\n border: 1px solid #ccc;\n border-radius: 4px;\n}\n\nbutton {\n padding: 10px;\n background-color: #4CAF50;\n color: white;\n border: none;\n border-radius: 4px;\n cursor: pointer;\n}\n\nbutton:hover {\n background-color: #45a049;\n}\n\nul {\n list-style-type: none;\n padding: 0;\n}\n\nli {\n background-color: white;\n padding: 10px;\n margin-bottom: 10px;\n border-radius: 4px;\n box-shadow: 0 2px 4px rgba(0,0,0,0.1);\n}\n\nfooter {\n text-align: center;\n padding: 10px;\n background-color: #4CAF50;\n color: white;\n position: fixed;\n bottom: 0;\n width: 100%;\n}\n---script.js---\ndocument.addEventListener('DOMContentLoaded', function() {\n const form = document.getElementById('health-form');\n const itemsList = document.getElementById('items-list');\n\n form.addEventListener('submit', function(event) {\n event.preventDefault();\n const itemName = document.getElementById('item-name').value;\n const itemDescription = document.getElementById('item-description').value;\n\n const item = {\n name: itemName,\n description: itemDescription\n };\n\n logItem(item);\n saveItemToCookie(item);\n form.reset();\n });\n\n function logItem(item) {\n const li = document.createElement('li');\n li.textContent = `${item.name}: ${item.description}`;\n itemsList.appendChild(li);\n }\n\n function saveItemToCookie(item) {\n const items = getItemsFromCookie();\n items.push(item);\n document.cookie = `healthItems=${JSON.stringify(items)}; path=/`;\n }\n\n function getItemsFromCookie() {\n const cookie = document.cookie.split('; ').find(row => row.startsWith('healthItems='));\n return cookie ? JSON.parse(cookie.split('=')[1]) : [];\n }\n\n function loadItemsFromCookie() {\n const items = getItemsFromCookie();\n items.forEach(item => logItem(item));\n }\n\n loadItemsFromCookie();\n});\n---end---" + }, + "logprobs": null, + "finish_reason": "stop" + } + ], + "usage": { + "prompt_tokens": 251, + "completion_tokens": 878, + "total_tokens": 1129, + "prompt_cache_hit_tokens": 0, + "prompt_cache_miss_tokens": 251 + }, + "system_fingerprint": "fp_f1afce2943" +} \ No newline at end of file diff --git a/readme.scroll b/readme.scroll new file mode 100644 index 0000000..5d4c26c --- /dev/null +++ b/readme.scroll @@ -0,0 +1,2 @@ +# healthlog.scroll.pub +Website generated by DeepSeek from prompt: I want crud solution for my health that stores a cookie when i log an item \ No newline at end of file diff --git a/script.js b/script.js new file mode 100644 index 0000000..38159b5 --- /dev/null +++ b/script.js @@ -0,0 +1,43 @@ +document.addEventListener('DOMContentLoaded', function() { + const form = document.getElementById('health-form'); + const itemsList = document.getElementById('items-list'); + + form.addEventListener('submit', function(event) { + event.preventDefault(); + const itemName = document.getElementById('item-name').value; + const itemDescription = document.getElementById('item-description').value; + + const item = { + name: itemName, + description: itemDescription + }; + + logItem(item); + saveItemToCookie(item); + form.reset(); + }); + + function logItem(item) { + const li = document.createElement('li'); + li.textContent = `${item.name}: ${item.description}`; + itemsList.appendChild(li); + } + + function saveItemToCookie(item) { + const items = getItemsFromCookie(); + items.push(item); + document.cookie = `healthItems=${JSON.stringify(items)}; path=/`; + } + + function getItemsFromCookie() { + const cookie = document.cookie.split('; ').find(row => row.startsWith('healthItems=')); + return cookie ? JSON.parse(cookie.split('=')[1]) : []; + } + + function loadItemsFromCookie() { + const items = getItemsFromCookie(); + items.forEach(item => logItem(item)); + } + + loadItemsFromCookie(); +}); \ No newline at end of file diff --git a/style.css b/style.css new file mode 100644 index 0000000..85944b2 --- /dev/null +++ b/style.css @@ -0,0 +1,74 @@ +body { + font-family: 'Arial', sans-serif; + margin: 0; + padding: 0; + background-color: #f4f4f9; + color: #333; +} + +header { + background-color: #4CAF50; + color: white; + padding: 20px; + text-align: center; +} + +main { + padding: 20px; +} + +section { + margin-bottom: 20px; +} + +form { + display: flex; + flex-direction: column; +} + +label { + margin-bottom: 5px; +} + +input, textarea { + margin-bottom: 10px; + padding: 10px; + border: 1px solid #ccc; + border-radius: 4px; +} + +button { + padding: 10px; + background-color: #4CAF50; + color: white; + border: none; + border-radius: 4px; + cursor: pointer; +} + +button:hover { + background-color: #45a049; +} + +ul { + list-style-type: none; + padding: 0; +} + +li { + background-color: white; + padding: 10px; + margin-bottom: 10px; + border-radius: 4px; + box-shadow: 0 2px 4px rgba(0,0,0,0.1); +} + +footer { + text-align: center; + padding: 10px; + background-color: #4CAF50; + color: white; + position: fixed; + bottom: 0; + width: 100%; +} \ No newline at end of file