diff --git a/client/homebrew/editor/snippetbar/snippetbar.jsx b/client/homebrew/editor/snippetbar/snippetbar.jsx index 0c054b12b..9ea04695f 100644 --- a/client/homebrew/editor/snippetbar/snippetbar.jsx +++ b/client/homebrew/editor/snippetbar/snippetbar.jsx @@ -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 ', - ' .phb{', - ' width : 210mm;', - ' height : 296.8mm;', - ' }', - '' + 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 : ['', - '' - ].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; + }` }, ] }, diff --git a/client/homebrew/editor/snippetbar/snippetsLegacy/snippets.js b/client/homebrew/editor/snippetbar/snippetsLegacy/snippets.js index 69f8e1597..9d31ddde5 100644 --- a/client/homebrew/editor/snippetbar/snippetsLegacy/snippets.js +++ b/client/homebrew/editor/snippetbar/snippetsLegacy/snippets.js @@ -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 : ['' + 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 : ['', - '' - ].join('\n') + gen : dedent` + /* Ink Friendly */', + .phb, .phb blockquote, .phb hr+blockquote { + background : white; + box-shadow : 0px 0px 3px; + } + + .phb img { + visibility : hidden; + }` }, ] },