Merge pull request #1549 from Gazook89/Images-Snippet-Menu
New Snippet Menu for Images, +3 new snippets
@@ -76,7 +76,8 @@ const Editor = createClass({
|
|||||||
const cursorPos = this.refs.codeEditor.getCursorPosition();
|
const cursorPos = this.refs.codeEditor.getCursorPosition();
|
||||||
lines[cursorPos.line] = splice(lines[cursorPos.line], cursorPos.ch, injectText);
|
lines[cursorPos.line] = splice(lines[cursorPos.line], cursorPos.ch, injectText);
|
||||||
|
|
||||||
this.refs.codeEditor.setCursorPosition(cursorPos.line + injectText.split('\n').length, cursorPos.ch + injectText.length);
|
const injectLines = injectText.split('\n');
|
||||||
|
this.refs.codeEditor.setCursorPosition(cursorPos.line + injectLines.length, cursorPos.ch + injectLines[injectLines.length - 1].length);
|
||||||
|
|
||||||
if(this.isText()) this.props.onTextChange(lines.join('\n'));
|
if(this.isText()) this.props.onTextChange(lines.join('\n'));
|
||||||
if(this.isStyle()) this.props.onStyleChange(lines.join('\n'));
|
if(this.isStyle()) this.props.onStyleChange(lines.join('\n'));
|
||||||
|
|||||||
@@ -7,6 +7,7 @@ const ClassFeatureGen = require('./classfeature.gen.js');
|
|||||||
const CoverPageGen = require('./coverpage.gen.js');
|
const CoverPageGen = require('./coverpage.gen.js');
|
||||||
const TableOfContentsGen = require('./tableOfContents.gen.js');
|
const TableOfContentsGen = require('./tableOfContents.gen.js');
|
||||||
const dedent = require('dedent-tabs').default;
|
const dedent = require('dedent-tabs').default;
|
||||||
|
const watercolorGen = require('./watercolor.gen.js');
|
||||||
|
|
||||||
|
|
||||||
module.exports = [
|
module.exports = [
|
||||||
@@ -48,28 +49,6 @@ module.exports = [
|
|||||||
}}
|
}}
|
||||||
\n`
|
\n`
|
||||||
},
|
},
|
||||||
{
|
|
||||||
name : 'Image',
|
|
||||||
icon : 'fas fa-image',
|
|
||||||
gen : dedent`
|
|
||||||
 {width:325px,mix-blend-mode:multiply}
|
|
||||||
|
|
||||||
{{artist,position:relative,top:-230px,left:-100px,margin-bottom:-30px
|
|
||||||
##### Cat Warrior
|
|
||||||
[Kyoung Hwan Kim](https://www.artstation.com/tahra)
|
|
||||||
}}`
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name : 'Background Image',
|
|
||||||
icon : 'fas fa-tree',
|
|
||||||
gen : dedent`
|
|
||||||
 {position:absolute,top:50px,right:30px,width:280px}
|
|
||||||
|
|
||||||
{{artist,top:90px,right:30px
|
|
||||||
##### Homebrew Mug
|
|
||||||
[naturalcrit](https://homebrew.naturalcrit.com)
|
|
||||||
}}`
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
name : 'QR Code',
|
name : 'QR Code',
|
||||||
icon : 'fas fa-qrcode',
|
icon : 'fas fa-qrcode',
|
||||||
@@ -79,7 +58,6 @@ module.exports = [
|
|||||||
`https://homebrewery.naturalcrit.com/share/${brew.shareId}` +
|
`https://homebrewery.naturalcrit.com/share/${brew.shareId}` +
|
||||||
`&size=100x100) {width:100px;mix-blend-mode:multiply}`;
|
`&size=100x100) {width:100px;mix-blend-mode:multiply}`;
|
||||||
}
|
}
|
||||||
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name : 'Page Number',
|
name : 'Page Number',
|
||||||
@@ -134,6 +112,48 @@ module.exports = [
|
|||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
|
||||||
|
/*********************** IMAGES *******************/
|
||||||
|
{
|
||||||
|
groupName : 'Images',
|
||||||
|
icon : 'fas fa-images',
|
||||||
|
view : 'text',
|
||||||
|
snippets : [
|
||||||
|
{
|
||||||
|
name : 'Image',
|
||||||
|
icon : 'fas fa-image',
|
||||||
|
gen : dedent`
|
||||||
|
 {width:325px,mix-blend-mode:multiply}
|
||||||
|
|
||||||
|
{{artist,position:relative,top:-230px,left:-100px,margin-bottom:-30px
|
||||||
|
##### Cat Warrior
|
||||||
|
[Kyoung Hwan Kim](https://www.artstation.com/tahra)
|
||||||
|
}}`
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name : 'Background Image',
|
||||||
|
icon : 'fas fa-tree',
|
||||||
|
gen : dedent`
|
||||||
|
 {position:absolute,top:50px,right:30px,width:280px}
|
||||||
|
|
||||||
|
{{artist,top:90px,right:30px
|
||||||
|
##### Homebrew Mug
|
||||||
|
[naturalcrit](https://homebrew.naturalcrit.com)
|
||||||
|
}}`
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name : 'Watercolor Splatter',
|
||||||
|
icon : 'fas fa-fill-drip',
|
||||||
|
gen : watercolorGen,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name : 'Watermark',
|
||||||
|
icon : 'fas fa-id-card',
|
||||||
|
gen : dedent`
|
||||||
|
{{watermark Homebrewery}}\n`
|
||||||
|
},
|
||||||
|
]
|
||||||
|
},
|
||||||
|
|
||||||
|
|
||||||
/************************* PHB ********************/
|
/************************* PHB ********************/
|
||||||
|
|
||||||
@@ -237,7 +257,7 @@ module.exports = [
|
|||||||
{
|
{
|
||||||
name : 'Class Table',
|
name : 'Class Table',
|
||||||
icon : 'fas fa-table',
|
icon : 'fas fa-table',
|
||||||
gen : ClassTableGen.full('classTable,frame,wide'),
|
gen : ClassTableGen.full('classTable,frame,decoration,wide'),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name : 'Class Table (unframed)',
|
name : 'Class Table (unframed)',
|
||||||
@@ -247,7 +267,7 @@ module.exports = [
|
|||||||
{
|
{
|
||||||
name : '1/2 Class Table',
|
name : '1/2 Class Table',
|
||||||
icon : 'fas fa-list-alt',
|
icon : 'fas fa-list-alt',
|
||||||
gen : ClassTableGen.half('classTable,frame'),
|
gen : ClassTableGen.half('classTable,decoration,frame'),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name : '1/2 Class Table (unframed)',
|
name : '1/2 Class Table (unframed)',
|
||||||
|
|||||||
@@ -0,0 +1,5 @@
|
|||||||
|
const _ = require('lodash');
|
||||||
|
|
||||||
|
module.exports = ()=>{
|
||||||
|
return `{{watercolor${_.random(1, 12)},top:20px,left:30px,width:300px,background-color:#BBAD82,opacity:80%}}\n\n`;
|
||||||
|
};
|
||||||
@@ -9,6 +9,7 @@
|
|||||||
@headerText : #58180D; // Dark maroon
|
@headerText : #58180D; // Dark maroon
|
||||||
@monsterStatBackground : #EEDBAB; // Light orange parchment
|
@monsterStatBackground : #EEDBAB; // Light orange parchment
|
||||||
@captionText : #766649; // Brown
|
@captionText : #766649; // Brown
|
||||||
|
@watercolorStain : #BBAD82; // Light brown
|
||||||
@page { margin: 0; }
|
@page { margin: 0; }
|
||||||
body {
|
body {
|
||||||
counter-reset : phb-page-numbers;
|
counter-reset : phb-page-numbers;
|
||||||
@@ -182,7 +183,9 @@ body {
|
|||||||
table{
|
table{
|
||||||
.useSansSerif();
|
.useSansSerif();
|
||||||
width : 100%;
|
width : 100%;
|
||||||
margin-bottom : 1em;
|
& + * {
|
||||||
|
margin-top : 1em;
|
||||||
|
}
|
||||||
thead{
|
thead{
|
||||||
display: table-row-group;
|
display: table-row-group;
|
||||||
font-weight : 800;
|
font-weight : 800;
|
||||||
@@ -272,8 +275,10 @@ body {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
//*****************************
|
//*****************************
|
||||||
// * ARTIST CREDIT BLOCK
|
// * Images Snippets
|
||||||
// *****************************/
|
// *****************************/
|
||||||
|
|
||||||
|
/* Arist Credit */
|
||||||
.artist {
|
.artist {
|
||||||
position : absolute;
|
position : absolute;
|
||||||
text-align : center;
|
text-align : center;
|
||||||
@@ -298,6 +303,64 @@ body {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Watermark */
|
||||||
|
.watermark {
|
||||||
|
display : grid !important;
|
||||||
|
place-items : center;
|
||||||
|
justify-content : center;
|
||||||
|
position : absolute;
|
||||||
|
top : 0;
|
||||||
|
left : 0;
|
||||||
|
width : 100%;
|
||||||
|
height : 100%;
|
||||||
|
font-size : 120px;
|
||||||
|
text-transform : uppercase;
|
||||||
|
color : black;
|
||||||
|
mix-blend-mode : overlay;
|
||||||
|
opacity : 30%;
|
||||||
|
transform : rotate(-45deg);
|
||||||
|
z-index : 500;
|
||||||
|
p {
|
||||||
|
margin-bottom : none;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Watercolor */
|
||||||
|
[class*="watercolor"] {
|
||||||
|
position : absolute;
|
||||||
|
width : 2000px; /* dimensions need to be real big so the user can set */
|
||||||
|
height : 2000px; /* height or width and the image will maintain aspect ratio */
|
||||||
|
-webkit-mask-image : var(--wc);
|
||||||
|
-webkit-mask-size : contain;
|
||||||
|
-webkit-mask-repeat : no-repeat;
|
||||||
|
mask-image : var(--wc);
|
||||||
|
mask-size : contain;
|
||||||
|
mask-repeat : no-repeat;
|
||||||
|
background-size : cover;
|
||||||
|
background-color : @watercolorStain; /*default color*/
|
||||||
|
--wc : @watercolor1; /*default image*/
|
||||||
|
z-index : -2;
|
||||||
|
}
|
||||||
|
|
||||||
|
.watercolor1 { --wc : @watercolor1; }
|
||||||
|
.watercolor2 { --wc : @watercolor2; }
|
||||||
|
.watercolor3 { --wc : @watercolor3; }
|
||||||
|
.watercolor4 { --wc : @watercolor4; }
|
||||||
|
.watercolor5 { --wc : @watercolor5; }
|
||||||
|
.watercolor6 { --wc : @watercolor6; }
|
||||||
|
.watercolor7 { --wc : @watercolor7; }
|
||||||
|
.watercolor8 { --wc : @watercolor8; }
|
||||||
|
.watercolor9 { --wc : @watercolor9; }
|
||||||
|
.watercolor10 { --wc : @watercolor10; }
|
||||||
|
.watercolor11 { --wc : @watercolor11; }
|
||||||
|
.watercolor12 { --wc : @watercolor12; }
|
||||||
|
|
||||||
|
img {
|
||||||
|
z-index: 2 !important;
|
||||||
|
filter : drop-shadow(0px 6px 6px rgba(0,0,0,.4));
|
||||||
|
position: absolute;
|
||||||
|
}
|
||||||
|
|
||||||
//*****************************
|
//*****************************
|
||||||
// * MONSTER STAT BLOCK
|
// * MONSTER STAT BLOCK
|
||||||
// *****************************/
|
// *****************************/
|
||||||
@@ -564,20 +627,43 @@ body {
|
|||||||
white-space : nowrap;
|
white-space : nowrap;
|
||||||
}
|
}
|
||||||
&.frame {
|
&.frame {
|
||||||
margin-top : 25px;
|
margin-top : 0.66cm;
|
||||||
margin-bottom : 40px;
|
margin-bottom : 1.05cm;
|
||||||
|
margin-left : -0.1cm;
|
||||||
|
margin-right : -0.1cm;
|
||||||
border-collapse : separate;
|
border-collapse : separate;
|
||||||
background-color : white;
|
background-color : white;
|
||||||
border : initial;
|
border : initial;
|
||||||
border-style : solid;
|
border-style : solid;
|
||||||
border-image-outset : 25px 17px;
|
border-image-outset : 0.55cm 0.3cm;
|
||||||
border-image-repeat : stretch;
|
border-image-repeat : stretch;
|
||||||
border-image-slice : 150 200 150 200;
|
border-image-slice : 200;
|
||||||
border-image-source : @frameBorderImage;
|
border-image-source : @frameBorderImage;
|
||||||
border-image-width : 47px;
|
border-image-width : 47px;
|
||||||
}
|
}
|
||||||
h5{
|
&.decoration {
|
||||||
margin-bottom : 10px;
|
transform-style : preserve-3d;
|
||||||
|
}
|
||||||
|
&.decoration::before {
|
||||||
|
content :'';
|
||||||
|
position : absolute;
|
||||||
|
background-image : @classTableDecoration;
|
||||||
|
background-size : contain;
|
||||||
|
background-repeat : space;
|
||||||
|
width : 7.75cm;
|
||||||
|
height : calc(100% + 3.3cm);
|
||||||
|
top : 50%;
|
||||||
|
left : 50%;
|
||||||
|
transform : translateY(-50%) translateX(-50%) translateZ(-1px);
|
||||||
|
filter : drop-shadow(0px 0px 1px #C8C5C080)
|
||||||
|
}
|
||||||
|
&.decoration.wide::before {
|
||||||
|
width : calc(100% + 3.3cm);
|
||||||
|
height : 7.75cm;
|
||||||
|
top : calc(50% + 0.4cm);
|
||||||
|
}
|
||||||
|
h5 + table{
|
||||||
|
margin-top : 0.2cm;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
//*****************************
|
//*****************************
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
// PHB
|
||||||
@footerAccentImage : data-uri('./themes/assets/footerAccent.png');
|
@footerAccentImage : data-uri('./themes/assets/footerAccent.png');
|
||||||
@frameBorderImage : data-uri('./themes/assets/frameBorder.png');
|
@frameBorderImage : data-uri('./themes/assets/frameBorder.png');
|
||||||
@backgroundImage : data-uri('./themes/assets/parchmentBackground.jpg');
|
@backgroundImage : data-uri('./themes/assets/parchmentBackground.jpg');
|
||||||
@@ -8,3 +9,18 @@
|
|||||||
@monsterBlockBackground : data-uri('./themes/assets/parchmentBackgroundGrayscale.jpg');
|
@monsterBlockBackground : data-uri('./themes/assets/parchmentBackgroundGrayscale.jpg');
|
||||||
@monsterBorderImage : data-uri('./themes/assets/monsterBorderFancy.png');
|
@monsterBorderImage : data-uri('./themes/assets/monsterBorderFancy.png');
|
||||||
@codeBorderImage : data-uri('./themes/assets/codeBorder.png');
|
@codeBorderImage : data-uri('./themes/assets/codeBorder.png');
|
||||||
|
@classTableDecoration : data-uri('./themes/assets/classTableDecoration.png');
|
||||||
|
|
||||||
|
// Watercolor Images
|
||||||
|
@watercolor1 : data-uri('./themes/assets/watercolor/watercolor1.png');
|
||||||
|
@watercolor2 : data-uri('./themes/assets/watercolor/watercolor2.png');
|
||||||
|
@watercolor3 : data-uri('./themes/assets/watercolor/watercolor3.png');
|
||||||
|
@watercolor4 : data-uri('./themes/assets/watercolor/watercolor4.png');
|
||||||
|
@watercolor5 : data-uri('./themes/assets/watercolor/watercolor5.png');
|
||||||
|
@watercolor6 : data-uri('./themes/assets/watercolor/watercolor6.png');
|
||||||
|
@watercolor7 : data-uri('./themes/assets/watercolor/watercolor7.png');
|
||||||
|
@watercolor8 : data-uri('./themes/assets/watercolor/watercolor8.png');
|
||||||
|
@watercolor9 : data-uri('./themes/assets/watercolor/watercolor9.png');
|
||||||
|
@watercolor10 : data-uri('./themes/assets/watercolor/watercolor10.png');
|
||||||
|
@watercolor11 : data-uri('./themes/assets/watercolor/watercolor11.png');
|
||||||
|
@watercolor12 : data-uri('./themes/assets/watercolor/watercolor12.png');
|
||||||
|
|||||||
BIN
themes/assets/classTableDecoration.png
Normal file
|
After Width: | Height: | Size: 67 KiB |
BIN
themes/assets/watercolor/watercolor1.png
Normal file
|
After Width: | Height: | Size: 161 KiB |
BIN
themes/assets/watercolor/watercolor10.png
Normal file
|
After Width: | Height: | Size: 114 KiB |
BIN
themes/assets/watercolor/watercolor11.png
Normal file
|
After Width: | Height: | Size: 78 KiB |
BIN
themes/assets/watercolor/watercolor12.png
Normal file
|
After Width: | Height: | Size: 34 KiB |
BIN
themes/assets/watercolor/watercolor2.png
Normal file
|
After Width: | Height: | Size: 65 KiB |
BIN
themes/assets/watercolor/watercolor3.png
Normal file
|
After Width: | Height: | Size: 80 KiB |
BIN
themes/assets/watercolor/watercolor4.png
Normal file
|
After Width: | Height: | Size: 66 KiB |
BIN
themes/assets/watercolor/watercolor5.png
Normal file
|
After Width: | Height: | Size: 78 KiB |
BIN
themes/assets/watercolor/watercolor6.png
Normal file
|
After Width: | Height: | Size: 62 KiB |
BIN
themes/assets/watercolor/watercolor7.png
Normal file
|
After Width: | Height: | Size: 116 KiB |
BIN
themes/assets/watercolor/watercolor8.png
Normal file
|
After Width: | Height: | Size: 71 KiB |
BIN
themes/assets/watercolor/watercolor9.png
Normal file
|
After Width: | Height: | Size: 73 KiB |