0
0
mirror of https://github.com/naturalcrit/homebrewery.git synced 2026-03-22 11:08:10 +00:00

initial pass

This commit is contained in:
Víctor Losada Hernández
2026-03-11 15:23:39 +01:00
parent 55ae00ecfe
commit a6755379f7
16 changed files with 45 additions and 26 deletions

View File

@@ -1,11 +1,12 @@
import _ from 'lodash';
import dedent from 'dedent';
const domain = window.location.origin;
export default {
center : ()=>{
return dedent`
{{imageMaskCenter${_.random(1, 16)},--offsetX:0%,--offsetY:0%,--rotation:0
![](https://homebrewery.naturalcrit.com/assets/dragoninflight.jpg){height:100%}
![The Roman Theater at Taormina, 1828, by Louise-Joséphine sarazin de Belmont](${domain}/assets/roman_theatre.webp){height:100%}
}}
<!-- Use --offsetX to shift the mask left or right (can use cm instead of %)
Use --offsetY to shift the mask up or down
@@ -13,6 +14,20 @@ export default {
},
edge : (side = 'bottom')=>{
const styles = ()=>{
switch (side) {
case 'bottom':
return `{width:100%,bottom:0%}`
break;
case 'top':
return `{width:100%,top:0%}`
break;
default:
return `{height:100%}`
break;
}
}
const rotation = {
'bottom' : 0,
'top' : 180,
@@ -20,8 +35,8 @@ export default {
'right' : 270
}[side];
return dedent`
{{imageMaskEdge${_.random(1, 8)},--offset:0%,--rotation:${rotation}
![](https://homebrewery.naturalcrit.com/assets/dragoninflight.jpg){height:100%}
{{imageMaskEdge${_.random(1, 8)},--offset:10%,--rotation:${rotation}
![The Roman Theater at Taormina, 1828, by Louise-Joséphine sarazin de Belmont](${domain}/assets/roman_theatre.webp)${styles()}
}}
<!-- Use --offset to shift the mask away from page center (can use cm instead of %)
Use --rotation to set rotation angle in degrees. -->\n\n`;
@@ -32,7 +47,7 @@ export default {
const offsetY = (y == 'top' ? '50%' : '-50%');
return dedent`
{{imageMaskCorner${_.random(1, 37)},--offsetX:${offsetX},--offsetY:${offsetY},--rotation:0
![](https://homebrewery.naturalcrit.com/assets/dragoninflight.jpg){height:100%}
![The Roman Theater at Taormina, 1828, by Louise-Joséphine sarazin de Belmont](${domain}/assets/roman_theatre.webp){height:100%}
}}
<!-- Use --offsetX to shift the mask left or right (can use cm instead of %)
Use --offsetY to shift the mask up or down