Merge branch 'master' into hendrik-testing
This commit is contained in:
BIN
website/public/external/nietslecht_button.png
vendored
Normal file
BIN
website/public/external/nietslecht_button.png
vendored
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 61 KiB |
76
website/public/js/masonry.js
Normal file
76
website/public/js/masonry.js
Normal file
@@ -0,0 +1,76 @@
|
||||
margin = 20;
|
||||
|
||||
$(window).on("load", function() {
|
||||
console.log("LOADED");
|
||||
container = $("div.posts");
|
||||
posts = container.children();
|
||||
posts.remove();
|
||||
|
||||
column = $('<div class="column"></div>').append(posts);
|
||||
container.append(column);
|
||||
|
||||
mansonry();
|
||||
mansonry();
|
||||
});
|
||||
|
||||
$(window).resize(function() {
|
||||
clearTimeout(window.resizedFinished);
|
||||
window.resizeFinished = setTimeout(function() {
|
||||
mansonry();
|
||||
}, 250);
|
||||
});
|
||||
|
||||
function mansonry() {
|
||||
|
||||
columnCount = Math.floor($(".posts").width() / 250);
|
||||
console.log("columns: " + columnCount);
|
||||
|
||||
/*
|
||||
* Initialise columns.
|
||||
*/
|
||||
var columns = new Array(columnCount);
|
||||
for (i = 0; i < columnCount; i++) {
|
||||
columns[i] = [0, []];
|
||||
console.log(columns[i]);
|
||||
}
|
||||
|
||||
/*
|
||||
* Function will find the column with the shortest height.
|
||||
*/
|
||||
function getShortestColumn(columns) {
|
||||
column = columns[0];
|
||||
|
||||
for (i = 1; i < columnCount; i++) {
|
||||
if (column[0] > columns[i][0]) {
|
||||
column = columns[i];
|
||||
}
|
||||
}
|
||||
|
||||
return column;
|
||||
}
|
||||
|
||||
/*
|
||||
* Rearange the objects.
|
||||
*/
|
||||
j = 0;
|
||||
posts.each(function(i) {
|
||||
post = posts[i];
|
||||
shortestColumn = getShortestColumn(columns);
|
||||
shortestColumn[0] = shortestColumn[0] + $(post).height() + margin;
|
||||
shortestColumn[1].push(post);
|
||||
|
||||
});
|
||||
|
||||
container.children().remove();
|
||||
/*
|
||||
* Display the objects again in the correct order.
|
||||
*/
|
||||
for (i = 0; i < columnCount; i++) {
|
||||
column = $('<div class="column"></div>').append(columns[i][1]);
|
||||
console.log(column);
|
||||
container.append(column);
|
||||
|
||||
}
|
||||
|
||||
$("div.posts div.column").width(100/columnCount + "%");
|
||||
}
|
||||
@@ -14,24 +14,47 @@
|
||||
padding-top: 50px;
|
||||
}
|
||||
|
||||
.posts {
|
||||
z-index: -1;
|
||||
margin-right: 0;
|
||||
width: calc(100% + 15px);
|
||||
}
|
||||
|
||||
.post-box {
|
||||
div.posts {
|
||||
padding-top: 20px;
|
||||
width: calc(100% + 20px);
|
||||
display: inline-flex;
|
||||
margin: 20px 15px 0 0;
|
||||
padding: 25px;
|
||||
background-color: #FFFFFF;
|
||||
}
|
||||
|
||||
/* fullscreen */
|
||||
.post-box {
|
||||
width: calc(25% - 69px);
|
||||
div.posts div.post {
|
||||
display: block;
|
||||
margin: 20px 0 0 0;
|
||||
padding: 10px;
|
||||
width: calc(100% - 40px);
|
||||
}
|
||||
|
||||
div.posts div.post img {
|
||||
width: 100%;
|
||||
height: auto;
|
||||
}
|
||||
|
||||
div.posts .post p.subscript {
|
||||
text-align: right;
|
||||
font-size: 8pt;
|
||||
}
|
||||
|
||||
/*.posts {*/
|
||||
/*z-index: -1;*/
|
||||
/*margin-right: 0;*/
|
||||
/*width: calc(100% + 15px);*/
|
||||
/*}*/
|
||||
|
||||
/*.post-box {*/
|
||||
/*display: inline-flex;*/
|
||||
/*margin: 20px 15px 0 0;*/
|
||||
/*padding: 25px;*/
|
||||
/*background-color: #FFFFFF;*/
|
||||
/*}*/
|
||||
|
||||
/*!* fullscreen *!*/
|
||||
/*.post-box {*/
|
||||
/*width: calc(25% - 69px);*/
|
||||
/*}*/
|
||||
|
||||
@media only screen and (max-width: 1500px) {
|
||||
.post-box {
|
||||
width: calc(50% - 68px);
|
||||
|
||||
18
website/public/template_sql.php
Normal file
18
website/public/template_sql.php
Normal file
@@ -0,0 +1,18 @@
|
||||
<html>
|
||||
<head>
|
||||
</head>
|
||||
<body>
|
||||
<?php
|
||||
|
||||
// database gegevens zijn elders opgeslagen
|
||||
include_once("../queries/connect.php");
|
||||
include_once("../queries/friendship.php");
|
||||
|
||||
$friends = selectAllFriends($db, 666);
|
||||
while($friend = $friends->fetch(PDO::FETCH_ASSOC)) {
|
||||
echo $friend['username'].' '.$friend['onlinestatus'] . "<br />";
|
||||
}
|
||||
|
||||
?>
|
||||
</body>
|
||||
</html>
|
||||
Reference in New Issue
Block a user