Browse Source

Updated look and feel

pull/4/head
jrtechs 6 years ago
parent
commit
93c492c899
6 changed files with 29 additions and 23 deletions
  1. +9
    -0
      includes/footer.html
  2. +6
    -3
      includes/header.html
  3. +4
    -8
      sidebar/categoriesSideBar.js
  4. +5
    -5
      sidebar/popularPosts.js
  5. +4
    -6
      sidebar/recentPosts.js
  6. +1
    -1
      utils/sql.js

+ 9
- 0
includes/footer.html View File

@ -22,6 +22,15 @@
</footer>
<script src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/8.9.1/highlight.min.js"></script>
<script>hljs.initHighlightingOnLoad();</script>
<!-- Global site tag (gtag.js) - Google Analytics -->
<script async src="https://www.googletagmanager.com/gtag/js?id=UA-51392711-1"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', 'UA-51392711-1');
</script>
</body>

+ 6
- 3
includes/header.html View File

@ -19,10 +19,13 @@
<script src="http://ajax.googleapis.com/ajax/libs/jquery/2.1.4/jquery.min.js"></script>
<style>
body,h1,h2,h3,h4,h5 {font-family: "Raleway", sans-serif}
<link href="https://fonts.googleapis.com/css?family=Open+Sans" rel="stylesheet">
<style>
html, body, h1, h2, h3, h4, h5, h6 {
font-family: 'Open Sans', sans-serif;
}
p{font-size:18px;}
</style>
<!-- Navbar -->

+ 4
- 8
sidebar/categoriesSideBar.js View File

@ -16,22 +16,18 @@ module.exports=
{
res.write("<div class=\"w3-card w3-margin\">");
res.write("<div class=\"w3-container w3-padding\"><h4>Categories</h4></div>");
res.write("<div class=\"w3-container w3-padding w3-gray\"><h4>Categories</h4></div>");
res.write("<ul class=\"w3-ul w3-hoverable w3-white\">");
res.write("<div class=\"w3-bar-block w3-white\">");
sql.getCategories().then(function(categories)
{
categories.forEach(function(cat)
{
//res.write(cat.name);
res.write("<li class=\"w3-padding-16\">");
res.write("<a href='/category/" + cat.url + "'><span class=\"w3-large\">" + cat.name + "</span><br></a>");
res.write("</li>");
res.write("<a class=\"w3-bar-item w3-button\" href='/category/" + cat.url + "'>" + cat.name + "<br></a>");
});
res.write("</ul></div>");
res.write("</div></div>");
resolve();
})

+ 5
- 5
sidebar/popularPosts.js View File

@ -13,18 +13,18 @@ module.exports=
res.write("<div class=\"w3-container w3-padding\"><h4>Popular Posts</h4></div>");
res.write("<ul class=\"w3-ul w3-hoverable w3-white\">");
res.write("<div class=\"w3-sidebar w3-bar-block\">");
sql.getPopularPosts().then(function(posts)
{
posts.forEach(function(cat)
{
console.log(cat);
res.write("<li class=\"w3-padding-16\">");
res.write("<a href='" + url + "'><span class=\"w3-large\">" + p.name + "</span><br></a>");
res.write("</li>");
res.write("<a class=\"w3-bar-item w3-button\" href='" + url + "'>" + p.name + "<br></a>");
});
res.write("</ul></div>");
res.write("</div></div>");
resolve();
})
});

+ 4
- 6
sidebar/recentPosts.js View File

@ -10,20 +10,18 @@ module.exports=
res.write("<div class=\"w3-card w3-margin\">");
res.write("<div class=\"w3-container w3-padding\"><h4>Recent Posts</h4></div>");
res.write("<div class=\"w3-container w3-padding w3-gray\"><h4>Recent Posts</h4></div>");
res.write("<ul class=\"w3-ul w3-hoverable w3-white\">");
res.write("<div class=\"w3-bar-block w3-white\">");
sql.getRecentPosts().then(function(posts)
{
posts.forEach(function(p)
{
var url = '/' + p.category + '/' + p.url;
res.write("<li class=\"w3-padding-16\">");
res.write("<a href='" + url + "'><span class=\"w3-large\">" + p.name + "</span><br></a>");
res.write("</li>");
res.write("<a class=\"w3-bar-item w3-button\" href='" + url + "'>" + p.name + "<br></a>");
});
res.write("</ul></div>");
res.write("</div></div>");
resolve();
})

+ 1
- 1
utils/sql.js View File

@ -132,7 +132,7 @@ module.exports=
{
return new Promise(function(resolve, reject)
{
var q = "select * from categories where name ='" + requestURL + "' limit 1";
var q = "select * from categories where url ='" + requestURL + "'";
fetch(q).then(function(categories)
{
if(categories.length != 0)

Loading…
Cancel
Save