2013-04-15 02:10:29 +01:00
|
|
|
!!! 5
|
|
|
|
html(lang='en')
|
|
|
|
head
|
|
|
|
meta(charset='utf-8')
|
|
|
|
script(type="text/javascript", src="//ajax.googleapis.com/ajax/libs/jquery/1.9.0/jquery.min.js")
|
2013-04-15 02:50:50 +01:00
|
|
|
link(rel="stylesheet", href="/imgurr.css")
|
2013-04-15 02:10:29 +01:00
|
|
|
title random imgur
|
|
|
|
script
|
2013-04-15 21:55:50 +00:00
|
|
|
var count = 0;
|
2013-04-16 16:42:57 +00:00
|
|
|
function getNewImage() {
|
2013-04-15 21:55:50 +00:00
|
|
|
count += 1;
|
2013-04-16 16:42:57 +00:00
|
|
|
$('#loading').text('Loading image ' + count + '...');
|
2013-04-16 17:22:09 +00:00
|
|
|
$('#loading').css('font-size', ((count * 0.03) + 12));
|
2013-04-16 16:42:57 +00:00
|
|
|
$('#image').load(function(){});
|
|
|
|
$.get("/api/imgur/getRandomImage", function(d) {
|
|
|
|
$('#image').attr('src', d.data[0]);
|
|
|
|
$.get("/api/imgur/getImageInfoString", { 'slug': d.data[1] }, function(info) {
|
|
|
|
$("#loading").text(count + ': ' + info.data[0]);
|
|
|
|
}, "json");
|
|
|
|
}, "json");
|
|
|
|
}
|
|
|
|
$(getNewImage());
|
|
|
|
$(document).on('keydown', function(e){(e.which==32)&&(getNewImage()) });
|
2013-04-15 02:10:29 +01:00
|
|
|
body
|
2013-04-15 02:50:50 +01:00
|
|
|
div#loading Loading Image
|
2013-04-15 02:10:29 +01:00
|
|
|
div#container
|
2013-04-15 02:50:50 +01:00
|
|
|
img#image
|