|
|
<!DOCTYPE html> |
|
|
<html lang="ko"> |
|
|
<head> |
|
|
<meta charset="UTF-8"> |
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0"> |
|
|
<title>HealthTrack - BMI ๊ณ์ฐ๊ธฐ</title> |
|
|
<script src="https://cdn.tailwindcss.com"></script> |
|
|
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css"> |
|
|
<style> |
|
|
@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+KR:wght@300;400;500;700&display=swap'); |
|
|
|
|
|
body { |
|
|
font-family: 'Noto Sans KR', sans-serif; |
|
|
background-color: #f8fafc; |
|
|
} |
|
|
|
|
|
.gradient-bg { |
|
|
background: linear-gradient(135deg, #3b82f6 0%, #10b981 100%); |
|
|
} |
|
|
|
|
|
.bmi-scale { |
|
|
height: 8px; |
|
|
background: linear-gradient(90deg, #10b981 0%, #f59e0b 50%, #ef4444 100%); |
|
|
border-radius: 4px; |
|
|
} |
|
|
|
|
|
.marker { |
|
|
position: absolute; |
|
|
top: -10px; |
|
|
width: 0; |
|
|
height: 0; |
|
|
border-left: 10px solid transparent; |
|
|
border-right: 10px solid transparent; |
|
|
border-top: 10px solid #3b82f6; |
|
|
transform: translateX(-10px); |
|
|
transition: left 0.5s ease; |
|
|
} |
|
|
|
|
|
.result-card { |
|
|
box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1); |
|
|
transition: all 0.3s ease; |
|
|
} |
|
|
|
|
|
.result-card:hover { |
|
|
transform: translateY(-5px); |
|
|
box-shadow: 0 15px 30px -5px rgba(0, 0, 0, 0.15); |
|
|
} |
|
|
|
|
|
input[type="range"]::-webkit-slider-thumb { |
|
|
-webkit-appearance: none; |
|
|
width: 20px; |
|
|
height: 20px; |
|
|
border-radius: 50%; |
|
|
background: #3b82f6; |
|
|
cursor: pointer; |
|
|
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2); |
|
|
} |
|
|
|
|
|
input[type="range"]::-moz-range-thumb { |
|
|
width: 20px; |
|
|
height: 20px; |
|
|
border-radius: 50%; |
|
|
background: #3b82f6; |
|
|
cursor: pointer; |
|
|
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2); |
|
|
} |
|
|
</style> |
|
|
</head> |
|
|
<body class="min-h-screen flex flex-col"> |
|
|
|
|
|
<header class="gradient-bg text-white py-6"> |
|
|
<div class="container mx-auto px-4"> |
|
|
<div class="flex items-center justify-between"> |
|
|
<div class="flex items-center space-x-3"> |
|
|
<div class="bg-white rounded-full p-2"> |
|
|
<i class="fas fa-heartbeat text-2xl text-blue-500"></i> |
|
|
</div> |
|
|
<h1 class="text-2xl font-bold">HealthTrack</h1> |
|
|
</div> |
|
|
<div class="hidden md:block"> |
|
|
<span class="text-blue-100">๋น์ ์ ๊ฑด๊ฐ์ ์ํ ์ฒซ ๊ฑธ์</span> |
|
|
</div> |
|
|
</div> |
|
|
</div> |
|
|
</header> |
|
|
|
|
|
|
|
|
<main class="flex-grow container mx-auto px-4 py-8"> |
|
|
<div class="max-w-3xl mx-auto"> |
|
|
<div class="bg-white rounded-xl shadow-md overflow-hidden mb-8"> |
|
|
<div class="p-6 md:p-8"> |
|
|
<h2 class="text-2xl font-bold text-gray-800 mb-6">์ฒด์ง๋ ์ง์(BMI) ๊ณ์ฐ๊ธฐ</h2> |
|
|
|
|
|
<div class="grid md:grid-cols-2 gap-6"> |
|
|
|
|
|
<div class="space-y-4"> |
|
|
<div> |
|
|
<label for="height" class="block text-sm font-medium text-gray-700 mb-1">ํค (cm)</label> |
|
|
<div class="relative"> |
|
|
<input type="number" id="height" min="100" max="250" step="0.1" |
|
|
class="w-full px-4 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-blue-500 focus:border-blue-500" |
|
|
placeholder="์: 175"> |
|
|
<div class="absolute inset-y-0 right-0 flex items-center pr-3 pointer-events-none"> |
|
|
<span class="text-gray-500">cm</span> |
|
|
</div> |
|
|
</div> |
|
|
<div class="mt-2"> |
|
|
<input type="range" id="height-slider" min="100" max="250" value="170" |
|
|
class="w-full h-2 bg-gray-200 rounded-lg appearance-none cursor-pointer"> |
|
|
</div> |
|
|
</div> |
|
|
|
|
|
|
|
|
<div> |
|
|
<label for="weight" class="block text-sm font-medium text-gray-700 mb-1">์ฒด์ค (kg)</label> |
|
|
<div class="relative"> |
|
|
<input type="number" id="weight" min="30" max="200" step="0.1" |
|
|
class="w-full px-4 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-blue-500 focus:border-blue-500" |
|
|
placeholder="์: 70"> |
|
|
<div class="absolute inset-y-0 right-0 flex items-center pr-3 pointer-events-none"> |
|
|
<span class="text-gray-500">kg</span> |
|
|
</div> |
|
|
</div> |
|
|
<div class="mt-2"> |
|
|
<input type="range" id="weight-slider" min="30" max="200" value="65" |
|
|
class="w-full h-2 bg-gray-200 rounded-lg appearance-none cursor-pointer"> |
|
|
</div> |
|
|
</div> |
|
|
|
|
|
<button id="calculate-btn" |
|
|
class="w-full gradient-bg text-white py-3 px-4 rounded-lg font-medium hover:opacity-90 transition duration-300 flex items-center justify-center space-x-2"> |
|
|
<i class="fas fa-calculator"></i> |
|
|
<span>BMI ๊ณ์ฐํ๊ธฐ</span> |
|
|
</button> |
|
|
</div> |
|
|
|
|
|
|
|
|
<div class="flex flex-col justify-center"> |
|
|
<div class="bg-gray-50 p-4 rounded-lg border border-gray-200"> |
|
|
<h3 class="text-lg font-medium text-gray-800 mb-3">BMI ๋ฒ์</h3> |
|
|
<div class="relative mb-8"> |
|
|
<div class="bmi-scale"></div> |
|
|
<div class="marker" id="bmi-marker"></div> |
|
|
</div> |
|
|
<div class="grid grid-cols-5 gap-1 text-xs text-center"> |
|
|
<div class="text-green-600">์ ์ฒด์ค<br>(18.5 ๋ฏธ๋ง)</div> |
|
|
<div class="text-green-700">์ ์<br>(18.5-23)</div> |
|
|
<div class="text-yellow-600">๊ณผ์ฒด์ค<br>(23-25)</div> |
|
|
<div class="text-orange-600">๋น๋ง<br>(25-30)</div> |
|
|
<div class="text-red-600">๊ณ ๋๋น๋ง<br>(30 ์ด์)</div> |
|
|
</div> |
|
|
</div> |
|
|
</div> |
|
|
</div> |
|
|
</div> |
|
|
</div> |
|
|
|
|
|
|
|
|
<div id="result-section" class="hidden"> |
|
|
<div class="result-card bg-white rounded-xl shadow-md overflow-hidden mb-8"> |
|
|
<div class="p-6 md:p-8"> |
|
|
<h2 class="text-2xl font-bold text-gray-800 mb-4">๋น์ ์ BMI ๊ฒฐ๊ณผ</h2> |
|
|
|
|
|
<div class="grid md:grid-cols-3 gap-6 mb-6"> |
|
|
|
|
|
<div class="bg-blue-50 rounded-lg p-4 border border-blue-100"> |
|
|
<div class="flex items-center justify-between"> |
|
|
<h3 class="text-lg font-medium text-blue-800">BMI ์ง์</h3> |
|
|
<i class="fas fa-chart-line text-blue-400 text-xl"></i> |
|
|
</div> |
|
|
<div class="mt-2"> |
|
|
<span id="bmi-value" class="text-3xl font-bold text-blue-600">0.00</span> |
|
|
</div> |
|
|
</div> |
|
|
|
|
|
|
|
|
<div class="bg-green-50 rounded-lg p-4 border border-green-100"> |
|
|
<div class="flex items-center justify-between"> |
|
|
<h3 class="text-lg font-medium text-green-800">์ฒด์ง๋ ๋ถ๋ฅ</h3> |
|
|
<i class="fas fa-tag text-green-400 text-xl"></i> |
|
|
</div> |
|
|
<div class="mt-2"> |
|
|
<span id="bmi-category" class="text-2xl font-bold text-green-600">-</span> |
|
|
</div> |
|
|
</div> |
|
|
|
|
|
|
|
|
<div class="bg-purple-50 rounded-lg p-4 border border-purple-100"> |
|
|
<div class="flex items-center justify-between"> |
|
|
<h3 class="text-lg font-medium text-purple-800">์ด์์ ์ฒด์ค ๋ฒ์</h3> |
|
|
<i class="fas fa-weight text-purple-400 text-xl"></i> |
|
|
</div> |
|
|
<div class="mt-2"> |
|
|
<span id="ideal-weight" class="text-xl font-bold text-purple-600">- kg</span> |
|
|
</div> |
|
|
</div> |
|
|
</div> |
|
|
|
|
|
|
|
|
<div id="health-tips" class="space-y-4"> |
|
|
<h3 class="text-xl font-semibold text-gray-800 border-b pb-2">๊ฑด๊ฐ ๊ด๋ฆฌ ํ</h3> |
|
|
<div id="underweight-tips" class="hidden"> |
|
|
<div class="flex items-start space-x-3"> |
|
|
<div class="bg-yellow-100 p-2 rounded-full"> |
|
|
<i class="fas fa-utensils text-yellow-600"></i> |
|
|
</div> |
|
|
<div> |
|
|
<h4 class="font-medium text-gray-800">์ ์ฒด์ค์ ์ํ ์์ ์ ๋ต</h4> |
|
|
<p class="text-gray-600 text-sm mt-1">๊ณ ์นผ๋ก๋ฆฌ์ด๋ฉด์ ์์๊ฐ ์๋ ์์์ ์ญ์ทจํ์ธ์. ๊ฒฌ๊ณผ๋ฅ, ์๋ณด์นด๋, ์ฌ๋ฆฌ๋ธ ์ค์ผ๊ณผ ๊ฐ์ ๊ฑด๊ฐํ ์ง๋ฐฉ์ ์ถ๊ฐํ๊ณ , ๋จ๋ฐฑ์ง ์ญ์ทจ๋ฅผ ๋๋ฆฌ๋ฉฐ, ์๋์ ์์ฌ๋ฅผ ์์ฃผ ๋์ธ์.</p> |
|
|
</div> |
|
|
</div> |
|
|
<div class="flex items-start space-x-3 mt-3"> |
|
|
<div class="bg-blue-100 p-2 rounded-full"> |
|
|
<i class="fas fa-dumbbell text-blue-600"></i> |
|
|
</div> |
|
|
<div> |
|
|
<h4 class="font-medium text-gray-800">๊ทผ๋ ฅ ์ด๋ ์ถ์ฒ</h4> |
|
|
<p class="text-gray-600 text-sm mt-1">๊ทผ์ก๋์ ์ฆ๊ฐ์ํค๊ธฐ ์ํด ์ ํญ ์ด๋์ ๊พธ์คํ ํ์ธ์. ์ค์ฟผํธ, ๋ฐ๋๋ฆฌํํธ, ๋ฒค์นํ๋ ์ค์ ๊ฐ์ ๋ณตํฉ ์ด๋์ด ํจ๊ณผ์ ์ด๋ฉฐ, ์ฃผ 2-3ํ ๊ทผ๋ ฅ ํ๋ จ์ ๊ถ์ฅํฉ๋๋ค.</p> |
|
|
</div> |
|
|
</div> |
|
|
</div> |
|
|
|
|
|
<div id="normal-tips" class="hidden"> |
|
|
<div class="flex items-start space-x-3"> |
|
|
<div class="bg-green-100 p-2 rounded-full"> |
|
|
<i class="fas fa-check-circle text-green-600"></i> |
|
|
</div> |
|
|
<div> |
|
|
<h4 class="font-medium text-gray-800">ํ ์ํ ์ ์ง๋ฅผ ์ํ ์กฐ์ธ</h4> |
|
|
<p class="text-gray-600 text-sm mt-1">๊ท ํ ์กํ ์๋จ๊ณผ ๊ท์น์ ์ธ ์ด๋์ ์ ์งํ์ธ์. ๋ค์ํ ์๊น์ ์ฑ์์ ๊ณผ์ผ์ ์ถฉ๋ถํ ์ญ์ทจํ๊ณ , ์ ์ ๋ ํ์ํ๋ฌผ ๋์ ์ ๊ณก์ ์ ํํ๋ฉฐ, ๊ฐ๊ณต ์ํ์ ์ค์ด์ธ์.</p> |
|
|
</div> |
|
|
</div> |
|
|
<div class="flex items-start space-x-3 mt-3"> |
|
|
<div class="bg-blue-100 p-2 rounded-full"> |
|
|
<i class="fas fa-running text-blue-600"></i> |
|
|
</div> |
|
|
<div> |
|
|
<h4 class="font-medium text-gray-800">์ข
ํฉ์ ์ธ ์ด๋ ๊ณํ</h4> |
|
|
<p class="text-gray-600 text-sm mt-1">์ฃผ 150๋ถ์ ์ค๋ฑ๋ ์ ์ฐ์ ์ด๋ ๋๋ 75๋ถ์ ๊ณ ๊ฐ๋ ์ ์ฐ์ ์ด๋๊ณผ ์ฃผ 2ํ์ ๊ทผ๋ ฅ ์ด๋์ ์กฐํฉํ์ธ์. ์๊ฐ๋ ํ๋ผํ
์ค๋ก ์ ์ฐ์ฑ๋ ๊ด๋ฆฌํ๋ ๊ฒ์ด ์ข์ต๋๋ค.</p> |
|
|
</div> |
|
|
</div> |
|
|
</div> |
|
|
|
|
|
<div id="overweight-tips" class="hidden"> |
|
|
<div class="flex items-start space-x-3"> |
|
|
<div class="bg-orange-100 p-2 rounded-full"> |
|
|
<i class="fas fa-carrot text-orange-600"></i> |
|
|
</div> |
|
|
<div> |
|
|
<h4 class="font-medium text-gray-800">์ฒด์ค ๊ฐ๋์ ์ํ ์๋จ</h4> |
|
|
<p class="text-gray-600 text-sm mt-1">ํ๋ฃจ ์ญ์ทจ ์นผ๋ก๋ฆฌ๋ฅผ 300-500kcal ์ค์ด๋ ์์์๋ ์ถฉ๋ถํ ์ญ์ทจํ์ธ์. ๋จ๋ฐฑ์ง ์ญ์ทจ๋ฅผ ๋๋ ค ํฌ๋ง๊ฐ์ ์ ์งํ๊ณ , ์คํ๊ณผ ์ ์ ํ์ํ๋ฌผ์ ์ค์ด๋ฉฐ, ๋ฌผ์ ์ถฉ๋ถํ ๋ง์์ธ์.</p> |
|
|
</div> |
|
|
</div> |
|
|
<div class="flex items-start space-x-3 mt-3"> |
|
|
<div class="bg-blue-100 p-2 rounded-full"> |
|
|
<i class="fas fa-heartbeat text-blue-600"></i> |
|
|
</div> |
|
|
<div> |
|
|
<h4 class="font-medium text-gray-800">ํจ๊ณผ์ ์ธ ์ด๋ ๋ฐฉ๋ฒ</h4> |
|
|
<p class="text-gray-600 text-sm mt-1">์ฃผ 5์ผ, ํ๋ฃจ 30๋ถ ์ด์์ ์ ์ฐ์ ์ด๋(๋น ๋ฅธ ๊ฑท๊ธฐ, ์์, ์ฌ์ดํด๋ง)๊ณผ ์ฃผ 2-3ํ์ ๊ทผ๋ ฅ ์ด๋์ ๋ณํํ์ธ์. ์ผ์ ์ํ์์ ํ๋๋์ ๋๋ฆฌ๋ ๊ฒ๋ ์ค์ํฉ๋๋ค.</p> |
|
|
</div> |
|
|
</div> |
|
|
</div> |
|
|
|
|
|
<div id="obese-tips" class="hidden"> |
|
|
<div class="flex items-start space-x-3"> |
|
|
<div class="bg-red-100 p-2 rounded-full"> |
|
|
<i class="fas fa-notes-medical text-red-600"></i> |
|
|
</div> |
|
|
<div> |
|
|
<h4 class="font-medium text-gray-800">์๋ฃ ์ ๋ฌธ๊ฐ์์ ์๋ด</h4> |
|
|
<p class="text-gray-600 text-sm mt-1">๊ณ ๋ ๋น๋ง์ ๊ฒฝ์ฐ ์ ๋ฌธ์์ ์๋ดํ์ฌ ์ฒด๊ณ์ ์ธ ๊ด๋ฆฌ ๊ณํ์ ์๋ฆฝํ์ธ์. ๊ฐ์ธ ๋ง์ถคํ ์๋จ๊ณผ ์ด๋ ํ๋ก๊ทธ๋จ์ด ํ์ํ ์ ์์ผ๋ฉฐ, ๊ธฐ์ ์งํ ํ์ธ์ด ์ค์ํฉ๋๋ค.</p> |
|
|
</div> |
|
|
</div> |
|
|
<div class="flex items-start space-x-3 mt-3"> |
|
|
<div class="bg-blue-100 p-2 rounded-full"> |
|
|
<i class="fas fa-walking text-blue-600"></i> |
|
|
</div> |
|
|
<div> |
|
|
<h4 class="font-medium text-gray-800">์์ ํ ์ด๋ ์ ๊ทผ๋ฒ</h4> |
|
|
<p class="text-gray-600 text-sm mt-1">๊ด์ ์ ๋ฌด๋ฆฌ๊ฐ ๊ฐ์ง ์๋ ์ด๋(์์ค ์ด๋, ์์ ๊ฑฐ ํ๊ธฐ)๋ถํฐ ์์ํ์ธ์. ์ ์ง์ ์ผ๋ก ์ด๋ ๊ฐ๋๋ฅผ ๋์ด๊ณ , ์ ๋ฌธ ํธ๋ ์ด๋์ ์ง๋๋ฅผ ๋ฐ๋ ๊ฒ์ด ์์ ํฉ๋๋ค.</p> |
|
|
</div> |
|
|
</div> |
|
|
</div> |
|
|
</div> |
|
|
</div> |
|
|
</div> |
|
|
</div> |
|
|
</div> |
|
|
</main> |
|
|
|
|
|
|
|
|
<footer class="bg-gray-800 text-white py-6"> |
|
|
<div class="container mx-auto px-4"> |
|
|
<div class="flex flex-col md:flex-row justify-between items-center"> |
|
|
<div class="mb-4 md:mb-0"> |
|
|
<div class="flex items-center space-x-2"> |
|
|
<i class="fas fa-heartbeat text-xl text-blue-400"></i> |
|
|
<span class="font-medium">HealthTrack</span> |
|
|
</div> |
|
|
<p class="text-gray-400 text-sm mt-1">๋น์ ์ ๊ฑด๊ฐ์ ์ฑ
์์ง๋ ํํธ๋</p> |
|
|
</div> |
|
|
<div class="text-sm text-gray-400 text-center md:text-right"> |
|
|
<p>ยฉ 2023 HealthTrack. All rights reserved.</p> |
|
|
<p class="mt-1">์ด ๊ฒฐ๊ณผ๋ ์ฐธ๊ณ ์ฉ์ด๋ฉฐ, ์ ๋ฌธ ์๋ฃ ์๋ด์ ๋์ฒดํ์ง ์์ต๋๋ค.</p> |
|
|
</div> |
|
|
</div> |
|
|
</div> |
|
|
</footer> |
|
|
|
|
|
<script> |
|
|
document.addEventListener('DOMContentLoaded', function() { |
|
|
|
|
|
const heightInput = document.getElementById('height'); |
|
|
const weightInput = document.getElementById('weight'); |
|
|
const heightSlider = document.getElementById('height-slider'); |
|
|
const weightSlider = document.getElementById('weight-slider'); |
|
|
const calculateBtn = document.getElementById('calculate-btn'); |
|
|
const resultSection = document.getElementById('result-section'); |
|
|
const bmiValue = document.getElementById('bmi-value'); |
|
|
const bmiCategory = document.getElementById('bmi-category'); |
|
|
const idealWeight = document.getElementById('ideal-weight'); |
|
|
const bmiMarker = document.getElementById('bmi-marker'); |
|
|
|
|
|
|
|
|
heightInput.addEventListener('input', function() { |
|
|
heightSlider.value = this.value; |
|
|
}); |
|
|
|
|
|
heightSlider.addEventListener('input', function() { |
|
|
heightInput.value = this.value; |
|
|
}); |
|
|
|
|
|
weightInput.addEventListener('input', function() { |
|
|
weightSlider.value = this.value; |
|
|
}); |
|
|
|
|
|
weightSlider.addEventListener('input', function() { |
|
|
weightInput.value = this.value; |
|
|
}); |
|
|
|
|
|
|
|
|
function calculateBMI(height, weight) { |
|
|
|
|
|
const heightInMeters = height / 100; |
|
|
|
|
|
return weight / (heightInMeters * heightInMeters); |
|
|
} |
|
|
|
|
|
|
|
|
function getBMICategory(bmi) { |
|
|
if (bmi < 18.5) return '์ ์ฒด์ค'; |
|
|
if (bmi < 23) return '์ ์ ์ฒด์ค'; |
|
|
if (bmi < 25) return '๊ณผ์ฒด์ค'; |
|
|
if (bmi < 30) return '๋น๋ง'; |
|
|
return '๊ณ ๋ ๋น๋ง'; |
|
|
} |
|
|
|
|
|
|
|
|
function getBMIColor(bmi) { |
|
|
if (bmi < 18.5) return 'text-yellow-500'; |
|
|
if (bmi < 23) return 'text-green-600'; |
|
|
if (bmi < 25) return 'text-yellow-600'; |
|
|
if (bmi < 30) return 'text-orange-600'; |
|
|
return 'text-red-600'; |
|
|
} |
|
|
|
|
|
|
|
|
function getIdealWeightRange(height) { |
|
|
const heightInMeters = height / 100; |
|
|
const lower = 18.5 * (heightInMeters * heightInMeters); |
|
|
const upper = 23 * (heightInMeters * heightInMeters); |
|
|
return `${lower.toFixed(1)} - ${upper.toFixed(1)}`; |
|
|
} |
|
|
|
|
|
|
|
|
function updateBMIMarker(bmi) { |
|
|
|
|
|
const minBMI = 15; |
|
|
const maxBMI = 40; |
|
|
|
|
|
|
|
|
let displayBMI = Math.max(minBMI, Math.min(maxBMI, bmi)); |
|
|
|
|
|
|
|
|
const percentage = ((displayBMI - minBMI) / (maxBMI - minBMI)) * 100; |
|
|
bmiMarker.style.left = `${percentage}%`; |
|
|
|
|
|
|
|
|
bmiMarker.style.borderTopColor = getBMIColor(bmi).replace('text', 'bg').split('-')[1]; |
|
|
} |
|
|
|
|
|
|
|
|
function showHealthTips(bmi) { |
|
|
|
|
|
document.querySelectorAll('#health-tips > div').forEach(el => { |
|
|
el.classList.add('hidden'); |
|
|
}); |
|
|
|
|
|
|
|
|
if (bmi < 18.5) { |
|
|
document.getElementById('underweight-tips').classList.remove('hidden'); |
|
|
} else if (bmi < 23) { |
|
|
document.getElementById('normal-tips').classList.remove('hidden'); |
|
|
} else if (bmi < 25) { |
|
|
document.getElementById('overweight-tips').classList.remove('hidden'); |
|
|
} else { |
|
|
document.getElementById('obese-tips').classList.remove('hidden'); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
calculateBtn.addEventListener('click', function() { |
|
|
const height = parseFloat(heightInput.value); |
|
|
const weight = parseFloat(weightInput.value); |
|
|
|
|
|
|
|
|
if (isNaN(height) || isNaN(weight) || height <= 0 || weight <= 0) { |
|
|
alert('์ฌ๋ฐ๋ฅธ ํค์ ์ฒด์ค์ ์
๋ ฅํด์ฃผ์ธ์.'); |
|
|
return; |
|
|
} |
|
|
|
|
|
|
|
|
const bmi = calculateBMI(height, weight); |
|
|
const roundedBMI = bmi.toFixed(2); |
|
|
const category = getBMICategory(bmi); |
|
|
const idealRange = getIdealWeightRange(height); |
|
|
|
|
|
|
|
|
bmiValue.textContent = roundedBMI; |
|
|
bmiValue.className = `text-3xl font-bold ${getBMIColor(bmi)}`; |
|
|
bmiCategory.textContent = category; |
|
|
bmiCategory.className = `text-2xl font-bold ${getBMIColor(bmi)}`; |
|
|
idealWeight.textContent = `${idealRange} kg`; |
|
|
|
|
|
|
|
|
updateBMIMarker(bmi); |
|
|
|
|
|
|
|
|
showHealthTips(bmi); |
|
|
|
|
|
|
|
|
resultSection.classList.remove('hidden'); |
|
|
|
|
|
|
|
|
resultSection.scrollIntoView({ behavior: 'smooth' }); |
|
|
}); |
|
|
|
|
|
|
|
|
updateBMIMarker(22); |
|
|
}); |
|
|
</script> |
|
|
<p style="border-radius: 8px; text-align: center; font-size: 12px; color: #fff; margin-top: 16px;position: fixed; left: 8px; bottom: 8px; z-index: 10; background: rgba(0, 0, 0, 0.8); padding: 4px 8px;">Made with <img src="https://enzostvs-deepsite.hf.space/logo.svg" alt="DeepSite Logo" style="width: 16px; height: 16px; vertical-align: middle;display:inline-block;margin-right:3px;filter:brightness(0) invert(1);"><a href="https://enzostvs-deepsite.hf.space" style="color: #fff;text-decoration: underline;" target="_blank" >DeepSite</a> - ๐งฌ <a href="https://enzostvs-deepsite.hf.space?remix=joung/joung-nag" style="color: #fff;text-decoration: underline;" target="_blank" >Remix</a></p></body> |
|
|
</html> |