forked from birtles/calor-me
-
Notifications
You must be signed in to change notification settings - Fork 1
/
index.html
179 lines (176 loc) · 6.89 KB
/
index.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
176
177
178
179
<!doctype html>
<!-- This Source Code Form is subject to the terms of the Mozilla Public
- License, v. 2.0. If a copy of the MPL was not distributed with this file,
- You can obtain one at http://mozilla.org/MPL/2.0/. -->
<html>
<head>
<meta charset="utf-8">
<title>Calor-me! Calor-you! Calor-rifitastical!</title>
<link rel="stylesheet" href="css/calor-me.css" type="text/css">
<script type="text/javascript" src="js/calor-me.js" async></script>
</head>
<body>
<nav aria-role="navigation">
<menu type="toolbar" aria-role="tablist">
<a href="#summary" aria-role="tab" aria-selected="true"
aria-controls="summary" class='tab_css'>Summary</a><a
href="#log" aria-role="tab" aria-selected="false"
aria-controls="log" class='tab_css'>Log</a><a
href="#settings" aria-role="tab" aria-selected="false"
aria-controls="settings" class='tab_css'>Settings</a>
</menu>
</nav>
<div>
<section id="summary" aria-role="tabpanel" aria-hidden="false">
<h2>Summary</h2>
<form class="summary-form">
<div class="graphic-container">
<iframe class="person-meter" src="img/figure.svg"
id="figure"></iframe>
<div class="text-summary" id="text-summary">
<span class="net-summary">-600cal</span>
<span class="details">
<span class="consumed-summary">1400cal consumed</span>
<span class="spent-summary">8000cal spent</span>
</span>
</div>
</div>
<div class="add-data-group" aria-role="group">
<button class="addFood" id="showFoodForm" ><span
class="sign">+</span></button>
<button class="addActivity" id="showActivityForm"><span
class="sign">-</span></button>
</div>
<label>
Weight
<input type="number" name="weight" value="70" placeholder="e.g. 65" style='width:100px;'>
kg
</label>
</form>
<!-- This "overlay container" div is presentational.
There doesn't seem to a neat way of covering all the rest of the
page with translucent grey while we pop-up the dialog without
introducing an extra element.
In the future Web Components will probably address this need. -->
<div class="overlay-container">
<section id="add-food" class="add-data" aria-role="dialog"
aria-label="Add food" aria-hidden="true">
<h2>Add food</h2>
<!-- The action is to workaround a Safari bug -->
<form action="javascript:">
<fieldset>
<input name="food" list="foods" placeholder="e.g. Apple">
<datalist id="foods">
<option>Apple
<option>Donut
</datalist>
<label> x
<input type="number" name="quantity" placeholder="e.g. 2"
class="food-quantity">
</label>
<label class="calc-result"> =
<input type="number" name="calorie-count"> kCal
</label>
</fieldset>
<fieldset>
<input type="submit" value="OK">
<button class="cancel">Cancel</button>
</fieldset>
</form>
</section>
<section id="add-activity" class="add-data" aria-role="dialog"
aria-label="Add activity" aria-hidden="true">
<h2>Add activity</h2>
<form action="javascript:">
<fieldset>
<input name="activity" list="activities"
placeholder="e.g. Running">
<datalist id="activities">
<option>Running
<option>Swimming
</datalist>
<label> for
<input type="number" name="duration" placeholder="e.g. 30"
class="activity-duration">
min
</label>
<label class="calc-result"> =
<input type="number" name="calorie-count"> kCal
</label>
</fieldset>
<fieldset>
<input type="submit" value="OK">
<button class="cancel">Cancel</button>
</fieldset>
</form>
</section>
</div>
</section>
<section id="log" aria-role="tabpanel" aria-hidden="true">
<h2>Log</h2>
<output>
<!-- Weight graph goes here -->
</output>
<details>
<summary class="under">
<time datetime="2012-10-12">12 Oct</time>,
<data class="calorie-balance under" value="-200">-200 kCal</data>
</summary>
<div class="log-entry plus">
<span class="food">Hamburger</span>
<data class="quantity" value="1">1</data>
<data class="calorie-count plus" value="500">500 kCal</data>
</div>
<div class="log-entry minus">
<span class="activity">Running</span>
<data class="calorie-count minus" value="-363">-363 kCal</data>
</div>
</details>
<details>
<summary class="under">
<time datetime="2012-10-11">11 Oct</time>,
<data class="calorie-balance over" value="153">+153 kCal</data>
</summary>
</details>
<details>
<summary class="equal">
<time datetime="2012-10-11">11 Oct</time>,
<data class="calorie-balance equal" value="8">+8 kCal</data>
</summary>
</details>
</section>
<section id="settings" aria-role="tabpanel" aria-hidden="true">
<h2>Settings</h2>
<label>Height (in cm):
<input type="number" name="height" placeholder="e.g. 172">
</label>
<label>Birth date:
<input type="date" name="dob" placeholder="e.g. 1987-03-09">
</label>
<label class="radio">
<input type="radio" name="gender" value="male" checked> Male
</label>
<label class="radio">
<input type="radio" name="gender" value="female"> Female
</label>
</section>
</div>
<div class="resources">
<!--
Exercise: Add another <audio> element here with id="tabSwitchSound"
This will be called every time the user changes tabs.
-->
<audio id="riseSound" preload="auto">
<source src="audio/rise.ogg" type="audio/ogg">
<source src="audio/rise.wav" type="audio/wave">
</audio>
<audio id="fallSound" preload="auto">
<source src="audio/fall.ogg" type="audio/ogg">
<source src="audio/fall.wav" type="audio/wave">
</audio>
<audio id='tabSwitchSound' preload="auto">
<source src="audio/fall.wav" type="audio/wave">
</audio>
</div>
</body>
</html>