0
0
mirror of https://github.com/naturalcrit/homebrewery.git synced 2026-01-05 23:12:39 +00:00

Merge upstream 'master' into part-cover-snippet

This commit is contained in:
Victor Losada Hernandez
2023-02-28 22:27:37 +01:00
86 changed files with 3698 additions and 2797 deletions

View File

@@ -1,21 +1,19 @@
@layer V3_5eDMG {
:root {
//Colors
--HB_Color_Accent : #EBCEC3; // Salmon
--HB_Color_Footnotes : #5C5C5C; // Dark gray
:root {
//Colors
--HB_Color_Accent : #EBCEC3; // Salmon
--HB_Color_Footnotes : #5C5C5C; // Dark gray
}
.page {
background-image : url(/assets/DMG_background.png);
background-size : cover;
&:after {
background-image : url(/assets/DMG_footerAccent.png);
height: 58px;
}
.page {
background-image : url(/assets/DMG_background.png);
background-size : cover;
&:after {
background-image : url(/assets/DMG_footerAccent.png);
height: 58px;
}
.footnote {
bottom : 40px;
}
.footnote {
bottom : 40px;
}
}

View File

@@ -171,7 +171,7 @@ module.exports = [
},
{
name : 'Cover Page',
icon : 'fas fa-file-word',
icon : 'fac fa-file-c',
gen : CoverPageGen,
},
{

View File

@@ -1,55 +1,46 @@
const _ = require('lodash');
const dedent = require('dedent-tabs').default;
const titles = [
'The Burning Gallows',
'The Ring of Nenlast',
'Below the Blind Tavern',
'Below the Hungering River',
'Before Bahamut\'s Land',
'The Cruel Grave from Within',
'The Strength of Trade Road',
'Through The Raven Queen\'s Worlds',
'Within the Settlement',
'The Crown from Within',
'The Merchant Within the Battlefield',
'Ioun\'s Fading Traveler',
'The Legion Ingredient',
'The Explorer Lure',
'Before the Charming Badlands',
'The Living Dead Above the Fearful Cage',
'Vecna\'s Hidden Sage',
'Bahamut\'s Demonspawn',
'Across Gruumsh\'s Elemental Chaos',
'The Blade of Orcus',
'Beyond Revenge',
'Brain of Insanity',
'Breed Battle!, A New Beginning',
'Evil Lake, A New Beginning',
'Invasion of the Gigantic Cat, Part II',
'Kraken War 2020',
'The Body Whisperers',
'The Diabolical Tales of the Ape-Women',
'The Doctor Immortal',
'The Doctor from Heaven',
'The Graveyard',
'Azure Core',
'Core Battle',
'Core of Heaven: The Guardian of Amazement',
'Deadly Amazement III',
'Dry Chaos IX',
'Gate Thunder',
'Guardian: Skies of the Dark Wizard',
'Lute of Eternity',
'Mercury\'s Planet: Brave Evolution',
'Ruby of Atlantis: The Quake of Peace',
'Sky of Zelda: The Thunder of Force',
'Vyse\'s Skies',
'White Greatness III',
'Yellow Divinity',
'Zidane\'s Ghost'
'The Burning Gallows', 'The Ring of Nenlast',
'Below the Blind Tavern', 'Below the Hungering River',
'Before Bahamut\'s Land', 'The Cruel Grave from Within',
'The Strength of Trade Road', 'Through The Raven Queen\'s Worlds',
'Within the Settlement', 'The Crown from Within',
'The Merchant Within the Battlefield', 'Ioun\'s Fading Traveler',
'The Legion Ingredient', 'The Explorer Lure',
'Before the Charming Badlands', 'Vecna\'s Hidden Sage',
'The Living Dead Above the Fearful Cage', 'Bahamut\'s Demonspawn',
'Across Gruumsh\'s Elemental Chaos', 'The Blade of Orcus',
'Beyond Revenge', 'Brain of Insanity',
'Breed Battle!, A New Beginning', 'Evil Lake, A New Beginning',
'Invasion of the Gigantic Cat, Part II', 'Kraken War 2020',
'The Body Whisperers', 'The Doctor from Heaven',
'The Diabolical Tales of the Ape-Women', 'The Doctor Immortal',
'Core of Heaven: Guardian of Amazement', 'The Graveyard',
'Guardian: Skies of the Dark Wizard', 'Lute of Eternity',
'Mercury\'s Planet: Brave Evolution', 'Azure Core',
'Sky of Zelda: The Thunder of Force', 'Core Battle',
'Ruby of Atlantis: The Quake of Peace', 'Deadly Amazement III',
'Dry Chaos IX', 'Gate Thunder',
'Vyse\'s Skies', 'White Greatness III',
'Yellow Divinity', 'Zidane\'s Ghost'
];
const subtitles = [
'Tomb of Shadows', 'Dragon\'s Lair',
'Lost Caverns', 'The Necromancer',
'Mystic Forest', 'Cursed Ruins',
'The Dark Abyss', 'Enchanted Maze',
'Haunted Castle', 'Sands of Fate',
'Dragon\'s Hoard', 'Undead Menace',
'Lost City Ruins', 'Goblin Ambush',
'Enchanted Forest', 'Darkness Rising',
'Quest for Glory', 'Ancient Prophecy',
'Shadowy Depths', 'Mystic Isles'
];
const footnote = [
'In an ominous universe, a botanist opposes terrorism.',
'In a demon-haunted city, in an age of lies and hate, a physicist tries to find an ancient treasure and battles a mob of aliens.',
'In a land of corruption, two cyberneticists and a dungeon delver search for freedom.',
@@ -74,51 +65,26 @@ const subtitles = [
'On a planet of mysticism, three travelers and a fire fighter quest for the ultimate weapon and oppose evil.',
'In a wicked universe, five seers fight lawlessness.',
'In a kingdom of death, in an era of illusion and blood, four colonists search for fame.',
'In an amazing kingdom, in an age of sorcery and lost souls, eight space pirates quest for freedom.',
'In a cursed empire, five inventors oppose terrorism.',
'On a crime-ridden planet of conspiracy, a watchman and an artificial intelligence try to find love and oppose lawlessness.',
'In a forgotten land, a reporter and a spy try to stop the apocalypse.',
'In a forbidden land of prophecy, a scientist and an archivist oppose a cabal of barbarians intent on stealing the souls of the innocent.',
'On an infernal world of illusion, a grave robber and a watchman try to find revenge and combat a syndicate of mages intent on stealing the source of all magic.',
'In a galaxy of dark magic, four fighters seek freedom.',
'In an empire of deception, six tomb-robbers quest for the ultimate weapon and combat an army of raiders.',
'In a kingdom of corruption and lost souls, in an age of panic, eight planetologists oppose evil.',
'In a galaxy of misery and hopelessness, in a time of agony and pain, five planetologists search for vengance.',
'In a universe of technology and insanity, in a time of sorcery, a computer techician quests for hope.',
'On a planet of dark magic and barbarism, in an age of horror and blasphemy, seven librarians search for fame.',
'In an empire of dark magic, in a time of blood and illusions, four monks try to find the ultimate weapon and combat terrorism.',
'In a forgotten empire of dark magic, six kings try to prevent the destruction of mankind.',
'In a galaxy of dark magic and horror, in an age of hopelessness, four marines and an outlaw combat evil.',
'In a mysterious city of illusion, in an age of computerization, a witch-hunter tries to find the ultimate weapon and opposes an evil corporation.',
'In a damned kingdom of technology, a virtual reality programmer and a fighter seek fame.',
'In a hellish kingdom, in an age of blasphemy and blasphemy, an astrologer searches for fame.',
'In a damned world of devils, an alien and a ranger quest for love and oppose a syndicate of demons.',
'In a cursed galaxy, in a time of pain, seven librarians hope to avert the apocalypse.',
'In a crime-infested galaxy, in an era of hopelessness and panic, three champions and a grave robber try to solve the ultimate crime.'
'In an amazing kingdom, in an age of sorcery and lost souls, eight space pirates quest for freedom.'
];
module.exports = ()=>{
return `<style>
.page#p1{ text-align:center; counter-increment: none; }
.page#p1:after{ display:none; }
.page:nth-child(2n) .pageNumber { left: inherit !important; right: 2px !important; }
.page:nth-child(2n+1) .pageNumber { right: inherit !important; left: 2px !important; }
.page:nth-child(2n)::after { transform: scaleX(1); }
.page:nth-child(2n+1)::after { transform: scaleX(-1); }
.page:nth-child(2n) .footnote { left: inherit; text-align: right; }
.page:nth-child(2n+1) .footnote { left: 80px; text-align: left; }
</style>
return dedent`
{{coverPage }}
{{margin-top:225px}}
{{logo ![](/assets/naturalCritLogo.svg)}}
# ${_.sample(titles)}
# ${_.sample(titles)}
## ${_.sample(subtitles)}
__________
{{margin-top:25px}}
{{banner HOMEBREW}}
{{wide
##### ${_.sample(subtitles)}
}}
{{footnote
${_.sample(footnote)}
}}
\\page`;
};
![background image](https://i.imgur.com/Mqx8Vf7.png)
\page`;
};

File diff suppressed because it is too large Load Diff

View File

@@ -1,9 +1,8 @@
/* eslint-disable max-lines */
const WatercolorGen = require('./snippets/watercolor.gen.js');
const dedent = require('dedent-tabs').default;
const WatercolorGen = require('./snippets/watercolor.gen.js');
const ImageMaskGen = require('./snippets/imageMask.gen.js');
const dedent = require('dedent-tabs').default;
module.exports = [
@@ -102,6 +101,60 @@ module.exports = [
icon : 'fas fa-fill-drip',
gen : WatercolorGen,
},
{
name : 'Watercolor Image Mask Edge',
icon : 'fac mask-edge',
gen : ImageMaskGen.edge('bottom'),
subsnippets : [
{
name : 'Top',
icon : 'fac position-top',
gen : ImageMaskGen.edge('top'),
},
{
name : 'Right',
icon : 'fac position-right',
gen : ImageMaskGen.edge('right'),
},
{
name : 'Bottom',
icon : 'fac position-bottom',
gen : ImageMaskGen.edge('bottom'),
},
{
name : 'Left',
icon : 'fac position-left',
gen : ImageMaskGen.edge('left'),
},
]
},
{
name : 'Watercolor Image Mask Corner',
icon : 'fac mask-corner',
gen : ImageMaskGen.corner,
subsnippets : [
{
name : 'Top-Left',
icon : 'fac position-top-left',
gen : ImageMaskGen.corner('top', 'left'),
},
{
name : 'Top-Right',
icon : 'fac position-top-right',
gen : ImageMaskGen.corner('top', 'right'),
},
{
name : 'Bottom-Left',
icon : 'fac position-bottom-left',
gen : ImageMaskGen.corner('bottom', 'left'),
},
{
name : 'Bottom-Right',
icon : 'fac position-bottom-right',
gen : ImageMaskGen.corner('bottom', 'right'),
}
]
},
{
name : 'Watermark',
icon : 'fas fa-id-card',

View File

@@ -0,0 +1,36 @@
const _ = require('lodash');
const dedent = require('dedent-tabs').default;
module.exports = {
edge : (side = 'bottom')=>{
const rotation = {
'bottom' : 0,
'top' : 180,
'left' : 90,
'right' : 270
}[side];
return dedent`
{{imageMaskEdge${_.random(1, 8)},--offset:0cm,--rotation:${rotation}
![](https://i.imgur.com/GZfjDWV.png){height:100%}
}}
<!-- Use --offset to shift the mask toward or away from the page center.
Use --rotation to set rotation angle in degrees. -->\n\n`;
},
corner : (y = 'top', x = 'left')=>{
const offsetX = (x == 'left' ? '-50%' : '50%');
const offsetY = (y == 'top' ? '50%' : '-50%');
return dedent`
{{imageMaskCorner${_.random(1, 37)},--offsetX:${offsetX},--offsetY:${offsetY},--rotation:0
![](https://i.imgur.com/GZfjDWV.png){height:100%}
}}
<!-- Use --offsetX to shift the mask left or right (can use cm instead of %)
Use --offsetY to shift the mask up or down
Use --rotation to set rotation angle in degrees. -->\n\n`;
}
};
()=>{
};

View File

@@ -16,6 +16,21 @@
-webkit-print-color-adjust : exact;
}
//*****************************
// * MUSTACHE DIVS/SPANS
// *****************************/
.page {
.block {
break-inside : avoid;
display : inline-block;
width : 100%;
}
.inline-block {
display : inline-block;
text-indent : initial;
}
}
.useColumns(@multiplier : 1, @fillMode: balance){
column-fill : @fillMode;
column-count : 2;
@@ -116,6 +131,50 @@
margin-top : 0; // have vertical spacing.
}
//************************************
// * CODE BLOCKS
// ************************************/
code{
font-family : "Courier New", Courier, monospace;
white-space : pre-wrap;
overflow-wrap : break-word;
}
pre code{
width : 100%;
display : inline-block;
}
//*****************************
// * EXTRAS
// *****************************/
.columnSplit {
visibility : hidden;
-webkit-column-break-after : always;
break-after : always;
-moz-column-break-after : always;
margin-top : 0;
& + * {
margin-top : 0;
}
}
//Avoid breaking up
blockquote,table{
z-index : 15;
-webkit-column-break-inside : avoid;
page-break-inside : avoid;
break-inside : avoid;
}
// Nested lists
ul ul,ol ol,ul ol,ol ul{
margin-bottom : 0px;
margin-left : 1.5em;
}
li{
-webkit-column-break-inside : avoid;
page-break-inside : avoid;
break-inside : avoid;
}
/* Watermark */
.watermark {
display : grid !important;
@@ -169,64 +228,139 @@
.watercolor11 { --wc : @watercolor11; }
.watercolor12 { --wc : @watercolor12; }
//************************************
// * CODE BLOCKS
// ************************************/
code{
font-family : "Courier New", Courier, monospace;
white-space : pre-wrap;
overflow-wrap : break-word;
}
pre code{
width : 100%;
display : inline-block;
}
//*****************************
// * EXTRAS
// *****************************/
.columnSplit {
visibility : hidden;
-webkit-column-break-after : always;
break-after : always;
-moz-column-break-after : always;
margin-top : 0;
& + * {
margin-top : 0;
/* Image Masks */
[class*="imageMask"] {
position : absolute;
height : 200%;
width : 200%;
left : 50%;
bottom : 50%;
--rotation : 0;
--revealer : none;
--checkerboard : none;
--scaleX : 1;
--scaleY : 1;
-webkit-mask-image : var(--wc), var(--revealer);
-webkit-mask-repeat : repeat-x;
-webkit-mask-size : 50%; //Scale only X to fit page width, leave height at aspect ratio, designed to hang off the edge
-webkit-mask-position : 50% calc(50% - var(--offset));
mask-image : var(--wc);
mask-repeat : repeat-x;
mask-size : 50%;
mask-position : 50% calc(50% - var(--offset));
background-image : var(--checkerboard);
background-size : 20px;
z-index : -1;
transform : translateY(50%) translateX(-50%) rotate(calc(1deg * var(--rotation))) scaleX(var(--scaleX)) scaleY(var(--scaleY));
transition : transform 2s;
& > p:has(img) {
position : absolute;
width : 50%;
height : 50%;
bottom : 50%;
left : 50%;
transform : translateX(-50%) translateY(50%) rotate(calc(-1deg * var(--rotation))) scaleX(calc(1 / var(--scaleX))) scaleY(calc(1 / var(--scaleY)));
transition : transform 2s;
}
& img {
position : absolute;
display : block;
bottom : 0;
}
&.bottom {
--rotation : 0;
& img {bottom: 0;}
}
&.top {
--rotation : 180;
& img {top: 0;}
}
&.left {
--rotation : 90;
& img {left: 0;}
}
&.right {
--rotation : -90;
& img {right: 0;}
}
&.revealImage {
--revealer : linear-gradient(0deg, rgba(0,0,0,.2) 0%, rgba(0,0,0,0.2));
--checkerboard : url(/assets/waterColorMasks/missingImage.png); //shows any masked regions not filled by image
}
}
//Avoid breaking up
blockquote,table{
z-index : 15;
-webkit-column-break-inside : avoid;
page-break-inside : avoid;
break-inside : avoid;
}
// Nested lists
ul ul,ol ol,ul ol,ol ul{
margin-bottom : 0px;
margin-left : 1.5em;
}
li{
-webkit-column-break-inside : avoid;
page-break-inside : avoid;
break-inside : avoid;
}
}
//*****************************
// * MUSTACHE DIVS/SPANS
// *****************************/
.page {
.block {
break-inside : avoid;
display : inline-block;
width : 100%;
}
.inline-block {
display : inline-block;
text-indent : initial;
.imageMaskEdge1 { --wc : url(/assets/waterColorMasks/edge/0001.webp); }
.imageMaskEdge2 { --wc : url(/assets/waterColorMasks/edge/0002.webp); }
.imageMaskEdge3 { --wc : url(/assets/waterColorMasks/edge/0003.webp); }
.imageMaskEdge4 { --wc : url(/assets/waterColorMasks/edge/0004.webp); }
.imageMaskEdge5 { --wc : url(/assets/waterColorMasks/edge/0005.webp); }
.imageMaskEdge6 { --wc : url(/assets/waterColorMasks/edge/0006.webp); }
.imageMaskEdge7 { --wc : url(/assets/waterColorMasks/edge/0007.webp); }
.imageMaskEdge8 { --wc : url(/assets/waterColorMasks/edge/0008.webp); }
[class*="imageMaskCorner"] {
height : 200%;
width : 200%;
left : calc(-50% + var(--offsetX));
bottom : calc(-50% + var(--offsetY));
-webkit-mask-image : var(--wc), var(--revealer);
-webkit-mask-repeat : no-repeat;
-webkit-mask-size : 100% 100%; //Scale both dimensions to fit page size
-webkit-mask-position : 50% 50%;
mask-image : var(--wc), var(--revealer);
mask-repeat : no-repeat;
mask-size : 100% 100%; //Scale both dimensions to fit page size
mask-position : 50% 50%;
transform : rotate(calc(1deg * var(--rotation))) scaleX(var(--scaleX)) scaleY(var(--scaleY));;
& > p:has(img) {
width : 50%;
height : 50%; //Complex transform below to handle mix of % and cm offsets
left : 25%;
bottom : 25%;
transform : scaleX(calc(1 / var(--scaleX))) scaleY(calc(1 / var(--scaleY)))
rotate(calc(-1deg * var(--rotation)))
translateX(calc(-1 * var(--offsetX)))
translateY(calc(1 * var(--offsetY)));
}
}
.imageMaskCorner1 { --wc : url(/assets/waterColorMasks/corner/0001.webp); }
.imageMaskCorner2 { --wc : url(/assets/waterColorMasks/corner/0002.webp); }
.imageMaskCorner3 { --wc : url(/assets/waterColorMasks/corner/0003.webp); }
.imageMaskCorner4 { --wc : url(/assets/waterColorMasks/corner/0004.webp); }
.imageMaskCorner5 { --wc : url(/assets/waterColorMasks/corner/0005.webp); }
.imageMaskCorner6 { --wc : url(/assets/waterColorMasks/corner/0006.webp); }
.imageMaskCorner7 { --wc : url(/assets/waterColorMasks/corner/0007.webp); }
.imageMaskCorner8 { --wc : url(/assets/waterColorMasks/corner/0008.webp); }
.imageMaskCorner9 { --wc : url(/assets/waterColorMasks/corner/0009.webp); }
.imageMaskCorner10 { --wc : url(/assets/waterColorMasks/corner/0010.webp); }
.imageMaskCorner11 { --wc : url(/assets/waterColorMasks/corner/0011.webp); }
.imageMaskCorner12 { --wc : url(/assets/waterColorMasks/corner/0012.webp); }
.imageMaskCorner13 { --wc : url(/assets/waterColorMasks/corner/0013.webp); }
.imageMaskCorner14 { --wc : url(/assets/waterColorMasks/corner/0014.webp); }
.imageMaskCorner15 { --wc : url(/assets/waterColorMasks/corner/0015.webp); }
.imageMaskCorner16 { --wc : url(/assets/waterColorMasks/corner/0016.webp); }
.imageMaskCorner17 { --wc : url(/assets/waterColorMasks/corner/0017.webp); }
.imageMaskCorner18 { --wc : url(/assets/waterColorMasks/corner/0018.webp); }
.imageMaskCorner19 { --wc : url(/assets/waterColorMasks/corner/0019.webp); }
.imageMaskCorner20 { --wc : url(/assets/waterColorMasks/corner/0020.webp); }
.imageMaskCorner21 { --wc : url(/assets/waterColorMasks/corner/0021.webp); }
.imageMaskCorner22 { --wc : url(/assets/waterColorMasks/corner/0022.webp); }
.imageMaskCorner23 { --wc : url(/assets/waterColorMasks/corner/0023.webp); }
.imageMaskCorner24 { --wc : url(/assets/waterColorMasks/corner/0024.webp); }
.imageMaskCorner25 { --wc : url(/assets/waterColorMasks/corner/0025.webp); }
.imageMaskCorner26 { --wc : url(/assets/waterColorMasks/corner/0026.webp); }
.imageMaskCorner27 { --wc : url(/assets/waterColorMasks/corner/0027.webp); }
.imageMaskCorner28 { --wc : url(/assets/waterColorMasks/corner/0028.webp); }
.imageMaskCorner29 { --wc : url(/assets/waterColorMasks/corner/0029.webp); }
.imageMaskCorner30 { --wc : url(/assets/waterColorMasks/corner/0030.webp); }
.imageMaskCorner31 { --wc : url(/assets/waterColorMasks/corner/0031.webp); }
.imageMaskCorner32 { --wc : url(/assets/waterColorMasks/corner/0032.webp); }
.imageMaskCorner33 { --wc : url(/assets/waterColorMasks/corner/0033.webp); }
.imageMaskCorner34 { --wc : url(/assets/waterColorMasks/corner/0034.webp); }
.imageMaskCorner35 { --wc : url(/assets/waterColorMasks/corner/0035.webp); }
.imageMaskCorner36 { --wc : url(/assets/waterColorMasks/corner/0036.webp); }
.imageMaskCorner37 { --wc : url(/assets/waterColorMasks/corner/0037.webp); }
}
//*****************************

File diff suppressed because it is too large Load Diff