-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbutton.html
More file actions
executable file
·187 lines (167 loc) · 7.1 KB
/
Copy pathbutton.html
File metadata and controls
executable file
·187 lines (167 loc) · 7.1 KB
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
176
177
178
179
180
181
182
183
184
185
186
187
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Fitness Calculator</title>
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/css/bootstrap.min.css" rel="stylesheet"
integrity="sha384-QWTKZyjpPEjISv5WaRU9OFeRpok6YctnYmDr5pNlyT2bRjXh0JMhjY6hW+ALEwIH" crossorigin="anonymous">
<style>
body {
font-family: Arial, Helvetica, sans-serif;
background-image: url('img/a.jpg');
background-attachment: fixed;
background-size: cover;
}
.navbar .navbar-nav .nav-link {
font-size: 20px;
margin: 0 10px;
color: aliceblue;
}
.container {
max-width: 400px;
margin: 0 auto;
padding: 20px;
background: rgba(252, 246, 246, 0.8);
border-radius: 8px;
}
.con {
display: flex;
justify-content: center;
align-items: center;
}
.navbar-toggler {
padding: 10px 20px;
font-size: 1rem;
line-height: 1.5;
color: #ffffff;
background-color: rgba(206, 47, 47, 0.936);
border-radius: 5px;
transition: background-color 0.3s ease;
}
.navbar-toggler:hover {
background-color: #e33e3e;
/* Background color on hover */
}
input[type="number"],
input[type="text"] {
width: 100%;
padding: 10px;
margin: 5px 0;
border-radius: 4px;
/* Rounded corners */
}
button {
width: 100%;
padding: 10px;
background-color: rgba(206, 47, 47, 0.936);
color: white;
border: none;
border-radius: 4px;
/* Rounded corners */
cursor: pointer;
}
button:hover {
background-color: rgba(206, 47, 47, 0.736);
}
.section {
display: none;
padding: 20px;
margin: 10px;
border: 1px solid #ccc;
border-radius: 8px;
}
.section.show {
display: block;
}
</style>
</head>
<body>
<nav class="navbar navbar-expand-lg navbar-light custom-navbar">
<div class="container-fluid">
<a class="navbar-brand" id="logo">
<img src="img/logo.png" alt="Logo" height="60px">
</a>
<button class="navbar-toggler" type="button" data-bs-toggle="collapse"
data-bs-target="#navbarSupportedContent" aria-controls="navbarSupportedContent" aria-expanded="false"
aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse" id="navbarSupportedContent">
<ul class="navbar-nav me-auto mb-2 mb-lg-0">
<a class="nav-link " aria-current="page" href="index.html">Home</a>
<li class="nav-item">
<a class="nav-link" href="#" onclick="showSection('bmi')">BMI</a>
</li>
<li class="nav-item">
<a class="nav-link" href="#" onclick="showSection('fat-percentage')">Body Fat Percentage</a>
</li>
<li class="nav-item">
<a class="nav-link" href="#" onclick="showSection('ideal-weight')">Ideal Weight</a>
</li>
<li class="nav-item">
<a class="nav-link" href="#" onclick="showSection('calories')">Calories</a>
</li>
</ul>
<form class="d-flex">
<button type="button" class="btn btn-primary" onclick="window.location='log.html';">Join Us</button>
</form>
</div>
</div>
</nav>
<div class="con">
<div id="bmi" class="section show container">
<h2>BMI Calculator</h2>
<label for="weight-bmi">Weight (kg):</label>
<input type="number" id="weight-bmi" placeholder="Enter weight in kilograms">
<label for="height-bmi">Height (cm):</label>
<input type="number" id="height-bmi" placeholder="Enter height in centimeters">
<button onclick="calculateBMI()">Calculate BMI</button>
<div id="result-bmi"></div>
</div>
<div id="fat-percentage" class="section container">
<h1>Body Fat Percentage Calculator</h1>
<form id="bodyFatCalculator">
<label for="weight-fat">Weight (in kilograms):</label>
<input type="number" id="weight-fat" name="weight" required><br><br>
<label for="waist">Waist Circumference (in centimeters):</label>
<input type="number" id="waist" name="waist" required><br><br>
<label for="gender">Gender:</label>
<select id="gender" name="gender" required>
<option value="male">Male</option>
<option value="female">Female</option>
</select><br><br>
<label for="age">Age (in years):</label>
<input type="number" id="age" name="age" required><br><br>
<button type="button" onclick="calculateBodyFatPercentage()">Calculate</button>
</form>
<p>Your Body Fat Percentage: <span id="result-fat"></span></p>
</div>
<div id="ideal-weight" class="section container">
<h2>Ideal Weight Calculator</h2>
<label for="height-weight">Height (cm):</label>
<input type="number" id="height-weight" placeholder="Enter height in centimeters">
<label for="weight-weight">Weight (kg):</label>
<input type="number" id="weight-weight" placeholder="Enter weight in kilograms">
<button onclick="calculateIdealWeight()">Calculate Ideal Weight</button>
<div id="result-weight"></div>
</div>
<div id="calories" class="section container">
<h2>Nutrition Tracking</h2>
<label for="meal">Meal:</label>
<input type="text" id="meal" placeholder="Enter meal name">
<label for="caloriesPerGram">Calories per Gram:</label>
<input type="number" id="caloriesPerGram" placeholder="Enter calories per gram">
<label for="amount">Amount (grams):</label>
<input type="number" id="amount" placeholder="Enter amount in grams">
<button onclick="addNutrition()">Add Nutrition</button>
<h3>Meal List</h3>
<ul id="mealList"></ul>
<div id="totalCalories">Total Calories Consumed: 0</div>
</div>
</div>
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/js/bootstrap.bundle.min.js"
integrity="sha384-YvpcrYf0tY3lHB60NNkmXc5s9fDVZLESaAA55NDzOxhy9GkcIdslK1eN7N6jIeHz"
crossorigin="anonymous"></script>
<script src="but.js">
</script>