{"id":18,"date":"2024-01-17T15:32:07","date_gmt":"2024-01-17T15:32:07","guid":{"rendered":"https:\/\/sadpoetryhub.com\/?page_id=18"},"modified":"2024-01-17T15:32:07","modified_gmt":"2024-01-17T15:32:07","slug":"bmi-calculator","status":"publish","type":"page","link":"https:\/\/sadpoetryhub.com\/?page_id=18","title":{"rendered":"BMI CALCULATOR"},"content":{"rendered":"\n<!DOCTYPE html>\n<html lang=\"en\">\n<head>\n    <meta charset=\"UTF-8\">\n    <meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\">\n    <title>Advanced BMI Calculator<\/title>\n    <style>\n        body {\n            font-family: Arial, sans-serif;\n            background-color: #f4f4f4;\n            margin: 0;\n            padding: 0;\n            display: flex;\n            flex-direction: column;\n            align-items: center;\n            height: 100vh;\n        }\n\n        header {\n            width: 100%;\n            background-color: #4caf50; \/* Green color for the header *\/\n            color: #fff;\n            padding: 10px 0;\n            text-align: center;\n        }\n\n        #calculator {\n            width: 750px;\n            background-color: #fff;\n            padding: 20px;\n            border-radius: 8px;\n            box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);\n            text-align: center;\n        }\n\n        h1 {\n            margin: 0; \/* Remove default margin for h1 *\/\n        }\n\n        label {\n            display: block;\n            margin-bottom: 8px;\n            font-weight: bold;\n        }\n\n        input, select {\n            width: 100%;\n            padding: 8px;\n            margin-bottom: 16px;\n            box-sizing: border-box;\n        }\n\n        button {\n            background-color: #4caf50;\n            color: #fff;\n            border: none;\n            padding: 10px 20px;\n            font-size: 16px;\n            cursor: pointer;\n            border-radius: 4px;\n        }\n\n        #result {\n            margin-top: 20px;\n            font-weight: bold;\n            color: #333;\n        }\n    <\/style>\n<\/head>\n<body>\n\n<header>\n    <h1>Advanced BMI Calculator<\/h1>\n<\/header>\n\n<div id=\"calculator\">\n    <label for=\"age\">Age:<\/label>\n    <input type=\"number\" id=\"age\" placeholder=\"Enter your age\" required>\n\n    <label for=\"gender\">Gender:<\/label>\n    <select id=\"gender\">\n        <option value=\"male\">Male<\/option>\n        <option value=\"female\">Female<\/option>\n    <\/select>\n\n    <label for=\"weight\">Weight (kg):<\/label>\n    <input type=\"number\" id=\"weight\" placeholder=\"Enter your weight\" required>\n\n    <label for=\"height\">Height (cm):<\/label>\n    <input type=\"number\" id=\"height\" placeholder=\"Enter your height\" required>\n\n    <button onclick=\"calculateBMI()\">Calculate BMI<\/button>\n\n    <div id=\"result\"><\/div>\n<\/div>\n\n<script>\n    function calculateBMI() {\n        var age = document.getElementById('age').value;\n        var gender = document.getElementById('gender').value;\n        var weight = document.getElementById('weight').value;\n        var height = document.getElementById('height').value;\n\n        if (age && gender && weight && height) {\n            var bmi = (weight \/ ((height \/ 100) * (height \/ 100))).toFixed(2);\n            var resultElement = document.getElementById('result');\n            resultElement.innerHTML = 'Your BMI is: ' + bmi;\n\n            \/\/ Interpretation of BMI with consideration of age and gender\n            if (gender === 'male') {\n                resultElement.innerHTML += '<br>For a male, ';\n            } else {\n                resultElement.innerHTML += '<br>For a female, ';\n            }\n\n            if (age < 18.5) {\n                resultElement.innerHTML += 'this is considered Underweight for your age.';\n            } else if (age >= 18.5 && age <= 24.9) {\n                resultElement.innerHTML += 'this is considered Normal weight for your age.';\n            } else if (age >= 25 && age <= 29.9) {\n                resultElement.innerHTML += 'this is considered Overweight for your age.';\n            } else {\n                resultElement.innerHTML += 'this is considered Obese for your age.';\n            }\n\n            \/\/ Additional information\n            var healthyBMIRange = '18.5 - 24.9';\n            var healthyWeight = ((height \/ 100) * (height \/ 100) * 24.9).toFixed(2);\n            var bmiPrime = (bmi \/ 25).toFixed(2);\n            var ponderalIndex = (weight \/ Math.pow((height \/ 100), 3)).toFixed(2);\n\n            resultElement.innerHTML += '<br>Healthy BMI Range: ' + healthyBMIRange;\n            resultElement.innerHTML += '<br>Healthy Weight for the Height: ' + healthyWeight + ' kg';\n            resultElement.innerHTML += '<br>BMI Prime: ' + bmiPrime;\n            resultElement.innerHTML += '<br>Ponderal Index: ' + ponderalIndex;\n\n        } else {\n            alert('Please enter all the required information.');\n        }\n    }\n<\/script>\n\n<\/body>\n<\/html>\n\n","protected":false},"excerpt":{"rendered":"<p>Advanced BMI Calculator Advanced BMI Calculator Age: Gender: MaleFemale Weight (kg): Height (cm): Calculate BMI<\/p>\n","protected":false},"author":1,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"site-sidebar-layout":"default","site-content-layout":"","ast-site-content-layout":"default","site-content-style":"default","site-sidebar-style":"default","ast-global-header-display":"","ast-banner-title-visibility":"","ast-main-header-display":"","ast-hfb-above-header-display":"","ast-hfb-below-header-display":"","ast-hfb-mobile-header-display":"","site-post-title":"","ast-breadcrumbs-content":"","ast-featured-img":"","footer-sml-layout":"","ast-disable-related-posts":"","theme-transparent-header-meta":"","adv-header-id-meta":"","stick-header-meta":"","header-above-stick-meta":"","header-main-stick-meta":"","header-below-stick-meta":"","astra-migrate-meta-layouts":"default","ast-page-background-enabled":"default","ast-page-background-meta":{"desktop":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"ast-content-background-meta":{"desktop":{"background-color":"var(--ast-global-color-4)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"var(--ast-global-color-4)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"var(--ast-global-color-4)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"footnotes":""},"class_list":["post-18","page","type-page","status-publish","hentry"],"_links":{"self":[{"href":"https:\/\/sadpoetryhub.com\/index.php?rest_route=\/wp\/v2\/pages\/18","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/sadpoetryhub.com\/index.php?rest_route=\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/sadpoetryhub.com\/index.php?rest_route=\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/sadpoetryhub.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/sadpoetryhub.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=18"}],"version-history":[{"count":0,"href":"https:\/\/sadpoetryhub.com\/index.php?rest_route=\/wp\/v2\/pages\/18\/revisions"}],"wp:attachment":[{"href":"https:\/\/sadpoetryhub.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=18"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}