feat: add credits

License: MIT
Signed-off-by: Henrique Dias <hacdias@gmail.com>
This commit is contained in:
Henrique Dias 2019-04-28 22:34:34 +01:00
parent cd14e6c2f6
commit fcb9d6c00e
2 changed files with 10 additions and 2 deletions

View File

@ -1,12 +1,16 @@
const { basename } = require('path')
const { pad } = require('./helpers')
const credits = '<p class="f6 small-caps">This work is licensed under a Creative Commons Attribution-NonCommercial 2.5 License.<br>Originally from <a target="_blank" href="https://xkcd.com/">xkcd.com</a>.</p>'
const comicPage = ({ alt, title, transcript, num, img }) => {
const btnClass = 'dib navy mh2 pa2 bg-light-blue hover-bg-lightest-blue br2 ba bw1 b--navy no-underline'
return `<html>
<head>
<title>${num} - ${title}</title>
<meta charset=utf-8>
<meta name=viewport content="width=device-width,initial-scale=1">
<link rel="stylesheet" href="../tachyons.css"/>
</head>
<body class="tc bg-washed-blue navy sans-serif ml-auto mr-auto mw7 w-90">
@ -20,6 +24,7 @@ const comicPage = ({ alt, title, transcript, num, img }) => {
<img src="./${basename(img)}" alt="${alt}">
<p class="dn">${transcript}</p>
${credits}
</body>
</html>`
}
@ -27,14 +32,17 @@ const comicPage = ({ alt, title, transcript, num, img }) => {
const homePage = (list) => `<html>
<head>
<title>XKCD</title>
<meta charset=utf-8>
<meta name=viewport content="width=device-width,initial-scale=1">
<link rel="stylesheet" href="./tachyons.css"/>
</head>
<body class="bg-washed-blue navy sans-serif ml-auto mr-auto mw7 w-90">
<h1 class="tc mh0 mt4 mb3 f2 small-caps tracked">XKCD</h1>
<ul class="list pa0 ma0">
${list.map(({ id, title, num }) => `<li><a class="blue hover-dark-blue no-underline" href="./${num}/index.html">${id} - ${title}</a></li>`).join('\n')}
</ul>
${credits}
</body>
</html>`

View File

@ -1,7 +1,7 @@
{
"name": "xkcd-clone",
"version": "1.0.0",
"description": "",
"description": "Clone XKCD comics.",
"main": "./lib/index.js",
"bin": {
"xkcd-clone": "./bin/index.js"