Added formatting to push footer to bottom

master
Keith Irwin 2017-04-12 14:32:28 -04:00
parent a15cf2c03f
commit 0abf8b3f50
No known key found for this signature in database
GPG Key ID: 378933C743E2BBC0
5 changed files with 61 additions and 22 deletions

View File

@ -4,7 +4,9 @@ const router = require('express').Router(),
mw = require('../middleware.js'),
mail = require('../mail.js');
router.route('/mail').get(function(req,res,next){
router
.get('/mail', function(req,res,next){
mail.send({
to: `"Keith Irwin" <hypergeek14@gmail.com>`,
from: mail.from,
@ -18,10 +20,14 @@ router.route('/mail').get(function(req,res,next){
mw.throwErr(err,req);
next();
});
});
})
router.route('/password').get(function(req,res){
.get('/password', function(req,res){
res.render('password');
})
.get('/short',function(req,res){
res.render('short');
});
module.exports = router;

17
static/js/footer.js Normal file
View File

@ -0,0 +1,17 @@
'use strict';
/* global $ */
// Push footer to bottom on pages with little content
function setFooter(){
var windowHeight = $(window).height(),
footerBottom = $("footer").offset().top + $("footer").height();
if (windowHeight > footerBottom){
$("footer").css( "margin-top", windowHeight-footerBottom );
}
}
// Execute on page load
$(function(){ setFooter(); });
// Execute on window resize
$(window).resize(function(){ setFooter(); });

14
views/short.html Normal file
View File

@ -0,0 +1,14 @@
{% extends 'templates/base.html' %}
{% block title %}{{super()}} | Short page test{% endblock %}
{% block main %}
<section class='container'>
<h1>Test</h1>
<p>This is a test of a short page. </p>
</section>
{% endblock %}

View File

@ -14,3 +14,5 @@
<a href="bitcoin:14VN8GzWQPssWQherCE5XNGBWzy3eCDn74?label=tracman"><i class="fa fa-btc"></i></a>
</div>
</footer>
<script src="/static/js/footer.js"></script>

View File

@ -1,5 +1,3 @@
<script src="/static/js/header.js"></script>
<header class='shadow'>
<!-- Logo -->
@ -54,3 +52,5 @@
<a href="#" class='close' data-dismiss="alert" aria-label="close"><i class='fa fa-times'></i></a>
</div>
{% endfor %}
<script src="/static/js/header.js"></script>