From da5d4236b6e99fc95bd5b38ae9546bcfdbf90a7d Mon Sep 17 00:00:00 2001 From: Victor Losada Hernandez Date: Sun, 23 Apr 2023 15:21:48 +0200 Subject: [PATCH 1/6] initial styling --- themes/V3/5ePHB/snippets.js | 21 +++++++++++++++++++++ themes/V3/5ePHB/style.less | 20 +++++++++++++++++++- 2 files changed, 40 insertions(+), 1 deletion(-) diff --git a/themes/V3/5ePHB/snippets.js b/themes/V3/5ePHB/snippets.js index 99aa00e23..91cc49de2 100644 --- a/themes/V3/5ePHB/snippets.js +++ b/themes/V3/5ePHB/snippets.js @@ -126,6 +126,27 @@ module.exports = [ icon : 'fas fa-mask', gen : ClassFeatureGen, }, + { + name : 'Quote', + icon : 'fas fa-quote-right', + gen : function(){ + return dedent` + {{quote + Stepping into the portal was like settling into a warm bath, + though the chill didn't jade from the air. At first everything + muted the roar of the river around the rocks below, the + chirping of frogs and crickets on shore, the evening bustle of + the town behind him . . . . A moment later, the world erupted + into vibrant life. Frogs and night birds sang a chorus; the air + was awash with autumn scents; the moonlight painted the + flo wers in iridescent blue, silver, and violet; and the rushing + of the river became a complex symphony. + + - James Wyatt, _Oath of Vigilance_ + }} + \n`; + }, + }, { name : 'Note', icon : 'fas fa-sticky-note', diff --git a/themes/V3/5ePHB/style.less b/themes/V3/5ePHB/style.less index 2acbe88bf..69bab6992 100644 --- a/themes/V3/5ePHB/style.less +++ b/themes/V3/5ePHB/style.less @@ -82,7 +82,7 @@ body { // * BASE // *****************************/ -.page{ +.page { p{ overflow-wrap : break-word; //TODO: MAKE ALL MARGINS TOP-ONLY. USE * + * STYLE SELECTORS display : block; @@ -241,6 +241,24 @@ body { } } } + //***************************** + // * QUOTE + // *****************************/ + .quote { + + p { + font-style :italic; + line-height :.5cm; + } + + li { + list-style-type : "---"; + float :right; + } + } + + + //***************************** // * NOTE // *****************************/ From 0abfb23ef27ca8063a0261ee878ad0541e1247b5 Mon Sep 17 00:00:00 2001 From: Victor Losada Hernandez Date: Sun, 23 Apr 2023 15:28:43 +0200 Subject: [PATCH 2/6] first line difference phb vs dmg --- themes/V3/5eDMG/style.less | 5 +++++ themes/V3/5ePHB/style.less | 7 ++++++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/themes/V3/5eDMG/style.less b/themes/V3/5eDMG/style.less index 50a3af0a3..d7a240d53 100644 --- a/themes/V3/5eDMG/style.less +++ b/themes/V3/5eDMG/style.less @@ -8,6 +8,11 @@ background-image : url(/assets/DMG_background.png); background-size : cover; + .quote p::first-line { + text-transform: none; + font-style: italic; + } + &:after { background-image : url(/assets/DMG_footerAccent.png); height: 58px; diff --git a/themes/V3/5ePHB/style.less b/themes/V3/5ePHB/style.less index 69bab6992..1fb3d591b 100644 --- a/themes/V3/5ePHB/style.less +++ b/themes/V3/5ePHB/style.less @@ -245,10 +245,15 @@ body { // * QUOTE // *****************************/ .quote { - + p { font-style :italic; line-height :.5cm; + + &::first-line { + text-transform: uppercase; + font-style: normal; + } } li { From 86823b43b1828f0a5a8b27e5cec754d894fca5d6 Mon Sep 17 00:00:00 2001 From: Victor Losada Hernandez Date: Sun, 23 Apr 2023 15:53:35 +0200 Subject: [PATCH 3/6] generated quotes, correct small caps --- themes/V3/5eDMG/style.less | 2 +- themes/V3/5ePHB/snippets.js | 19 ++-------- themes/V3/5ePHB/snippets/quote.gen.js | 51 +++++++++++++++++++++++++++ themes/V3/5ePHB/style.less | 2 +- 4 files changed, 55 insertions(+), 19 deletions(-) create mode 100644 themes/V3/5ePHB/snippets/quote.gen.js diff --git a/themes/V3/5eDMG/style.less b/themes/V3/5eDMG/style.less index d7a240d53..b9160318b 100644 --- a/themes/V3/5eDMG/style.less +++ b/themes/V3/5eDMG/style.less @@ -9,7 +9,7 @@ background-size : cover; .quote p::first-line { - text-transform: none; + font-variant : normal; font-style: italic; } diff --git a/themes/V3/5ePHB/snippets.js b/themes/V3/5ePHB/snippets.js index 91cc49de2..d9c574723 100644 --- a/themes/V3/5ePHB/snippets.js +++ b/themes/V3/5ePHB/snippets.js @@ -7,6 +7,7 @@ const scriptGen = require('./snippets/script.gen.js'); const ClassFeatureGen = require('./snippets/classfeature.gen.js'); const CoverPageGen = require('./snippets/coverpage.gen.js'); const TableOfContentsGen = require('./snippets/tableOfContents.gen.js'); +const QuoteGen = require('./snippets/quote.gen.js'); const dedent = require('dedent-tabs').default; @@ -129,23 +130,7 @@ module.exports = [ { name : 'Quote', icon : 'fas fa-quote-right', - gen : function(){ - return dedent` - {{quote - Stepping into the portal was like settling into a warm bath, - though the chill didn't jade from the air. At first everything - muted the roar of the river around the rocks below, the - chirping of frogs and crickets on shore, the evening bustle of - the town behind him . . . . A moment later, the world erupted - into vibrant life. Frogs and night birds sang a chorus; the air - was awash with autumn scents; the moonlight painted the - flo wers in iridescent blue, silver, and violet; and the rushing - of the river became a complex symphony. - - - James Wyatt, _Oath of Vigilance_ - }} - \n`; - }, + gen : QuoteGen, }, { name : 'Note', diff --git a/themes/V3/5ePHB/snippets/quote.gen.js b/themes/V3/5ePHB/snippets/quote.gen.js new file mode 100644 index 000000000..f7b86c0ad --- /dev/null +++ b/themes/V3/5ePHB/snippets/quote.gen.js @@ -0,0 +1,51 @@ +const _ = require("lodash"); + +const quotes = [ + "The sword glinted in the dim light, its edges keen and deadly. As the adventurer reached for it, he couldn't help but feel a surge of excitement mixed with fear. This was no ordinary blade.", + "The dragon's roar shook the ground beneath their feet, and the brave knight stood tall, his sword at the ready. He knew that this would be the battle of his life, but he was determined to emerge victorious.", + "The wizard's laboratory was a sight to behold, filled with bubbling cauldrons, ancient tomes, and strange artifacts from distant lands. As the apprentice gazed around in wonder, she knew that she was about to embark on a journey unlike any other.", + "The tavern was packed with rowdy patrons, their voices raised in song and laughter. The bard took center stage, strumming his lute and launching into a tale of adventure and heroism that had the crowd hanging on his every word.", + "The thief crept through the shadows, his eyes scanning the room for any sign of danger. He knew that one false move could mean the difference between success and failure, and he was determined to come out on top.", + "The elf queen stood atop her castle walls, surveying the kingdom below with a mix of pride and sadness. She knew that the coming war would be brutal, but she was determined to protect her people at all costs.", + "The necromancer's tower loomed in the distance, its dark spires piercing the sky. As the adventurers approached, they could feel the chill of death emanating from within", + "The ranger moved through the forest like a shadow, his senses attuned to every sound and movement around him. He knew that danger lurked behind every tree, but he was ready for whatever came his way.", + "The paladin knelt before the altar, his hands clasped in prayer. He knew that his faith would be tested in the days ahead, but he was ready to face whatever trials lay in store for him.", + "The druid communed with the spirits of nature, his mind merging with the trees, the animals, and the very earth itself. He knew that his power came with a great responsibility, and he was determined to use it for the greater good.", +]; + +const authors = [ + "Unknown", + "James Wyatt", + "Eolande Blackwood", + "Ragnar Ironheart", + "Lyra Nightshade", + "Valtorius Darkstar", + "Isadora Fireheart", + "Theron Shadowbane", + "Lirien Starweaver", + "Drogathar Bonecrusher", + "Kaelen Frostblade", +]; + +const books = [ + "The Blade of Destiny", + "Dragonfire and Steel", + "The Bard's Tale", + "Darkness Rising", + "The Sacred Quest", + "Shadows in the Forest", + "The Starweaver Chronicles", + "Beneath the Bones", + "Moonlit Magic", + "Frost and Fury", + +]; +module.exports = () => { + return ` +{{quote +${_.sample(quotes)} + +- ${_.sample(authors)}, _${_.sample(books)}_ +}} +\n`; +}; diff --git a/themes/V3/5ePHB/style.less b/themes/V3/5ePHB/style.less index 1fb3d591b..444a60a23 100644 --- a/themes/V3/5ePHB/style.less +++ b/themes/V3/5ePHB/style.less @@ -251,7 +251,7 @@ body { line-height :.5cm; &::first-line { - text-transform: uppercase; + font-variant : small-caps; font-style: normal; } } From 8ebd5ccff93e507bcf008fce5bc8923b06449dd2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADctor=20Losada=20Hern=C3=A1ndez?= Date: Tue, 8 Aug 2023 19:11:54 +0200 Subject: [PATCH 4/6] syntax change --- themes/V3/5ePHB/snippets/quote.gen.js | 6 ++++-- themes/V3/5ePHB/style.less | 16 ++++++++++++---- 2 files changed, 16 insertions(+), 6 deletions(-) diff --git a/themes/V3/5ePHB/snippets/quote.gen.js b/themes/V3/5ePHB/snippets/quote.gen.js index f7b86c0ad..4c3bbe759 100644 --- a/themes/V3/5ePHB/snippets/quote.gen.js +++ b/themes/V3/5ePHB/snippets/quote.gen.js @@ -44,8 +44,10 @@ module.exports = () => { return ` {{quote ${_.sample(quotes)} - -- ${_.sample(authors)}, _${_.sample(books)}_ + +: +{{attribution ${_.sample(authors)}, *${_.sample(books)}*}} + }} \n`; }; diff --git a/themes/V3/5ePHB/style.less b/themes/V3/5ePHB/style.less index 444a60a23..acb6d2f5c 100644 --- a/themes/V3/5ePHB/style.less +++ b/themes/V3/5ePHB/style.less @@ -250,16 +250,24 @@ body { font-style :italic; line-height :.5cm; - &::first-line { + &:first-child::first-line { font-variant : small-caps; font-style: normal; } } - li { - list-style-type : "---"; - float :right; + .attribution { + font-style: normal; + display: block; + text-align: right; + + &:before { + content: '---'; + margin-right: .2em; + } } + + } From b3497e14f1753710f566e6d7a472191194ae4af1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADctor=20Losada=20Hern=C3=A1ndez?= Date: Tue, 8 Aug 2023 19:15:19 +0200 Subject: [PATCH 5/6] remove italics --- themes/V3/5ePHB/snippets/quote.gen.js | 1 - themes/V3/5ePHB/style.less | 1 - 2 files changed, 2 deletions(-) diff --git a/themes/V3/5ePHB/snippets/quote.gen.js b/themes/V3/5ePHB/snippets/quote.gen.js index 4c3bbe759..fdf3892aa 100644 --- a/themes/V3/5ePHB/snippets/quote.gen.js +++ b/themes/V3/5ePHB/snippets/quote.gen.js @@ -47,7 +47,6 @@ ${_.sample(quotes)} : {{attribution ${_.sample(authors)}, *${_.sample(books)}*}} - }} \n`; }; diff --git a/themes/V3/5ePHB/style.less b/themes/V3/5ePHB/style.less index a004a5519..b103c043a 100644 --- a/themes/V3/5ePHB/style.less +++ b/themes/V3/5ePHB/style.less @@ -247,7 +247,6 @@ body { .quote { p { - font-style :italic; line-height :.5cm; &:first-child::first-line { From 2125b8a0264986f52d4f820864a7724984519a60 Mon Sep 17 00:00:00 2001 From: Trevor Buckner Date: Thu, 14 Sep 2023 16:44:59 -0400 Subject: [PATCH 6/6] Small tweaks --- themes/V3/5eDMG/style.less | 5 ++--- themes/V3/5ePHB/snippets/quote.gen.js | 1 - themes/V3/5ePHB/style.less | 14 ++++++++++++-- 3 files changed, 14 insertions(+), 6 deletions(-) diff --git a/themes/V3/5eDMG/style.less b/themes/V3/5eDMG/style.less index 589e28d63..92820f9d5 100644 --- a/themes/V3/5eDMG/style.less +++ b/themes/V3/5eDMG/style.less @@ -10,9 +10,8 @@ background-image : url(/assets/DMG_background.png); background-size : cover; - .quote p::first-line { - font-variant : normal; - font-style: italic; + .quote p:first-child::first-line { + all: unset; } &:after { diff --git a/themes/V3/5ePHB/snippets/quote.gen.js b/themes/V3/5ePHB/snippets/quote.gen.js index fdf3892aa..c5e3d6293 100644 --- a/themes/V3/5ePHB/snippets/quote.gen.js +++ b/themes/V3/5ePHB/snippets/quote.gen.js @@ -45,7 +45,6 @@ module.exports = () => { {{quote ${_.sample(quotes)} -: {{attribution ${_.sample(authors)}, *${_.sample(books)}*}} }} \n`; diff --git a/themes/V3/5ePHB/style.less b/themes/V3/5ePHB/style.less index b103c043a..f887f6da5 100644 --- a/themes/V3/5ePHB/style.less +++ b/themes/V3/5ePHB/style.less @@ -246,16 +246,23 @@ body { // *****************************/ .quote { - p { - line-height :.5cm; + &>p { + line-height :.54cm; + font-style: italic; &:first-child::first-line { font-variant : small-caps; font-style: normal; + font-size: 0.38cm; } } + p+.attribution { + margin-top: 0; + } + .attribution { + line-height: 0.54cm; font-style: normal; display: block; text-align: right; @@ -266,6 +273,9 @@ body { } } + &+* { + margin-top: 0.54cm; + } }