From 143d390895d45a4f7bac56a74c1bd10028a84f6a Mon Sep 17 00:00:00 2001 From: Gazook89 <58999374+Gazook89@users.noreply.github.com> Date: Sat, 14 Aug 2021 19:50:12 -0500 Subject: [PATCH 01/10] Add "Style Editor" menu to Style pane And other tweaks: - Move drop caps snippets to Style Editor menu - retitle Editor menu to either Text Editor or Style Editor - minor: removed old unnecessary comments in code from earlier (my own). - Removed leading spaces on drop cap comment - added drop cap comment on "remove drop caps" snippet. --- .../editor/snippetbar/snippets/snippets.js | 47 ++++++++++++------- 1 file changed, 29 insertions(+), 18 deletions(-) diff --git a/client/homebrew/editor/snippetbar/snippets/snippets.js b/client/homebrew/editor/snippetbar/snippets/snippets.js index a4c47d765..b8116d40d 100644 --- a/client/homebrew/editor/snippetbar/snippets/snippets.js +++ b/client/homebrew/editor/snippetbar/snippets/snippets.js @@ -12,7 +12,7 @@ const dedent = require('dedent-tabs').default; module.exports = [ { - groupName : 'Editor', + groupName : 'Text Editor', icon : 'fas fa-pencil-alt', view : 'text', snippets : [ @@ -91,34 +91,45 @@ module.exports = [ icon : 'fas fa-book', gen : TableOfContentsGen }, + { + name : 'Add Comment', + icon : 'fas fa-code', + gen : dedent`\n + + ` + }, + ] + }, + { + groupName : 'Style Editor', + icon : 'fas fa-pencil-alt', + view : 'style', + snippets : [ { name : 'Remove Drop Cap', icon : 'fas fa-remove-format', - gen : '' + gen : '/* Removes Drop Caps */\n' + + '.phb3 h1+p:first-letter {\n' + + ' all: unset;\n' + + '}\n' }, { name : 'Tweak Drop Cap', icon : 'fas fa-sliders-h', - gen : '' + gen : '/* Drop Cap settings */\n' + + '.phb3 h1 + p::first-letter {\n' + + ' float: left;\n' + + ' font-family: SolberaImitationRemake;\n' + + ' font-size: 3.5cm;\n' + + ' color: #222;\n' + + ' line-height: .8em;\n' + + '}\n' }, { name : 'Add Comment', - icon : 'fas fa-code', /* might need to be fa-solid fa-comment-code --not sure, Gazook */ + icon : 'fas fa-code', gen : dedent`\n - + /* This is a comment that will not be rendered into your brew. Hotkey (Ctrl/Cmd + /). */ ` }, ] From 84698aa68fc51ef10fd60e730669a28a72d97b4f Mon Sep 17 00:00:00 2001 From: Gazook89 <58999374+Gazook89@users.noreply.github.com> Date: Sat, 14 Aug 2021 20:18:11 -0500 Subject: [PATCH 02/10] Match changes in commit 143d390 to Legacy Matching legacy to v3 (adds another menu to style editor, etc). --- .../snippetbar/snippetsLegacy/snippets.js | 45 ++++++++++++------- 1 file changed, 28 insertions(+), 17 deletions(-) diff --git a/client/homebrew/editor/snippetbar/snippetsLegacy/snippets.js b/client/homebrew/editor/snippetbar/snippetsLegacy/snippets.js index b9cf865a9..fe1fa87f6 100644 --- a/client/homebrew/editor/snippetbar/snippetsLegacy/snippets.js +++ b/client/homebrew/editor/snippetbar/snippetsLegacy/snippets.js @@ -11,7 +11,7 @@ const TableOfContentsGen = require('./tableOfContents.gen.js'); module.exports = [ { - groupName : 'Editor', + groupName : 'Text Editor', icon : 'fas fa-pencil-alt', view : 'text', snippets : [ @@ -78,33 +78,44 @@ module.exports = [ icon : 'fas fa-book', gen : TableOfContentsGen }, + { + name : 'Add Comment', + icon : 'fas fa-code', + gen : `\n\n\n` + } + ] + }, + + + { + groupName : 'Style Editor', + icon : 'fas fa-pencil-alt', + view : 'style', + snippets : [ { name : 'Remove Drop Cap', icon : 'fas fa-remove-format', - gen : '' + gen : '/* Removes Drop Caps */\n' + + '.phb h1+p:first-letter {\n' + + ' all: unset;\n' + + '}\n' }, { name : 'Tweak Drop Cap', icon : 'fas fa-sliders-h', - gen : '' + gen : '/* Drop Cap Settings */\n' + + '.phb h1 + p::first-letter {\n' + + ' float: left;\n' + + ' font-family: Solberry;\n' + + ' font-size: 10em;\n' + + ' color: #222;\n' + + ' line-height: .8em;\n' + + '}\n' }, { name : 'Add Comment', icon : 'fas fa-code', - gen : `\n\n\n` + gen : `\n/* This is a comment that will not be rendered into your brew. Hotkey (Ctrl/Cmd + /). */\n\n` } ] }, From 4653fcd7821f9ed4fb6bcc7bddb6a7d3b15a7ed1 Mon Sep 17 00:00:00 2001 From: Gazook89 <58999374+Gazook89@users.noreply.github.com> Date: Sat, 14 Aug 2021 20:24:51 -0500 Subject: [PATCH 03/10] Remove reference to hotkeys in Style Comments Removed reference to hotkeys for commenting in the Style Editor since that is not implemented yet. can be added back to match the Text Editor commenting snippet once implemented. --- client/homebrew/editor/snippetbar/snippets/snippets.js | 2 +- client/homebrew/editor/snippetbar/snippetsLegacy/snippets.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/client/homebrew/editor/snippetbar/snippets/snippets.js b/client/homebrew/editor/snippetbar/snippets/snippets.js index b8116d40d..53c41fc63 100644 --- a/client/homebrew/editor/snippetbar/snippets/snippets.js +++ b/client/homebrew/editor/snippetbar/snippets/snippets.js @@ -129,7 +129,7 @@ module.exports = [ name : 'Add Comment', icon : 'fas fa-code', gen : dedent`\n - /* This is a comment that will not be rendered into your brew. Hotkey (Ctrl/Cmd + /). */ + /* This is a comment that will not be rendered into your brew. */ ` }, ] diff --git a/client/homebrew/editor/snippetbar/snippetsLegacy/snippets.js b/client/homebrew/editor/snippetbar/snippetsLegacy/snippets.js index fe1fa87f6..2ec29746c 100644 --- a/client/homebrew/editor/snippetbar/snippetsLegacy/snippets.js +++ b/client/homebrew/editor/snippetbar/snippetsLegacy/snippets.js @@ -115,7 +115,7 @@ module.exports = [ { name : 'Add Comment', icon : 'fas fa-code', - gen : `\n/* This is a comment that will not be rendered into your brew. Hotkey (Ctrl/Cmd + /). */\n\n` + gen : `\n/* This is a comment that will not be rendered into your brew. */\n\n` } ] }, From 3063337eb211a4e83d3db65edeb3cd4297783183 Mon Sep 17 00:00:00 2001 From: Gazook89 <58999374+Gazook89@users.noreply.github.com> Date: Sun, 5 Sep 2021 15:40:08 -0500 Subject: [PATCH 04/10] update v3 drop cap tweak to match new styling and change v3 drop cap to use only `background` rather than `background-image` so that the tweak snippet can easily change between gradient and just a regular color. and re-order table menu so that the regular table snippet is at top. --- .../editor/snippetbar/snippets/snippets.js | 65 +++++++++---------- .../snippetbar/snippetsLegacy/snippets.js | 20 +++--- themes/5ePhb.style.less | 2 +- 3 files changed, 43 insertions(+), 44 deletions(-) diff --git a/client/homebrew/editor/snippetbar/snippets/snippets.js b/client/homebrew/editor/snippetbar/snippets/snippets.js index 37f37e2b6..b965e59a2 100644 --- a/client/homebrew/editor/snippetbar/snippets/snippets.js +++ b/client/homebrew/editor/snippetbar/snippets/snippets.js @@ -106,11 +106,10 @@ module.exports = [ icon : 'fas fa-sliders-h', gen : '/* Drop Cap settings */\n' + '.phb3 h1 + p::first-letter {\n' + - ' float: left;\n' + ' font-family: SolberaImitationRemake;\n' + ' font-size: 3.5cm;\n' + - ' color: #222;\n' + - ' line-height: .8em;\n' + + ' background: linear-gradient(-45deg, #322814, #998250, #322814);\n' + + ' line-height: 1em;\n' + '}\n' }, { @@ -265,36 +264,6 @@ module.exports = [ icon : 'fas fa-table', view : 'text', snippets : [ - { - name : 'Class Table', - icon : 'fas fa-table', - gen : ClassTableGen.full('classTable,frame,decoration,wide'), - }, - { - name : 'Class Table (unframed)', - icon : 'fas fa-border-none', - gen : ClassTableGen.full('classTable,wide'), - }, - { - name : '1/2 Class Table', - icon : 'fas fa-list-alt', - gen : ClassTableGen.half('classTable,decoration,frame'), - }, - { - name : '1/2 Class Table (unframed)', - icon : 'fas fa-border-none', - gen : ClassTableGen.half('classTable'), - }, - { - name : '1/3 Class Table', - icon : 'fas fa-border-all', - gen : ClassTableGen.third('classTable,frame'), - }, - { - name : '1/3 Class Table (unframed)', - icon : 'fas fa-border-none', - gen : ClassTableGen.third('classTable'), - }, { name : 'Table', icon : 'fas fa-th-list', @@ -354,6 +323,36 @@ module.exports = [ }} \n`; } + }, + { + name : 'Class Table', + icon : 'fas fa-table', + gen : ClassTableGen.full('classTable,frame,decoration,wide'), + }, + { + name : 'Class Table (unframed)', + icon : 'fas fa-border-none', + gen : ClassTableGen.full('classTable,wide'), + }, + { + name : '1/2 Class Table', + icon : 'fas fa-list-alt', + gen : ClassTableGen.half('classTable,decoration,frame'), + }, + { + name : '1/2 Class Table (unframed)', + icon : 'fas fa-border-none', + gen : ClassTableGen.half('classTable'), + }, + { + name : '1/3 Class Table', + icon : 'fas fa-border-all', + gen : ClassTableGen.third('classTable,frame'), + }, + { + name : '1/3 Class Table (unframed)', + icon : 'fas fa-border-none', + gen : ClassTableGen.third('classTable'), } ] }, diff --git a/client/homebrew/editor/snippetbar/snippetsLegacy/snippets.js b/client/homebrew/editor/snippetbar/snippetsLegacy/snippets.js index b7caaa82e..fbf5cd359 100644 --- a/client/homebrew/editor/snippetbar/snippetsLegacy/snippets.js +++ b/client/homebrew/editor/snippetbar/snippetsLegacy/snippets.js @@ -204,16 +204,6 @@ module.exports = [ icon : 'fas fa-table', view : 'text', snippets : [ - { - name : 'Class Table', - icon : 'fas fa-table', - gen : ClassTableGen.full, - }, - { - name : 'Half Class Table', - icon : 'fas fa-list-alt', - gen : ClassTableGen.half, - }, { name : 'Table', icon : 'fas fa-th-list', @@ -275,6 +265,16 @@ module.exports = [ '\n\n', ].join('\n'); }, + }, + { + name : 'Class Table', + icon : 'fas fa-table', + gen : ClassTableGen.full, + }, + { + name : 'Half Class Table', + icon : 'fas fa-list-alt', + gen : ClassTableGen.half, } ] }, diff --git a/themes/5ePhb.style.less b/themes/5ePhb.style.less index e17a9038e..74ec8d8d1 100644 --- a/themes/5ePhb.style.less +++ b/themes/5ePhb.style.less @@ -145,7 +145,7 @@ body { margin-top :-0.3cm; padding-bottom :2px; margin-bottom :-20px; - background-image : linear-gradient(-45deg, #322814, #998250, #322814); + background : linear-gradient(-45deg, #322814, #998250, #322814); background-clip : text; -webkit-background-clip : text; color : rgba(0, 0, 0, 0); From ad5d7d20979db64f1a73f4933f57063848af0c7a Mon Sep 17 00:00:00 2001 From: Gazook89 <58999374+Gazook89@users.noreply.github.com> Date: Sun, 5 Sep 2021 16:21:23 -0500 Subject: [PATCH 05/10] added dedents --- .../editor/snippetbar/snippets/snippets.js | 60 ++++++++----------- .../snippetbar/snippetsLegacy/snippets.js | 28 ++++----- 2 files changed, 40 insertions(+), 48 deletions(-) diff --git a/client/homebrew/editor/snippetbar/snippets/snippets.js b/client/homebrew/editor/snippetbar/snippets/snippets.js index b965e59a2..91260f396 100644 --- a/client/homebrew/editor/snippetbar/snippets/snippets.js +++ b/client/homebrew/editor/snippetbar/snippets/snippets.js @@ -82,9 +82,7 @@ module.exports = [ { name : 'Add Comment', icon : 'fas fa-code', - gen : dedent`\n - - ` + gen : '' }, ] }, @@ -96,28 +94,26 @@ module.exports = [ { name : 'Remove Drop Cap', icon : 'fas fa-remove-format', - gen : '/* Removes Drop Caps */\n' + - '.phb3 h1+p:first-letter {\n' + - ' all: unset;\n' + - '}\n' + gen : dedent`/* Removes Drop Caps */ + .phb3 h1+p:first-letter { + all: unset; + }\n\n` }, { name : 'Tweak Drop Cap', icon : 'fas fa-sliders-h', - gen : '/* Drop Cap settings */\n' + - '.phb3 h1 + p::first-letter {\n' + - ' font-family: SolberaImitationRemake;\n' + - ' font-size: 3.5cm;\n' + - ' background: linear-gradient(-45deg, #322814, #998250, #322814);\n' + - ' line-height: 1em;\n' + - '}\n' + gen : dedent`/* Drop Cap settings */ + .phb3 h1 + p::first-letter { + font-family: SolberaImitationRemake; + font-size: 3.5cm; + background: linear-gradient(-45deg, #322814, #998250, #322814); + line-height: 1em; + }\n\n` }, { name : 'Add Comment', icon : 'fas fa-code', - gen : dedent`\n - /* This is a comment that will not be rendered into your brew. */ - ` + gen : '/* This is a comment that will not be rendered into your brew. */' }, ] }, @@ -370,26 +366,22 @@ module.exports = [ { name : 'A4 Page Size', icon : 'far fa-file', - gen : ['/* A4 Page Size */', - '.page{', - ' width : 210mm;', - ' height : 296.8mm;', - '}', - '' - ].join('\n') + gen : dedent`/* A4 Page Size */ + .page{ + width : 210mm; + height : 296.8mm; + }\n\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') + gen : dedent`/* Square Page Size */ + .page { + width : 125mm; + height : 125mm; + padding : 12.5mm; + columns : unset; + }\n\n` }, { name : 'Ink Friendly', @@ -407,7 +399,7 @@ module.exports = [ .page img { visibility : hidden; - }` + }\n\n` }, ] }, diff --git a/client/homebrew/editor/snippetbar/snippetsLegacy/snippets.js b/client/homebrew/editor/snippetbar/snippetsLegacy/snippets.js index fbf5cd359..b47c68831 100644 --- a/client/homebrew/editor/snippetbar/snippetsLegacy/snippets.js +++ b/client/homebrew/editor/snippetbar/snippetsLegacy/snippets.js @@ -81,7 +81,7 @@ module.exports = [ { name : 'Add Comment', icon : 'fas fa-code', - gen : `\n\n\n` + gen : '' } ] }, @@ -95,27 +95,27 @@ module.exports = [ { name : 'Remove Drop Cap', icon : 'fas fa-remove-format', - gen : '/* Removes Drop Caps */\n' + - '.phb h1+p:first-letter {\n' + - ' all: unset;\n' + - '}\n' + gen : dedent`/* Removes Drop Caps */ + .phb h1+p:first-letter { + all: unset; + }\n\n` }, { name : 'Tweak Drop Cap', icon : 'fas fa-sliders-h', - gen : '/* Drop Cap Settings */\n' + - '.phb h1 + p::first-letter {\n' + - ' float: left;\n' + - ' font-family: Solberry;\n' + - ' font-size: 10em;\n' + - ' color: #222;\n' + - ' line-height: .8em;\n' + - '}\n' + gen : dedent`/* Drop Cap Settings */ + .phb h1 + p::first-letter { + float: left; + font-family: Solberry; + font-size: 10em; + color: #222; + line-height: .8em; + }\n\n` }, { name : 'Add Comment', icon : 'fas fa-code', - gen : `\n/* This is a comment that will not be rendered into your brew. */\n\n` + gen : '/* This is a comment that will not be rendered into your brew. */' } ] }, From b8df5d083f97ff9b4282f4697519716c7381f1b5 Mon Sep 17 00:00:00 2001 From: Gazook89 <58999374+Gazook89@users.noreply.github.com> Date: Wed, 15 Sep 2021 15:45:58 -0500 Subject: [PATCH 06/10] update v3 drop cap snippets to .page --- client/homebrew/editor/snippetbar/snippets/snippets.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/client/homebrew/editor/snippetbar/snippets/snippets.js b/client/homebrew/editor/snippetbar/snippets/snippets.js index 91260f396..b52c7f855 100644 --- a/client/homebrew/editor/snippetbar/snippets/snippets.js +++ b/client/homebrew/editor/snippetbar/snippets/snippets.js @@ -95,7 +95,7 @@ module.exports = [ name : 'Remove Drop Cap', icon : 'fas fa-remove-format', gen : dedent`/* Removes Drop Caps */ - .phb3 h1+p:first-letter { + .page h1+p:first-letter { all: unset; }\n\n` }, @@ -103,7 +103,7 @@ module.exports = [ name : 'Tweak Drop Cap', icon : 'fas fa-sliders-h', gen : dedent`/* Drop Cap settings */ - .phb3 h1 + p::first-letter { + .page h1 + p::first-letter { font-family: SolberaImitationRemake; font-size: 3.5cm; background: linear-gradient(-45deg, #322814, #998250, #322814); From 0de0c22e61327940b283d69d1523266d87881882 Mon Sep 17 00:00:00 2001 From: Gazook89 <58999374+Gazook89@users.noreply.github.com> Date: Wed, 15 Sep 2021 16:14:14 -0500 Subject: [PATCH 07/10] Update v3 ink-friendly snippet to reset drop-shadow rather than box-shadow --- client/homebrew/editor/snippetbar/snippets/snippets.js | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/client/homebrew/editor/snippetbar/snippets/snippets.js b/client/homebrew/editor/snippetbar/snippets/snippets.js index b52c7f855..37f9dad81 100644 --- a/client/homebrew/editor/snippetbar/snippets/snippets.js +++ b/client/homebrew/editor/snippetbar/snippets/snippets.js @@ -390,11 +390,7 @@ module.exports = [ /* 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; + filter : drop-shadow(0px 0px 3px #888) !important; } .page img { From 1c88eb80c01579e369a448e0c55bd720c03f2a0c Mon Sep 17 00:00:00 2001 From: Gazook89 <58999374+Gazook89@users.noreply.github.com> Date: Wed, 15 Sep 2021 16:30:30 -0500 Subject: [PATCH 08/10] update v3 ink friendly again to remove `.pages` from css selector having `.pages` included in the selector did not match the selectivity in the base .less sheet. Oddly, it was working in the Edit Page, but not in the Print Page. --- client/homebrew/editor/snippetbar/snippets/snippets.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/client/homebrew/editor/snippetbar/snippets/snippets.js b/client/homebrew/editor/snippetbar/snippets/snippets.js index 37f9dad81..6183594f4 100644 --- a/client/homebrew/editor/snippetbar/snippets/snippets.js +++ b/client/homebrew/editor/snippetbar/snippets/snippets.js @@ -388,7 +388,7 @@ module.exports = [ icon : 'fas fa-tint', gen : dedent` /* Ink Friendly */ - .pages *:is(.page,.monster,.note,.descriptive) { + *:is(.page,.monster,.note,.descriptive) { background : white !important; filter : drop-shadow(0px 0px 3px #888) !important; } From 3c1ecf1292fa5b55649fb9e8322a2188e81eab5c Mon Sep 17 00:00:00 2001 From: Trevor Buckner Date: Tue, 21 Sep 2021 22:59:25 -0400 Subject: [PATCH 09/10] Fix merge --- .../editor/snippetbar/snippetsLegacy/snippets.js | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/client/homebrew/editor/snippetbar/snippetsLegacy/snippets.js b/client/homebrew/editor/snippetbar/snippetsLegacy/snippets.js index efae5c9e8..40c8405ac 100644 --- a/client/homebrew/editor/snippetbar/snippetsLegacy/snippets.js +++ b/client/homebrew/editor/snippetbar/snippetsLegacy/snippets.js @@ -204,6 +204,16 @@ module.exports = [ icon : 'fas fa-table', view : 'text', snippets : [ + { + name : 'Class Table', + icon : 'fas fa-table', + gen : ClassTableGen.full, + }, + { + name : 'Half Class Table', + icon : 'fas fa-list-alt', + gen : ClassTableGen.half, + }, { name : 'Table', icon : 'fas fa-th-list', From eb7340434e7b17aedf28e993005fe9cdf8d2060e Mon Sep 17 00:00:00 2001 From: Trevor Buckner Date: Tue, 21 Sep 2021 23:31:08 -0400 Subject: [PATCH 10/10] Revert dropcap `background` to `background-image` Changing to just `background` undoes `background-clip` as well. This is more explicit. --- client/homebrew/editor/snippetbar/snippets/snippets.js | 2 +- themes/5ePhb.style.less | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/client/homebrew/editor/snippetbar/snippets/snippets.js b/client/homebrew/editor/snippetbar/snippets/snippets.js index 4eeac4e00..15fc5ba14 100644 --- a/client/homebrew/editor/snippetbar/snippets/snippets.js +++ b/client/homebrew/editor/snippetbar/snippets/snippets.js @@ -106,7 +106,7 @@ module.exports = [ .page h1 + p::first-letter { font-family: SolberaImitationRemake; font-size: 3.5cm; - background: linear-gradient(-45deg, #322814, #998250, #322814); + background-image: linear-gradient(-45deg, #322814, #998250, #322814); line-height: 1em; }\n\n` }, diff --git a/themes/5ePhb.style.less b/themes/5ePhb.style.less index 69c952659..607a13cca 100644 --- a/themes/5ePhb.style.less +++ b/themes/5ePhb.style.less @@ -146,10 +146,10 @@ body { font-size : 3.5cm; padding-left : 40px; //Allow background color to extend into margins margin-left : -40px; - margin-top :-0.3cm; - padding-bottom :2px; - margin-bottom :-20px; - background : linear-gradient(-45deg, #322814, #998250, #322814); + margin-top : -0.3cm; + padding-bottom : 2px; + margin-bottom : -20px; + background-image : linear-gradient(-45deg, #322814, #998250, #322814); background-clip : text; -webkit-background-clip : text; color : rgba(0, 0, 0, 0);