commit a87a7bffbcefc6d208763b5fa997d2eec5019303
Author: root <root@hub.scroll.pub> Date: 2024-12-30 05:46:17 +0000 Subject: Initial commit diff --git a/body.html b/body.html new file mode 100644 index 0000000..880160c --- /dev/null +++ b/body.html @@ -0,0 +1,42 @@ +<header> + <h1>WeightWise</h1> + <p>Your personal weight tracking and dietary recommendation system</p> +</header> + +<main> + <section class="tracker"> + <h2>Weight Tracker</h2> + <form id="weightForm"> + <label for="weightInput">Today's Weight (kg):</label> + <input type="number" id="weightInput" step="0.1" required> + <button type="submit">Add Record</button> + </form> + <div class="chart-container"> + <canvas id="weightChart"></canvas> + </div> + </section> + + <section class="goals"> + <h2>Set Your Goals</h2> + <form id="goalForm"> + <label for="targetWeight">Target Weight (kg):</label> + <input type="number" id="targetWeight" step="0.1" required> + + <label for="timeFrame">Time Frame (weeks):</label> + <input type="number" id="timeFrame" required> + + <button type="submit">Update Goals</button> + </form> + </section> + + <section class="recommendations"> + <h2>Dietary Recommendations</h2> + <div id="recommendationContent"> + <p>Enter your goals to get personalized recommendations.</p> + </div> + </section> +</main> + +<footer> + <p>Your journey to better health starts here.</p> +</footer> \ No newline at end of file diff --git a/index.scroll b/index.scroll new file mode 100644 index 0000000..6b0af26 --- /dev/null +++ b/index.scroll @@ -0,0 +1,8 @@ +buildHtml +baseUrl https://weightwise.scroll.pub +metaTags +editButton /edit.html +title WeightWise - Track Your Weight & Get Dietary Recommendations +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..ce6f7c5 --- /dev/null +++ b/prompt.json @@ -0,0 +1,25 @@ +{ + "id": "793667ff-ad3e-45b9-ae78-f536a66763f9", + "object": "chat.completion", + "created": 1735537552, + "model": "deepseek-chat", + "choices": [ + { + "index": 0, + "message": { + "role": "assistant", + "content": "---domain---\nweightwise.scroll.pub\n---index.scroll---\nbuildHtml\nbaseUrl https://weightwise.scroll.pub\nmetaTags\neditButton /edit.html\ntitle WeightWise - Track Your Weight & Get Dietary Recommendations\nstyle.css\nbody.html\nscript.js\n---body.html---\n<header>\n <h1>WeightWise</h1>\n <p>Your personal weight tracking and dietary recommendation system</p>\n</header>\n\n<main>\n <section class=\"tracker\">\n <h2>Weight Tracker</h2>\n <form id=\"weightForm\">\n <label for=\"weightInput\">Today's Weight (kg):</label>\n <input type=\"number\" id=\"weightInput\" step=\"0.1\" required>\n <button type=\"submit\">Add Record</button>\n </form>\n <div class=\"chart-container\">\n <canvas id=\"weightChart\"></canvas>\n </div>\n </section>\n\n <section class=\"goals\">\n <h2>Set Your Goals</h2>\n <form id=\"goalForm\">\n <label for=\"targetWeight\">Target Weight (kg):</label>\n <input type=\"number\" id=\"targetWeight\" step=\"0.1\" required>\n \n <label for=\"timeFrame\">Time Frame (weeks):</label>\n <input type=\"number\" id=\"timeFrame\" required>\n \n <button type=\"submit\">Update Goals</button>\n </form>\n </section>\n\n <section class=\"recommendations\">\n <h2>Dietary Recommendations</h2>\n <div id=\"recommendationContent\">\n <p>Enter your goals to get personalized recommendations.</p>\n </div>\n </section>\n</main>\n\n<footer>\n <p>Your journey to better health starts here.</p>\n</footer>\n---style.css---\n:root {\n --primary-color: #4CAF50;\n --secondary-color: #45a049;\n --background-color: #f5f5f5;\n --text-color: #333;\n --chart-color: #4CAF50;\n}\n\nbody {\n font-family: 'Segoe UI', system-ui, 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: var(--primary-color);\n color: white;\n padding: 2rem;\n text-align: center;\n}\n\nh1 {\n margin: 0;\n font-size: 2.5rem;\n}\n\nmain {\n max-width: 1200px;\n margin: 2rem auto;\n padding: 0 1rem;\n}\n\nsection {\n background: white;\n border-radius: 8px;\n box-shadow: 0 2px 4px rgba(0,0,0,0.1);\n margin-bottom: 2rem;\n padding: 2rem;\n}\n\nform {\n display: grid;\n gap: 1rem;\n margin-bottom: 1.5rem;\n}\n\nlabel {\n font-weight: 600;\n}\n\ninput {\n padding: 0.8rem;\n border: 1px solid #ddd;\n border-radius: 4px;\n font-size: 1rem;\n}\n\nbutton {\n background: var(--primary-color);\n color: white;\n padding: 0.8rem 1.5rem;\n border: none;\n border-radius: 4px;\n cursor: pointer;\n font-size: 1rem;\n transition: background 0.3s ease;\n}\n\nbutton:hover {\n background: var(--secondary-color);\n}\n\n.chart-container {\n position: relative;\n height: 300px;\n margin-top: 2rem;\n}\n\nfooter {\n text-align: center;\n padding: 1rem;\n background: var(--primary-color);\n color: white;\n margin-top: 2rem;\n}\n\n@media (max-width: 768px) {\n h1 {\n font-size: 2rem;\n }\n \n section {\n padding: 1rem;\n }\n \n .chart-container {\n height: 200px;\n }\n}\n---script.js---\n// Initialize weight data\nlet weightData = [];\nlet goals = {\n targetWeight: null,\n timeFrame: null\n};\n\n// Chart setup\nconst ctx = document.getElementById('weightChart').getContext('2d');\nconst chart = new Chart(ctx, {\n type: 'line',\n data: {\n labels: [],\n datasets: [{\n label: 'Weight (kg)',\n data: [],\n borderColor: '#4CAF50',\n fill: false\n }]\n },\n options: {\n responsive: true,\n maintainAspectRatio: false,\n scales: {\n y: {\n beginAtZero: false\n }\n }\n }\n});\n\n// Form submission handlers\ndocument.getElementById('weightForm').addEventListener('submit', function(e) {\n e.preventDefault();\n const weight = parseFloat(document.getElementById('weightInput').value);\n const date = new Date().toLocaleDateString();\n \n weightData.push({ date, weight });\n updateChart();\n updateRecommendations();\n this.reset();\n});\n\ndocument.getElementById('goalForm').addEventListener('submit', function(e) {\n e.preventDefault();\n goals.targetWeight = parseFloat(document.getElementById('targetWeight').value);\n goals.timeFrame = parseInt(document.getElementById('timeFrame').value);\n updateRecommendations();\n this.reset();\n});\n\n// Update chart with new data\nfunction updateChart() {\n const labels = weightData.map(entry => entry.date);\n const data = weightData.map(entry => entry.weight);\n \n chart.data.labels = labels;\n chart.data.datasets[0].data = data;\n chart.update();\n}\n\n// Generate recommendations\nfunction updateRecommendations() {\n const recContent = document.getElementById('recommendationContent');\n \n if (!weightData.length || !goals.targetWeight) {\n recContent.innerHTML = '<p>Enter your goals to get personalized recommendations.</p>';\n return;\n }\n\n const currentWeight = weightData[weightData.length - 1].weight;\n const weightDifference = currentWeight - goals.targetWeight;\n const weeklyGoal = weightDifference / goals.timeFrame;\n\n let recommendation = `<p>Current Weight: ${currentWeight} kg</p>\n <p>Target Weight: ${goals.targetWeight} kg</p>\n <p>Weekly Goal: ${Math.abs(weeklyGoal.toFixed(1))} kg ${weeklyGoal > 0 ? 'loss' : 'gain'}</p>`;\n\n if (weeklyGoal > 0) {\n recommendation += `<h3>Weight Loss Tips:</h3>\n <ul>\n <li>Create a calorie deficit of ${Math.round(weeklyGoal * 7700 / 7)} calories per day</li>\n <li>Increase physical activity</li>\n <li>Focus on whole, unprocessed foods</li>\n <li>Stay hydrated</li>\n </ul>`;\n } else {\n recommendation += `<h3>Weight Gain Tips:</h3>\n <ul>\n <li>Create a calorie surplus of ${Math.round(Math.abs(weeklyGoal) * 7700 / 7)} calories per day</li>\n <li>Focus on calorie-dense foods</li>\n <li>Incorporate strength training</li>\n <li>Eat frequent, balanced meals</li>\n </ul>`;\n }\n\n recContent.innerHTML = recommendation;\n}\n---end---" + }, + "logprobs": null, + "finish_reason": "stop" + } + ], + "usage": { + "prompt_tokens": 251, + "completion_tokens": 1642, + "total_tokens": 1893, + "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..a2130f9 --- /dev/null +++ b/readme.scroll @@ -0,0 +1,2 @@ +# weightwise.scroll.pub +Website generated by DeepSeek from prompt: I want a website to track my weight changes and provide dietary recommendations based on my goals \ No newline at end of file diff --git a/script.js b/script.js new file mode 100644 index 0000000..6851fd2 --- /dev/null +++ b/script.js @@ -0,0 +1,98 @@ +// Initialize weight data +let weightData = []; +let goals = { + targetWeight: null, + timeFrame: null +}; + +// Chart setup +const ctx = document.getElementById('weightChart').getContext('2d'); +const chart = new Chart(ctx, { + type: 'line', + data: { + labels: [], + datasets: [{ + label: 'Weight (kg)', + data: [], + borderColor: '#4CAF50', + fill: false + }] + }, + options: { + responsive: true, + maintainAspectRatio: false, + scales: { + y: { + beginAtZero: false + } + } + } +}); + +// Form submission handlers +document.getElementById('weightForm').addEventListener('submit', function(e) { + e.preventDefault(); + const weight = parseFloat(document.getElementById('weightInput').value); + const date = new Date().toLocaleDateString(); + + weightData.push({ date, weight }); + updateChart(); + updateRecommendations(); + this.reset(); +}); + +document.getElementById('goalForm').addEventListener('submit', function(e) { + e.preventDefault(); + goals.targetWeight = parseFloat(document.getElementById('targetWeight').value); + goals.timeFrame = parseInt(document.getElementById('timeFrame').value); + updateRecommendations(); + this.reset(); +}); + +// Update chart with new data +function updateChart() { + const labels = weightData.map(entry => entry.date); + const data = weightData.map(entry => entry.weight); + + chart.data.labels = labels; + chart.data.datasets[0].data = data; + chart.update(); +} + +// Generate recommendations +function updateRecommendations() { + const recContent = document.getElementById('recommendationContent'); + + if (!weightData.length || !goals.targetWeight) { + recContent.innerHTML = '<p>Enter your goals to get personalized recommendations.</p>'; + return; + } + + const currentWeight = weightData[weightData.length - 1].weight; + const weightDifference = currentWeight - goals.targetWeight; + const weeklyGoal = weightDifference / goals.timeFrame; + + let recommendation = `<p>Current Weight: ${currentWeight} kg</p> + <p>Target Weight: ${goals.targetWeight} kg</p> + <p>Weekly Goal: ${Math.abs(weeklyGoal.toFixed(1))} kg ${weeklyGoal > 0 ? 'loss' : 'gain'}</p>`; + + if (weeklyGoal > 0) { + recommendation += `<h3>Weight Loss Tips:</h3> + <ul> + <li>Create a calorie deficit of ${Math.round(weeklyGoal * 7700 / 7)} calories per day</li> + <li>Increase physical activity</li> + <li>Focus on whole, unprocessed foods</li> + <li>Stay hydrated</li> + </ul>`; + } else { + recommendation += `<h3>Weight Gain Tips:</h3> + <ul> + <li>Create a calorie surplus of ${Math.round(Math.abs(weeklyGoal) * 7700 / 7)} calories per day</li> + <li>Focus on calorie-dense foods</li> + <li>Incorporate strength training</li> + <li>Eat frequent, balanced meals</li> + </ul>`; + } + + recContent.innerHTML = recommendation; +} \ No newline at end of file diff --git a/style.css b/style.css new file mode 100644 index 0000000..dedb989 --- /dev/null +++ b/style.css @@ -0,0 +1,102 @@ +:root { + --primary-color: #4CAF50; + --secondary-color: #45a049; + --background-color: #f5f5f5; + --text-color: #333; + --chart-color: #4CAF50; +} + +body { + font-family: 'Segoe UI', system-ui, sans-serif; + margin: 0; + padding: 0; + background-color: var(--background-color); + color: var(--text-color); + line-height: 1.6; +} + +header { + background: var(--primary-color); + color: white; + padding: 2rem; + text-align: center; +} + +h1 { + margin: 0; + font-size: 2.5rem; +} + +main { + max-width: 1200px; + margin: 2rem auto; + padding: 0 1rem; +} + +section { + background: white; + border-radius: 8px; + box-shadow: 0 2px 4px rgba(0,0,0,0.1); + margin-bottom: 2rem; + padding: 2rem; +} + +form { + display: grid; + gap: 1rem; + margin-bottom: 1.5rem; +} + +label { + font-weight: 600; +} + +input { + padding: 0.8rem; + border: 1px solid #ddd; + border-radius: 4px; + font-size: 1rem; +} + +button { + background: var(--primary-color); + color: white; + padding: 0.8rem 1.5rem; + border: none; + border-radius: 4px; + cursor: pointer; + font-size: 1rem; + transition: background 0.3s ease; +} + +button:hover { + background: var(--secondary-color); +} + +.chart-container { + position: relative; + height: 300px; + margin-top: 2rem; +} + +footer { + text-align: center; + padding: 1rem; + background: var(--primary-color); + color: white; + margin-top: 2rem; +} + +@media (max-width: 768px) { + h1 { + font-size: 2rem; + } + + section { + padding: 1rem; + } + + .chart-container { + height: 200px; + } +} \ No newline at end of file