-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
100 lines (82 loc) · 3.51 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
<head>
<title>Maid Spin</title>
<link rel="icon" type="image/png" href="/files/favicon.png"/>
<meta http-equiv="content-type" content="charset=utf-8"/>
<meta name="description" content="iklone's Anime & Manga Blog">
<meta name="keywords" content="anime, manga, blog, maid, meido, mecha">
<meta name="author" content="iklone">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link href="https://fonts.googleapis.com/css?family=PT+Sans" rel="stylesheet">
<link rel="stylesheet" type="text/css" href="/css/main.css">
<link rel="stylesheet" type="text/css" href="/css/heaven.css">
<script>
maria = ["dance", "disgust", "glasses", "gong", "languages", "neko", "okay", "phone", "romance", "scold", "sing", "snooker"];
postNum = 0;
function addPost(id, title, img) {
//create image
newImage = document.createElement("img");
newImage.setAttribute("src", img);
//creat read more text
newReadMore = document.createElement("div");
newReadMore.setAttribute("class", "postReadMore");
newReadMore.innerText = "Click to Read Post";
//create image container div
newImageContainer = document.createElement("div");
newImageContainer.setAttribute("class", "postImageContainer");
newImageContainer.appendChild(newImage);
newImageContainer.appendChild(newReadMore);
//create title
newTitle = document.createElement("div");
newTitle.setAttribute("class", "postTitle");
newTitle.innerText = title;
//create post div
newPost = document.createElement("div");
newPost.setAttribute("class", "post");
newPost.setAttribute("onclick", 'window.location.href = "/post/' + id + '";');
newPost.setAttribute("title", "/post/" + id);
newPost.appendChild(newImageContainer);
newPost.appendChild(newTitle);
//add to post list
postList = document.getElementById("postList");
postList.appendChild(newPost);
postNum++;
}
function addPostBatch(num) {
//live code
var xhttp;
xhttp = new XMLHttpRequest();
xhttp.onreadystatechange = function() {
if (this.readyState == 4 && this.status == 200) {
console.log(this.responseText);
if (this.responseText == "") { //no more posts so hide extend button
document.getElementById("extendList").setAttribute("style", "display: none;");
} else { // evaluate response
eval(this.responseText);
}
}
};
xhttp.open("GET", "/php/getPost.php?start=" + postNum + "&num=" + num, true);
xhttp.send();
}
</script>
<script src="/js/pageLoader.js"></script>
</head>
<body>
<div id="headerLoad"></div>
<div id="body">
<div class="box" id="left"></div>
<div class="box" id="centre">
<div class="block">
<h3>Recent Posts</h3>
<div id="postList"></div>
<div id="extendList" onclick='addPostBatch(6);'>Load More ▼</div>
</div>
</div>
<div class="box" id="right"></div>
</div>
<div id="footerLoad"></div>
<script>
loadParts();
addPostBatch(6);
</script>
</body>