0
0
mirror of https://github.com/naturalcrit/homebrewery.git synced 2026-01-18 07:52:41 +00:00

Add subsnippets for edge masks

This commit is contained in:
Trevor Buckner
2023-02-07 10:31:29 -05:00
parent 2ea639000b
commit 63346cfd7a
2 changed files with 32 additions and 3 deletions

View File

@@ -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};
![](https://i.imgur.com/GZfjDWV.png){height:100%}
}}
<!-- Use --offset to shift the edge up or down from the page center.