-
Notifications
You must be signed in to change notification settings - Fork 0
/
subjects.html
329 lines (262 loc) · 6.84 KB
/
subjects.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
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
<!doctype html>
<html class="no-js" lang="en">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Tutorify</title>
<link rel="stylesheet" href="css/foundation.css" />
<script src="js/vendor/modernizr.js"></script>
<link href='http://fonts.googleapis.com/css?family=Open+Sans:400,300' rel='stylesheet' type='text/css'>
<link rel="stylesheet" href="css/foundation.min.css" />
<script src="js/vendor/modernizr.js"></script>
<link href="css/style.css" rel="stylesheet" />
<link href="css/flaticon.css" rel="stylesheet" />
<link rel="stylesheet" href="font-awesome/css/font-awesome.min.css">
<style>
.result{
width: 95%;
height: 200px;
background-color: #f5f5f5;
margin: 0 auto;
}
.result-image{
margin-left: 25px;
margin-top: 25px;
width: 150px;
height: 150px;
float: left;
}
.result-info{
/*background-color: blue;*/
height: 90%;
width: 75%;
/*float: right;*/
margin: 0 auto;
text-align: center;
/*color: yellow;*/
}
.learn-more{
height: 50px;
width: 50px;
float: right;
background-color: blue;
}
.box{
list-style-type: none;
width: 100px !important;
/*height: 500px;*/
margin: 0 auto;
/*border: 1px solid black;*/
}
ul{
margin-bottom: 0px !important;
margin-left: 0px !important;
}
.element{
list-style-type: none;
width: 300px !important;
background-color: 00000a;
text-align: center;
/*line-height: 20px;*/
/*height:50px !important;*/
/*width:100px;*/
/*border: 1px solid black;*/
list-style-position: inside;
/* padding: 5px;
padding: -top: 5px;
padding-bottom: 5px;
*/ margin: 0 auto;
text-align: center;
height: 35px;
/*border-bottom: 1px solid black;*/
}
li+li {
border-top: 1px solid #000000;
}
.known{
background-color: #19B5FE;
}
.element:active{
background-color: #424242;
}
.back{
/*border: 1px solid black;*/
width: 25%;
float: left;
margin: 0 auto;
padding: 0;
/*height: 100px;*/
/*background-color: 00000;*/
}
.subject{
width: 45%;
/*height: 100%;*/
/*float: right;*/
margin: 0 auto;
background-color: 00000;
font-weight: bold;
line-height: 18px;
color: #F64747;
}
</style>
</head>
<body>
<nav class="top-bar" data-topbar role="navigation">
<ul class="title-area">
<li class="name">
<h1><a href="index.html">Tutorify</a></h1>
</li>
<!-- Remove the class "menu-icon" to get rid of menu icon. Take out "Menu" to just have icon alone -->
<li class="toggle-topbar menu-icon"><a href="#"><span>Menu</span></a></li>
</ul>
<section class="top-bar-section">
<!-- Right Nav Section -->
<ul class="right">
<li ><a href="index.html">Home</a></li>
<li ><a href="index.html">My Profile</a></li>
</ul>
</li>
<ul class="right">
<!-- <li><a href="signup.html">Sign Up</a></li> -->
<li><a href="#">Log Out</a></li>
</ul>
</ul>
</section>
</nav>
<h2> Choose subjects you would like to teach: </h2>
<br/><br/>
<div class="row">
<ul id="box" class="">
<li class="element">
<div class="back" id="back"> Back</div>
<div class="subject">Math</div>
</li>
<li class="element" id="1">1</li>
<li class="element" id="2">2</li>
<li class="element" id="3">3</li>
<li class="element" id="4">4</li>
</ul>
</div>
<script src="js/vendor/jquery.js"></script>
<script src="js/foundation.min.js"></script>
<script>
$(document).foundation();
</script>
<script type="text/javascript">
var categories = ["Math", "Lit", "Science", "History"];
var topics = [
["algebra", "pre_calc", "calc"],
["lit_1", "lit_2", "lit_3"],
["bio", "ap_bio", "chem", "ap_chem", "phys", "phys_h", "ap_phys"],
["world_history", "us_history", "apush", "us_gov", "ap_gov"]
];
var topicsKnown = ["abc"];
var showingCats = true;
$(document).ready(function() {
loadCategories();
$(".back").click(function(){
loadCategories();
});
$("#box").click(function(e){
// alert(e.target.id + " " + showingCats);
if(e.target.id == "back")
{
loadCategories();
}
else if(showingCats)
{
loadTopic(e.target.id);
}
else
{
// if e.target.id is in the array, delete it from the array, else push it into the array
var found = false;
var j;
for(j = 0; j < topicsKnown.length; j++)
{
// console.log("184 " + topicsKnown[j] + " " + topics[idNum][i]);
if(topicsKnown[j] === e.target.id)
{
found = true;
break;
}
}
if(!found)
topicsKnown.push(e.target.id);
else
topicsKnown[j] = "";
$("#" + e.target.id).toggleClass('known');
// console.log($(this).attr("class").indexOf("known"));
}
});
});
function printTK(){
for(var i = 0; i < topicsKnown.length; i++)
{
console.log(topicsKnown[i]);
}
}
function loadCategories(){
showingCats = true;
var htmlText = "";
for(var i = 0; i < categories.length; i++)
{
htmlText += "<li class=\"element\" id=\"" + categories[i] + "\">" + categories[i] + "</li>";
}
$("#box").html(htmlText);
$("#box").removeClass().addClass("categories");
}
function loadTopic(idNum){
showingCats = false;
var idNum = categories.indexOf(idNum);
var htmlText = "<li class=\"element\"><div class=\"back\" id=\"back\"><--- Back</div>" +
" <div class=\"subject\">" + categories[idNum] + "</div></li>";
for(var i = 0; i < topics[idNum].length; i++)
{
var found = false;
for(var j = 0; j < topicsKnown.length; j++)
{
if(topicsKnown[j] === topics[idNum][i])
{
found = true;
j = topicsKnown.length;
}
}
if(!found)
htmlText += "<li class=\"element\" id=\"" + topics[idNum][i] + "\">" + topics[idNum][i] + "</li>";
else
htmlText += "<li class=\"element known\" id=\"" + topics[idNum][i] + "\">" + topics[idNum][i] + "</li>";
}
$("#box").html(htmlText);
$("#box").removeClass().addClass("topics");
}
</script>
<div style="float: center; text-align:center;margin: 0 auto;">
<br/>
<a href="#" class="button" >Done</a>
</div>
<br> <br><br>
</div>
<a class="close-reveal-modal">×</a>
</div>
<script src="js/vendor/jquery.js"></script>
<script src="js/foundation.min.js"></script>
<script>
$(document).foundation();
</script>
</body>
<footer class="footer">
<div class="row">
<div class="small-12 columns">
<p class="slogan">Learning and Earning at the Tap of a Button</p>
<p class="links">
<a href="#">Home</a>
<a href="#features">Features</a>
<a href="about.">About</a>
<a href="contact.">Contact</a>
</p>
<p class="copywrite">Copywrite © 2015 Tutorify</p>
</div>
</div>
</footer>
</html>