f0ckv1/s/index.tpl.html

45 lines
1.6 KiB
HTML
Raw Normal View History

<!DOCTYPE blah>
<html>
<head>
<title>f0ck me!</title>
<link rel="icon" type="image/gif" href="./s/favicon.gif" />
2016-08-30 12:26:57 +00:00
<link rel="stylesheet" type="text/css" href="./s/style.css">
</head>
<body>
<div class="navbar"><a href="/">f0ck.me</a> | <a href="/how">how to</a> | <a href="/contact">Contact</a></div><br />
2016-08-30 12:26:57 +00:00
<div class="body">
<div id="posts" data-last="{{ last }}">
{% for item in items %}
<a href="./{{ item.id }}" title="{{ item.mime }}"><img class="thumb" src="//f0ck.me/t/{{ item.id }}.png" /></a>
{% endfor %}
2016-08-17 22:08:33 +00:00
</div>
2016-08-30 12:26:57 +00:00
<div class="clear"></div>
2016-08-17 22:08:33 +00:00
</div>
2016-08-30 12:26:57 +00:00
<div style="position: fixed; top:0;right:0" id="debug"></div>
<script src="./s/jquery-3.1.0.min.js"></script>
<script>
var scrollListener = function () {
$(window).one("scroll", function () {
if($(window).scrollTop() + 256 >= $(document).height() - $(window).height()) {
$.ajax({
url: './api/p/'+$('#posts').data('last'),
dataType: 'json',
success: function(msg) {
var html = "";
for(var i = 0; i < msg.items.length; i++)
if(msg.items[i].id)
html += "<a href=\"./"+msg.items[i].id+"\" title=\""+msg.items[i].mime+"\"><img class=\"thumb\" src=\"//f0ck.me/t/"+msg.items[i].id+".png\" /></a>\n";
$('#posts').append(html);
$('#posts').data('last', msg.last);
}
});
}
setTimeout(scrollListener, 50);
});
};
$(document).ready(function () {
scrollListener();
});
</script>
2016-08-17 18:34:53 +00:00
</body>
2016-08-30 12:26:57 +00:00
</html>