commit 89958988ebbde910aa5aaf2f8fa86c9a3b7160d9
Author: root <root@hub.scroll.pub> Date: 2024-12-31 16:51:59 +0000 Subject: Initial commit diff --git a/body.html b/body.html new file mode 100644 index 0000000..98e2082 --- /dev/null +++ b/body.html @@ -0,0 +1,57 @@ +<header> + <h1>StockWise</h1> + <p>Smart Inventory & Order Management</p> +</header> + +<main> + <section class="controls"> + <button id="addItem">+ Add New Item</button> + <input type="text" id="search" placeholder="Search items..."> + </section> + + <section class="inventory"> + <div class="table-header"> + <span>Item</span> + <span>Factory</span> + <span>Cost</span> + <span>Price</span> + <span>Stock</span> + <span>Actions</span> + </div> + <div id="inventoryList"></div> + </section> + + <dialog id="itemModal"> + <form id="itemForm"> + <h2>Edit Item</h2> + <label> + Item Name: + <input type="text" name="name" required> + </label> + <label> + Factory: + <input type="text" name="factory" required> + </label> + <label> + Cost Price: + <input type="number" name="cost" step="0.01" required> + </label> + <label> + Sell Price: + <input type="number" name="price" step="0.01" required> + </label> + <label> + Stock Count: + <input type="number" name="stock" required> + </label> + <div class="form-buttons"> + <button type="button" id="cancelBtn">Cancel</button> + <button type="submit">Save</button> + </div> + </form> + </dialog> +</main> + +<footer> + <p>Simplify your inventory management with StockWise</p> +</footer> \ No newline at end of file diff --git a/index.scroll b/index.scroll new file mode 100644 index 0000000..2fefee7 --- /dev/null +++ b/index.scroll @@ -0,0 +1,8 @@ +buildHtml +baseUrl https://stockwise.scroll.pub +metaTags +editButton /edit.html +title StockWise - Smart Inventory Management +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..cb0aa56 --- /dev/null +++ b/prompt.json @@ -0,0 +1,25 @@ +{ + "id": "7972981e-9133-44ad-b395-95c9b5ee7211", + "object": "chat.completion", + "created": 1735663889, + "model": "deepseek-chat", + "choices": [ + { + "index": 0, + "message": { + "role": "assistant", + "content": "---domain---\nstockwise.scroll.pub\n---index.scroll---\nbuildHtml\nbaseUrl https://stockwise.scroll.pub\nmetaTags\neditButton /edit.html\ntitle StockWise - Smart Inventory Management\nstyle.css\nbody.html\nscript.js\n---body.html---\n<header>\n <h1>StockWise</h1>\n <p>Smart Inventory & Order Management</p>\n</header>\n\n<main>\n <section class=\"controls\">\n <button id=\"addItem\">+ Add New Item</button>\n <input type=\"text\" id=\"search\" placeholder=\"Search items...\">\n </section>\n\n <section class=\"inventory\">\n <div class=\"table-header\">\n <span>Item</span>\n <span>Factory</span>\n <span>Cost</span>\n <span>Price</span>\n <span>Stock</span>\n <span>Actions</span>\n </div>\n <div id=\"inventoryList\"></div>\n </section>\n\n <dialog id=\"itemModal\">\n <form id=\"itemForm\">\n <h2>Edit Item</h2>\n <label>\n Item Name:\n <input type=\"text\" name=\"name\" required>\n </label>\n <label>\n Factory:\n <input type=\"text\" name=\"factory\" required>\n </label>\n <label>\n Cost Price:\n <input type=\"number\" name=\"cost\" step=\"0.01\" required>\n </label>\n <label>\n Sell Price:\n <input type=\"number\" name=\"price\" step=\"0.01\" required>\n </label>\n <label>\n Stock Count:\n <input type=\"number\" name=\"stock\" required>\n </label>\n <div class=\"form-buttons\">\n <button type=\"button\" id=\"cancelBtn\">Cancel</button>\n <button type=\"submit\">Save</button>\n </div>\n </form>\n </dialog>\n</main>\n\n<footer>\n <p>Simplify your inventory management with StockWise</p>\n</footer>\n---style.css---\n:root {\n --primary: #2563eb;\n --primary-hover: #1d4ed8;\n --background: #f8fafc;\n --text: #1e293b;\n --border: #e2e8f0;\n --shadow: 0 1px 3px rgba(0,0,0,0.1);\n}\n\nbody {\n font-family: system-ui, -apple-system, sans-serif;\n background: var(--background);\n color: var(--text);\n margin: 0;\n padding: 20px;\n line-height: 1.5;\n}\n\nheader {\n text-align: center;\n margin-bottom: 2rem;\n}\n\nheader h1 {\n font-size: 2.5rem;\n color: var(--primary);\n margin: 0;\n}\n\nheader p {\n color: #64748b;\n margin: 0.5rem 0 0;\n}\n\n.controls {\n display: flex;\n gap: 1rem;\n margin-bottom: 2rem;\n}\n\n#addItem {\n background: var(--primary);\n color: white;\n border: none;\n padding: 0.75rem 1.5rem;\n border-radius: 0.5rem;\n cursor: pointer;\n transition: background 0.2s;\n}\n\n#addItem:hover {\n background: var(--primary-hover);\n}\n\n#search {\n flex: 1;\n padding: 0.75rem;\n border: 1px solid var(--border);\n border-radius: 0.5rem;\n}\n\n.inventory {\n background: white;\n border-radius: 0.5rem;\n box-shadow: var(--shadow);\n overflow: hidden;\n}\n\n.table-header {\n display: grid;\n grid-template-columns: 2fr 1.5fr 1fr 1fr 1fr 1fr;\n gap: 1rem;\n padding: 1rem;\n background: var(--background);\n font-weight: 600;\n border-bottom: 1px solid var(--border);\n}\n\n#inventoryList {\n display: flex;\n flex-direction: column;\n}\n\n.item-row {\n display: grid;\n grid-template-columns: 2fr 1.5fr 1fr 1fr 1fr 1fr;\n gap: 1rem;\n padding: 1rem;\n border-bottom: 1px solid var(--border);\n align-items: center;\n}\n\n.item-row:last-child {\n border-bottom: none;\n}\n\n.item-row button {\n background: none;\n border: 1px solid var(--border);\n padding: 0.5rem;\n border-radius: 0.25rem;\n cursor: pointer;\n transition: all 0.2s;\n}\n\n.item-row button:hover {\n background: var(--background);\n}\n\ndialog {\n border: none;\n border-radius: 0.5rem;\n box-shadow: var(--shadow);\n width: min(90%, 400px);\n padding: 2rem;\n}\n\ndialog::backdrop {\n background: rgba(0,0,0,0.5);\n}\n\n.form-buttons {\n display: flex;\n gap: 1rem;\n margin-top: 1.5rem;\n}\n\nfooter {\n text-align: center;\n margin-top: 2rem;\n color: #64748b;\n}\n\n@media (max-width: 768px) {\n .table-header, .item-row {\n grid-template-columns: repeat(3, 1fr);\n }\n \n .table-header span:nth-child(4),\n .table-header span:nth-child(5),\n .item-row > div:nth-child(4),\n .item-row > div:nth-child(5) {\n display: none;\n }\n}\n---script.js---\nlet inventory = [];\nlet currentEditIndex = null;\n\nconst inventoryList = document.getElementById('inventoryList');\nconst itemModal = document.getElementById('itemModal');\nconst itemForm = document.getElementById('itemForm');\nconst addItemBtn = document.getElementById('addItem');\nconst cancelBtn = document.getElementById('cancelBtn');\nconst searchInput = document.getElementById('search');\n\nfunction renderInventory() {\n inventoryList.innerHTML = '';\n inventory.forEach((item, index) => {\n const itemRow = document.createElement('div');\n itemRow.className = 'item-row';\n itemRow.innerHTML = `\n <div>${item.name}</div>\n <div>${item.factory}</div>\n <div>$${item.cost.toFixed(2)}</div>\n <div>$${item.price.toFixed(2)}</div>\n <div>${item.stock}</div>\n <div>\n <button onclick=\"editItem(${index})\">Edit</button>\n <button onclick=\"deleteItem(${index})\">Delete</button>\n </div>\n `;\n inventoryList.appendChild(itemRow);\n });\n}\n\nfunction addItem(item) {\n inventory.push(item);\n renderInventory();\n}\n\nfunction editItem(index) {\n currentEditIndex = index;\n const item = inventory[index];\n itemForm.name.value = item.name;\n itemForm.factory.value = item.factory;\n itemForm.cost.value = item.cost;\n itemForm.price.value = item.price;\n itemForm.stock.value = item.stock;\n itemModal.showModal();\n}\n\nfunction deleteItem(index) {\n inventory.splice(index, 1);\n renderInventory();\n}\n\nitemForm.addEventListener('submit', (e) => {\n e.preventDefault();\n const item = {\n name: itemForm.name.value,\n factory: itemForm.factory.value,\n cost: parseFloat(itemForm.cost.value),\n price: parseFloat(itemForm.price.value),\n stock: parseInt(itemForm.stock.value)\n };\n \n if (currentEditIndex !== null) {\n inventory[currentEditIndex] = item;\n currentEditIndex = null;\n } else {\n addItem(item);\n }\n \n itemModal.close();\n renderInventory();\n itemForm.reset();\n});\n\naddItemBtn.addEventListener('click', () => {\n currentEditIndex = null;\n itemModal.showModal();\n});\n\ncancelBtn.addEventListener('click', () => {\n itemModal.close();\n itemForm.reset();\n});\n\nsearchInput.addEventListener('input', () => {\n const searchTerm = searchInput.value.toLowerCase();\n const filtered = inventory.filter(item => \n item.name.toLowerCase().includes(searchTerm) ||\n item.factory.toLowerCase().includes(searchTerm)\n );\n inventoryList.innerHTML = '';\n filtered.forEach((item, index) => {\n const itemRow = document.createElement('div');\n itemRow.className = 'item-row';\n itemRow.innerHTML = `\n <div>${item.name}</div>\n <div>${item.factory}</div>\n <div>$${item.cost.toFixed(2)}</div>\n <div>$${item.price.toFixed(2)}</div>\n <div>${item.stock}</div>\n <div>\n <button onclick=\"editItem(${index})\">Edit</button>\n <button onclick=\"deleteItem(${index})\">Delete</button>\n </div>\n `;\n inventoryList.appendChild(itemRow);\n });\n});\n\n// Initial render\nrenderInventory();\n---end---" + }, + "logprobs": null, + "finish_reason": "stop" + } + ], + "usage": { + "prompt_tokens": 277, + "completion_tokens": 2025, + "total_tokens": 2302, + "prompt_cache_hit_tokens": 0, + "prompt_cache_miss_tokens": 277 + }, + "system_fingerprint": "fp_f1afce2943" +} \ No newline at end of file diff --git a/readme.scroll b/readme.scroll new file mode 100644 index 0000000..38fe94d --- /dev/null +++ b/readme.scroll @@ -0,0 +1,2 @@ +# stockwise1.scroll.pub +Website generated by DeepSeek from prompt: a website for ecommerce order and inventory management, i can add delete and edti entries of each items. i can log and track the cost and sell price, change of counts, and which factory they are from. \ No newline at end of file diff --git a/script.js b/script.js new file mode 100644 index 0000000..761be36 --- /dev/null +++ b/script.js @@ -0,0 +1,110 @@ +let inventory = []; +let currentEditIndex = null; + +const inventoryList = document.getElementById('inventoryList'); +const itemModal = document.getElementById('itemModal'); +const itemForm = document.getElementById('itemForm'); +const addItemBtn = document.getElementById('addItem'); +const cancelBtn = document.getElementById('cancelBtn'); +const searchInput = document.getElementById('search'); + +function renderInventory() { + inventoryList.innerHTML = ''; + inventory.forEach((item, index) => { + const itemRow = document.createElement('div'); + itemRow.className = 'item-row'; + itemRow.innerHTML = ` + <div>${item.name}</div> + <div>${item.factory}</div> + <div>$${item.cost.toFixed(2)}</div> + <div>$${item.price.toFixed(2)}</div> + <div>${item.stock}</div> + <div> + <button onclick="editItem(${index})">Edit</button> + <button onclick="deleteItem(${index})">Delete</button> + </div> + `; + inventoryList.appendChild(itemRow); + }); +} + +function addItem(item) { + inventory.push(item); + renderInventory(); +} + +function editItem(index) { + currentEditIndex = index; + const item = inventory[index]; + itemForm.name.value = item.name; + itemForm.factory.value = item.factory; + itemForm.cost.value = item.cost; + itemForm.price.value = item.price; + itemForm.stock.value = item.stock; + itemModal.showModal(); +} + +function deleteItem(index) { + inventory.splice(index, 1); + renderInventory(); +} + +itemForm.addEventListener('submit', (e) => { + e.preventDefault(); + const item = { + name: itemForm.name.value, + factory: itemForm.factory.value, + cost: parseFloat(itemForm.cost.value), + price: parseFloat(itemForm.price.value), + stock: parseInt(itemForm.stock.value) + }; + + if (currentEditIndex !== null) { + inventory[currentEditIndex] = item; + currentEditIndex = null; + } else { + addItem(item); + } + + itemModal.close(); + renderInventory(); + itemForm.reset(); +}); + +addItemBtn.addEventListener('click', () => { + currentEditIndex = null; + itemModal.showModal(); +}); + +cancelBtn.addEventListener('click', () => { + itemModal.close(); + itemForm.reset(); +}); + +searchInput.addEventListener('input', () => { + const searchTerm = searchInput.value.toLowerCase(); + const filtered = inventory.filter(item => + item.name.toLowerCase().includes(searchTerm) || + item.factory.toLowerCase().includes(searchTerm) + ); + inventoryList.innerHTML = ''; + filtered.forEach((item, index) => { + const itemRow = document.createElement('div'); + itemRow.className = 'item-row'; + itemRow.innerHTML = ` + <div>${item.name}</div> + <div>${item.factory}</div> + <div>$${item.cost.toFixed(2)}</div> + <div>$${item.price.toFixed(2)}</div> + <div>${item.stock}</div> + <div> + <button onclick="editItem(${index})">Edit</button> + <button onclick="deleteItem(${index})">Delete</button> + </div> + `; + inventoryList.appendChild(itemRow); + }); +}); + +// Initial render +renderInventory(); \ No newline at end of file diff --git a/style.css b/style.css new file mode 100644 index 0000000..f47be4b --- /dev/null +++ b/style.css @@ -0,0 +1,145 @@ +:root { + --primary: #2563eb; + --primary-hover: #1d4ed8; + --background: #f8fafc; + --text: #1e293b; + --border: #e2e8f0; + --shadow: 0 1px 3px rgba(0,0,0,0.1); +} + +body { + font-family: system-ui, -apple-system, sans-serif; + background: var(--background); + color: var(--text); + margin: 0; + padding: 20px; + line-height: 1.5; +} + +header { + text-align: center; + margin-bottom: 2rem; +} + +header h1 { + font-size: 2.5rem; + color: var(--primary); + margin: 0; +} + +header p { + color: #64748b; + margin: 0.5rem 0 0; +} + +.controls { + display: flex; + gap: 1rem; + margin-bottom: 2rem; +} + +#addItem { + background: var(--primary); + color: white; + border: none; + padding: 0.75rem 1.5rem; + border-radius: 0.5rem; + cursor: pointer; + transition: background 0.2s; +} + +#addItem:hover { + background: var(--primary-hover); +} + +#search { + flex: 1; + padding: 0.75rem; + border: 1px solid var(--border); + border-radius: 0.5rem; +} + +.inventory { + background: white; + border-radius: 0.5rem; + box-shadow: var(--shadow); + overflow: hidden; +} + +.table-header { + display: grid; + grid-template-columns: 2fr 1.5fr 1fr 1fr 1fr 1fr; + gap: 1rem; + padding: 1rem; + background: var(--background); + font-weight: 600; + border-bottom: 1px solid var(--border); +} + +#inventoryList { + display: flex; + flex-direction: column; +} + +.item-row { + display: grid; + grid-template-columns: 2fr 1.5fr 1fr 1fr 1fr 1fr; + gap: 1rem; + padding: 1rem; + border-bottom: 1px solid var(--border); + align-items: center; +} + +.item-row:last-child { + border-bottom: none; +} + +.item-row button { + background: none; + border: 1px solid var(--border); + padding: 0.5rem; + border-radius: 0.25rem; + cursor: pointer; + transition: all 0.2s; +} + +.item-row button:hover { + background: var(--background); +} + +dialog { + border: none; + border-radius: 0.5rem; + box-shadow: var(--shadow); + width: min(90%, 400px); + padding: 2rem; +} + +dialog::backdrop { + background: rgba(0,0,0,0.5); +} + +.form-buttons { + display: flex; + gap: 1rem; + margin-top: 1.5rem; +} + +footer { + text-align: center; + margin-top: 2rem; + color: #64748b; +} + +@media (max-width: 768px) { + .table-header, .item-row { + grid-template-columns: repeat(3, 1fr); + } + + .table-header span:nth-child(4), + .table-header span:nth-child(5), + .item-row > div:nth-child(4), + .item-row > div:nth-child(5) { + display: none; + } +} \ No newline at end of file