Skip to content
This repository was archived by the owner on Jan 20, 2025. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Reddit Tiles
Many posts on the funny reddit group are just pictures. This mashup takes the posts and displays them in an image tile-layout so images are easier to preview and browse through.

# Mashup project

This project is open-ended!
Expand Down
7 changes: 7 additions & 0 deletions css/style.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
.headermessage {
margin: 19px;
color: black;
font-family: 'Open Sans', sans-serif;
font-size: 16px;
font-weight: bold;
}
Binary file added image/reddit.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
50 changes: 49 additions & 1 deletion index.html
Original file line number Diff line number Diff line change
@@ -1,8 +1,56 @@
<!DOCTYPE html>
<html>
<head>
<title>Mashup</title>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.1.0/jquery.min.js"></script>
<!---Bootstrap-->
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous">
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js" integrity="sha384-Tc5IQib027qvyjSMfHjOMaLkfuWVxZxUPnCJA7l2mCWNIpG9mGCD8wGNIcPD7Txa" crossorigin="anonymous"></script>

<!--Angular
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.5.7/angular.min.js"></script-->
<title>Reddit Tiles</title>
<!-- Custom-->
<link href="css/style.css" rel="stylesheet"/>
<!-- <script src="js/app.js"></script>-->
<script>
$.ajax('https://www.reddit.com/r/funny/new/.json', {
success: function(data) {
console.log('Got:', data);
$(data.data.children).each(function(idx, val){
//val.title
//val.url
//'//reddit.com' + val.permalink
elm = "<div class='col-lg-3 col-md-4 col-xs-6 thumb'>" +
"<a class='thumbnail' href='" + val.data.url + "'>" +
"<img class='img-responsive' src='" + val.data.thumbnail + "' alt='No Image'>" +
"</a>" +
"<p>" + val.data.title + "</p>" +
"</div>";
$("#list").append(elm);
});
},
error: function(err) {
console.log('Got:', err);
}
});
</script>
</head>
<body>
<div>


<div class="container-fluid">
<div class="row text-center">
<h2 class="headermessage">Funny Reddit Posts</h2>
</div>
<div class="row" id="list">
</div>
</div>

</div>
</body>
</html>
<!--
Source:
http://www.prepbootstrap.com/bootstrap-template/responsive-image-tiles
-->
Empty file added js/app.js
Empty file.