{"id":29260,"date":"2025-08-27T09:42:58","date_gmt":"2025-08-27T09:42:58","guid":{"rendered":"https:\/\/lingamshakti.com\/demo\/?page_id=29260"},"modified":"2025-09-29T06:44:46","modified_gmt":"2025-09-29T06:44:46","slug":"load-calculator","status":"publish","type":"page","link":"https:\/\/lingamshakti.com\/demo\/load-calculator\/","title":{"rendered":"Load Calculator"},"content":{"rendered":"\t\t<div data-elementor-type=\"wp-page\" data-elementor-id=\"29260\" class=\"elementor elementor-29260\">\n\t\t\t\t\t\t<section class=\"elementor-section elementor-top-section elementor-element elementor-element-1f1277b elementor-section-boxed elementor-section-height-default elementor-section-height-default\" data-id=\"1f1277b\" data-element_type=\"section\">\n\t\t\t\t\t\t<div class=\"elementor-container elementor-column-gap-default\">\n\t\t\t\t\t<div class=\"elementor-column elementor-col-100 elementor-top-column elementor-element elementor-element-9c5b9b4\" data-id=\"9c5b9b4\" data-element_type=\"column\">\n\t\t\t<div class=\"elementor-widget-wrap elementor-element-populated\">\n\t\t\t\t\t\t<div class=\"elementor-element elementor-element-45f14f8 lte-heading-align-center elementor-widget elementor-widget-lte-header\" data-id=\"45f14f8\" data-element_type=\"widget\" data-widget_type=\"lte-header.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t<div class=\"lte-heading lte-style-default lte-subcolor-main heading-tag-h3 heading-subtag-h6\"><div class=\"lte-heading-content\"><h3 class=\"lte-header\">Battery  <span>Load &amp; Runtime <\/span> Calculator<\/h3><\/div><\/div>\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/section>\n\t\t\t\t<section class=\"elementor-section elementor-top-section elementor-element elementor-element-439a4a1 elementor-section-boxed elementor-section-height-default elementor-section-height-default\" data-id=\"439a4a1\" data-element_type=\"section\">\n\t\t\t\t\t\t<div class=\"elementor-container elementor-column-gap-default\">\n\t\t\t\t\t<div class=\"elementor-column elementor-col-100 elementor-top-column elementor-element elementor-element-fb90936\" data-id=\"fb90936\" data-element_type=\"column\">\n\t\t\t<div class=\"elementor-widget-wrap elementor-element-populated\">\n\t\t\t\t\t\t<div class=\"elementor-element elementor-element-23f3193 elementor-widget elementor-widget-html\" data-id=\"23f3193\" data-element_type=\"widget\" data-widget_type=\"html.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t<!-- Home Load Calculator Embed -->\n<div class=\"gc-wrap\"> \n  <div class=\"glass-card load-calculator\">\n    <div class=\"header\">\n      <!--<h2>Home Load Calculator<\/h2>-->\n      <!--<p class=\"sub\">Estimate inverter, battery & backup \u2014 styled with glassmorphism.<\/p>-->\n    <\/div>\n\n    <div id=\"appliance-list\" class=\"sections\">\n      <section class=\"appliance-category\">\n        <h3>\ud83d\udca1 Lights<\/h3>\n        <div class=\"appliance-item\">\n          <label>Tubelights <span class=\"muted\">(40W)<\/span><\/label>\n          <input type=\"number\" data-watt=\"40\" value=\"0\">\n        <\/div>\n        <div class=\"appliance-item\">\n          <label>LED Bulbs <span class=\"muted\">(9W)<\/span><\/label>\n          <input type=\"number\" data-watt=\"9\" value=\"0\">\n        <\/div>\n      <\/section>\n\n      <section class=\"appliance-category\">\n        <h3>\ud83c\udf73 Kitchen<\/h3>\n        <div class=\"appliance-item\">\n          <label>Fridge <span class=\"muted\">(150W)<\/span><\/label>\n          <input type=\"number\" data-watt=\"150\" value=\"0\">\n        <\/div>\n        <div class=\"appliance-item\">\n          <label>Microwave <span class=\"muted\">(800W)<\/span><\/label>\n          <input type=\"number\" data-watt=\"800\" value=\"0\">\n        <\/div>\n      <\/section>\n\n      <section class=\"appliance-category\">\n        <h3>\ud83c\udfac Entertainment<\/h3>\n        <div class=\"appliance-item\">\n          <label>Television <span class=\"muted\">(100W)<\/span><\/label>\n          <input type=\"number\" data-watt=\"100\" value=\"0\">\n        <\/div>\n        <div class=\"appliance-item\">\n          <label>Laptop <span class=\"muted\">(50W)<\/span><\/label>\n          <input type=\"number\" data-watt=\"50\" value=\"0\">\n        <\/div>\n      <\/section>\n\n      <section class=\"appliance-category custom-appls\">\n        <h4>\u2795 Custom Appliances<\/h4>\n        <div id=\"custom-list\"><\/div>\n        <div class=\"add-appliance\">\n          <input type=\"text\" id=\"new-appliance-name\" placeholder=\"Appliance (e.g. Water Pump)\">\n          <input type=\"number\" id=\"new-appliance-watt\" placeholder=\"Watt (W)\">\n          <input type=\"number\" id=\"new-appliance-qty\" placeholder=\"Qty\" value=\"1\" min=\"1\">\n          <button id=\"add-appliance-btn\" class=\"btn add\">Add<\/button>\n        <\/div>\n      <\/section>\n    <\/div>\n\n    <div class=\"controls\">\n      <div class=\"backup-select\">\n        <label for=\"desired-backup\">\u23f3 Desired Backup Time<\/label>\n        <select id=\"desired-backup\">\n          <option value=\"\">Auto<\/option>\n          <option value=\"2\">2 Hours<\/option>\n          <option value=\"3\">3 Hours<\/option>\n          <option value=\"4\">4 Hours<\/option>\n          <option value=\"6\">6 Hours<\/option>\n          <option value=\"8\">8 Hours<\/option>\n        <\/select>\n      <\/div>\n\n      <div class=\"actions\">\n        <button id=\"calc-btn\" class=\"btn primary\">\u26a1 Calculate<\/button>\n        <button id=\"reset-btn\" class=\"btn ghost\">\ud83d\udd04 Reset<\/button>\n      <\/div>\n    <\/div><br>\n\n    <!-- Results -->\n    <div class=\"result-card\">\n      <div class=\"result-row\">\n        <div class=\"label\">Total Connected Load<\/div>\n        <div class=\"value\" id=\"total-load\">0 W<\/div>\n      <\/div>\n      <div class=\"result-row\">\n        <div class=\"label\">Daily Energy (est.)<\/div>\n        <div class=\"value\" id=\"daily-units\">- kWh\/day<\/div>\n      <\/div>\n\n      <!-- Inverter -->\n      <div class=\"result-row\">\n        <div class=\"label\">Recommended Inverter<\/div>\n        <div class=\"value\">\n          <span id=\"inverter-size\">-<\/span>\n          <div><img decoding=\"async\" id=\"inverter-img\" src=\"\" alt=\"\" style=\"max-width:300px;display:none;margin-top:8px;\"><\/div>\n        <\/div>\n      <\/div>\n\n      <!-- Battery -->\n      <div class=\"result-row\">\n        <div class=\"label\">Recommended Battery<\/div>\n        <div class=\"value\">\n          <span id=\"battery-size\">-<\/span>\n          <div><img decoding=\"async\" id=\"battery-img\" src=\"\" alt=\"\" style=\"max-width:300px;display:none;margin-top:8px;\"><\/div>\n        <\/div>\n      <\/div>\n\n      <div class=\"result-row\">\n        <div class=\"label\">Available Backup<\/div>\n        <div class=\"value\" id=\"backup-time\">-<\/div>\n      <\/div>\n      <div class=\"result-row\">\n        <div class=\"label\">Selected Need<\/div>\n        <div class=\"value\" id=\"selected-backup\">-<\/div>\n      <\/div>\n    <\/div>\n  <\/div>\n<\/div>\n\n<!-- Styles -->\n<style>\n:root {\n  --card-bg: rgba(255, 255, 255, 0.12);\n  --glass: #ffffff12;\n  --accent: #ff6332;\n  --muted: #97a0ad;\n}\n.gc-wrap { display: flex; justify-content: center; width: 100%; }\n.glass-card { width: 95%; max-width: 1200px; border-radius: 18px; padding: 28px; backdrop-filter: blur(8px) saturate(110%); background: linear-gradient(135deg, rgba(255,255,255,0.55), rgba(255,255,255,0.40)); box-shadow: 0 8px 30px rgb(243 93 34 \/ 79%); border:1px solid rgba(255,255,255,0.6); color:#333; }\n.header { text-align:center; margin-bottom:18px; }\n.header h2 { margin:0; font-size:22px; color:var(--accent); }\n.header .sub { margin:6px 0 0; color:var(--muted); font-size:14px; }\n.sections { display:grid; grid-template-columns:1fr 420px; gap:22px; }\n.appliance-category { background:linear-gradient(180deg, rgba(255,255,255,0.6), rgba(255,255,255,0.45)); padding:14px; border-radius:12px; border:1px solid rgba(255,255,255,0.6); }\n.appliance-item { display:flex; justify-content:space-between; align-items:center; padding:10px; border-radius:10px; background:rgba(255,255,255,0.6); margin-bottom:10px; border:1px solid rgba(16,42,67,0.04); }\n.appliance-item label { font-weight:600; }\n.appliance-item .muted { font-weight:500; color:var(--muted); margin-left:8px; font-size:13px; }\n.appliance-item input { width:80px; padding:8px; border-radius:10px; border:1px solid rgba(16,42,67,0.08); text-align:center; background:rgba(255,255,255,0.9); color:#0b2540; }\n.add-appliance input { flex:1; min-width:100px; padding:10px; border-radius:10px; border:1px solid rgba(16,42,67,0.06); background:rgba(255,255,255,0.9); color:#0b2540; }\n.btn { padding:10px 14px; border-radius:10px; border:0; cursor:pointer; font-weight:700; transition:transform 0.2s ease, box-shadow 0.2s ease; }\n.btn:hover { transform:translateY(-2px); box-shadow:0 4px 8px rgba(0,0,0,0.1); }\n.btn.add { background:linear-gradient(90deg,#34d399,#10b981); color:#022c22; }\n.btn.remove { background:transparent; border:1px solid rgba(16,42,67,0.06); color:#153e5a; font-weight:500; padding:6px 10px; font-size:13px; }\n.controls { display:flex; justify-content:space-between; align-items:center; margin-top:18px; }\n.backup-select label { font-weight:700; margin-right:8px; }\n.backup-select select { padding:8px 10px; border-radius:8px; border:1px solid rgba(16,42,67,0.06); background:rgba(255,255,255,0.9); color:#0b2540; }\n.actions { display:flex; gap:12px; }\n.btn.primary { background:linear-gradient(90deg, var(--accent), #ff8a5a); color:#fff; }\n.btn.ghost { background:transparent; border:1px solid rgba(16,42,67,0.06); color:#153e5a; }\n.result-card { margin-top:18px; padding:14px; border-radius:12px; background:linear-gradient(180deg, rgba(255,255,255,0.6), rgba(255,255,255,0.45)); border:1px solid rgba(255,255,255,0.6); display:grid; grid-template-columns:1fr 1fr; gap:12px; }\n.result-row { display:flex; flex-direction:column; padding:10px; border-radius:10px; background:rgba(255,255,255,0.9); }\n.result-row .label { font-size:13px; color:var(--muted); margin-bottom:6px; }\n.result-row .value { font-size:18px; font-weight:800; color:#0b2540; }\n@media(max-width:980px) {\n  .sections { grid-template-columns:1fr; }\n  .result-card { grid-template-columns:1fr; }\n  .controls { flex-direction:column; align-items:stretch; gap:16px; }\n  .actions { flex-direction:column; }\n  .btn { width:100%; }\n  .add-appliance { flex-direction:column; align-items:stretch; }\n  .add-appliance input { width:100%; }\n}\n<\/style>\n\n<!-- JavaScript -->\n<script>\ndocument.addEventListener('DOMContentLoaded', function() {\n  const applianceList = document.getElementById('appliance-list');\n  const customList = document.getElementById('custom-list');\n  const addApplianceBtn = document.getElementById('add-appliance-btn');\n  const calcBtn = document.getElementById('calc-btn');\n  const resetBtn = document.getElementById('reset-btn');\n  const desiredBackup = document.getElementById('desired-backup');\n\n  \/\/ Custom image mapping (change to your image paths)\n  const inverterImages = {\n    \"800\": \"https:\/\/lingamshakti.com\/demo\/wp-content\/uploads\/2025\/08\/e-batteriepng.png\",\n    \"1600\": \"https:\/\/lingamshakti.com\/demo\/wp-content\/uploads\/2025\/08\/e-batteriepng.png\",\n    \"2400\": \"https:\/\/lingamshakti.com\/demo\/wp-content\/uploads\/2025\/08\/e-batteriepng.png\"\n  };\n  const batteryImages = {\n      \n    \"150\": \"https:\/\/lingamshakti.com\/demo\/wp-content\/uploads\/2025\/08\/e-batteriepng.png\",\n     \"151-200\": \"https:\/\/lingamshakti.com\/demo\/wp-content\/uploads\/2025\/09\/erickshaw-batteries1.png\",\n     \n    \"300\": \"https:\/\/lingamshakti.com\/demo\/wp-content\/uploads\/2025\/08\/e-batteriepng.png\",\n    \"450\": \"https:\/\/lingamshakti.com\/demo\/wp-content\/uploads\/2025\/08\/e-batteriepng.png\"\n    \n  };\n\n  function parseNumber(v){const n=parseFloat(v);return Number.isFinite(n)?n:0;}\n  function setResultsEmpty(){\n    ['inverter-size','battery-size','daily-units','backup-time','selected-backup'].forEach(id=>document.getElementById(id).innerText='-');\n    document.getElementById('inverter-img').style.display=\"none\";\n    document.getElementById('battery-img').style.display=\"none\";\n  }\n\n  function calculateLoad(){\n    let total=0;\n    document.querySelectorAll('.appliance-item input[type=number]').forEach(inp=>{\n      total+=parseNumber(inp.value)*parseNumber(inp.dataset.watt);\n    });\n    document.getElementById('total-load').innerText=total.toLocaleString()+' W';\n    if(total<=0){setResultsEmpty();return;}\n    const inverterVA=Math.ceil(total\/800)*800;\n    const batteryAh=Math.ceil(total\/150)*150;\n    const daily=((total*6)\/1000).toFixed(2);\n    const availableBackup=((batteryAh*12*0.8)\/total).toFixed(1);\n    const selected=desiredBackup.value||'Auto';\n    document.getElementById('inverter-size').innerText=inverterVA+' VA';\n    document.getElementById('battery-size').innerText=batteryAh+' Ah';\n    document.getElementById('daily-units').innerText=daily+' kWh\/day';\n    document.getElementById('backup-time').innerText=availableBackup+' h';\n    document.getElementById('selected-backup').innerText=selected+(selected==='Auto'?'':' h');\n\n    \/\/ Update inverter image\n    const inverterImg=document.getElementById('inverter-img');\n    if(inverterImages[inverterVA]){\n      inverterImg.src=inverterImages[inverterVA];\n      inverterImg.style.display=\"block\";\n    } else inverterImg.style.display=\"none\";\n\n    \/\/ Update battery image\n    const batteryImg=document.getElementById('battery-img');\n    if(batteryImages[batteryAh]){\n      batteryImg.src=batteryImages[batteryAh];\n      batteryImg.style.display=\"block\";\n    } else batteryImg.style.display=\"none\";\n\n    \/\/ Backup color warning\n    const sel=parseNumber(desiredBackup.value);\n    const backupRow=document.getElementById('backup-time');\n    backupRow.style.color=sel>0?(parseFloat(availableBackup)>=sel?'green':'#d9534f'):'';\n  }\n\n  function resetCalc(){\n    document.querySelectorAll('.appliance-item input[type=number]').forEach(i=>i.value=0);\n    desiredBackup.value='';\n    calculateLoad();\n    while(customList.firstChild){customList.removeChild(customList.firstChild);}\n  }\n\n  function createApplianceElement(name,watt,qty=1){\n    const div=document.createElement('div');\n    div.className='appliance-item';\n    div.innerHTML=`<label>${escapeHtml(name)} <span class=\"muted\">(${watt}W)<\/span><\/label><input type=\"number\" data-watt=\"${watt}\" value=\"${qty}\" min=\"0\"><button class=\"btn remove\" data-action=\"remove\">Remove<\/button>`;\n    return div;\n  }\n\n  function addCustomAppliance(){\n    const nameInput=document.getElementById('new-appliance-name');\n    const wattInput=document.getElementById('new-appliance-watt');\n    const qtyInput=document.getElementById('new-appliance-qty');\n    const name=nameInput.value.trim();\n    const watt=parseNumber(wattInput.value);\n    const qty=parseNumber(qtyInput.value)||1;\n    if(!name||watt<=0){console.error(\"Enter valid appliance and wattage > 0\");return;}\n    const el=createApplianceElement(name,watt,qty);\n    customList.appendChild(el);\n    nameInput.value=''; wattInput.value=''; qtyInput.value='1';\n    calculateLoad();\n  }\n\n  function escapeHtml(s){return s.replace(\/[&<>\"']\/g,c=>({'&':'&amp;','<':'&lt;','>':'&gt;','\"':'&quot;',\"'\":\"&#39;\"}[c]));}\n\n  applianceList.addEventListener('input', e=>{if(e.target&&e.target.matches('input[type=number]')) calculateLoad();});\n  applianceList.addEventListener('click', e=>{const btn=e.target.closest('button.remove'); if(btn){btn.closest('.appliance-item').remove(); calculateLoad();}});\n  addApplianceBtn.addEventListener('click',addCustomAppliance);\n  calcBtn.addEventListener('click',calculateLoad);\n  resetBtn.addEventListener('click',resetCalc);\n  desiredBackup.addEventListener('change',calculateLoad);\n  setResultsEmpty();\n});\n<\/script>\n\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/section>\n\t\t\t\t<\/div>\n\t\t","protected":false},"excerpt":{"rendered":"","protected":false},"author":1,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"footnotes":""},"class_list":["post-29260","page","type-page","status-publish","hentry"],"_links":{"self":[{"href":"https:\/\/lingamshakti.com\/demo\/wp-json\/wp\/v2\/pages\/29260","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/lingamshakti.com\/demo\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/lingamshakti.com\/demo\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/lingamshakti.com\/demo\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/lingamshakti.com\/demo\/wp-json\/wp\/v2\/comments?post=29260"}],"version-history":[{"count":13,"href":"https:\/\/lingamshakti.com\/demo\/wp-json\/wp\/v2\/pages\/29260\/revisions"}],"predecessor-version":[{"id":30859,"href":"https:\/\/lingamshakti.com\/demo\/wp-json\/wp\/v2\/pages\/29260\/revisions\/30859"}],"wp:attachment":[{"href":"https:\/\/lingamshakti.com\/demo\/wp-json\/wp\/v2\/media?parent=29260"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}