mirror of
https://github.com/naturalcrit/homebrewery.git
synced 2025-12-24 14:12:40 +00:00
Add subsnippets for edge masks
This commit is contained in:
@@ -104,7 +104,29 @@ module.exports = [
|
||||
{
|
||||
name : 'Watercolor Image Mask Edge',
|
||||
icon : 'fas fa-fill-drip',
|
||||
gen : ImageMaskGen.edge,
|
||||
gen : ImageMaskGen.edge('bottom'),
|
||||
subsnippets : [
|
||||
{
|
||||
name : 'Top',
|
||||
icon : 'fac position-top',
|
||||
gen : ImageMaskGen.edge('top'),
|
||||
},
|
||||
{
|
||||
name : 'Right',
|
||||
icon : 'fac position-right',
|
||||
gen : ImageMaskGen.edge('right'),
|
||||
},
|
||||
{
|
||||
name : 'Bottom',
|
||||
icon : 'fac position-bottom',
|
||||
gen : ImageMaskGen.edge('bottom'),
|
||||
},
|
||||
{
|
||||
name : 'Left',
|
||||
icon : 'fac position-left',
|
||||
gen : ImageMaskGen.edge('left'),
|
||||
},
|
||||
]
|
||||
},
|
||||
{
|
||||
name : 'Watercolor Image Mask Corner',
|
||||
|
||||
@@ -2,9 +2,16 @@ const _ = require('lodash');
|
||||
const dedent = require('dedent-tabs').default;
|
||||
|
||||
module.exports = {
|
||||
edge : ()=>{
|
||||
edge : (side = 'bottom')=>{
|
||||
let rotation;
|
||||
switch (side){
|
||||
case 'bottom': rotation = 0; break;
|
||||
case 'top' : rotation = 180; break;
|
||||
case 'left' : rotation = 90; break;
|
||||
case 'right' : rotation = 270; break;
|
||||
}
|
||||
return dedent`
|
||||
{{imageMaskEdge${_.random(1, 8)},--offset:0cm,--rotation:0
|
||||
{{imageMaskEdge${_.random(1, 8)},--offset:0cm,--rotation:${rotation};
|
||||
{height:100%}
|
||||
}}
|
||||
<!-- Use --offset to shift the edge up or down from the page center.
|
||||
|
||||
Reference in New Issue
Block a user