-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathindex.html
581 lines (521 loc) · 16.2 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
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
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
<!doctype html>
<!--
,
, . ( ) -.\ |
| / .- |\ /| _ \'/
\'/ | \.-""-./ | \_) ;-'
`'-; (_/ ; \ , ; ) /
\ ( \ (.\/.) / .-. / |
\ \ \ \/\/ /-._.' \ | |
\ \ \ .. /_ \ | |
\ \ | |__) |\ \ | |
\ `"`|==|_ | \ \| |
\,-'|==| \ | \ |
\/ '. / `\ /
| | ` ,
| | )\
__.....__/ | / \
/` \ `//`
| \`-....-'\ `-.____.'/
| | / /`"-----'`
| | | |
| / | |
.------' \ / /
(((--------' \ |
| \
| |
| |
| /
/ )
jgs / |
(-(-(' ~2014 OKFocus, iNTERnET LEGENDz~
-->
<html>
<head>
<title>Pull My Picture!</title>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"/>
<meta name="keywords" content="okfocus,ok focus,ryder ripps,jules laplace,paul bouchon,digital agency,okfocus.com,internet legends"/>
<meta name="description" content="Random pictures free to steal!" />
<meta name="author" content="OKFocus" />
<meta property="og:title" content="Pull My Picture!"/>
<meta property="og:type" content="website"/>
<meta property="og:image" content="http://www.pullmypicture.com/img/apple-touch-icon-144x144.png" />
<meta property="og:url" content="http://pullmypicture.com"/>
<meta property="og:site_name" content="Pull My Picture!" />
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no"/>
<meta name="apple-mobile-web-app-status-bar-style" content="black">
<meta name="apple-mobile-web-app-capable" content="yes">
<link rel="apple-touch-icon-precomposed" sizes="57x57" href="http://www.pullmypicture.com/img/apple-touch-icon-57x57.png" />
<link rel="apple-touch-icon-precomposed" sizes="114x114" href="http://www.pullmypicture.com/img/apple-touch-icon-114x114.png" />
<link rel="apple-touch-icon-precomposed" sizes="72x72" href="http://www.pullmypicture.com/img/apple-touch-icon-72x72.png" />
<link rel="apple-touch-icon-precomposed" sizes="144x144" href="http://www.pullmypicture.com/img/apple-touch-icon-144x144.png" />
<link rel="apple-touch-icon-precomposed" sizes="60x60" href="http://www.pullmypicture.com/img/apple-touch-icon-60x60.png" />
<link rel="apple-touch-icon-precomposed" sizes="120x120" href="http://www.pullmypicture.com/img/apple-touch-icon-120x120.png" />
<link rel="apple-touch-icon-precomposed" sizes="76x76" href="http://www.pullmypicture.com/img/apple-touch-icon-76x76.png" />
<link rel="icon" type="image/png" href="http://www.pullmypicture.com/img/favicon-96x96.png" sizes="96x96" />
<link rel="icon" type="image/png" href="http://www.pullmypicture.com/img/favicon-32x32.png" sizes="32x32" />
<link rel="icon" type="image/png" href="http://www.pullmypicture.com/img/favicon-16x16.png" sizes="16x16" />
<link rel="icon" type="image/png" href="http://www.pullmypicture.com/img/favicon-128.png" sizes="128x128" />
<meta name="application-name" content="Pull My Picture!"/>
<meta name="msapplication-TileColor" content="#FFFFFF" />
<meta name="msapplication-TileImage" content="http://www.pullmypicture.com/img/mstile-144x144.png" />
<meta name="msapplication-square70x70logo" content="http://www.pullmypicture.com/img/mstile-70x70.png" />
<meta name="msapplication-square150x150logo" content="http://www.pullmypicture.com/img/mstile-150x150.png" />
<style>
*, *:before, *:after {
-moz-box-sizing: border-box; -webkit-box-sizing: border-box; box-sizing: border-box;
-webkit-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
-o-user-select: none;
user-select: none;
}
html,body{
width: 100%;
height: 100%;
margin: 0;
padding: 0;
font-family: sans-serif;
overflow:hidden;
}
#cursor {
position:absolute;
width:200px;
height:200px;
background:url(img/cursor.png)no-repeat top left;
z-index:5;
pointer-events:none;
}
body:active #cursor {
background:url(img/cursor2.png)no-repeat top left;
}
#photos {
width: 100%;
}
#photos div {
width: 100%;
height: 300px;
background-position: center;
}
#container {
position:absolute;
width:100%;
height:100%;
background-size:contain;
background-position:center;
-webkit-transition: -webkit-transform 0ms;
transform: translate3d(0,0,0) scale3d(1,1,1);
-o-transform: translate3d(0,0,0) scale3d(1,1,1);
-ms-transform: translate3d(0,0,0) scale3d(1,1,1);
-moz-transform: translate3d(0,0,0) scale3d(1,1,1);
-webkit-transform: translate3d(0,0,0) scale3d(1,1,1);
-webkit-backface-visibility: hidden;
cursor:none;
}
#container.pullrefresh-slideup,
#container.pullrefresh-loading {
-o-transition: -o-transform .3s;
-ms-transition: -ms-transform .3s;
-moz-transition: -moz-transform .3s;
-webkit-transition: -webkit-transform .3s;
}
#pullrefresh {
display: block;
overflow: hidden;
position: absolute;
top: -490px;
left: 0;
width: 100%;
height: 490px;
background: #ccc;
box-shadow: 0 -5px 20px #999 inset;
font-family:arial;
font-weight:bold;
}
#pullrefresh .message {
position: absolute;
left: 0;
bottom: 20px;
right: 0;
color: #777;
text-align: center;
text-shadow: 1px 1px 0 #dfdfdf;
font-weight: bold;
}
#pullrefresh .message span:after { content: "Pull to refresh..."; }
.pullrefresh-breakpoint #pullrefresh .message span:after { content: "Release to refresh..."; }
.pullrefresh-loading #pullrefresh .message span:after { content: "Loading new image..."; }
#pullrefresh .icon {
position: absolute;
left: 20px;
}
/* arrow icon */
#pullrefresh .icon.arrow {
background: url(img/arrow.png) no-repeat;
width: 71px;
height: 28px;
bottom: 10px;
transform: rotate(90deg);
transition: transform .3s;
-o-transform: rotate(90deg);
-o-transition: -o-transform .3s;
-ms-transform: rotate(90deg);
-ms-transition: -ms-transform .3s;
-moz-transform: rotate(90deg);
-moz-transition: -moz-transform .3s;
-webkit-transform: rotate(90deg);
-webkit-transition: -webkit-transform .3s;
-webkit-backface-visibility: hidden;
}
#pullrefresh .icon.arrow.arrow-up {
transform: rotate(-90deg);
-o-transform: rotate(-90deg);
-ms-transform: rotate(-90deg);
-moz-transform: rotate(-90deg);
-webkit-transform: rotate(-90deg);
}
/* spinner icon */
/* rotate spinner with css animation */
@keyframes rotate{ 0%{ transform: rotate(0deg); } 100%{ transform: rotate(360deg); } }
@-o-keyframes rotate{ 0%{ -o-transform: rotate(0deg); } 100%{ -o-transform: rotate(360deg); } }
@-ms-keyframes rotate{ 0%{ -ms-transform: rotate(0deg); } 100%{ -ms-transform: rotate(360deg); } }
@-moz-keyframes rotate{ 0%{ -moz-transform: rotate(0deg); } 100%{ -moz-transform: rotate(360deg); } }
@-webkit-keyframes rotate{ 0%{ -webkit-transform: rotate(0deg); } 100%{ -webkit-transform: rotate(360deg); } }
#pullrefresh .icon.loading {
background: url(img/spinner.png) no-repeat;
width: 19px;
height: 19px;
background-size: 100%;
bottom: 0;
animation: rotate 1s linear infinite;
-o-animation: rotate 1s linear infinite;
-ms-animation: rotate 1s linear infinite;
-moz-animation: rotate 1s linear infinite;
-webkit-animation: rotate 1s linear infinite;
}
#info {
position: absolute;
bottom: 40px;
font-size: 12px;
background: rgba(255,255,255,0.9);
width: 340px;
text-align: center;
padding: 10px;
left: 50%;
margin-left: -170px;
font-weight: 100;
border-radius: 3px;
}
.mobile #info {
bottom:0;
width:100%;
margin-left:0;
left:0;
border-radius:0;
}
.mobile #container {
background-size:contain;
background-repeat: no-repeat;
background-color: #f9f9f9;
background-position: 0px 20%;
}
.mobile #cursor {
display:none;
}
.imageLink {
width: 100%;
overflow: hidden;
text-overflow: ellipsis;
display: inline-block;
margin-bottom: 5px;
font-weight: bold;
}
a {
color:black;
}
</style>
<script>
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');
ga('create', 'UA-25748597-33', 'pullmypicture.com');
ga('send', 'pageview');
</script>
</head>
<body>
<div id="container">
<div id="pullrefresh">
<div class="message">
<div id="pullrefresh-icon" class="icon arrow arrow-down"></div>
<span></span>
</div>
</div>
</div>
<div id="info">
<a href="https://farm4.staticflickr.com/3919/14207612238_599b287046.jpg" target="_blank" class="imageLink"></a><br>
Pull this page down to get a random photo with a <a href="http://creativecommons.org/" target="_blank">Creative Commons</a> license, feel free to use these images in any capacity. Pull images, have a good time.<br><br>Site by <a href="http://okfoc.us">OKFocus</a>
</div>
<div id="cursor"></div>
</body>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js"></script>
<script src="hammer.js"></script>
<script src="modernizr.js"></script>
<script>
var is_iphone = (navigator.userAgent.match(/iPhone/i)) || (navigator.userAgent.match(/iPod/i)),
is_ipad = (navigator.userAgent.match(/iPad/i)),
is_android = (navigator.userAgent.match(/Android/i)),
is_mobile = is_iphone || is_ipad || is_android;
$("html").addClass(is_mobile ? "mobile" : "desktop");
function fetch () {
// var tags = "hand face bomb gun".split(" ")
var sorts = "interestingness-desc".split(" ")
var min_year = randrange(1980,2013)
var max_year = randrange(min_year,2014)
var req = $.ajax({
url: "https://api.flickr.com/services/rest/",
data: {
method: 'flickr.photos.search',
api_key: '04ecc5dbe4e4c54fe7986066071685e5',
// tags: choice(tags),
sort: rand(sorts),
license: "5,6,7",
min_taken_date: (min_year) + '-01-01 00:00:00',
max_taken_date: (max_year) + '-06-01 00:00:00',
page: rand(100),
media: 'photos',
format: 'json',
},
jsonp: "jsonFlickrApi",
dataType: "jsonp",
})
}
function rand(n){return Math.random()*n|0 }
function choice(a){ return a[rand(a.length)] }
function randrange(a,b){ return rand(b-a) + a }
function shuffle(a){
for (var i = a.length; i > 0; i--){
var r = rand(i)
var swap = a[i-1]
a[i-1] = a[r]
a[r] = swap
}
return a
}
var photos, started = false
function jsonFlickrApi (data){
var $photos = $("#photos")
photos = shuffle(data.photos.photo)
$("body,html").scrollTop(0)
if (! started) {
refresh.handler()
}
started = true
}
var count = 0
function next_image() {
var photo = photos.pop()
count++
if (photos.length < 5 || (count % 10) == 0) {
fetch()
}
return photo
}
function link_url (photo) {
return "https://www.flickr.com/photos/" + photo.owner + "/" + photo.id
}
function photo_url (photo) {
return[
"https://farm",
photo.farm,
".staticflickr.com/",
photo.server,
"/",
photo.id,
"_",
photo.secret,
"_b",
".jpg"
].join("")
}
/**
* pull to refresh
* @type {*}
*/
var PullToRefresh = (function() {
function Main(container, slidebox, slidebox_icon, handler) {
var self = this;
this.breakpoint = 80;
this.container = container;
this.slidebox = slidebox;
this.slidebox_icon = slidebox_icon;
this.handler = handler;
this._slidedown_height = 0;
this._anim = null;
this._dragged_down = false;
this.hammertime = Hammer(this.container)
.on("touch dragdown release", function(ev) {
self.handleHammer(ev);
});
}
Main.prototype.handleHammer = function(ev) {
var self = this;
switch(ev.type) {
// reset element on start
case 'touch':
this.hide();
break;
// on release we check how far we dragged
case 'release':
if(!this._dragged_down) {
return;
}
// cancel animation
cancelAnimationFrame(this._anim);
// over the breakpoint, trigger the callback
if(ev.gesture.deltaY >= this.breakpoint) {
container_el.className = 'pullrefresh-loading';
pullrefresh_icon_el.className = 'icon loading';
this.setHeight(60);
this.handler.call(this);
}
// just hide it
else {
pullrefresh_el.className = 'slideup';
container_el.className = 'pullrefresh-slideup';
this.hide();
}
break;
// when we dragdown
case 'dragdown':
// if we are not at the top move down
var scrollY = window.scrollY;
if(scrollY > 5) {
return;
} else if(scrollY !== 0) {
window.scrollTo(0,0);
}
this._dragged_down = true;
// no requestAnimationFrame instance is running, start one
if(!this._anim) {
this.updateHeight();
}
// stop browser scrolling
ev.gesture.preventDefault();
// update slidedown height
// it will be updated when requestAnimationFrame is called
this._slidedown_height = ev.gesture.deltaY * 0.4;
break;
}
};
/**
* when we set the height, we just change the container y
* @param {Number} height
*/
Main.prototype.setHeight = function(height) {
if(Modernizr.csstransforms3d) {
this.container.style.transform = 'translate3d(0,'+height+'px,0) ';
this.container.style.oTransform = 'translate3d(0,'+height+'px,0)';
this.container.style.msTransform = 'translate3d(0,'+height+'px,0)';
this.container.style.mozTransform = 'translate3d(0,'+height+'px,0)';
this.container.style.webkitTransform = 'translate3d(0,'+height+'px,0) scale3d(1,1,1)';
}
else if(Modernizr.csstransforms) {
this.container.style.transform = 'translate(0,'+height+'px) ';
this.container.style.oTransform = 'translate(0,'+height+'px)';
this.container.style.msTransform = 'translate(0,'+height+'px)';
this.container.style.mozTransform = 'translate(0,'+height+'px)';
this.container.style.webkitTransform = 'translate(0,'+height+'px)';
}
else {
this.container.style.top = height+"px";
}
};
/**
* hide the pullrefresh message and reset the vars
*/
Main.prototype.hide = function() {
container_el.className = '';
this._slidedown_height = 0;
this.setHeight(0);
cancelAnimationFrame(this._anim);
this._anim = null;
this._dragged_down = false;
};
/**
* hide the pullrefresh message and reset the vars
*/
Main.prototype.slideUp = function() {
var self = this;
cancelAnimationFrame(this._anim);
pullrefresh_el.className = 'slideup';
container_el.className = 'pullrefresh-slideup';
this.setHeight(0);
setTimeout(function() {
self.hide();
}, 500);
};
/**
* update the height of the slidedown message
*/
Main.prototype.updateHeight = function() {
var self = this;
this.setHeight(this._slidedown_height);
if(this._slidedown_height >= this.breakpoint){
this.slidebox.className = 'breakpoint';
this.slidebox_icon.className = 'icon arrow arrow-up';
}
else {
this.slidebox.className = '';
this.slidebox_icon.className = 'icon arrow';
}
this._anim = requestAnimationFrame(function() {
self.updateHeight();
});
};
return Main;
})();
function getEl(id) {
return document.getElementById(id);
}
var container_el = getEl('container');
var pullrefresh_el = getEl('pullrefresh');
var pullrefresh_icon_el = getEl('pullrefresh-icon');
var image_el = getEl('random-image');
var refresh = new PullToRefresh(container_el, pullrefresh_el, pullrefresh_icon_el);
// update image onrefresh
refresh.handler = function() {
if (! photos.length) {
self.slideUp();
return
}
var self = this;
var photo = next_image()
var preload = new Image();
preload.onload = function() {
$("#container").css("background-image", "url(" + preload.src + ")");
$(".imageLink").attr("href", link_url(photo)).html(link_url(photo))
self.slideUp();
};
preload.src = photo_url(photo)
if (preload.complete) {
preload.onload()
}
}
$(document).on('mousemove', function(e){
$('#cursor').css({
left: e.pageX - 50,
top: e.pageY - 50
});
$( "#info" ).mouseenter(function() {
$( cursor ).hide();
});
$( "#info" ).mouseleave(function() {
$( cursor ).show();
});
});
fetch()
</script>
<img src="cursor2.png" style="position:fixed;opacity:0;left:-40000000%;top:-100000%">
</html>