Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

creating meme upload tutorial #69

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
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
48 changes: 48 additions & 0 deletions meme/templates/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
<!DOCTYPE html>

<head>
<meta name="viewport" content="user-scalable=no, width=device-width, initial-scale=1, maximum-scale=1">
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<link href="https://unpkg.com/nanogallery2/dist/css/nanogallery2.min.css" rel="stylesheet" type="text/css">
<script type="text/javascript" src="https://unpkg.com/nanogallery2/dist/jquery.nanogallery2.min.js"></script>
</head>

<body>
<div style="text-align: center;">
<img height="auto" width="10%" src="../../assets/img/header.png">
</div>
<h1 style="text-align: center;">Meme Templates</h1>
<div style="text-align: center;
background-color:rgba(56,91,85,.5);
padding:5px;">
<h4>
All memes here are posted after taking permission from the person and creator of
meme and this is a offtopic community collaboration for fun only</h4>
<h5>click here to know how to add a new meme (link to page will be added here)</h5>
</div>

<div id="meme_gallery"></div>

<script>
let data = null;
var xmlhttp = new XMLHttpRequest();
xmlhttp.onreadystatechange = function () {
if (this.readyState == 4 && this.status == 200) {
data = JSON.parse(this.responseText);
jQuery("#meme_template").nanogallery2({
items: data,
thumbnailWidth: 'auto',
thumbnailHeight: 200,
itemsBaseURL: 'https://i.imgur.com/',
locationHash: false
});
}
};
xmlhttp.open("GET", "meme_template_data.json", true);
xmlhttp.send();

</script>

</body>

</html>
Empty file.
17 changes: 17 additions & 0 deletions meme/templates/meme_template_data.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
[
{
"src": "5RTn9fK.jpg",
"srct": "5RTn9fK.jpg",
"title": "meme on xeon zolt",
"by": "",
"description": "the guy in image gets angry very fast so its adviced not to mess up with his server logs or things can go out of hand"
},
{
"src": "oeXTPgZ.jpg",
"srct": "oeXTPgZ.jpg",
"title": "meme on TK Sourab",
"by": "Raju Dev",
"description": "the guy in pic is a vim user and wants to tell everyone that he uses vim"
}
]