-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcommunication.html
More file actions
68 lines (60 loc) · 2.52 KB
/
communication.html
File metadata and controls
68 lines (60 loc) · 2.52 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
<!DOCTYPE html>
<html>
<head>
<title>Design For Understanding: Communication</title>
<meta charset="UTF-8">
<meta name="viewport" width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0>
<link rel="stylesheet" href="assets/common/css/hci.css">
<script src="https://code.jquery.com/jquery.min.js"></script>
</head>
<body id="bodyWhite">
<h1>Design For Understanding: Food</h1>
<button onclick="showGraphs(1)" id="heading-fruit">Fruits ▼</button>
<div id="dropdown-fruit">
<image class="graphs" src="assets/common/images/fruits/fruit_table.png">
<image class="graphs" src="assets/common/images/fruits/fruit_calories.png">
<image class="graphs" src="assets/common/images/fruits/fruit_sugar.png">
<image class="graphs" src="assets/common/images/fruits/fruit_protein.png">
</div>
<button onclick="showGraphs(2)" id="heading-veg">Vegetables ▼</button>
<div id="dropdown-veg">
<image class="graphs" src="assets/common/images/vegetables/veg_table.png">
<image class="graphs" src="assets/common/images/vegetables/veg_calories.png">
<image class="graphs" src="assets/common/images/vegetables/veg_sugar.png">
<image class="graphs" src="assets/common/images/vegetables/veg_protein.png">
</div>
<button onclick="showGraphs(3)" id="heading-meat">Meats ▼</button>
<div id="dropdown-meat">
<image class="graphs" src="assets/common/images/meat/meat_table.png">
<image class="graphs" src="assets/common/images/meat/meat_calories.png">
<image class="graphs" src="assets/common/images/meat/meat_sugar.png">
<image class="graphs" src="assets/common/images/meat/meat_protein.png">
</div>
<script>
var fruit = 0;
var veg = 0;
var meat = 0;
function showGraphs(option) {
if (option == 1 && fruit == 0) {
document.getElementById("dropdown-fruit").style.display = "block";
fruit = 1;
} else if (option == 2 && veg == 0) {
document.getElementById("dropdown-veg").style.display = "block";
veg = 1;
} else if (option == 3 && meat == 0) {
document.getElementById("dropdown-meat").style.display = "block";
meat = 1;
} else if (option == 1 && fruit == 1) {
document.getElementById("dropdown-fruit").style.display = "none";
fruit = 0;
} else if (option == 2 && veg == 1) {
document.getElementById("dropdown-veg").style.display = "none";
veg = 0;
} else if (option == 3 && meat == 1) {
document.getElementById("dropdown-meat").style.display = "none";
meat = 0;
}
}
</script>
</body>
</html>