From 91b0b1f2dfde75b0626a0cb17d21e40c6974f621 Mon Sep 17 00:00:00 2001 From: Eric Woodward Date: Sat, 27 Jan 2018 09:49:04 -0500 Subject: [PATCH] FIXED random reload link to work behind static cache. UPDATED padding on random card. UPDATED to v0.2.2. --- package.json | 2 +- public/styles/styles.css | 3 ++- routes/index.js | 2 +- views/partials/random_card.ejs | 4 ++-- 4 files changed, 6 insertions(+), 5 deletions(-) diff --git a/package.json b/package.json index 7f3c3f3..3305677 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@mysticbits/codex-mythica", - "version": "0.2.1", + "version": "0.2.2", "private": true, "scripts": { "start": "nodejs ./bin/www" diff --git a/public/styles/styles.css b/public/styles/styles.css index ac56810..c6c90ce 100644 --- a/public/styles/styles.css +++ b/public/styles/styles.css @@ -216,7 +216,7 @@ p { .card-randomLink { border: none; display: inline-block; - padding: .25em; + padding: 0; line-height: 0; margin: 0; } @@ -227,6 +227,7 @@ p { .card-randomLink > figure { border: none; + margin: .5em 2em; } .card-randomLink > figure > figcaption { diff --git a/routes/index.js b/routes/index.js index fadf36f..e8462a8 100644 --- a/routes/index.js +++ b/routes/index.js @@ -27,7 +27,7 @@ router.get('/', function(req, res) { cards = require('../lib/cards.json'), rand_card_num = Math.floor(Math.random() * Math.floor(cards.length-1)); - res.render('index', { title: 'Welcome', query: (req.query || {}), card: cards[rand_card_num] }); + res.render('index', { title: 'Welcome', query: (req.query || {}), card: cards[rand_card_num], random_num: rand_card_num }); }); router.get('/cards/:card_num', (req, res) => { diff --git a/views/partials/random_card.ejs b/views/partials/random_card.ejs index 3965375..ee5a5b5 100644 --- a/views/partials/random_card.ejs +++ b/views/partials/random_card.ejs @@ -1,4 +1,4 @@ -<% if (typeof card !== 'undefined') { %> +<% if (typeof card !== 'undefined' && typeof random_num !== 'undefined') { %>
@@ -16,6 +16,6 @@

or - ↻ reload the page for a different card. + ↻ reload the page for a different card.

<% } %>