Changes to recipecalc.scroll.pub

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

Recipe Cost Calculator

+

Calculate the total cost of your recipes with ease

+
+
+
+
+

Add Ingredients

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

Ingredient List

+
+
+
+
+
+
+
+
+
+
+
+
+
IngredientQuantityCostAction
+
+
+
+

Total Recipe Cost: $0.00

+
+
+
+
+
+

Recipe Cost Calculator - Made with ♥ for home chefs

+
index.scroll
Changed around line 1
+ buildHtml
+ baseUrl https://recipecalc.scroll.pub
+ metaTags
+ editButton /edit.html
+ title Recipe Cost Calculator
+ style.css
+ body.html
+ script.js
prompt.json
Changed around line 1
+ {
+ "id": "msg_01A7SqRMJwqpddFw9vAamb9e",
+ "type": "message",
+ "role": "assistant",
+ "model": "claude-3-5-sonnet-20241022",
+ "content": [
+ {
+ "type": "text",
+ "text": "Here's a recipe cost calculator website that meets your requirements:\n\n---domain---\nrecipecalc.scroll.pub\n\n---index.scroll---\nbuildHtml\nbaseUrl https://recipecalc.scroll.pub\nmetaTags\neditButton /edit.html\ntitle Recipe Cost Calculator\nstyle.css\nbody.html\nscript.js\n\n---body.html---\n
\n

Recipe Cost Calculator

\n

Calculate the total cost of your recipes with ease

\n
\n\n
\n
\n

Add Ingredients

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

Ingredient List

\n
\n \n \n \n \n \n \n \n \n \n \n \n
IngredientQuantityCostAction
\n
\n \n
\n

Total Recipe Cost: $0.00

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

Recipe Cost Calculator - Made with ♥ for home chefs

\n
\n\n---style.css---\n:root {\n --primary-color: #2c3e50;\n --accent-color: #3498db;\n --background-color: #f9fafb;\n --text-color: #2c3e50;\n --border-radius: 8px;\n --spacing: 1rem;\n}\n\n* {\n margin: 0;\n padding: 0;\n box-sizing: border-box;\n}\n\nbody {\n font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;\n line-height: 1.6;\n color: var(--text-color);\n background: var(--background-color);\n}\n\nheader {\n background: var(--primary-color);\n color: white;\n padding: 2rem var(--spacing);\n text-align: center;\n box-shadow: 0 2px 4px rgba(0,0,0,0.1);\n}\n\nmain {\n max-width: 1200px;\n margin: 0 auto;\n padding: var(--spacing);\n}\n\nsection {\n background: white;\n border-radius: var(--border-radius);\n padding: 2rem;\n margin: 2rem 0;\n box-shadow: 0 2px 4px rgba(0,0,0,0.05);\n}\n\nh2 {\n color: var(--primary-color);\n margin-bottom: 1.5rem;\n}\n\n.form-group {\n margin-bottom: 1rem;\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 #ddd;\n border-radius: var(--border-radius);\n font-size: 1rem;\n transition: border-color 0.3s;\n}\n\ninput:focus {\n outline: none;\n border-color: var(--accent-color);\n}\n\nbutton {\n background: var(--accent-color);\n color: white;\n border: none;\n padding: 0.75rem 1.5rem;\n border-radius: var(--border-radius);\n cursor: pointer;\n font-size: 1rem;\n transition: background-color 0.3s;\n}\n\nbutton:hover {\n background: #2980b9;\n}\n\ntable {\n width: 100%;\n border-collapse: collapse;\n margin: 1rem 0;\n}\n\nth, td {\n padding: 1rem;\n text-align: left;\n border-bottom: 1px solid #ddd;\n}\n\nth {\n background: #f5f6f7;\n font-weight: 600;\n}\n\n.delete-btn {\n background: #e74c3c;\n padding: 0.5rem 1rem;\n font-size: 0.9rem;\n}\n\n.delete-btn:hover {\n background: #c0392b;\n}\n\n.total {\n text-align: right;\n margin-top: 2rem;\n font-size: 1.2rem;\n}\n\nfooter {\n text-align: center;\n padding: 2rem;\n background: var(--primary-color);\n color: white;\n margin-top: 2rem;\n}\n\n@media (max-width: 768px) {\n .form-group {\n margin-bottom: 1.5rem;\n }\n \n table {\n display: block;\n overflow-x: auto;\n }\n \n th, td {\n padding: 0.75rem;\n }\n}\n\n@media (min-width: 768px) {\n #ingredient-form {\n display: grid;\n grid-template-columns: repeat(3, 1fr);\n gap: 1rem;\n }\n \n .form-group {\n margin-bottom: 0;\n }\n \n button[type=\"submit\"] {\n grid-column: 1 / -1;\n }\n}\n\n---script.js---\ndocument.addEventListener('DOMContentLoaded', () => {\n const form = document.getElementById('ingredient-form');\n const ingredientsTable = document.getElementById('ingredients-table');\n const totalCostElement = document.getElementById('total-cost');\n \n let ingredients = [];\n \n form.addEventListener('submit', (e) => {\n e.preventDefault();\n \n const name = document.getElementById('ingredient-name').value;\n const quantity = parseFloat(document.getElementById('ingredient-quantity').value);\n const cost = parseFloat(document.getElementById('ingredient-cost').value);\n \n addIngredient(name, quantity, cost);\n form.reset();\n });\n \n function addIngredient(name, quantity, cost) {\n ingredients.push({ name, quantity, cost });\n updateTable();\n }\n \n function deleteIngredient(index) {\n ingredients.splice(index, 1);\n updateTable();\n }\n \n function updateTable() {\n ingredientsTable.innerHTML = '';\n let totalCost = 0;\n \n ingredients.forEach((ingredient, index) => {\n const row = document.createElement('tr');\n const itemCost = ingredient.quantity * ingredient.cost;\n totalCost += itemCost;\n \n row.innerHTML = `\n ${ingredient.name}\n ${ingredient.quantity}\n $${ingredient.cost.toFixed(2)}\n \n \n \n `;\n \n ingredientsTable.appendChild(row);\n });\n \n totalCostElement.textContent = `$${totalCost.toFixed(2)}`;\n }\n \n // Make deleteIngredient function available globally\n window.deleteIngredient = deleteIngredient;\n});\n\n---end---\n\nThis recipe cost calculator features:\n\n1. Clean, modern design with smooth animations and transitions\n2. Responsive grid layout that adapts to different screen sizes\n3. Interactive form with real-time validation\n4. Dynamic table that updates as ingredients are added/removed\n5. Automatic cost calculation\n6. Accessible form labels and semantic HTML\n7. Beautiful color scheme and typography\n8. Smooth shadows and rounded corners for depth\n9. Error-proof number inputs\n10. Mobile-first approach\n\nThe design is professional yet approachable, making it easy for home chefs to calculate their recipe costs quickly and efficiently."
+ }
+ ],
+ "stop_reason": "end_turn",
+ "stop_sequence": null,
+ "usage": {
+ "input_tokens": 297,
+ "cache_creation_input_tokens": 0,
+ "cache_read_input_tokens": 0,
+ "output_tokens": 2237
+ }
+ }
readme.scroll
Changed around line 1
+ # recipecalc.scroll.pub
+ Website generated by Claude from prompt: a website to calculate the cost of a recipe given the ingredients' name, cost and quantity. Show the ingredient list in a table format
script.js
Changed around line 1
+ document.addEventListener('DOMContentLoaded', () => {
+ const form = document.getElementById('ingredient-form');
+ const ingredientsTable = document.getElementById('ingredients-table');
+ const totalCostElement = document.getElementById('total-cost');
+
+ let ingredients = [];
+
+ form.addEventListener('submit', (e) => {
+ e.preventDefault();
+
+ const name = document.getElementById('ingredient-name').value;
+ const quantity = parseFloat(document.getElementById('ingredient-quantity').value);
+ const cost = parseFloat(document.getElementById('ingredient-cost').value);
+
+ addIngredient(name, quantity, cost);
+ form.reset();
+ });
+
+ function addIngredient(name, quantity, cost) {
+ ingredients.push({ name, quantity, cost });
+ updateTable();
+ }
+
+ function deleteIngredient(index) {
+ ingredients.splice(index, 1);
+ updateTable();
+ }
+
+ function updateTable() {
+ ingredientsTable.innerHTML = '';
+ let totalCost = 0;
+
+ ingredients.forEach((ingredient, index) => {
+ const row = document.createElement('tr');
+ const itemCost = ingredient.quantity * ingredient.cost;
+ totalCost += itemCost;
+
+ row.innerHTML = `
+ ${ingredient.name}
+ ${ingredient.quantity}
+ $${ingredient.cost.toFixed(2)}
+
+
+ Delete
+
+
+ `;
+
+ ingredientsTable.appendChild(row);
+ });
+
+ totalCostElement.textContent = `$${totalCost.toFixed(2)}`;
+ }
+
+ // Make deleteIngredient function available globally
+ window.deleteIngredient = deleteIngredient;
+ });
style.css
Changed around line 1
+ :root {
+ --primary-color: #2c3e50;
+ --accent-color: #3498db;
+ --background-color: #f9fafb;
+ --text-color: #2c3e50;
+ --border-radius: 8px;
+ --spacing: 1rem;
+ }
+
+ * {
+ margin: 0;
+ padding: 0;
+ box-sizing: border-box;
+ }
+
+ body {
+ font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
+ line-height: 1.6;
+ color: var(--text-color);
+ background: var(--background-color);
+ }
+
+ header {
+ background: var(--primary-color);
+ color: white;
+ padding: 2rem var(--spacing);
+ text-align: center;
+ box-shadow: 0 2px 4px rgba(0,0,0,0.1);
+ }
+
+ main {
+ max-width: 1200px;
+ margin: 0 auto;
+ padding: var(--spacing);
+ }
+
+ section {
+ background: white;
+ border-radius: var(--border-radius);
+ padding: 2rem;
+ margin: 2rem 0;
+ box-shadow: 0 2px 4px rgba(0,0,0,0.05);
+ }
+
+ h2 {
+ color: var(--primary-color);
+ margin-bottom: 1.5rem;
+ }
+
+ .form-group {
+ margin-bottom: 1rem;
+ }
+
+ label {
+ display: block;
+ margin-bottom: 0.5rem;
+ font-weight: 500;
+ }
+
+ input {
+ width: 100%;
+ padding: 0.75rem;
+ border: 1px solid #ddd;
+ border-radius: var(--border-radius);
+ font-size: 1rem;
+ transition: border-color 0.3s;
+ }
+
+ input:focus {
+ outline: none;
+ border-color: var(--accent-color);
+ }
+
+ button {
+ background: var(--accent-color);
+ color: white;
+ border: none;
+ padding: 0.75rem 1.5rem;
+ border-radius: var(--border-radius);
+ cursor: pointer;
+ font-size: 1rem;
+ transition: background-color 0.3s;
+ }
+
+ button:hover {
+ background: #2980b9;
+ }
+
+ table {
+ width: 100%;
+ border-collapse: collapse;
+ margin: 1rem 0;
+ }
+
+ th, td {
+ padding: 1rem;
+ text-align: left;
+ border-bottom: 1px solid #ddd;
+ }
+
+ th {
+ background: #f5f6f7;
+ font-weight: 600;
+ }
+
+ .delete-btn {
+ background: #e74c3c;
+ padding: 0.5rem 1rem;
+ font-size: 0.9rem;
+ }
+
+ .delete-btn:hover {
+ background: #c0392b;
+ }
+
+ .total {
+ text-align: right;
+ margin-top: 2rem;
+ font-size: 1.2rem;
+ }
+
+ footer {
+ text-align: center;
+ padding: 2rem;
+ background: var(--primary-color);
+ color: white;
+ margin-top: 2rem;
+ }
+
+ @media (max-width: 768px) {
+ .form-group {
+ margin-bottom: 1.5rem;
+ }
+
+ table {
+ display: block;
+ overflow-x: auto;
+ }
+
+ th, td {
+ padding: 0.75rem;
+ }
+ }
+
+ @media (min-width: 768px) {
+ #ingredient-form {
+ display: grid;
+ grid-template-columns: repeat(3, 1fr);
+ gap: 1rem;
+ }
+
+ .form-group {
+ margin-bottom: 0;
+ }
+
+ button[type="submit"] {
+ grid-column: 1 / -1;
+ }
+ }