mirror of
https://github.com/reality/dbot.git
synced 2024-12-25 04:02:39 +01:00
Improved HCI
This commit is contained in:
parent
669623b7cd
commit
af1e357df4
15
public/imgurr.css
Normal file
15
public/imgurr.css
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
html, body { margin: 0; padding: 0; height: 100%; }
|
||||||
|
#container, #image {
|
||||||
|
margin: 0; padding: 0;
|
||||||
|
max-height: 100%;
|
||||||
|
}
|
||||||
|
#container { text-align: center; }
|
||||||
|
#loading {
|
||||||
|
background: rgba(255, 0, 0, 0.8);
|
||||||
|
display: none;
|
||||||
|
position: absolute;
|
||||||
|
top: 50px;
|
||||||
|
left: 30px;
|
||||||
|
padding: 10px;
|
||||||
|
color: #EFEFEF;
|
||||||
|
}
|
@ -3,13 +3,17 @@ html(lang='en')
|
|||||||
head
|
head
|
||||||
meta(charset='utf-8')
|
meta(charset='utf-8')
|
||||||
script(type="text/javascript", src="//ajax.googleapis.com/ajax/libs/jquery/1.9.0/jquery.min.js")
|
script(type="text/javascript", src="//ajax.googleapis.com/ajax/libs/jquery/1.9.0/jquery.min.js")
|
||||||
|
link(rel="stylesheet", href="/imgurr.css")
|
||||||
title random imgur
|
title random imgur
|
||||||
script
|
script
|
||||||
function wat() {
|
function wat() {
|
||||||
|
$('#loading').show();
|
||||||
|
$('#image').load(function(){$('#loading').hide(); console.log('loaded')});
|
||||||
$.get("/api/imgur/getRandomImage", function(d) {$('#image').attr('src', d.data[0])}, "json");
|
$.get("/api/imgur/getRandomImage", function(d) {$('#image').attr('src', d.data[0])}, "json");
|
||||||
};
|
};
|
||||||
$(wat());
|
$(wat());
|
||||||
$(document).keypress(wat);
|
$(document).on('keydown', function(e){(e.which==32)&&(wat()) });
|
||||||
body
|
body
|
||||||
|
div#loading Loading Image
|
||||||
div#container
|
div#container
|
||||||
img#image(style='width: 100%')
|
img#image
|
||||||
|
Loading…
Reference in New Issue
Block a user