-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathsearch4.html
168 lines (150 loc) · 5.89 KB
/
search4.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
<!DOCTYPE html>
<html lang="en">
<head>
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script>
<meta charset="utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
<title>eatHarmony</title>
<link rel="stylesheet" type="text/css" href="style.css">
<link rel="icon" type="image/png" href="http://eatharmony.gdhacks.com/images/eHarmonyfavicon.png">
<script src="superslides/dist/jquery.superslides.js" type="text/javascript"></script>
<script type='text/javascript'>
<!-- document.getElementById(skdjgh 'hostname' ).innerText = window.location.hostname; -->
$("form").ready(function(){
$("form").keypress(function(e) {
if(e.which == 13) {
e.preventDefault();
var ingreds = $("#search").val();
var ingredients = ingreds.split(',');
var url = parse(ingredients);
$(".wrap").animate({'margin-top': '0'}, 2000);
$(".logo").animate({'height':'50px','width':'80%','padding-top':'20px','padding-bottom':'0px'}, 1000);
$(".bottomBar").animate({'padding-bottom':'0px'},2000);
$("#slides").slideDown();
$("h4").fadeOut();
document.getElementById(titles[0]).innerHTML="CHIKHUN";
document.getElementById(images[0]).src = "http://upload.wikimedia.org/wikipedia/commons/5/57/Chicken_-_melbourne_show_2005.jpg";
$(function() {
$("#i1").width(200);
});
document.getElementById(ingred[0]).innerHTML="chicken, more chicken, chicken stock, chicken bone";
/*$("form").animate({top: $(document).height()/2}, 2000);*/
}
});
});
var titles = new Array("r1","r2","r3","r4","r5","r6");
var images = new Array("i1","i2","i3","i4","i5","i6")
var ingred = new Array("recipe1","recipe2","recipe3","recipe4","recipe5","recipe6")
function displayRecipes(recipeArray)
{
for (var i = 0; i < 6; i++)
{
$(titles[i]).text($(this).data(recipeArray[i].recipeName));
var ing = recipeArray[i].ingredients;
var text = ""
for (var j = 0; j < ing.length; j++)
{
text = text + ing[j] + ", "
}
$(ingred[i]).text($(this).data(text));
}
}
function parse(ingred)
{
var api = 'http://api.yummly.com/v1/api/recipes?_app_id=3738dde6&_app_key=c9d9a3b2b8bf4d47d5c23b3864fc3cf7&allowedIngredient[]='
for (var i = 0; i < ingred.length-1; i++)
{
var rec = ingred[i].trimLeft();
rec = rec.trimRight();
api = api + rec + '&allowedIngredient[]='
}
rec = ingred[ingred.length-1].trimLeft();
rec = rec.trimRight();
api = api + rec
return api
}
$(function() {
$("#slides").superslides({
hashchange: true,
animation_speed: 'slow' , pagination:false
});
});
</script>
</head>
<body>
<div class="wrap text-center">
<div class = "logo">
<a href="http://eatharmony.gdhacks.com/searchtest.html"><img src="images/EatHarmonyLogo.png" alt=""></a>
</div>
<h4 >
Are your single ingredients ready to mingle?
</h4>
<div id="slides">
<div class="slides-container">
<!--<div class="resultContainer">
<div class="resultDiv">-->
<div id="f1_container">
<div id="f1_card" class="shadow">
<div class="front face">
blahhh
</div>
<div class="back face center">
helllooo <span id = "r1"></span><br />
<img id = "i1"><br />
<span id = "recipe1"></span><br />
</div>
</div>
</div>
</div>
<div class="resultDiv">
<span id = "r2"></span><br />
<img id = "i2"></span><br />
<span id = "recipe2"></span><br /><br /><br /><br /><br /><br /><br /><br /><br />
<br /><br /><br /><br /><br /><br /><br /><br /><br />
</div>
<div class="resultDiv">
<span id = "r3"></span><br />
<img id = "i3"></span><br />
<span id = "recipe3"></span><br /><br /><br /><br /><br /><br /><br /><br /><br />
<br /><br /><br /><br /><br /><br /><br /><br /><br />
</div>
</div>
<div class="resultContainer">
<div class="resultDiv">
<span id = "r4"></span><br />
<img id = "i4"></span><br />
<span id = "recipe4"></span><br /><br /><br /><br /><br /><br /><br /><br /><br />
<br /><br /><br /><br /><br /><br /><br /><br /><br />
</div>
<div class="resultDiv">
<span id = "r5"></span><br />
<img id = "i5"></span><br />
<span id = "recipe5"></span><br /><br /><br /><br /><br /><br /><br /><br /><br />
<br /><br /><br /><br /><br /><br /><br /><br /><br />
</div>
<div class="resultDiv">
<span id = "r6">
<img id = "i6"></span><br />
<span id = "r6"></span><br />
<span id = "recipe6"></span><br /><br /><br /><br /><br /><br /><br /><br /><br />
<br /><br /><br /><br /><br /><br /><br /><br /><br />
</div>
</div>
<nav class="slides-navigation">
<a href="#" class="next">
>
</a>
<a href="#" class="prev">
<
</a>
</nav>
</div>
</div>
<div id="bottomBar">
<hr>
<form>
<span><input type="text" id = "search" class="search rounded" placeholder="e.g. bananas, spinach,..."></span>
</form>
</div>
</body>
</html>