-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcare.html
175 lines (156 loc) · 8.22 KB
/
care.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title> Nutrient </title>
<!-- Bootstrap CSS CDN -->
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.1.0/css/bootstrap.min.css" integrity="sha384-9gVQ4dYFwwWSjIDZnLEWnxCjeSWFphJiwGPXr1jddIhOegiu1FwO5qRGvFXOdJZ4" crossorigin="anonymous">
<!-- CSS -->
<link rel="stylesheet" href="style.css">
<!--Font Awesome JS -->
<script defer src="https://use.fontawesome.com/releases/v5.0.13/js/solid.js" integrity="sha384-tzzSw1/Vo+0N5UhStP3bvwWPq+uvzCMfrN1fEFe+xBmv1C/AtVX5K0uZtmcHitFZ" crossorigin="anonymous"></script>
<script defer src="https://use.fontawesome.com/releases/v5.0.13/js/fontawesome.js" integrity="sha384-6OIrr52G08NpOFSZdxxz1xdNSndlD4vdcf/q2myIUVO0VsqaGHJsB0RaBE01VTOY" crossorigin="anonymous"></script>
</head>
<body>
<div class="wrapper">
<!-- Sidebar -->
<nav id="sidebar">
<div class="sidebar-header">
<h3><a href="main.html">Nutrient</a></h3>
</div>
<ul class="list-unstyled components">
<p>Menu</p>
<li>
<a href="index.html">Home</a>
</li>
<li>
<a href="care.html">Care</a>
</li>
<li>
<a href="#pageSubmenu" data-toggle="collapse" aria-expanded="false" class="dropdown-toggle">Foods</a>
<ul class="collapse list-unstyled" id="pageSubmenu">
<li>
<a href="foodinfo.html">Help</a>
</li>
<li>
<a href="cfood.html">Carbohydrate</a>
</li>
<li>
<a href="pfood.html">Protain</a>
</li>
<li>
<a href="ffood.html">Fat</a>
</li>
</ul>
</li>
<li>
<a href="reference.html">References</a>
</li>
</ul>
</nav>
<!-- 내용 -->
<div id="content">
<nav class="navbar navbar-expand-lg navbar-light bg-light">
<div class="container-fluid">
<button type="button" id="sidebarCollapse" class="btn btn-info">
<i class="fas fa-align-left"></i>
<span> menu </span>
</button>
<button class="btn btn-dark d-inline-block d-lg-none ml-auto" type="button" data-toggle="collapse" data-target="#navbarSupportedContent" aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">
<i class="fas fa-align-justify"></i>
</button>
<div class="collapse navbar-collapse" id="navbarSupportedContent">
<ul class="nav navbar-nav ml-auto">
<li class="nav-item">
<a class="nav-link" href="index.html">Home</a>
</li>
<li class="nav-item active">
<a class="nav-link" href="care.html">Care</a>
</li>
<li class="nav-item">
<a class="nav-link" href="foodinfo.html">Foods</a>
</li>
<li class="nav-item">
<a class="nav-link" href="reference.html">References</a>
</li>
</ul>
</div>
</div>
</nav>
<form method="POST" name="bodyspec">
<h3>Gender</h3>
<select name="gender" id="gender" style="width:232px;">
<option value="1">female</option>
<option value="2">male</option>
</select>
<h3>Height(cm)</h3>
<input type="text" id="height">
<h3>Weight(kg)</h3>
<input type="text" id="weight">
<h3>BodyFat(%)</h3>
<input type="text" id="bodyfat">
<h3>Age</h3>
<input type="text" id="age">
<h3>Activity</h3>
<select name="activity" id="activity" style="width:232px;">
<option value="1.2">Sedentary (little to no exercise)</option>
<option value="1.375">Lightly Active (light exercise/sports 1-3 days/week)</option>
<option value="1.55">Moderately Active (moderate exercise/sports 3-5 days/week)</option>
<option value="1.725">Very Active (hard exercise/sports 6-7 days a week)</option>
<option value="1.9">Extremely Active (very heavy exercise/ physical job/ training twice a day)</option>
</select>
<br>
<input type="button" name="calculate" value="calculate" onclick="cal()">
<div class="card" style="width: 400px;">
<h3>Fat Loss</h3>
<p id="FatLoss">0 kcal</p>
<h3>Maintenance</h3>
<p id="Maintenance">0 kcal</p>
<h3>Get Weight</h3>
<p id="GetWeight">0 kcal</p>
</div>
</form>
</div>
</div>
<!-- jQuery CDN -->
<script src="https://code.jquery.com/jquery-3.3.1.slim.min.js" integrity="sha384-q8i/X+965DzO0rT7abK41JStQIAqVgRVzpbzo5smXKp4YfRvH+8abtTE1Pi6jizo" crossorigin="anonymous"></script>
<!-- Popper.JS -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.0/umd/popper.min.js" integrity="sha384-cs/chFZiN24E4KMATLdqdvsezGxaGsi4hLGOzlXwp5UZB1LY//20VyM2taTB4QvJ" crossorigin="anonymous"></script>
<!-- Bootstrap JS -->
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.1.0/js/bootstrap.min.js" integrity="sha384-uefMccjFJAIv6A+rW+L4AHf99KvxDjWSu1z9VI8SKNVmz4sk7buKt/6v9KI65qnm" crossorigin="anonymous"></script>
<!-- jQuery function -->
<script type="text/javascript">
$(document).ready(function () {
$('#sidebarCollapse').on('click', function () {
$('#sidebar').toggleClass('active');
});
});
</script>
<!-- appropriate calory calculation function -->
<script >
function cal(){
spec=document.bodyspec;
var height=1*spec.height.value;
var weight=1*spec.weight.value;
var bodyfat=0.01*spec.bodyfat.value;
var age=1*spec.age.value;
var sel=spec.activity;
var activity= 1*sel.options[sel.selectedIndex].value;
var check=spec.gender;
var gender=check.options[check.selectedIndex].value;
if(gender=='1'){
var bmr=655.0+(weight*9.6*(1.0-bodyfat))+(1.8*height)-(4.7*age);
}
else if(gender=='2'){
var bmr=66.0+(weight*13.7*(1.0-bodyfat))+(5.0*height)-(6.8*age);
}
var tdee=parseFloat(activity)*bmr;
document.getElementById("FatLoss").innerHTML=parseInt(tdee-500)+" Kcal";
document.getElementById("Maintenance").innerHTML=parseInt(tdee)+" Kcal";
document.getElementById("GetWeight").innerHTML=parseInt(tdee+300)+" Kcal";
}
</script>
</body>
</html>