{"id":245,"date":"2025-12-08T10:48:44","date_gmt":"2025-12-08T10:48:44","guid":{"rendered":"https:\/\/lapobesity.com\/?page_id=245"},"modified":"2025-12-08T11:32:57","modified_gmt":"2025-12-08T11:32:57","slug":"weight-loss-app","status":"publish","type":"page","link":"https:\/\/lapobesity.com\/?page_id=245","title":{"rendered":"Weight Loss Planner"},"content":{"rendered":"\n<meta charset=\"utf-8\">\n  <meta name=\"viewport\" content=\"width=device-width, initial-scale=1\">\n  <title>Weight Loss Planner \u2014 Reach &amp; Maintain Your Ideal Weight<\/title>\n  <meta name=\"description\" content=\"Personalized weight-loss planner with BMI, TDEE, calorie target, food classification (calories), meal logging and progress tracking. Ready to paste into your blog.\">\n\n  <!-- Google Fonts (optional) -->\n  <link href=\"https:\/\/fonts.googleapis.com\/css2?family=Inter:wght@300;400;600;700&amp;display=swap\" rel=\"stylesheet\">\n\n  <!-- Chart.js for progress chart -->\n  <script src=\"https:\/\/cdn.jsdelivr.net\/npm\/chart.js\"><\/script>\n\n  <style>\n    :root{\n      --bg:#0f1724; \/* dark card *\/\n      --card:#ffffff;\n      --muted:#6b7280;\n      --accent:#2563eb;\n      --success:#10b981;\n      font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial;\n    }\n    html,body{height:100%;margin:0;background:linear-gradient(180deg,#f8fafc 0%, #eef2ff 100%);color:#0f1724}\n    .container{max-width:1100px;margin:28px auto;padding:20px}\n    header{display:flex;align-items:center;gap:16px}\n    h1{margin:0;font-size:20px}\n    .grid{display:grid;grid-template-columns:1fr 420px;gap:18px;margin-top:18px}\n    .card{background:var(--card);border-radius:12px;padding:16px;box-shadow:0 6px 24px rgba(15,23,36,0.06)}\n    label{display:block;font-size:13px;color:var(--muted);margin-bottom:6px}\n    input[type=text], input[type=number], select{width:100%;padding:10px;border-radius:8px;border:1px solid #e6e9ef;font-size:14px}\n    .row{display:flex;gap:10px}\n    .row > *{flex:1}\n    .btn{display:inline-block;padding:10px 12px;border-radius:10px;border:0;background:var(--accent);color:white;font-weight:600;cursor:pointer}\n    .btn.ghost{background:transparent;border:1px solid #e6e9ef;color:var(--muted)}\n    .muted{color:var(--muted);font-size:13px}\n    .small{font-size:13px}\n    table{width:100%;border-collapse:collapse;margin-top:8px}\n    th,td{padding:8px;text-align:left;border-bottom:1px solid #f1f5f9;font-size:13px}\n    .food-tag{display:inline-block;padding:6px 8px;border-radius:999px;border:1px solid #eef2ff;font-size:12px;margin:4px}\n    .flex{display:flex;gap:8px;align-items:center}\n    .food-list{max-height:240px;overflow:auto}\n    .log-list{max-height:200px;overflow:auto}\n    footer{margin-top:18px;text-align:center;color:var(--muted);font-size:13px}\n    @media (max-width:980px){.grid{grid-template-columns:1fr;}.container{padding:12px}}\n  <\/style>\n\n\n  <div class=\"container\">\n    <header>\n      <div>\n        <h1>Weight Loss Planner<\/h1>\n        <div class=\"muted\">Personalized plan \u2014 calculate calories, classify foods, log meals &amp; track progress<\/div>\n      <\/div>\n    <\/header>\n\n    <div class=\"grid\">\n      <!-- LEFT: Tools -->\n      <div>\n        <div class=\"card\" id=\"calculatorCard\">\n          <h2 style=\"margin-top:0\">Personal Details &amp; Targets<\/h2>\n          <div class=\"row\">\n            <div>\n              <label>Age<\/label>\n              <input id=\"age\" type=\"number\" min=\"10\" value=\"30\">\n            <\/div>\n            <div>\n              <label>Sex<\/label>\n              <select id=\"sex\"><option value=\"male\">Male<\/option><option value=\"female\">Female<\/option><\/select>\n            <\/div>\n          <\/div>\n          <div class=\"row\" style=\"margin-top:10px\">\n            <div>\n              <label>Height (cm)<\/label>\n              <input id=\"height\" type=\"number\" min=\"80\" value=\"170\">\n            <\/div>\n            <div>\n              <label>Current weight (kg)<\/label>\n              <input id=\"weight\" type=\"number\" min=\"20\" step=\"0.1\" value=\"75\">\n            <\/div>\n          <\/div>\n\n          <div style=\"margin-top:10px\">\n            <label>Activity level<\/label>\n            <select id=\"activity\">\n              <option value=\"1.2\">Sedentary (little\/no exercise)<\/option>\n              <option value=\"1.375\">Light (1-3 days\/week)<\/option>\n              <option value=\"1.55\" selected=\"\">Moderate (3-5 days\/week)<\/option>\n              <option value=\"1.725\">Very active (6-7 days\/week)<\/option>\n              <option value=\"1.9\">Extremely active<\/option>\n            <\/select>\n          <\/div>\n\n          <div style=\"display:flex;gap:8px;margin-top:12px;align-items:center\">\n            <button class=\"btn\" id=\"calcBtn\">Calculate Plan<\/button>\n            <button class=\"btn ghost\" id=\"saveProfile\">Save profile<\/button>\n            <div class=\"muted small\" style=\"margin-left:auto\">Units: metric (kg, cm)<\/div>\n          <\/div>\n\n          <div id=\"results\" style=\"margin-top:12px;display:none\">\n            <div class=\"flex\">\n              <div>\n                <div class=\"muted small\">BMI<\/div>\n                <div id=\"bmiVal\" style=\"font-weight:700;font-size:18px\"><\/div>\n                <div id=\"bmiCat\" class=\"muted small\"><\/div>\n              <\/div>\n              <div style=\"margin-left:20px\">\n                <div class=\"muted small\">BMR (kcal\/day)<\/div>\n                <div id=\"bmrVal\" style=\"font-weight:700\"><\/div>\n                <div class=\"muted small\">TDEE (est)<\/div>\n                <div id=\"tdeeVal\" style=\"font-weight:700\"><\/div>\n              <\/div>\n              <div style=\"margin-left:20px\">\n                <div class=\"muted small\">Daily Calorie Target<\/div>\n                <div id=\"calTarget\" style=\"font-weight:700;color:var(--accent)\"><\/div>\n                <div class=\"muted small\">Suggested weekly loss: <span id=\"weekLoss\"><\/span><\/div>\n              <\/div>\n            <\/div>\n            <div style=\"margin-top:10px\" class=\"muted small\">Tip: choose a modest calorie deficit (300\u2013700 kcal\/day) for sustainable weight loss. This calculator uses the Mifflin\u2013St Jeor formula.<\/div>\n          <\/div>\n        <\/div>\n\n        <div class=\"card\" style=\"margin-top:14px\">\n          <h2 style=\"margin-top:0\">Food Classification &amp; Quick Search<\/h2>\n          <div class=\"muted small\">Search a food or browse categories (calories per 100g shown).<\/div>\n          <div style=\"display:flex;gap:8px;margin-top:8px\">\n            <input id=\"foodSearch\" type=\"text\" placeholder=\"Search foods (eg. apple, chicken breast)\">\n            <button class=\"btn ghost\" id=\"resetSearch\">Reset<\/button>\n          <\/div>\n\n          <div style=\"margin-top:10px;display:flex;gap:8px;flex-wrap:wrap\">\n            <button class=\"food-tag\" data-cat=\"all\">All<\/button>\n            <button class=\"food-tag\" data-cat=\"fruits\">Fruits<\/button>\n            <button class=\"food-tag\" data-cat=\"vegetables\">Vegetables<\/button>\n            <button class=\"food-tag\" data-cat=\"protein\">Protein<\/button>\n            <button class=\"food-tag\" data-cat=\"dairy\">Dairy<\/button>\n            <button class=\"food-tag\" data-cat=\"grains\">Grains<\/button>\n            <button class=\"food-tag\" data-cat=\"fats\">Fats &amp; Oils<\/button>\n            <button class=\"food-tag\" data-cat=\"snacks\">Snacks &amp; Sweets<\/button>\n          <\/div>\n\n          <div class=\"food-list\" style=\"margin-top:10px\">\n            <table id=\"foodTable\">\n              <thead><tr><th>Food<\/th><th>Category<\/th><th>kcal \/ 100g<\/th><th><\/th><\/tr><\/thead>\n              <tbody><\/tbody>\n            <\/table>\n          <\/div>\n\n          <div style=\"margin-top:10px;display:flex;gap:8px;align-items:center\">\n            <input id=\"customFoodName\" type=\"text\" placeholder=\"Custom food name\">\n            <input id=\"customFoodCals\" type=\"number\" placeholder=\"kcal\/100g\" style=\"width:120px\">\n            <select id=\"customFoodCat\" style=\"width:160px\">\n              <option value=\"fruits\">Fruits<\/option>\n              <option value=\"vegetables\">Vegetables<\/option>\n              <option value=\"protein\">Protein<\/option>\n              <option value=\"dairy\">Dairy<\/option>\n              <option value=\"grains\">Grains<\/option>\n              <option value=\"fats\">Fats &amp; Oils<\/option>\n              <option value=\"snacks\">Snacks &amp; Sweets<\/option>\n            <\/select>\n            <button class=\"btn\" id=\"addFood\">Add<\/button>\n          <\/div>\n        <\/div>\n\n        <div class=\"card\" style=\"margin-top:14px\">\n          <h2 style=\"margin-top:0\">Meal Builder &amp; Daily Log<\/h2>\n          <div class=\"muted small\">Build a meal from foods, choose portion (g) and add to today&#8217;s log.<\/div>\n          <div style=\"display:flex;gap:8px;margin-top:8px\">\n            <select id=\"selectFood\"><\/select>\n            <input id=\"portion\" type=\"number\" min=\"1\" value=\"100\" style=\"width:120px\">\n            <button class=\"btn\" id=\"addMealBtn\">Add to log<\/button>\n          <\/div>\n\n          <div style=\"margin-top:10px\">\n            <div class=\"muted small\">Today&#8217;s log<\/div>\n            <div class=\"log-list\" id=\"logArea\">\n              <table id=\"logTable\"><thead><tr><th>Item<\/th><th>g<\/th><th>kcal<\/th><th><\/th><\/tr><\/thead><tbody><\/tbody><\/table>\n            <\/div>\n            <div style=\"display:flex;justify-content:space-between;margin-top:8px;align-items:center\">\n              <div class=\"muted small\">Daily total: <strong id=\"dailyTotal\">0<\/strong> kcal<\/div>\n              <div>\n                <button class=\"btn ghost\" id=\"clearLog\">Clear<\/button>\n                <button class=\"btn\" id=\"exportLog\">Export JSON<\/button>\n              <\/div>\n            <\/div>\n          <\/div>\n        <\/div>\n\n      <\/div>\n\n      <!-- RIGHT: Progress \/ Chart \/ Summary -->\n      <aside>\n        <div class=\"card\">\n          <h2 style=\"margin-top:0\">Progress Tracker<\/h2>\n          <label>Enter today&#8217;s weight (kg)<\/label>\n          <div style=\"display:flex;gap:8px\">\n            <input id=\"todayWeight\" type=\"number\" step=\"0.1\">\n            <button class=\"btn\" id=\"saveWeight\">Save<\/button>\n          <\/div>\n          <canvas id=\"progressChart\" style=\"width:100%;height:220px;margin-top:12px\"><\/canvas>\n          <div style=\"display:flex;gap:8px;margin-top:10px\">\n            <button class=\"btn ghost\" id=\"resetWeights\">Reset Weights<\/button>\n            <button class=\"btn ghost\" id=\"downloadPlan\">Download Plan<\/button>\n          <\/div>\n        <\/div>\n\n        <div class=\"card\" style=\"margin-top:14px\">\n          <h2 style=\"margin-top:0\">Plan Summary &amp; Tips<\/h2>\n          <div class=\"muted small\">Your calorie target and short guidance will appear after calculation. Use the log to see how you compare to your target.<\/div>\n          <div id=\"planSummary\" style=\"margin-top:8px\"><\/div>\n          <hr>\n          <h3 style=\"margin:6px 0\">Quick tips<\/h3>\n          <ul class=\"muted small\">\n            <li>Prefer whole foods &amp; lean protein; avoid ultra-processed snacks.<\/li>\n            <li>Make gradual sustainable changes \u2014 slow loss preserves muscle.<\/li>\n            <li>Track portions with a kitchen scale for accuracy.<\/li>\n            <li>Ensure adequate protein (\u22481.2\u20131.6 g\/kg during weight loss).<\/li>\n          <\/ul>\n        <\/div>\n\n        <div class=\"card\" style=\"margin-top:14px\">\n          <h2 style=\"margin-top:0\">Export \/ Import<\/h2>\n          <div class=\"muted small\">Save or load your profile, food list, logs and weights (local storage JSON).<\/div>\n          <div style=\"display:flex;gap:8px;margin-top:8px\">\n            <button class=\"btn\" id=\"saveAll\">Save to browser<\/button>\n            <button class=\"btn ghost\" id=\"loadAll\">Load from browser<\/button>\n          <\/div>\n          <div style=\"margin-top:10px;display:flex;gap:8px\">\n            <button class=\"btn\" id=\"downloadData\">Download JSON<\/button>\n            <input id=\"importFile\" type=\"file\" accept=\"application\/json\">\n          <\/div>\n        <\/div>\n      <\/aside>\n    <\/div>\n\n    <footer>\n     \n    <\/footer>\n  <\/div>\n\n  <script>\n    \/* ---------- App data ---------- *\/\n    const defaultFoods = [\n      {name:'Apple', category:'fruits', cals:52},\n      {name:'Banana', category:'fruits', cals:89},\n      {name:'Orange', category:'fruits', cals:47},\n      {name:'Broccoli', category:'vegetables', cals:34},\n      {name:'Spinach', category:'vegetables', cals:23},\n      {name:'Chicken breast (skinless)', category:'protein', cals:165},\n      {name:'Salmon', category:'protein', cals:208},\n      {name:'Greek yogurt (plain)', category:'dairy', cals:59},\n      {name:'Milk (whole)', category:'dairy', cals:61},\n      {name:'White rice (cooked)', category:'grains', cals:130},\n      {name:'Oats (raw)', category:'grains', cals:389},\n      {name:'Olive oil', category:'fats', cals:884},\n      {name:'Peanut butter', category:'fats', cals:588},\n      {name:'Dark chocolate (70%)', category:'snacks', cals:598},\n      {name:'Potato (boiled)', category:'grains', cals:87},\n    ];\n\n    \/* ---------- Helpers ---------- *\/\n    const $ = id => document.getElementById(id);\n    const q = sel => document.querySelector(sel);\n\n    function round(n, d=1){return Math.round(n*Math.pow(10,d))\/Math.pow(10,d)}\n\n    \/* ---------- State ---------- *\/\n    let foods = JSON.parse(localStorage.getItem('wl_foods') || 'null') || defaultFoods.slice();\n    let log = JSON.parse(localStorage.getItem('wl_log') || '[]');\n    let weights = JSON.parse(localStorage.getItem('wl_weights') || '[]');\n    let profile = JSON.parse(localStorage.getItem('wl_profile') || 'null') || null;\n\n    \/* ---------- UI population ---------- *\/\n    function populateFoodTable(filterText='', filterCat='all'){\n      const tbody = document.querySelector('#foodTable tbody'); tbody.innerHTML='';\n      const list = foods.filter(f => (filterCat==='all' || f.category===filterCat) && (f.name.toLowerCase().includes(filterText.toLowerCase()) || filterText===''));\n      for(const f of list){\n        const tr = document.createElement('tr');\n        tr.innerHTML = `<td>${f.name}<\/td><td>${f.category}<\/td><td>${f.cals}<\/td><td><button class='btn ghost small add-to-select' data-name='${f.name}'>Choose<\/button><\/td>`;\n        tbody.appendChild(tr);\n      }\n      attachChooseButtons();\n      populateSelectFood();\n    }\n\n    function populateSelectFood(){\n      const sel = $('selectFood'); sel.innerHTML='';\n      for(const f of foods){\n        const opt = document.createElement('option'); opt.value = f.name; opt.textContent = `${f.name} \u2014 ${f.cals} kcal\/100g`;\n        sel.appendChild(opt);\n      }\n    }\n\n    function attachChooseButtons(){\n      document.querySelectorAll('.add-to-select').forEach(btn=>{\n        btn.onclick = ()=>{ const name = btn.dataset.name; $('selectFood').value = name; }\n      })\n    }\n\n    \/* ---------- Calculator ---------- *\/\n    function calcPlan(){\n      const age = Number($('age').value);\n      const sex = $('sex').value;\n      const height = Number($('height').value);\n      const weight = Number($('weight').value);\n      const activity = Number($('activity').value);\n      if(!age || !height || !weight) return alert('Fill in age, height and weight');\n\n      \/\/ BMI\n      const bmi = weight \/ ((height\/100)*(height\/100));\n      const bmiCat = bmi < 18.5 ? 'Underweight' : bmi < 25 ? 'Normal' : bmi < 30 ? 'Overweight' : 'Obese';\n\n      \/\/ BMR (Mifflin \u2014 St Jeor)\n      let bmr = (10*weight) + (6.25*height) - (5*age) + (sex==='male'?5:-161);\n      let tdee = bmr * activity;\n\n      \/\/ Calorie target for weight loss: choose moderate deficit of 20% by default but recommend 300-700kcal\n      let deficit = Math.min(0.20, 700 \/ tdee); \/\/ don't exceed 20% by default\n      let calTarget = Math.round(tdee * (1 - deficit));\n\n      \/\/ estimate weekly weight loss\n      const weeklyLossKg = Math.round(((tdee - calTarget) * 7) \/ 7700 * 100)\/100; \/\/ 7700 kcal\/kg approx\n\n      \/\/ show\n      $('bmiVal').textContent = round(bmi,2);\n      $('bmiCat').textContent = bmiCat;\n      $('bmrVal').textContent = Math.round(bmr) + ' kcal';\n      $('tdeeVal').textContent = Math.round(tdee) + ' kcal';\n      $('calTarget').textContent = calTarget + ' kcal\/day';\n      $('weekLoss').textContent = (weeklyLossKg>0?weeklyLossKg + ' kg\/week':'\u2014');\n      $('results').style.display='block';\n\n      \/\/ save profile\n      profile = {age,sex,height,weight,activity,bmr:Math.round(bmr),tdee:Math.round(tdee),calTarget};\n      localStorage.setItem('wl_profile', JSON.stringify(profile));\n      renderPlanSummary();\n    }\n\n    \/* ---------- Plan Summary ---------- *\/\n    function renderPlanSummary(){\n      const el = $('planSummary'); if(!profile){ el.innerHTML='No plan calculated yet.'; return; }\n      el.innerHTML = `<div style=\"font-weight:700\">Daily target: ${profile.calTarget} kcal<\/div>\n        <div class='muted small'>BMR: ${profile.bmr} kcal \u00b7 TDEE: ${profile.tdee} kcal<\/div>\n        <div style='margin-top:6px' class='muted small'>To lose 0.25\u20130.75 kg\/week, use a daily deficit of 300\u2013700 kcal. Keep protein adequate and include resistance training.<\/div>`;\n    }\n\n    \/* ---------- Food CRUD ---------- *\/\n    $('addFood').onclick = ()=>{\n      const name = $('customFoodName').value.trim();\n      const cals = Number($('customFoodCals').value);\n      const cat = $('customFoodCat').value;\n      if(!name || !cals) return alert('Enter name and kcal\/100g');\n      foods.unshift({name,category:cat,cals});\n      saveFoods();\n      populateFoodTable();\n      $('customFoodName').value='';$('customFoodCals').value='';\n    }\n\n    function saveFoods(){ localStorage.setItem('wl_foods', JSON.stringify(foods)); }\n\n    \/* ---------- Meal Log ---------- *\/\n    $('addMealBtn').onclick = ()=>{\n      const foodName = $('selectFood').value;\n      const portion = Number($('portion').value);\n      const f = foods.find(x=>x.name===foodName);\n      if(!f) return alert('Select food');\n      const kcal = Math.round((f.cals * portion)\/100);\n      log.unshift({name:foodName,grams:portion,kcal,ts:Date.now()});\n      localStorage.setItem('wl_log', JSON.stringify(log));\n      renderLog();\n    }\n\n    function renderLog(){\n      const tbody = document.querySelector('#logTable tbody'); tbody.innerHTML='';\n      let total = 0;\n      for(const it of log){\n        total += it.kcal;\n        const tr = document.createElement('tr');\n        tr.innerHTML = `<td>${it.name}<\/td><td>${it.grams}<\/td><td>${it.kcal}<\/td><td><button class='btn ghost' data-ts='${it.ts}'>Del<\/button><\/td>`;\n        tbody.appendChild(tr);\n      }\n      $('dailyTotal').textContent = total;\n      \/\/ attach delete\n      document.querySelectorAll('#logTable button').forEach(b=>b.onclick = ()=>{ const ts = Number(b.dataset.ts); log = log.filter(x=>x.ts!==ts); localStorage.setItem('wl_log', JSON.stringify(log)); renderLog(); });\n    }\n\n    $('clearLog').onclick = ()=>{ if(confirm('Clear today\\'s log?')){ log=[]; localStorage.removeItem('wl_log'); renderLog(); } }\n\n    \/* ---------- Weights & Chart ---------- *\/\n    let chart = null;\n    function initChart(){\n      const ctx = document.getElementById('progressChart').getContext('2d');\n      chart = new Chart(ctx, {\n        type: 'line',\n        data: {labels: weights.map(w=>new Date(w.ts).toLocaleDateString()), datasets:[{label:'Weight (kg)', data: weights.map(w=>w.weight), fill:false, tension:0.3}]},\n        options: {scales:{y:{beginAtZero:false}},plugins:{legend:{display:false}}}\n      });\n    }\n\n    $('saveWeight').onclick = ()=>{\n      const w = Number($('todayWeight').value);\n      if(!w) return alert('Enter a weight');\n      weights.push({weight:w,ts:Date.now()});\n      localStorage.setItem('wl_weights', JSON.stringify(weights));\n      refreshChart();\n      $('todayWeight').value='';\n    }\n\n    function refreshChart(){\n      if(!chart) initChart();\n      chart.data.labels = weights.map(w=>new Date(w.ts).toLocaleDateString());\n      chart.data.datasets[0].data = weights.map(w=>w.weight);\n      chart.update();\n    }\n\n    $('resetWeights').onclick = ()=>{ if(confirm('Reset all saved weights?')){ weights=[]; localStorage.removeItem('wl_weights'); refreshChart(); } }\n\n    \/* ---------- Export \/ Import ---------- *\/\n    $('saveAll').onclick = ()=>{\n      localStorage.setItem('wl_foods', JSON.stringify(foods));\n      localStorage.setItem('wl_log', JSON.stringify(log));\n      localStorage.setItem('wl_weights', JSON.stringify(weights));\n      localStorage.setItem('wl_profile', JSON.stringify(profile));\n      alert('Saved to browser storage');\n    }\n\n    $('loadAll').onclick = ()=>{\n      foods = JSON.parse(localStorage.getItem('wl_foods') || 'null') || defaultFoods.slice();\n      log = JSON.parse(localStorage.getItem('wl_log') || '[]');\n      weights = JSON.parse(localStorage.getItem('wl_weights') || '[]');\n      profile = JSON.parse(localStorage.getItem('wl_profile') || 'null') || profile;\n      populateFoodTable(); renderLog(); refreshChart(); renderPlanSummary();\n      alert('Loaded from browser storage');\n    }\n\n    $('downloadData').onclick = ()=>{\n      const data = {foods,log,weights,profile};\n      const blob = new Blob([JSON.stringify(data,null,2)],{type:'application\/json'});\n      const url = URL.createObjectURL(blob);\n      const a = document.createElement('a'); a.href=url; a.download='weight-loss-data.json'; a.click(); URL.revokeObjectURL(url);\n    }\n\n    $('importFile').onchange = (e)=>{\n      const f = e.target.files[0]; if(!f) return;\n      const reader = new FileReader();\n      reader.onload = ()=>{ try{ const obj = JSON.parse(reader.result); if(obj.foods) foods = obj.foods; if(obj.log) log = obj.log; if(obj.weights) weights = obj.weights; if(obj.profile) profile = obj.profile; localStorage.setItem('wl_foods', JSON.stringify(foods)); localStorage.setItem('wl_log', JSON.stringify(log)); localStorage.setItem('wl_weights', JSON.stringify(weights)); localStorage.setItem('wl_profile', JSON.stringify(profile)); populateFoodTable(); renderLog(); refreshChart(); renderPlanSummary(); alert('Imported successfully'); }catch(err){alert('Invalid JSON');} }\n      reader.readAsText(f);\n    }\n\n    $('downloadPlan').onclick = ()=>{\n      const plan = {profile,foods,log,weights};\n      const blob = new Blob([JSON.stringify(plan,null,2)],{type:'application\/json'});\n      const url = URL.createObjectURL(blob);\n      const a = document.createElement('a'); a.href=url; a.download='weight-loss-plan.json'; a.click(); URL.revokeObjectURL(url);\n    }\n\n    \/* ---------- Misc UI ---------- *\/\n    $('calcBtn').onclick = calcPlan;\n    $('saveProfile').onclick = ()=>{ if(profile){ localStorage.setItem('wl_profile', JSON.stringify(profile)); alert('Profile saved'); } else alert('Calculate plan first') };\n\n    $('foodSearch').addEventListener('input', e=>populateFoodTable(e.target.value));\n    document.querySelectorAll('.food-tag').forEach(btn=>btn.onclick = ()=>{ const cat=btn.dataset.cat; $('foodSearch').value=''; populateFoodTable('',cat); });\n    $('resetSearch').onclick = ()=>{ $('foodSearch').value=''; populateFoodTable(); }\n\n    $('exportLog').onclick = ()=>{\n      const blob = new Blob([JSON.stringify(log,null,2)],{type:'application\/json'});\n      const url = URL.createObjectURL(blob);\n      const a = document.createElement('a'); a.href=url; a.download='daily-log.json'; a.click(); URL.revokeObjectURL(url);\n    }\n\n    $('calcBtn').addEventListener('keydown', e=>{ if(e.key==='Enter') calcPlan(); })\n\n    function init(){\n      populateFoodTable(); renderLog(); initChart(); refreshChart(); renderPlanSummary();\n      if(profile){ $('age').value = profile.age; $('sex').value=profile.sex; $('height').value = profile.height; $('weight').value = profile.weight; $('activity').value = profile.activity; }\n    }\n\n    init();\n  <\/script>\n","protected":false},"excerpt":{"rendered":"<p>Weight Loss Planner \u2014 Reach &amp; Maintain Your Ideal Weight Weight Loss Planner Personalized plan \u2014 calculate calories, classify foods,&hellip;<\/p>\n","protected":false},"author":1,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"om_disable_all_campaigns":false,"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"footnotes":""},"class_list":["post-245","page","type-page","status-publish","hentry","no-post-thumbnail","entry"],"aioseo_notices":[],"aioseo_head":"\n\t\t<!-- All in One SEO 4.9.8 - aioseo.com -->\n\t<meta name=\"description\" content=\"Weight Loss Planner \u2014 Reach &amp; Maintain Your Ideal Weight Weight Loss Planner Personalized plan \u2014 calculate calories, classify foods, log meals &amp; track progress Personal Details &amp; Targets Age Sex MaleFemale Height (cm) Current weight (kg) Activity level Sedentary (little\/no exercise) Light (1-3 days\/week) Moderate (3-5 days\/week) Very active (6-7 days\/week) Extremely active Calculate\" \/>\n\t<meta name=\"robots\" content=\"noindex, max-image-preview:large\" \/>\n\t<link rel=\"canonical\" href=\"https:\/\/lapobesity.com\/?page_id=245\" \/>\n\t<meta name=\"generator\" content=\"All in One SEO (AIOSEO) 4.9.8\" \/>\n\t\t<meta property=\"og:locale\" content=\"en_US\" \/>\n\t\t<meta property=\"og:site_name\" content=\"Obesity Solutions - Support Healthy Dietary Patterns, Implement and support better nutrition\" \/>\n\t\t<meta property=\"og:type\" content=\"article\" \/>\n\t\t<meta property=\"og:title\" content=\"Weight Loss Planner - Obesity Solutions\" \/>\n\t\t<meta property=\"og:description\" content=\"Weight Loss Planner \u2014 Reach &amp; Maintain Your Ideal Weight Weight Loss Planner Personalized plan \u2014 calculate calories, classify foods, log meals &amp; track progress Personal Details &amp; Targets Age Sex MaleFemale Height (cm) Current weight (kg) Activity level Sedentary (little\/no exercise) Light (1-3 days\/week) Moderate (3-5 days\/week) Very active (6-7 days\/week) Extremely active Calculate\" \/>\n\t\t<meta property=\"og:url\" content=\"https:\/\/lapobesity.com\/?page_id=245\" \/>\n\t\t<meta property=\"og:image\" content=\"https:\/\/lapobesity.com\/wp-content\/uploads\/2026\/02\/cropped-lapobesity.png\" \/>\n\t\t<meta property=\"og:image:secure_url\" content=\"https:\/\/lapobesity.com\/wp-content\/uploads\/2026\/02\/cropped-lapobesity.png\" \/>\n\t\t<meta property=\"article:published_time\" content=\"2025-12-08T10:48:44+00:00\" \/>\n\t\t<meta property=\"article:modified_time\" content=\"2025-12-08T11:32:57+00:00\" \/>\n\t\t<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n\t\t<meta name=\"twitter:title\" content=\"Weight Loss Planner - Obesity Solutions\" \/>\n\t\t<meta name=\"twitter:description\" content=\"Weight Loss Planner \u2014 Reach &amp; Maintain Your Ideal Weight Weight Loss Planner Personalized plan \u2014 calculate calories, classify foods, log meals &amp; track progress Personal Details &amp; Targets Age Sex MaleFemale Height (cm) Current weight (kg) Activity level Sedentary (little\/no exercise) Light (1-3 days\/week) Moderate (3-5 days\/week) Very active (6-7 days\/week) Extremely active Calculate\" \/>\n\t\t<meta name=\"twitter:image\" content=\"https:\/\/lapobesity.com\/wp-content\/uploads\/2026\/02\/cropped-lapobesity.png\" \/>\n\t\t<script type=\"application\/ld+json\" class=\"aioseo-schema\">\n\t\t\t{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/lapobesity.com\\\/?page_id=245#breadcrumblist\",\"itemListElement\":[{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/lapobesity.com#listItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/lapobesity.com\",\"nextItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/lapobesity.com\\\/?page_id=245#listItem\",\"name\":\"Weight Loss Planner\"}},{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/lapobesity.com\\\/?page_id=245#listItem\",\"position\":2,\"name\":\"Weight Loss Planner\",\"previousItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/lapobesity.com#listItem\",\"name\":\"Home\"}}]},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/lapobesity.com\\\/#organization\",\"name\":\"lapobesity.com\",\"description\":\"Support Healthy Dietary Patterns, Implement and support better nutrition\",\"url\":\"https:\\\/\\\/lapobesity.com\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"url\":\"https:\\\/\\\/lapobesity.com\\\/wp-content\\\/uploads\\\/2026\\\/02\\\/cropped-lapobesity.png\",\"@id\":\"https:\\\/\\\/lapobesity.com\\\/?page_id=245\\\/#organizationLogo\",\"width\":1920,\"height\":543,\"caption\":\"lapobesity, fitness, wellnes\"},\"image\":{\"@id\":\"https:\\\/\\\/lapobesity.com\\\/?page_id=245\\\/#organizationLogo\"}},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/lapobesity.com\\\/?page_id=245#webpage\",\"url\":\"https:\\\/\\\/lapobesity.com\\\/?page_id=245\",\"name\":\"Weight Loss Planner - Obesity Solutions\",\"description\":\"Weight Loss Planner \\u2014 Reach & Maintain Your Ideal Weight Weight Loss Planner Personalized plan \\u2014 calculate calories, classify foods, log meals & track progress Personal Details & Targets Age Sex MaleFemale Height (cm) Current weight (kg) Activity level Sedentary (little\\\/no exercise) Light (1-3 days\\\/week) Moderate (3-5 days\\\/week) Very active (6-7 days\\\/week) Extremely active Calculate\",\"inLanguage\":\"en-US\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/lapobesity.com\\\/#website\"},\"breadcrumb\":{\"@id\":\"https:\\\/\\\/lapobesity.com\\\/?page_id=245#breadcrumblist\"},\"datePublished\":\"2025-12-08T10:48:44+00:00\",\"dateModified\":\"2025-12-08T11:32:57+00:00\"},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/lapobesity.com\\\/#website\",\"url\":\"https:\\\/\\\/lapobesity.com\\\/\",\"name\":\"Obesity Solutions\",\"description\":\"Support Healthy Dietary Patterns, Implement and support better nutrition\",\"inLanguage\":\"en-US\",\"publisher\":{\"@id\":\"https:\\\/\\\/lapobesity.com\\\/#organization\"}}]}\n\t\t<\/script>\n\t\t<!-- All in One SEO -->\n\n","aioseo_head_json":{"title":"Weight Loss Planner - Obesity Solutions","description":"Weight Loss Planner \u2014 Reach & Maintain Your Ideal Weight Weight Loss Planner Personalized plan \u2014 calculate calories, classify foods, log meals & track progress Personal Details & Targets Age Sex MaleFemale Height (cm) Current weight (kg) Activity level Sedentary (little\/no exercise) Light (1-3 days\/week) Moderate (3-5 days\/week) Very active (6-7 days\/week) Extremely active Calculate","canonical_url":"https:\/\/lapobesity.com\/?page_id=245","robots":"noindex, max-image-preview:large","keywords":"","webmasterTools":{"miscellaneous":""},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"BreadcrumbList","@id":"https:\/\/lapobesity.com\/?page_id=245#breadcrumblist","itemListElement":[{"@type":"ListItem","@id":"https:\/\/lapobesity.com#listItem","position":1,"name":"Home","item":"https:\/\/lapobesity.com","nextItem":{"@type":"ListItem","@id":"https:\/\/lapobesity.com\/?page_id=245#listItem","name":"Weight Loss Planner"}},{"@type":"ListItem","@id":"https:\/\/lapobesity.com\/?page_id=245#listItem","position":2,"name":"Weight Loss Planner","previousItem":{"@type":"ListItem","@id":"https:\/\/lapobesity.com#listItem","name":"Home"}}]},{"@type":"Organization","@id":"https:\/\/lapobesity.com\/#organization","name":"lapobesity.com","description":"Support Healthy Dietary Patterns, Implement and support better nutrition","url":"https:\/\/lapobesity.com\/","logo":{"@type":"ImageObject","url":"https:\/\/lapobesity.com\/wp-content\/uploads\/2026\/02\/cropped-lapobesity.png","@id":"https:\/\/lapobesity.com\/?page_id=245\/#organizationLogo","width":1920,"height":543,"caption":"lapobesity, fitness, wellnes"},"image":{"@id":"https:\/\/lapobesity.com\/?page_id=245\/#organizationLogo"}},{"@type":"WebPage","@id":"https:\/\/lapobesity.com\/?page_id=245#webpage","url":"https:\/\/lapobesity.com\/?page_id=245","name":"Weight Loss Planner - Obesity Solutions","description":"Weight Loss Planner \u2014 Reach & Maintain Your Ideal Weight Weight Loss Planner Personalized plan \u2014 calculate calories, classify foods, log meals & track progress Personal Details & Targets Age Sex MaleFemale Height (cm) Current weight (kg) Activity level Sedentary (little\/no exercise) Light (1-3 days\/week) Moderate (3-5 days\/week) Very active (6-7 days\/week) Extremely active Calculate","inLanguage":"en-US","isPartOf":{"@id":"https:\/\/lapobesity.com\/#website"},"breadcrumb":{"@id":"https:\/\/lapobesity.com\/?page_id=245#breadcrumblist"},"datePublished":"2025-12-08T10:48:44+00:00","dateModified":"2025-12-08T11:32:57+00:00"},{"@type":"WebSite","@id":"https:\/\/lapobesity.com\/#website","url":"https:\/\/lapobesity.com\/","name":"Obesity Solutions","description":"Support Healthy Dietary Patterns, Implement and support better nutrition","inLanguage":"en-US","publisher":{"@id":"https:\/\/lapobesity.com\/#organization"}}]},"og:locale":"en_US","og:site_name":"Obesity Solutions - Support Healthy Dietary Patterns, Implement and support better nutrition","og:type":"article","og:title":"Weight Loss Planner - Obesity Solutions","og:description":"Weight Loss Planner \u2014 Reach &amp; Maintain Your Ideal Weight Weight Loss Planner Personalized plan \u2014 calculate calories, classify foods, log meals &amp; track progress Personal Details &amp; Targets Age Sex MaleFemale Height (cm) Current weight (kg) Activity level Sedentary (little\/no exercise) Light (1-3 days\/week) Moderate (3-5 days\/week) Very active (6-7 days\/week) Extremely active Calculate","og:url":"https:\/\/lapobesity.com\/?page_id=245","og:image":"https:\/\/lapobesity.com\/wp-content\/uploads\/2026\/02\/cropped-lapobesity.png","og:image:secure_url":"https:\/\/lapobesity.com\/wp-content\/uploads\/2026\/02\/cropped-lapobesity.png","article:published_time":"2025-12-08T10:48:44+00:00","article:modified_time":"2025-12-08T11:32:57+00:00","twitter:card":"summary_large_image","twitter:title":"Weight Loss Planner - Obesity Solutions","twitter:description":"Weight Loss Planner \u2014 Reach &amp; Maintain Your Ideal Weight Weight Loss Planner Personalized plan \u2014 calculate calories, classify foods, log meals &amp; track progress Personal Details &amp; Targets Age Sex MaleFemale Height (cm) Current weight (kg) Activity level Sedentary (little\/no exercise) Light (1-3 days\/week) Moderate (3-5 days\/week) Very active (6-7 days\/week) Extremely active Calculate","twitter:image":"https:\/\/lapobesity.com\/wp-content\/uploads\/2026\/02\/cropped-lapobesity.png"},"aioseo_meta_data":{"post_id":"245","title":null,"description":null,"keywords":[],"keyphrases":{"focus":{"keyphrase":"","score":0,"analysis":{"keyphraseInTitle":{"score":0,"maxScore":9,"error":1}}},"additional":[]},"primary_term":null,"canonical_url":null,"og_title":null,"og_description":null,"og_object_type":"default","og_image_type":"default","og_image_url":null,"og_image_width":null,"og_image_height":null,"og_image_custom_url":null,"og_image_custom_fields":null,"og_video":"","og_custom_url":null,"og_article_section":null,"og_article_tags":[],"twitter_use_og":false,"twitter_card":"default","twitter_image_type":"default","twitter_image_url":null,"twitter_image_custom_url":null,"twitter_image_custom_fields":null,"twitter_title":null,"twitter_description":null,"schema":{"blockGraphs":[],"customGraphs":[],"default":{"data":{"Article":[],"Course":[],"Dataset":[],"FAQPage":[],"Movie":[],"Person":[],"Product":[],"ProductReview":[],"Car":[],"Recipe":[],"Service":[],"SoftwareApplication":[],"WebPage":[]},"graphName":"WebPage","isEnabled":true},"graphs":[]},"schema_type":"default","schema_type_options":null,"pillar_content":false,"robots_default":true,"robots_noindex":false,"robots_noarchive":false,"robots_nosnippet":false,"robots_nofollow":false,"robots_noimageindex":false,"robots_noodp":false,"robots_notranslate":false,"robots_max_snippet":"-1","robots_max_videopreview":"-1","robots_max_imagepreview":"large","priority":null,"frequency":"default","local_seo":null,"breadcrumb_settings":null,"limit_modified_date":false,"ai":null,"created":"2025-12-08 10:48:21","updated":"2026-02-21 22:39:55","seo_analyzer_scan_date":null},"aioseo_breadcrumb":"<div class=\"aioseo-breadcrumbs\"><span class=\"aioseo-breadcrumb\">\n\t\t\t<a href=\"https:\/\/lapobesity.com\" title=\"Home\">Home<\/a>\n\t\t<\/span><span class=\"aioseo-breadcrumb-separator\">&raquo;<\/span><span class=\"aioseo-breadcrumb\">\n\t\t\tWeight Loss Planner\n\t\t<\/span><\/div>","aioseo_breadcrumb_json":[{"label":"Home","link":"https:\/\/lapobesity.com"},{"label":"Weight Loss Planner","link":"https:\/\/lapobesity.com\/?page_id=245"}],"_links":{"self":[{"href":"https:\/\/lapobesity.com\/index.php?rest_route=\/wp\/v2\/pages\/245","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/lapobesity.com\/index.php?rest_route=\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/lapobesity.com\/index.php?rest_route=\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/lapobesity.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/lapobesity.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=245"}],"version-history":[{"count":4,"href":"https:\/\/lapobesity.com\/index.php?rest_route=\/wp\/v2\/pages\/245\/revisions"}],"predecessor-version":[{"id":257,"href":"https:\/\/lapobesity.com\/index.php?rest_route=\/wp\/v2\/pages\/245\/revisions\/257"}],"wp:attachment":[{"href":"https:\/\/lapobesity.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=245"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}