-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path16_VitaminFood.html
More file actions
121 lines (105 loc) · 3.5 KB
/
16_VitaminFood.html
File metadata and controls
121 lines (105 loc) · 3.5 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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Health Analysis App</title>
<style>
body {
font-family: 'Arial', sans-serif;
background-color: #f4f4f4;
margin: 0;
padding: 0;
text-align: center;
}
h1 {
color: #333;
}
div.container {
background-color: #fff;
border-radius: 10px;
box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
margin: 20px auto;
max-width: 800px;
padding: 20px;
}
h2 {
color: #555;
margin-top: 20px;
}
label {
display: block;
margin: 10px 0;
padding: 10px;
background-color: #f9f9f9;
border-radius: 5px;
cursor: pointer;
transition: background-color 0.3s;
}
label:hover {
background-color: #e0e0e0;
}
button {
background-color: #4caf50;
border: none;
color: white;
padding: 10px 20px;
text-align: center;
text-decoration: none;
display: inline-block;
font-size: 16px;
margin: 10px 0;
cursor: pointer;
border-radius: 5px;
}
#analysis-result {
margin-top: 20px;
padding: 20px;
border: 2px solid #ddd;
border-radius: 10px;
background-color: #fff;
text-align: left;
}
#analysis-result h2 {
color: #555;
border-bottom: 2px solid #ddd;
padding-bottom: 10px;
}
#analysis-result p {
margin: 10px 0;
}
</style>
</head>
<body>
<div class="container">
<h1>Health Analysis App</h1>
<!-- Fruits and Food Selection -->
<div>
<h2>Select Fruits and Food for Analysis</h2>
<!-- Add more items as needed -->
<label><input type="checkbox" class="item" data-name="Apple" data-advantage="Rich in fiber and antioxidants." data-disadvantage="High sugar content, moderation advised."> Apple</label>
<label><input type="checkbox" class="item" data-name="Broccoli" data-advantage="High in vitamins and fiber." data-disadvantage="May cause gas in some individuals."> Broccoli</label>
<!-- Add more fruits and food items -->
</div>
<button onclick="analyzeSelection()">Analyze</button>
<div id="analysis-result">
<!-- Display analysis results here -->
</div>
</div>
<script>
function analyzeSelection() {
const selectedItems = document.querySelectorAll('.item:checked');
let analysisResult = '<h2>Health Analysis:</h2>';
selectedItems.forEach(item => {
const itemName = item.dataset.name;
const advantage = item.dataset.advantage;
const disadvantage = item.dataset.disadvantage;
analysisResult += <p><strong>${itemName}:</strong></p>;
analysisResult += <p><strong>Advantage:</strong> ${advantage}</p>;
analysisResult += <p><strong>Disadvantage:</strong> ${disadvantage}</p>;
});
document.getElementById('analysis-result').innerHTML = analysisResult;
}
</script>
</body>
</html>