diff --git a/output/cover.pdf b/output/cover.pdf index 5e91d98..8b38247 100644 Binary files a/output/cover.pdf and b/output/cover.pdf differ diff --git a/scripts/cover.js b/scripts/cover.js index 3b42a62..0e39c46 100644 --- a/scripts/cover.js +++ b/scripts/cover.js @@ -3,6 +3,7 @@ import { readFile, writeFile, access } from 'fs/promises'; import { resolve, dirname } from 'path'; import { fileURLToPath } from 'url'; import nunjucks from 'nunjucks'; +import matter from 'gray-matter'; const __dir = dirname(fileURLToPath(import.meta.url)); const root = resolve(__dir, '..'); @@ -48,6 +49,10 @@ async function generate() { const backImage = await fileExists(resolve(root, 'images/cover/back.png')) ? '../images/cover/back.png' : null; + // Load author / title from front matter + const fmRaw = await readFile(resolve(root, 'content', '00-front-matter.md'), 'utf-8'); + const { data: fm } = matter(fmRaw); + // Render HTML from template const env = nunjucks.configure(resolve(root, 'templates'), { autoescape: false }); const html = env.render('cover.html', { @@ -63,6 +68,9 @@ async function generate() { hasSpineText: pageCount >= MIN_SPINE_TEXT, frontImage, backImage, + author: fm.author || '', + title: fm.title || 'Das Kaleidoskop der Schlummerwelten', + subtitle: fm.subtitle || '', }); const htmlOut = resolve(root, 'output', 'cover.html'); diff --git a/templates/cover.html b/templates/cover.html index dc00622..4792f8c 100644 --- a/templates/cover.html +++ b/templates/cover.html @@ -19,18 +19,60 @@ --spine-left: calc(var(--bleed) + var(--trim-w)); --front-left: calc(var(--bleed) + var(--trim-w) + var(--spine-w)); - /* Design tokens */ + /* Design tokens — matches interior "Illuminated Nocturne" palette */ --color-bg: #080820; - --color-mid: #111138; - --color-gold: #c8a84b; - --color-gold2: #f0d080; + --color-mid: #0f0f30; + --color-gold: #b89a4e; + --color-gold2: #e8c96a; --color-text: #e8e4d8; - --color-muted: rgba(200,168,75,0.45); + --color-muted: rgba(184,154,78,0.5); + + --font-display: 'Cormorant Garamond', Georgia, serif; + --font-body: 'Lora', Georgia, serif; + } + + /* ── Fonts ─────────────────────────────────────────────── */ + @font-face { + font-family: 'Cormorant Garamond'; + font-style: normal; + font-weight: 400; + src: url('../fonts/cormorant-garamond-400-normal.woff2') format('woff2'); + } + @font-face { + font-family: 'Cormorant Garamond'; + font-style: italic; + font-weight: 300; + src: url('../fonts/cormorant-garamond-300-italic.woff2') format('woff2'); + } + @font-face { + font-family: 'Cormorant Garamond'; + font-style: italic; + font-weight: 400; + src: url('../fonts/cormorant-garamond-400-italic.woff2') format('woff2'); + } + @font-face { + font-family: 'Cormorant Garamond'; + font-style: italic; + font-weight: 600; + src: url('../fonts/cormorant-garamond-600-italic.woff2') format('woff2'); + } + @font-face { + font-family: 'Lora'; + font-style: normal; + font-weight: 400; + src: url('../fonts/lora-400-normal.woff2') format('woff2'); + } + @font-face { + font-family: 'Lora'; + font-style: italic; + font-weight: 400; + src: url('../fonts/lora-400-italic.woff2') format('woff2'); } * { box-sizing: border-box; margin: 0; padding: 0; } html, body { + font-family: var(--font-body); width: var(--total-w); height: var(--total-h); background: var(--color-bg); @@ -107,18 +149,19 @@ } .back-headline { - font-family: Georgia, serif; + font-family: var(--font-display); font-style: italic; + font-weight: 300; font-size: 0.22in; color: var(--color-gold); - letter-spacing: 0.02em; - margin-bottom: 0.12in; + letter-spacing: 0.03em; + margin-bottom: 0.14in; } .back-synopsis { - font-family: Georgia, serif; - font-size: 0.145in; - line-height: 1.7; + font-family: var(--font-body); + font-size: 0.138in; + line-height: 1.8; color: var(--color-text); flex: 1; } @@ -132,12 +175,13 @@ } .back-tagline { - font-family: Georgia, serif; + font-family: var(--font-display); font-style: italic; - font-size: 0.115in; + font-weight: 300; + font-size: 0.118in; color: var(--color-muted); max-width: 60%; - line-height: 1.5; + line-height: 1.6; } /* Barcode placeholder — KDP places the barcode here if left blank */ @@ -175,23 +219,27 @@ } .spine-title { - font-family: Georgia, serif; + font-family: var(--font-display); font-style: italic; + font-weight: 300; font-size: 0.13in; color: var(--color-gold); letter-spacing: 0.04em; } .spine-divider { + font-family: var(--font-display); font-size: 0.1in; color: var(--color-muted); } .spine-author { - font-family: Georgia, serif; + font-family: var(--font-display); + font-style: italic; + font-weight: 300; font-size: 0.1in; - color: var(--color-text); - letter-spacing: 0.05em; + color: rgba(232, 228, 216, 0.7); + letter-spacing: 0.06em; } .spine-too-narrow { @@ -233,19 +281,29 @@ } .front-title { - font-family: Georgia, serif; + font-family: var(--font-display); font-style: italic; - font-size: 0.52in; - line-height: 1.2; + font-weight: 300; + font-size: 0.54in; + line-height: 1.18; color: var(--color-gold2); - text-shadow: 0 0 0.15in rgba(200,168,75,0.4), 0 2px 8px rgba(0,0,0,0.8); + text-shadow: 0 0 0.18in rgba(184,154,78,0.45), 0 2px 10px rgba(0,0,0,0.9); + letter-spacing: 0.01em; + } + + .front-rule { + width: 1.6in; + height: 1px; + background: linear-gradient(to right, transparent, var(--color-gold), transparent); } .front-subtitle { - font-family: Georgia, serif; - font-size: 0.18in; - letter-spacing: 0.08em; - color: var(--color-text); + font-family: var(--font-display); + font-style: italic; + font-weight: 300; + font-size: 0.17in; + letter-spacing: 0.1em; + color: rgba(232, 228, 216, 0.75); text-shadow: 0 1px 4px rgba(0,0,0,0.8); } @@ -259,29 +317,33 @@ display: flex; align-items: center; justify-content: center; - background: radial-gradient(ellipse at center, #1a1a4a 0%, #080820 70%); + background: radial-gradient(ellipse at 50% 40%, #1a1a4a 0%, #080820 70%); } .front-art-placeholder span { - font-family: monospace; - font-size: 0.12in; - color: rgba(200,168,75,0.4); - border: 1px dashed rgba(200,168,75,0.2); - padding: 0.15in 0.3in; + font-family: var(--font-display); + font-style: italic; + font-size: 0.13in; + color: rgba(184,154,78,0.4); + border: 1px solid rgba(184,154,78,0.15); + padding: 0.15in 0.35in; + letter-spacing: 0.05em; } .front-author { - font-family: Georgia, serif; - font-size: 0.16in; - letter-spacing: 0.1em; - color: rgba(200,168,75,0.7); + font-family: var(--font-display); + font-style: italic; + font-weight: 300; + font-size: 0.15in; + letter-spacing: 0.12em; + color: rgba(184,154,78,0.65); text-shadow: 0 1px 4px rgba(0,0,0,0.8); } - .front-ornament-bottom { - font-size: 0.14in; + .front-ornament { + font-family: var(--font-display); + font-size: 0.16in; color: var(--color-muted); - letter-spacing: 0.4em; } /* ── Safe-zone & bleed guides overlay ───────────────────── */ @@ -372,8 +434,8 @@ {% if hasSpineText %}
✦ ✦ ✦
+❧
Zwölf magische Einschlafgeschichten
- -· · ·
+ {% if author %}{% endif %} +· · ·