-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathfeeeetch.html
More file actions
268 lines (242 loc) · 7.26 KB
/
feeeetch.html
File metadata and controls
268 lines (242 loc) · 7.26 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
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
<html>
<head>
<title>FlipTube</title>
<style>
/* Avoid resource latency for these, since they hide unenhanced content */
.yui3-js-enabled .yui3-scrollview-loading {
visibility:hidden;
}
#additional-content {
display:none;
}
</style>
<link rel="stylesheet" href="http://yui.yahooapis.com/3.6.0/build/cssreset/cssreset-min.css" type="text/css" charset="utf-8">
<link rel="stylesheet" href="http://yuilibrary.com/yui/docs/assets/scrollview/horizontal.css" type="text/css" charset="utf-8">
<link rel="stylesheet" href="http://yui.yahooapis.com/3.6.0/build/cssgrids/cssgrids.css" type="text/css">
<script src="http://yui.yahooapis.com/3.6.0/build/yui/yui-min.js"></script>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js" >
</script>
<script type="text/javascript">
YUI().use('node','event-hover','anim',function(Y) {
Y.one('#search').on('focus',function() {
var boxAnim = new Y.Anim({
node:'#search',
to : {
width:400
},
easing:'elasticOut'
});
boxAnim.run();
});
Y.one('#search').on('hover',function over() {
var boxAnim = new Y.Anim({
node:'#search',
to : {
width:400
},
easing:'elasticBoth'
});
boxAnim.run();
Y.one("#search").focus();
});
Y.one("#search").on("blur",function() {
var boxAnim = new Y.Anim({
node:'#search',
to : {
width:200
},
easing:'elasticBoth'
});
boxAnim.run();
});
});
</script>
<style type="text/css">
body{}
#search{position:absolute;right:14%;border:1px solid gray;width:200px;height:35px;border:none;border-bottom:1px solid gray;top:4%;padding-left:8px;padding-right:8px;
}
#search:focus{
width:400px;border:none;border-bottom:1px solid gray;
box-shadow: 0 0 1em #00ffe4;
}
#head{width:100%;height:13%;background:url('1.png');}
#query{cursor:pointer;position:absolute;right:10%;top:2%;}
#naam{position:absolute;left:7%;top:1%;width:150px;}
#top{background:red;position:absolute;top:0%;}
#container{position:absolute;left:28%;top:22%;width:640px;height:360px;border:1px solid gray;}
#scrollview-prev{cursor:pointer;position:absolute;top:50%;left:4%;}
#scrollview-next{cursor:pointer;position:absolute;top:50%;right:4%;}
#footer{position:absolute;bottom:0%;left:0%;height:5%;;font-size:70%;color:white;background:url('1.png');width:100%;font-family:"Rockwell";}
#copy{position:absolute;right:2%;}
#quote{position:absolute;left:2%;}
</style>
<script>
YUI().use('node','event-move',function(Y) {
var diff;
var minimum=-50;
Y.one('#results').on('gesturemovestart', function(e) {
//alert(e.pageY);
//Y.one('#test').setHTML(e.pageY);
diff=e.pageX;
//this.once("selectstart",function(e){e.preventDefault();});
});
Y.one('#results').on('gesturemoveend', function(e) {
diff=e.pageX-diff;
if(diff<minimum)
next();
else if(diff>Math.abs(minimum))
previous();
});
});
</script>
<script type="text/javascript" charset="utf-8">
YUI().use('scrollview', 'scrollview-paginator', function(Y) {
var scrollView = new Y.ScrollView({
id: "scrollview",
srcNode : '#scrollview-content',
width : '640px',
flick: {
minDistance:10,
minVelocity:0.3,
axis: "x"
}
});
scrollView.plug(Y.Plugin.ScrollViewPaginator, {
selector: 'li'
});
scrollView.render();
var content = scrollView.get("contentBox");
content.delegate("click", function(e) {
// For mouse based devices, we need to make sure the click isn't fired
// at the end of a drag/flick. We use 2 as an arbitrary threshold.
if (Math.abs(scrollView.lastScrolledAmt) < 2) {
//alert(e.currentTarget.getAttribute("alt"));
}
}, "embed");
// Prevent default image drag behavior
content.delegate("mousedown", function(e) {
//e.preventDefault();
}, "embed");
Y.one('#scrollview-prev').on('click', function(e){previous();});
Y.one('#scrollview-next').on('click', function(e){next();});
});
</script>
<script type="text/javascript">
var urls = new Array();
var player = new Array();
var current_loaded = -1;
var total_loaded;
function translate()
{
$('#scrollview-content').css('-webkit-transition', 'all 1s ease-out');
$('#scrollview-content').css('-webkit-transform', 'translateX(-'+current_loaded*640+'px)');
}
function search()
{
$('#results').html("");
var query = $('#search').val();
//var query = 'select files.file.content from youtube.search where query="louis ck" and files.file.type="application/x-shockwave-flash" limit 10';
//var url = "http://query.yahooapis.com/v1/public/yql?q="+encodeURIComponent(query)+"&format=json";
//FIXME
var url = "http://query.yahooapis.com/v1/public/yql?q=select%20files.file.content%20from%20youtube.search%20where%20query%3D%22"+encodeURIComponent(query)+"%22%20and%20files.file.type%3D%22application%2Fx-shockwave-flash%22%20limit%2010&format=json&diagnostics=true&env=store%3A%2F%2Fdatatables.org%2Falltableswithkeys";
$.ajax({
url:url}).
done(function(data){
$.each(data.query.results.video, function(index, url){
console.log(index + " " + url);
urls[index] = url.files.file;
});
console.log(urls);
createDivs(urls);
current_loaded=0;
player=new Array();
checkLoaded(current_loaded);
total_loaded=10;
});
}
function createDivs(urls)
{
$.each(urls,function(index,url){
$('#results').append('<li width="640px" height="360px" class="playerdiv" id="player_'+index+'"></li>');
});
}
function checkLoaded(index)
{
if($('#player_'+index).html() === "")
{
embedPlayer(urls[index], index);
}
else
{
play(index);
}
}
function embedPlayer(url, index)
{
$('#player_'+index).append('<embed style="z-index:0;" class="playerid" width="640px" height="360px" allowfullscreen="false" allowscriptaccess="always" quality="high" bgcolor="#000000" controls=0 name="playerid" src="'+url+'&enablejsapi=1" type="application/x-shockwave-flash">');
}
//YT JS API functions
function onYouTubePlayerReady(playerId) {
//alert("player ready");
player[current_loaded]=$("#player_"+current_loaded+" > .playerid")[0];
play(current_loaded);
}
function pause(index)
{
player[index].pauseVideo();
}
function play(index)
{
player[index].playVideo();
}
function next()
{
if(current_loaded<total_loaded)
{
pause(current_loaded);
current_loaded+=1;
checkLoaded(current_loaded);
translate();
}
}
function previous()
{
if(current_loaded>0)
{
pause(current_loaded);
current_loaded-=1;
checkLoaded(current_loaded);
translate();
}
}
</script>
</head>
<body>
<div id="head">
<img src="logo.png" id="naam"/>
<div id="sCont">
<input type="text" placeholder="Enter keywords" id="search"/><div id="query" ><a href="javascript:search();" accesskey="enter"><img src="toolbar_find.png" /></a></div>
</div>
</div>
<div class="yui3-g">
<div class="yui3-u-1-4">
</div>
<div class="yui3-u-1-2" style="margin-top:5%">
<center>
<div id="scrollview-content" class="yui3-scrollview-loading">
<ul id="results">
</ul>
</div>
</center>
<div id="scrollview-pager">
<div id="scrollview-prev"><img src="glyphicons_171_fast_backward.png"/></div>
<div id="scrollview-next"><img src="glyphicons_177_fast_forward.png"/></div>
</div>
</div>
</div>
<br/>
<div id="footer">
<span style="position:absolute;left:2%;bottom:30%;"><b>Random Footer Quote to be filled</b></span><span style="position:absolute;right:2%;bottom:30%;"><b>Apocalypse 2012</b></span>
</div>
<br/>
</html>