FIXED random reload link to work behind static cache.
UPDATED padding on random card. UPDATED to v0.2.2.
This commit is contained in:
parent
5ca57a3189
commit
91b0b1f2df
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@mysticbits/codex-mythica",
|
"name": "@mysticbits/codex-mythica",
|
||||||
"version": "0.2.1",
|
"version": "0.2.2",
|
||||||
"private": true,
|
"private": true,
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"start": "nodejs ./bin/www"
|
"start": "nodejs ./bin/www"
|
||||||
|
@ -216,7 +216,7 @@ p {
|
|||||||
.card-randomLink {
|
.card-randomLink {
|
||||||
border: none;
|
border: none;
|
||||||
display: inline-block;
|
display: inline-block;
|
||||||
padding: .25em;
|
padding: 0;
|
||||||
line-height: 0;
|
line-height: 0;
|
||||||
margin: 0;
|
margin: 0;
|
||||||
}
|
}
|
||||||
@ -227,6 +227,7 @@ p {
|
|||||||
|
|
||||||
.card-randomLink > figure {
|
.card-randomLink > figure {
|
||||||
border: none;
|
border: none;
|
||||||
|
margin: .5em 2em;
|
||||||
}
|
}
|
||||||
|
|
||||||
.card-randomLink > figure > figcaption {
|
.card-randomLink > figure > figcaption {
|
||||||
|
@ -27,7 +27,7 @@ router.get('/', function(req, res) {
|
|||||||
cards = require('../lib/cards.json'),
|
cards = require('../lib/cards.json'),
|
||||||
rand_card_num = Math.floor(Math.random() * Math.floor(cards.length-1));
|
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) => {
|
router.get('/cards/:card_num', (req, res) => {
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
<% if (typeof card !== 'undefined') { %>
|
<% if (typeof card !== 'undefined' && typeof random_num !== 'undefined') { %>
|
||||||
<a href="/cards/<%= card.num.toLowerCase() %>"
|
<a href="/cards/<%= card.num.toLowerCase() %>"
|
||||||
class="card-randomLink" title="Tap or click to learn about <%= card.name %>'s card!">
|
class="card-randomLink" title="Tap or click to learn about <%= card.name %>'s card!">
|
||||||
<figure>
|
<figure>
|
||||||
@ -16,6 +16,6 @@
|
|||||||
</a>
|
</a>
|
||||||
<p class="card-randomWrapper">
|
<p class="card-randomWrapper">
|
||||||
or
|
or
|
||||||
<a href="/">↻ reload the page for a different card.</a>
|
<a href="/?r<%=random_num%>">↻ reload the page for a different card.</a>
|
||||||
</p>
|
</p>
|
||||||
<% } %>
|
<% } %>
|
||||||
|
Loading…
Reference in New Issue
Block a user