From 5c4da77357e9c6533fea7506abbf906d422adab3 Mon Sep 17 00:00:00 2001 From: James Socol Date: Sat, 20 Feb 2021 14:04:54 -0500 Subject: [PATCH 001/145] Parametrize fillMode for .useColumns A @fillMode parameter for .useColumns9) allows setting `column-fill` property to `balance` for wide statblocks (or other wide column types) instead of relying on Chrome's fallback behavior that ignores `auto` when there's no set container height. Set the default for the for `@fillMode` to `auto` to maintain the current behavior. --- client/homebrew/phbStyle/phb.style.less | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/client/homebrew/phbStyle/phb.style.less b/client/homebrew/phbStyle/phb.style.less index 792755ade..b480a234b 100644 --- a/client/homebrew/phbStyle/phb.style.less +++ b/client/homebrew/phbStyle/phb.style.less @@ -26,9 +26,9 @@ body { letter-spacing : -0.02em; } } -.useColumns(@multiplier : 1){ +.useColumns(@multiplier : 1, @fillMode: auto){ column-count : 2; - column-fill : auto; + column-fill : @fillMode; column-gap : 1cm; column-width : 8cm * @multiplier; -webkit-column-count : 2; @@ -272,7 +272,7 @@ body { } //Full Width hr+hr+blockquote{ - .useColumns(0.96); + .useColumns(0.96, @fillMode: balance); } //***************************** // * FOOTER From e3285b5ca40e6f2284406501dc89f6a69d47e6e8 Mon Sep 17 00:00:00 2001 From: Gazook89 <58999374+Gazook89@users.noreply.github.com> Date: Mon, 9 Aug 2021 21:06:29 -0500 Subject: [PATCH 002/145] Create .frame class for Class Tables Add a `.frame` class for Class Tables so that the frame and background can be toggled on or off in a similar fashion to the new monster stat block. This will allow a class table to be used as a "third caster archetype" table such as referenced in PR #1079. Adds consistency with Monster blocks, too. --- themes/5ePhb.style.less | 24 +++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/themes/5ePhb.style.less b/themes/5ePhb.style.less index 9e56a7009..5e5fb3b7c 100644 --- a/themes/5ePhb.style.less +++ b/themes/5ePhb.style.less @@ -514,17 +514,19 @@ body { // * CLASS TABLE // *****************************/ .page .classTable{ - margin-top : 25px; - margin-bottom : 40px; - border-collapse : separate; - background-color : white; - border : initial; - border-style : solid; - border-image-outset : 25px 17px; - border-image-repeat : stretch; - border-image-slice : 150 200 150 200; - border-image-source : @frameBorderImage; - border-image-width : 47px; + &.frame { + margin-top : 25px; + margin-bottom : 40px; + border-collapse : separate; + background-color : white; + border : initial; + border-style : solid; + border-image-outset : 25px 17px; + border-image-repeat : stretch; + border-image-slice : 150 200 150 200; + border-image-source : @frameBorderImage; + border-image-width : 47px; + } h5{ margin-bottom : 10px; } From 5d4bc23c84db150422110e94c663e16f97e3b88d Mon Sep 17 00:00:00 2001 From: Gazook89 <58999374+Gazook89@users.noreply.github.com> Date: Mon, 9 Aug 2021 21:09:34 -0500 Subject: [PATCH 003/145] Remove text wrapping from spanned header This removes text wrapping from col-spanned headers inside a classtable...needed for half-tables that contain `--- Spells Slots per Spell Level ---` so they don't wrap to next line. Both v3 and Legacy --- themes/5ePhb.style.less | 3 +++ themes/5ePhbLegacy.style.less | 3 +++ 2 files changed, 6 insertions(+) diff --git a/themes/5ePhb.style.less b/themes/5ePhb.style.less index 5e5fb3b7c..c733ca221 100644 --- a/themes/5ePhb.style.less +++ b/themes/5ePhb.style.less @@ -514,6 +514,9 @@ body { // * CLASS TABLE // *****************************/ .page .classTable{ + th[colspan] { + white-space : nowrap; + } &.frame { margin-top : 25px; margin-bottom : 40px; diff --git a/themes/5ePhbLegacy.style.less b/themes/5ePhbLegacy.style.less index 0f1cae7ec..9346c25bd 100644 --- a/themes/5ePhbLegacy.style.less +++ b/themes/5ePhbLegacy.style.less @@ -407,6 +407,9 @@ body { border-image-slice : 150 200 150 200; border-image-source : @frameBorderImage; border-image-width : 47px; + th[colspan] { + white-space : nowrap; + } h5{ margin-bottom : 10px; } From 779426dbb1afab4c6fe624144a21c9cd9c025c4d Mon Sep 17 00:00:00 2001 From: "G.Ambatte" Date: Tue, 10 Aug 2021 21:43:41 +1200 Subject: [PATCH 004/145] Set modifiedTime during view count update --- server/googleActions.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/server/googleActions.js b/server/googleActions.js index bfe1b406f..b2288866b 100644 --- a/server/googleActions.js +++ b/server/googleActions.js @@ -359,8 +359,9 @@ GoogleActions = { await drive.files.update({ fileId : brew.googleId, - resource : { properties : { views : brew.views + 1, - lastViewed : new Date() } } + resource : { modifiedTime : brew.updatedAt, + properties : { views : brew.views + 1, + lastViewed : new Date() } } }) .catch((err)=>{ console.log('Error updating Google views'); From e108e3082190dd7e5b5efa128f2aaac099d3edcb Mon Sep 17 00:00:00 2001 From: "G.Ambatte" Date: Tue, 10 Aug 2021 22:51:52 +1200 Subject: [PATCH 005/145] Remove `brew.views` for EditPage brew object --- client/homebrew/pages/editPage/editPage.jsx | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/client/homebrew/pages/editPage/editPage.jsx b/client/homebrew/pages/editPage/editPage.jsx index a643296d4..d5fa6956b 100644 --- a/client/homebrew/pages/editPage/editPage.jsx +++ b/client/homebrew/pages/editPage/editPage.jsx @@ -51,16 +51,18 @@ const EditPage = createClass({ }, getInitialState : function() { + const newBrew = this.props.brew; + delete newBrew.views; return { - brew : this.props.brew, + brew : newBrew, isSaving : false, isPending : false, - alertTrashedGoogleBrew : this.props.brew.trashed, + alertTrashedGoogleBrew : newBrew.trashed, alertLoginToTransfer : false, - saveGoogle : this.props.brew.googleId ? true : false, + saveGoogle : newBrew.googleId ? true : false, confirmGoogleTransfer : false, errors : null, - htmlErrors : Markdown.validate(this.props.brew.text), + htmlErrors : Markdown.validate(newBrew.text), url : '' }; }, From 8bda68d6846de267a9f6b8dc661d9cbd8ad7c513 Mon Sep 17 00:00:00 2001 From: Gazook89 <58999374+Gazook89@users.noreply.github.com> Date: Tue, 10 Aug 2021 08:31:08 -0500 Subject: [PATCH 006/145] Add 1/3 ClassTable, Unframed classes - Adds a snippet for 1/3 Spellcasting/ClassTables for Issue #191 and builds on PR #1079 to work with v3 (but leaves out Legacy). - Refactored classTable gen to more closely match monster block gen in terms of element classes (passed to gen function via attributes rather than baked into `return` function) - Added an "unframed" snippet for each Full, Half, and Third class tables, which is consistent with monster stat blocks, and also is needed to satisfy #191 / #1079. --- .../snippetbar/snippets/classtable.gen.js | 48 +++++++++++++++++-- .../editor/snippetbar/snippets/snippets.js | 26 ++++++++-- 2 files changed, 67 insertions(+), 7 deletions(-) diff --git a/client/homebrew/editor/snippetbar/snippets/classtable.gen.js b/client/homebrew/editor/snippetbar/snippets/classtable.gen.js index c8a2d051f..ec5b4433a 100644 --- a/client/homebrew/editor/snippetbar/snippets/classtable.gen.js +++ b/client/homebrew/editor/snippetbar/snippets/classtable.gen.js @@ -51,7 +51,7 @@ const getFeature = (level)=>{ }; module.exports = { - full : function(){ + full : function(classes){ const classname = _.sample(classnames); const maxes = [4, 3, 3, 3, 3, 2, 2, 1, 1]; @@ -70,7 +70,7 @@ module.exports = { let cantrips = 3; let spells = 1; let slots = 2; - return `{{classTable,wide\n##### The ${classname}\n` + + return `{{${classes}\n##### The ${classname}\n` + `| Level | Proficiency | Features | Cantrips | Spells | --- Spell Slots Per Level --- |||||||||\n`+ `| ^| Bonus ^| ^| Known ^| Known ^| 1st | 2nd | 3rd | 4th | 5th | 6th | 7th | 8th | 9th |\n`+ `|:-----:|:-----------:|:---------|:--------:|:------:|:---:|:---:|:---:|:---:|:---:|:---:|:---:|:---:|:---:|\n${ @@ -92,11 +92,11 @@ module.exports = { }).join('\n')}\n}}\n\n`; }, - half : function(){ + half : function(classes){ const classname = _.sample(classnames); let featureScore = 1; - return `
\n##### The ${classname}\n` + + return `{{${classes}\n##### The ${classname}\n` + `| Level | Proficiency Bonus | Features | ${_.sample(features)}|\n` + `|:---:|:---:|:---|:---:|\n${ _.map(levels, function(levelName, level){ @@ -111,5 +111,45 @@ module.exports = { return `| ${res} |`; }).join('\n')}\n
\n\n`; + }, + + third : function(classes){ + const classname = _.sample(classnames); + + const maxes = [4, 3, 3, 3, 3, 2, 2, 1, 1]; + const drawSlots = function(Slots){ + let slots = Number(Slots); + return _.times(4, function(i){ + const max = maxes[i]; + if(slots < 1) return '—'; + const res = _.min([max, slots]); + slots -= res; + return res; + }).join(' | '); + }; + + + let cantrips = 3; + let spells = 1; + let slots = 2; + return `{{${classes}\n##### ${classname} Spellcasting\n` + + `| Class | Cantrips | Spells | --- Spells Slots per Spell Level --- ||||\n` + + `| Level ^| Known ^| Known ^| 1st | 2nd | 3rd | 4th |\n` + + `|:---:|:---:|:---:|:---:|:---:|:---:|:---:|\n${ + _.map(levels, function(levelName, level){ + const res = [ + levelName, + cantrips, + spells, + drawSlots(slots) + ].join(' | '); + + cantrips += _.random(0, 1); + spells += _.random(0, 1); + slots += _.random(0, 2); + + return `| ${res} |`; + }).join('\n')}\n}}\n\n`; } + }; diff --git a/client/homebrew/editor/snippetbar/snippets/snippets.js b/client/homebrew/editor/snippetbar/snippets/snippets.js index b30a96e7c..10cb9cf4e 100644 --- a/client/homebrew/editor/snippetbar/snippets/snippets.js +++ b/client/homebrew/editor/snippetbar/snippets/snippets.js @@ -212,12 +212,32 @@ module.exports = [ { name : 'Class Table', icon : 'fas fa-table', - gen : ClassTableGen.full, + gen : ClassTableGen.full('classTable,frame,wide'), }, { - name : 'Half Class Table', + name : 'Class Table (unframed)', + icon : 'fas fa-table', + gen : ClassTableGen.full('classTable,wide'), + }, + { + name : '1/2 Class Table', icon : 'fas fa-list-alt', - gen : ClassTableGen.half, + gen : ClassTableGen.half('classTable,frame'), + }, + { + name : '1/2 Class Table (unframed)', + icon : 'fas fa-list-alt', + gen : ClassTableGen.half('classTable'), + }, + { + name : '1/3 Class Table', + icon : 'fas fa-list-alt', + gen : ClassTableGen.third('classTable,frame'), + }, + { + name : '1/3 Class Table (unframed)', + icon : 'fas fa-list-alt', + gen : ClassTableGen.third('classTable'), }, { name : 'Table', From 927cc2e9b557195a2774c6f179b23cb84dcb98b7 Mon Sep 17 00:00:00 2001 From: Gazook89 <58999374+Gazook89@users.noreply.github.com> Date: Tue, 10 Aug 2021 08:33:05 -0500 Subject: [PATCH 007/145] Fix "Spell Slots per Spell Level" Update current "--- Spells Slots per Level ---" to more accurate "--- Spells Slots per Spell Level ---" to match source material. --- client/homebrew/editor/snippetbar/snippets/classtable.gen.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/client/homebrew/editor/snippetbar/snippets/classtable.gen.js b/client/homebrew/editor/snippetbar/snippets/classtable.gen.js index ec5b4433a..39d033108 100644 --- a/client/homebrew/editor/snippetbar/snippets/classtable.gen.js +++ b/client/homebrew/editor/snippetbar/snippets/classtable.gen.js @@ -71,7 +71,7 @@ module.exports = { let spells = 1; let slots = 2; return `{{${classes}\n##### The ${classname}\n` + - `| Level | Proficiency | Features | Cantrips | Spells | --- Spell Slots Per Level --- |||||||||\n`+ + `| Level | Proficiency | Features | Cantrips | Spells | --- Spell Slots Per Spell Level --- |||||||||\n`+ `| ^| Bonus ^| ^| Known ^| Known ^| 1st | 2nd | 3rd | 4th | 5th | 6th | 7th | 8th | 9th |\n`+ `|:-----:|:-----------:|:---------|:--------:|:------:|:---:|:---:|:---:|:---:|:---:|:---:|:---:|:---:|:---:|\n${ _.map(levels, function(levelName, level){ From 9f519b469d349a65d061fd5b262e4d189949e5ae Mon Sep 17 00:00:00 2001 From: Gazook89 <58999374+Gazook89@users.noreply.github.com> Date: Tue, 10 Aug 2021 08:44:25 -0500 Subject: [PATCH 008/145] Change classTable Icons --- client/homebrew/editor/snippetbar/snippets/snippets.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/client/homebrew/editor/snippetbar/snippets/snippets.js b/client/homebrew/editor/snippetbar/snippets/snippets.js index 10cb9cf4e..fce298b57 100644 --- a/client/homebrew/editor/snippetbar/snippets/snippets.js +++ b/client/homebrew/editor/snippetbar/snippets/snippets.js @@ -216,7 +216,7 @@ module.exports = [ }, { name : 'Class Table (unframed)', - icon : 'fas fa-table', + icon : 'fas fa-border-none', gen : ClassTableGen.full('classTable,wide'), }, { @@ -226,17 +226,17 @@ module.exports = [ }, { name : '1/2 Class Table (unframed)', - icon : 'fas fa-list-alt', + icon : 'fas fa-border-none', gen : ClassTableGen.half('classTable'), }, { name : '1/3 Class Table', - icon : 'fas fa-list-alt', + icon : 'fas fa-border-all', gen : ClassTableGen.third('classTable,frame'), }, { name : '1/3 Class Table (unframed)', - icon : 'fas fa-list-alt', + icon : 'fas fa-border-none', gen : ClassTableGen.third('classTable'), }, { From 2a428100c52567aa4c39aae252f50f9f8ee78d93 Mon Sep 17 00:00:00 2001 From: Gazook89 <58999374+Gazook89@users.noreply.github.com> Date: Tue, 10 Aug 2021 09:11:14 -0500 Subject: [PATCH 009/145] fix some indentation issues for circleCI --- .../snippetbar/snippets/classtable.gen.js | 60 +++++++++---------- 1 file changed, 30 insertions(+), 30 deletions(-) diff --git a/client/homebrew/editor/snippetbar/snippets/classtable.gen.js b/client/homebrew/editor/snippetbar/snippets/classtable.gen.js index 39d033108..5d631cb48 100644 --- a/client/homebrew/editor/snippetbar/snippets/classtable.gen.js +++ b/client/homebrew/editor/snippetbar/snippets/classtable.gen.js @@ -116,40 +116,40 @@ module.exports = { third : function(classes){ const classname = _.sample(classnames); - const maxes = [4, 3, 3, 3, 3, 2, 2, 1, 1]; - const drawSlots = function(Slots){ - let slots = Number(Slots); - return _.times(4, function(i){ - const max = maxes[i]; - if(slots < 1) return '—'; - const res = _.min([max, slots]); - slots -= res; - return res; - }).join(' | '); - }; + const maxes = [4, 3, 3, 3, 3, 2, 2, 1, 1]; + const drawSlots = function(Slots){ + let slots = Number(Slots); + return _.times(4, function(i){ + const max = maxes[i]; + if(slots < 1) return '—'; + const res = _.min([max, slots]); + slots -= res; + return res; + }).join(' | '); + }; - let cantrips = 3; - let spells = 1; - let slots = 2; - return `{{${classes}\n##### ${classname} Spellcasting\n` + - `| Class | Cantrips | Spells | --- Spells Slots per Spell Level --- ||||\n` + - `| Level ^| Known ^| Known ^| 1st | 2nd | 3rd | 4th |\n` + - `|:---:|:---:|:---:|:---:|:---:|:---:|:---:|\n${ - _.map(levels, function(levelName, level){ - const res = [ - levelName, - cantrips, - spells, - drawSlots(slots) - ].join(' | '); + let cantrips = 3; + let spells = 1; + let slots = 2; + return `{{${classes}\n##### ${classname} Spellcasting\n` + + `| Class | Cantrips | Spells | --- Spells Slots per Spell Level --- ||||\n` + + `| Level ^| Known ^| Known ^| 1st | 2nd | 3rd | 4th |\n` + + `|:---:|:---:|:---:|:---:|:---:|:---:|:---:|\n${ + _.map(levels, function(levelName, level){ + const res = [ + levelName, + cantrips, + spells, + drawSlots(slots) + ].join(' | '); - cantrips += _.random(0, 1); - spells += _.random(0, 1); - slots += _.random(0, 2); + cantrips += _.random(0, 1); + spells += _.random(0, 1); + slots += _.random(0, 2); - return `| ${res} |`; - }).join('\n')}\n}}\n\n`; + return `| ${res} |`; + }).join('\n')}\n}}\n\n`; } }; From c8997cee68239772a5de26a619346a1436a31711 Mon Sep 17 00:00:00 2001 From: Gazook89 <58999374+Gazook89@users.noreply.github.com> Date: Tue, 10 Aug 2021 14:35:28 -0500 Subject: [PATCH 010/145] Fix two css values throwing errors --- themes/5ePhb.style.less | 6 +++--- themes/5ePhbLegacy.style.less | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/themes/5ePhb.style.less b/themes/5ePhb.style.less index 9e56a7009..dbee1845a 100644 --- a/themes/5ePhb.style.less +++ b/themes/5ePhb.style.less @@ -238,7 +238,7 @@ body { // ************************************/ .descriptive{ .useSansSerif(); - display : block-inline; + display : inline-block; margin-top : 1.4em; background-color : #faf7ea; font-family : ScalySansRemake; @@ -335,12 +335,12 @@ body { // Monster Ability table hr + table:first-of-type{ margin : 0; - column-span : 1; + column-span : none; color : @headerText; background-color : transparent; border-style : none; border-image : none; - -webkit-column-span : 1; + -webkit-column-span : none; tr { background-color : transparent; } diff --git a/themes/5ePhbLegacy.style.less b/themes/5ePhbLegacy.style.less index 0f1cae7ec..4604c2bd7 100644 --- a/themes/5ePhbLegacy.style.less +++ b/themes/5ePhbLegacy.style.less @@ -230,11 +230,11 @@ body { // Monster Ability table hr+table{ margin : 0; - column-span : 1; + column-span : none; background-color : transparent; border-style : none; border-image : none; - -webkit-column-span : 1; + -webkit-column-span : none; tbody{ tr:nth-child(odd), tr:nth-child(even){ background-color : transparent; @@ -415,7 +415,7 @@ body { // * DESCRIPTIVE TEXT BOX // ************************************/ .phb .descriptive{ - display : block-inline; + display : inline-block; margin-bottom : 1em; background-color : #faf7ea; font-family : ScalySans; From c9e1d7ba5c27d8f5510cb198a74573c5efd71dea Mon Sep 17 00:00:00 2001 From: Gazook89 <58999374+Gazook89@users.noreply.github.com> Date: Tue, 10 Aug 2021 16:35:21 -0500 Subject: [PATCH 011/145] Fixed closing curly brackets on half class table --- client/homebrew/editor/snippetbar/snippets/classtable.gen.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/client/homebrew/editor/snippetbar/snippets/classtable.gen.js b/client/homebrew/editor/snippetbar/snippets/classtable.gen.js index 5d631cb48..1b1beb66a 100644 --- a/client/homebrew/editor/snippetbar/snippets/classtable.gen.js +++ b/client/homebrew/editor/snippetbar/snippets/classtable.gen.js @@ -110,7 +110,7 @@ module.exports = { featureScore += _.random(0, 1); return `| ${res} |`; - }).join('\n')}\n\n\n`; + }).join('\n')}\n}}\n\n`; }, third : function(classes){ From 4b001d98902e2933e5c0addd3fa76da152a2ed39 Mon Sep 17 00:00:00 2001 From: Gazook89 <58999374+Gazook89@users.noreply.github.com> Date: Tue, 10 Aug 2021 20:22:36 -0500 Subject: [PATCH 012/145] Move Image Snippets to New Menu Separating image related snippets to a new drop down snippet menu. --- .../editor/snippetbar/snippets/snippets.js | 31 ++++++++++++------- 1 file changed, 19 insertions(+), 12 deletions(-) diff --git a/client/homebrew/editor/snippetbar/snippets/snippets.js b/client/homebrew/editor/snippetbar/snippets/snippets.js index b30a96e7c..2a08d2d4f 100644 --- a/client/homebrew/editor/snippetbar/snippets/snippets.js +++ b/client/homebrew/editor/snippetbar/snippets/snippets.js @@ -47,18 +47,6 @@ module.exports = [ }} \n` }, - { - name : 'Image', - icon : 'fas fa-image', - gen : dedent` - ![cat warrior](https://s-media-cache-ak0.pinimg.com/736x/4a/81/79/4a8179462cfdf39054a418efd4cb743e.jpg) {width:325px} - Credit: Kyounghwan Kim` - }, - { - name : 'Background Image', - icon : 'fas fa-tree', - gen : `![homebrew mug](http://i.imgur.com/hMna6G0.png) {position:absolute,top:50px,right:30px,width:280px}` - }, { name : 'QR Code', icon : 'fas fa-qrcode', @@ -123,6 +111,25 @@ module.exports = [ ] }, + /*********************** IMAGES *******************/ + { + groupName : 'Images', + icon : 'fas fa-book', + snippets : [ + { + name : 'Image', + icon : 'fas fa-image', + gen : dedent` + ![cat warrior](https://s-media-cache-ak0.pinimg.com/736x/4a/81/79/4a8179462cfdf39054a418efd4cb743e.jpg) {width:325px} + Credit: Kyounghwan Kim` + }, + { + name : 'Background Image', + icon : 'fas fa-tree', + gen : `![homebrew mug](http://i.imgur.com/hMna6G0.png) {position:absolute,top:50px,right:30px,width:280px}` + }, + }, + /************************* PHB ********************/ From 21058331cfd456a1db4b3739ed51b5133b3d436e Mon Sep 17 00:00:00 2001 From: Gazook89 <58999374+Gazook89@users.noreply.github.com> Date: Tue, 10 Aug 2021 20:24:43 -0500 Subject: [PATCH 013/145] Add Class Table Circle Decoration Snippet Adding a background image snippet that includes the fancy circular decoration found behind class tables in the source material. *Could arguably replace the normal "Background Image" snippet and hit two bases with one stone* --- client/homebrew/editor/snippetbar/snippets/snippets.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/client/homebrew/editor/snippetbar/snippets/snippets.js b/client/homebrew/editor/snippetbar/snippets/snippets.js index 2a08d2d4f..b3be55914 100644 --- a/client/homebrew/editor/snippetbar/snippets/snippets.js +++ b/client/homebrew/editor/snippetbar/snippets/snippets.js @@ -128,6 +128,13 @@ module.exports = [ icon : 'fas fa-tree', gen : `![homebrew mug](http://i.imgur.com/hMna6G0.png) {position:absolute,top:50px,right:30px,width:280px}` }, + { + name : 'Class Table Decoration', + icon : 'fas fa-award', + gen : dedent`\n + ![ClassTable Decoration](https://i.imgur.com/xYVVT7e.png) {position:absolute,top:0px,right:0px,width:380px}` + }, + ] }, From 51116efba7aa9c911177e3cc86809b7f2378fbd3 Mon Sep 17 00:00:00 2001 From: Gazook89 <58999374+Gazook89@users.noreply.github.com> Date: Tue, 10 Aug 2021 20:56:28 -0500 Subject: [PATCH 014/145] Add Blended Watercolor Background Image Add a snippet to create a nice watercolor background for use behind other images. Includes injection syntax which includes absolute position, hue-rotate, mix-blend-mode, and opacity. Chooses an image randomly from an Imgur album. All images created by me (and open to creating more/making adjustments). v3 only. Could be improved by cycling through images rather than choosing randomly. --- .../editor/snippetbar/snippets/snippets.js | 9 +++++++-- .../snippetbar/snippets/watercolor.gen.js | 20 +++++++++++++++++++ 2 files changed, 27 insertions(+), 2 deletions(-) create mode 100644 client/homebrew/editor/snippetbar/snippets/watercolor.gen.js diff --git a/client/homebrew/editor/snippetbar/snippets/snippets.js b/client/homebrew/editor/snippetbar/snippets/snippets.js index b3be55914..7aa2c2208 100644 --- a/client/homebrew/editor/snippetbar/snippets/snippets.js +++ b/client/homebrew/editor/snippetbar/snippets/snippets.js @@ -7,6 +7,7 @@ const ClassFeatureGen = require('./classfeature.gen.js'); const CoverPageGen = require('./coverpage.gen.js'); const TableOfContentsGen = require('./tableOfContents.gen.js'); const dedent = require('dedent-tabs').default; +const watercolorGen = require('./watercolor.gen.js'); module.exports = [ @@ -131,8 +132,12 @@ module.exports = [ { name : 'Class Table Decoration', icon : 'fas fa-award', - gen : dedent`\n - ![ClassTable Decoration](https://i.imgur.com/xYVVT7e.png) {position:absolute,top:0px,right:0px,width:380px}` + gen : `\n![ClassTable Decoration](https://i.imgur.com/xYVVT7e.png) {position:absolute,top:0px,right:0px,width:380px}` + }, + { + name : 'Watercolor Splatter', + icon : 'fas fa-fill-drip', + gen : watercolorGen, }, ] }, diff --git a/client/homebrew/editor/snippetbar/snippets/watercolor.gen.js b/client/homebrew/editor/snippetbar/snippets/watercolor.gen.js new file mode 100644 index 000000000..17be660f8 --- /dev/null +++ b/client/homebrew/editor/snippetbar/snippets/watercolor.gen.js @@ -0,0 +1,20 @@ +const _ = require('lodash'); + +const watercolorBG = [ + 'https://i.imgur.com/UPUX4zG.png', + 'https://i.imgur.com/Q6Uquv9.png', + 'https://i.imgur.com/UOtaJpJ.png', + 'https://i.imgur.com/Wy2DVk3.png', + 'https://i.imgur.com/IempVlg.png', + 'https://i.imgur.com/iJ1ddgd.png', + 'https://i.imgur.com/qg4an04.png', + 'https://i.imgur.com/ogGTcCh.png', + 'https://i.imgur.com/itBD19A.png', + 'https://i.imgur.com/tbbycAt.png', + 'https://i.imgur.com/1SVWpGR.png', + 'https://i.imgur.com/wC1zkuJ.png' +]; + +module.exports = ()=>{ + return `\n![watercolor bg](${_.sample(watercolorBG)}) {watercolor,position:absolute,top:0px,left:0px,width:240px,filter:hue-rotate(0deg),mix-blend-mode:multiply,opacity:80%}\n` +}; \ No newline at end of file From cefa3147fcf4b888ecaad362e8c1b10f15b00ba9 Mon Sep 17 00:00:00 2001 From: Gazook89 <58999374+Gazook89@users.noreply.github.com> Date: Tue, 10 Aug 2021 21:16:12 -0500 Subject: [PATCH 015/145] Fixes for CircleCI --- client/homebrew/editor/snippetbar/snippets/watercolor.gen.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/client/homebrew/editor/snippetbar/snippets/watercolor.gen.js b/client/homebrew/editor/snippetbar/snippets/watercolor.gen.js index 17be660f8..40b5da973 100644 --- a/client/homebrew/editor/snippetbar/snippets/watercolor.gen.js +++ b/client/homebrew/editor/snippetbar/snippets/watercolor.gen.js @@ -6,7 +6,7 @@ const watercolorBG = [ 'https://i.imgur.com/UOtaJpJ.png', 'https://i.imgur.com/Wy2DVk3.png', 'https://i.imgur.com/IempVlg.png', - 'https://i.imgur.com/iJ1ddgd.png', + 'https://i.imgur.com/iJ1ddgd.png', 'https://i.imgur.com/qg4an04.png', 'https://i.imgur.com/ogGTcCh.png', 'https://i.imgur.com/itBD19A.png', @@ -16,5 +16,5 @@ const watercolorBG = [ ]; module.exports = ()=>{ - return `\n![watercolor bg](${_.sample(watercolorBG)}) {watercolor,position:absolute,top:0px,left:0px,width:240px,filter:hue-rotate(0deg),mix-blend-mode:multiply,opacity:80%}\n` + return `\n![watercolor bg](${_.sample(watercolorBG)}) {watercolor,position:absolute,top:0px,left:0px,width:240px,filter:hue-rotate(0deg),mix-blend-mode:multiply,opacity:80%}\n`; }; \ No newline at end of file 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 016/145] 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 017/145] 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 018/145] 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 521c393b746d35c9e705c3d0d61269200ece319d Mon Sep 17 00:00:00 2001 From: "G.Ambatte" Date: Sun, 15 Aug 2021 15:51:24 +1200 Subject: [PATCH 019/145] Add title filtering to User Page. --- client/homebrew/pages/userPage/userPage.jsx | 32 ++++++++++++++++++-- client/homebrew/pages/userPage/userPage.less | 3 +- 2 files changed, 31 insertions(+), 4 deletions(-) diff --git a/client/homebrew/pages/userPage/userPage.jsx b/client/homebrew/pages/userPage/userPage.jsx index 9e78ee6ea..58bce39b6 100644 --- a/client/homebrew/pages/userPage/userPage.jsx +++ b/client/homebrew/pages/userPage/userPage.jsx @@ -31,8 +31,9 @@ const UserPage = createClass({ }, getInitialState : function() { return { - sortType : 'alpha', - sortDir : 'asc' + sortType : 'alpha', + sortDir : 'asc', + filterString : '' }; }, getUsernameWithS : function() { @@ -52,6 +53,7 @@ const UserPage = createClass({ }, sortBrewOrder : function(brew){ + if(!brew.title){brew.title='No Title';}; const mapping = { 'alpha' : _.deburr(brew.title.toLowerCase()), 'created' : moment(brew.createdAt).format(), @@ -90,6 +92,25 @@ const UserPage = createClass({ ; }, + handleFilterTextChange : function(e){ + this.setState({ + filterString : e.target.value + }); + return; + }, + + renderFilterOption : function(){ + return + + ; + }, + renderSortOptions : function(){ return
@@ -114,6 +135,7 @@ const UserPage = createClass({ {`${(this.state.sortDir == 'asc' ? '\u25B2 ASC' : '\u25BC DESC')}`} + {this.renderFilterOption()}
@@ -121,7 +143,11 @@ const UserPage = createClass({ }, getSortedBrews : function(){ - return _.groupBy(this.props.brews, (brew)=>{ + const testString = _.deburr(this.state.filterString).toLowerCase(); + const brewCollection = this.state.filterString ? _.filter(this.props.brews, (brew)=>{ + return (_.deburr(brew?.title).toLowerCase().includes(testString)); + }) : this.props.brews; + return _.groupBy(brewCollection, (brew)=>{ return (brew.published ? 'published' : 'private'); }); }, diff --git a/client/homebrew/pages/userPage/userPage.less b/client/homebrew/pages/userPage/userPage.less index c7e8621e3..3b1fa0260 100644 --- a/client/homebrew/pages/userPage/userPage.less +++ b/client/homebrew/pages/userPage/userPage.less @@ -34,8 +34,9 @@ font-family : 'Open Sans', sans-serif; position : fixed; top : 35px; + left : calc(50vw - 408px); border : 2px solid #58180D; - width : 675px; + width : 800px; background-color : #EEE5CE; padding : 2px; text-align : center; From a7e6d0a5138c2639ccda26582956aa4518c4494a Mon Sep 17 00:00:00 2001 From: Gazook89 <58999374+Gazook89@users.noreply.github.com> Date: Sat, 14 Aug 2021 23:34:12 -0500 Subject: [PATCH 020/145] Update metadataEditor.less "small" text --- client/homebrew/editor/metadataEditor/metadataEditor.less | 3 --- 1 file changed, 3 deletions(-) diff --git a/client/homebrew/editor/metadataEditor/metadataEditor.less b/client/homebrew/editor/metadataEditor/metadataEditor.less index a58df14cd..c046b655d 100644 --- a/client/homebrew/editor/metadataEditor/metadataEditor.less +++ b/client/homebrew/editor/metadataEditor/metadataEditor.less @@ -62,9 +62,6 @@ .button(@silver); } small{ - position : absolute; - bottom : -15px; - left : 0px; font-size : 0.6em; font-style : italic; } From 501b356344ab4b874bffa567b449efd719be93a4 Mon Sep 17 00:00:00 2001 From: "G.Ambatte" Date: Sun, 15 Aug 2021 19:15:43 +1200 Subject: [PATCH 021/145] Updates based on Gitter feedback --- client/homebrew/pages/userPage/userPage.jsx | 8 +++++--- client/homebrew/pages/userPage/userPage.less | 3 +++ 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/client/homebrew/pages/userPage/userPage.jsx b/client/homebrew/pages/userPage/userPage.jsx index 58bce39b6..b2b0df5ec 100644 --- a/client/homebrew/pages/userPage/userPage.jsx +++ b/client/homebrew/pages/userPage/userPage.jsx @@ -102,9 +102,10 @@ const UserPage = createClass({ renderFilterOption : function(){ return @@ -145,7 +146,8 @@ const UserPage = createClass({ getSortedBrews : function(){ const testString = _.deburr(this.state.filterString).toLowerCase(); const brewCollection = this.state.filterString ? _.filter(this.props.brews, (brew)=>{ - return (_.deburr(brew?.title).toLowerCase().includes(testString)); + return (_.deburr(brew?.title).toLowerCase().includes(testString)) || + (_.deburr(brew?.description).toLowerCase().includes(testString)); }) : this.props.brews; return _.groupBy(brewCollection, (brew)=>{ return (brew.published ? 'published' : 'private'); diff --git a/client/homebrew/pages/userPage/userPage.less b/client/homebrew/pages/userPage/userPage.less index 3b1fa0260..d968aab9a 100644 --- a/client/homebrew/pages/userPage/userPage.less +++ b/client/homebrew/pages/userPage/userPage.less @@ -53,6 +53,9 @@ vertical-align : middle; tbody tr{ background-color: transparent !important; + i{ + padding-right : 5px + } button{ background-color : transparent; color : #58180D; From 76a6c9c2d39ab5f02c1a163f41b9ddc503e66579 Mon Sep 17 00:00:00 2001 From: Gazook89 <58999374+Gazook89@users.noreply.github.com> Date: Sun, 15 Aug 2021 19:52:12 -0500 Subject: [PATCH 022/145] Remove :before on .note Move all properties from :before to the base .note....don't see a need to add a superfluous pseudo element. --- themes/5ePhb.style.less | 20 ++++++-------------- 1 file changed, 6 insertions(+), 14 deletions(-) diff --git a/themes/5ePhb.style.less b/themes/5ePhb.style.less index 095d7c568..629886e4c 100644 --- a/themes/5ePhb.style.less +++ b/themes/5ePhb.style.less @@ -199,20 +199,12 @@ body { // * NOTE // *****************************/ .note{ - &::before{ - content : ""; - box-sizing : border-box; - border-style : solid; - border-width : 11px; - border-image : @noteBorderImage 12; - border-image-outset : 9px 0px; - box-shadow : 1px 4px 14px #888; - position : absolute; - width : 100%; - height : 100%; - top : 0; - left : 0; - } + box-sizing : border-box; + border-style : solid; + border-width : 11px; + border-image : @noteBorderImage 12; + border-image-outset : 9px 0px; + box-shadow : 1px 4px 14px #888; .useSansSerif(); position : relative; margin-top : 1.3em; From 0773dd24ab600844a4bbfb09737e09327f035a8c Mon Sep 17 00:00:00 2001 From: Gazook89 <58999374+Gazook89@users.noreply.github.com> Date: Sun, 15 Aug 2021 19:57:20 -0500 Subject: [PATCH 023/145] change box-shadows to drop-shadows monster blocks, descriptive notes, regular notes. --- themes/5ePhb.style.less | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/themes/5ePhb.style.less b/themes/5ePhb.style.less index 629886e4c..d50349f46 100644 --- a/themes/5ePhb.style.less +++ b/themes/5ePhb.style.less @@ -204,7 +204,7 @@ body { border-width : 11px; border-image : @noteBorderImage 12; border-image-outset : 9px 0px; - box-shadow : 1px 4px 14px #888; + filter : drop-shadow(1px 4px 6px #888); .useSansSerif(); position : relative; margin-top : 1.3em; @@ -239,7 +239,7 @@ body { border-width : 7px; border-image : @descriptiveBoxImage 12 stretch; border-image-outset : 4px; - box-shadow : 0px 0px 6px #faf7ea; + filter : drop-shadow(0 0 3px #faf7ea); padding : 0.1em; & + * { margin-top : 1.4em; @@ -297,7 +297,7 @@ body { border-image-outset : 0px 2px; background-blend-mode : overlay; background-attachment : fixed; - box-shadow : 1px 4px 14px #888; + filter : drop-shadow(1px 4px 6px #888); padding : 4px 2px; margin : 0px -6px 1em; } From 1b7729ca010b3b5f4b0b9f507269d5dfddafdec7 Mon Sep 17 00:00:00 2001 From: Gazook89 <58999374+Gazook89@users.noreply.github.com> Date: Sun, 15 Aug 2021 20:17:15 -0500 Subject: [PATCH 024/145] reverting change to .note:before setting back to what it was. apparently :before is necessary due to border-image spacing. --- themes/5ePhb.style.less | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/themes/5ePhb.style.less b/themes/5ePhb.style.less index d50349f46..b736056b0 100644 --- a/themes/5ePhb.style.less +++ b/themes/5ePhb.style.less @@ -199,12 +199,20 @@ body { // * NOTE // *****************************/ .note{ - box-sizing : border-box; - border-style : solid; - border-width : 11px; - border-image : @noteBorderImage 12; - border-image-outset : 9px 0px; - filter : drop-shadow(1px 4px 6px #888); + &::before{ + content : ""; + box-sizing : border-box; + border-style : solid; + border-width : 11px; + border-image : @noteBorderImage 12; + border-image-outset : 9px 0px; + filter : drop-shadow(1px 4px 6px #888); + position : absolute; + width : 100%; + height : 100%; + top : 0; + left : 0; + } .useSansSerif(); position : relative; margin-top : 1.3em; From bdfcde766136970f7520e4dee677d37b437c6d83 Mon Sep 17 00:00:00 2001 From: "G.Ambatte" Date: Tue, 17 Aug 2021 20:23:26 +1200 Subject: [PATCH 025/145] Fix issue with /