-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.php
96 lines (81 loc) · 2.2 KB
/
index.php
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
<html>
<head>
<!-- Latest compiled and minified CSS -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.1/css/bootstrap.min.css">
<!-- Optional theme -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.1/css/bootstrap-theme.min.css">
<!-- Latest compiled and minified JavaScript -->
<script src="https://code.jquery.com/jquery-2.1.1.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.1/js/bootstrap.min.js"></script>
</head>
<body style="background-color: #000000; overflow-y: hidden;">
<div class="container-fluid">
<!--Append images through script-->
</div>
<script>
var images = [];
$(document).ready(function(){
getImages();
});
function addImage(obj)
{
var html = "";
html += "<div class='col-md-3'>";
html += "<img name='"+obj.id+"' src='"+obj.src+"' style='padding-bottom: 15px; width: 100%;'/>";
html += "<div style='position: relative; top: -32px; background-color: #000000; opacity: 0.75; color: #FFFFFF;'>@"+obj.username+' ('+obj.fullname+')'+"</div>";
html += "</div>";
$(".container-fluid").prepend(html);
}
function getImages()
{
$.ajax({
type: "POST",
url: "getImages.php",
data: {tag:"<?php echo $_GET['tag'] ?>"}
})
.done(function(data){
//console.log(JSON.parse(data));
var obj = JSON.parse(data);
for(var i = 0; i<obj.length; i++)
{
var exists = false;
for(var j = 0; j<images.length; j++)
{
if(obj[i].src == images[j].src)
{
exists = true;
break;
}
}
if(exists) continue;
images.push(obj[i]);
addImage(obj[i]);
}
setTimeout(pageScroll, 500);
$(".container-fluid").animate({
opacity: 1,
}, 2000);
});
}
var scroll = 0;
function pageScroll() {
$(document).scrollTop($(document).scrollTop()+1);
var newScroll = $(document).scrollTop();
if(newScroll == scroll && scroll != 0)
{
$( ".container-fluid" ).animate({
opacity: 0,
}, 2000, function() {
$(document).scrollTop(0);
getImages();
});
}
else
{
scroll = newScroll;
scrolldelay = setTimeout('pageScroll()',20);
}
}
</script>
</body>
</html>