0
0
mirror of https://github.com/naturalcrit/homebrewery.git synced 2026-01-07 05:32:41 +00:00

Merge branch 'master' into metadata-panel-css-tweak

This commit is contained in:
Gazook89
2021-08-16 13:30:07 -05:00
12 changed files with 305 additions and 54 deletions

View File

@@ -167,6 +167,10 @@ const MetadataEditor = createClass({
onChange={(e)=>this.handleRenderer('V3', e)} />
V3
</label>
<a href='/v3_preview' target='_blank' rel='noopener noreferrer'>
Click here for a quick intro to V3!
</a>
</div>
</div>;
},

View File

@@ -43,6 +43,11 @@
display : inline-flex;
align-items : center;
}
a {
font-size : 0.7em;
font-weight : 800;
display : inline-flex;
}
input{
vertical-align : middle;
cursor : pointer;

View File

@@ -39,12 +39,10 @@ const Snippetbar = createClass({
renderSnippetGroups : function(){
let snippets = [];
if(this.props.view === 'text') {
if(this.props.renderer === 'V3')
snippets = SnippetsV3;
else
snippets = SnippetsLegacy;
}
if(this.props.renderer === 'V3')
snippets = SnippetsV3.filter((snippetGroup)=>snippetGroup.view === this.props.view);
else
snippets = SnippetsLegacy.filter((snippetGroup)=>snippetGroup.view === this.props.view);
return _.map(snippets, (snippetGroup)=>{
return <SnippetGroup

View File

@@ -14,6 +14,7 @@ module.exports = [
{
groupName : 'Editor',
icon : 'fas fa-pencil-alt',
view : 'text',
snippets : [
{
name : 'Column Break',
@@ -139,6 +140,7 @@ module.exports = [
{
groupName : 'PHB',
icon : 'fas fa-book',
view : 'text',
snippets : [
{
name : 'Spell',
@@ -230,6 +232,7 @@ module.exports = [
{
groupName : 'Tables',
icon : 'fas fa-table',
view : 'text',
snippets : [
{
name : 'Class Table',
@@ -307,33 +310,54 @@ module.exports = [
/**************** PRINT *************/
/**************** PAGE *************/
{
groupName : 'Print',
icon : 'fas fa-print',
view : 'style',
snippets : [
{
name : 'A4 PageSize',
name : 'A4 Page Size',
icon : 'far fa-file',
gen : ['<style>',
' .phb{',
' width : 210mm;',
' height : 296.8mm;',
' }',
'</style>'
gen : ['/* A4 Page Size */',
'.page{',
' width : 210mm;',
' height : 296.8mm;',
'}',
''
].join('\n')
},
{
name : 'Square Page Size',
icon : 'far fa-file',
gen : ['/* Square Page Size */',
'.page {',
' width : 125mm;',
' height : 125mm;',
' padding : 12.5mm;',
' columns : unset;',
'}',
''
].join('\n')
},
{
name : 'Ink Friendly',
icon : 'fas fa-tint',
gen : ['<style>',
' .phb{ background : white;}',
' .phb img{ display : none;}',
' .phb hr+blockquote{background : white;}',
'</style>',
''
].join('\n')
gen : dedent`
/* Ink Friendly */
.pages *:is(.page,.monster,.note,.descriptive) {
background : white !important;
box-shadow : 0px 0px 3px !important;
}
.page .note:before {
box-shadow : 0px 0px 3px;
}
.page img {
visibility : hidden;
}`
},
]
},

View File

@@ -6,13 +6,14 @@ const MonsterBlockGen = require('./monsterblock.gen.js');
const ClassFeatureGen = require('./classfeature.gen.js');
const CoverPageGen = require('./coverpage.gen.js');
const TableOfContentsGen = require('./tableOfContents.gen.js');
const dedent = require('dedent-tabs').default;
module.exports = [
{
groupName : 'Editor',
icon : 'fas fa-pencil-alt',
view : 'text',
snippets : [
{
name : 'Column Break',
@@ -114,6 +115,7 @@ module.exports = [
{
groupName : 'PHB',
icon : 'fas fa-book',
view : 'text',
snippets : [
{
name : 'Spell',
@@ -189,6 +191,7 @@ module.exports = [
{
groupName : 'Tables',
icon : 'fas fa-table',
view : 'text',
snippets : [
{
name : 'Class Table',
@@ -273,28 +276,44 @@ module.exports = [
{
groupName : 'Print',
icon : 'fas fa-print',
view : 'style',
snippets : [
{
name : 'A4 PageSize',
name : 'A4 Page Size',
icon : 'far fa-file',
gen : ['<style>',
' .phb{',
' width : 210mm;',
' height : 296.8mm;',
' }',
'</style>'
gen : ['/* A4 Page Size */',
'.phb {',
' width : 210mm;',
' height : 296.8mm;',
'}'
].join('\n')
},
{
name : 'Square Page Size',
icon : 'far fa-file',
gen : ['/* Square Page Size */',
'.phb {',
' width : 125mm;',
' height : 125mm;',
' padding : 12.5mm;',
' columns : unset;',
'}',
''
].join('\n')
},
{
name : 'Ink Friendly',
icon : 'fas fa-tint',
gen : ['<style>',
' .phb{ background : white;}',
' .phb img{ display : none;}',
' .phb hr+blockquote{background : white;}',
'</style>',
''
].join('\n')
gen : dedent`
/* Ink Friendly */',
.phb, .phb blockquote, .phb hr+blockquote {
background : white;
box-shadow : 0px 0px 3px;
}
.phb img {
visibility : hidden;
}`
},
]
},