0
0
mirror of https://github.com/naturalcrit/homebrewery.git synced 2026-01-08 07:32:40 +00:00

Add 8 corner images.

Doesn't work well with --rotation but you can just set top,left or whatever. --offset works.
This commit is contained in:
Trevor Buckner
2022-09-27 23:55:24 -04:00
parent b8d7d1a8e4
commit 89c091c630
21 changed files with 65 additions and 11 deletions

View File

@@ -96,7 +96,7 @@ const BrewItem = createClass({
render : function(){ render : function(){
const brew = this.props.brew; const brew = this.props.brew;
if(Array.isArray(brew.tags)) { // temporary fix until dud tags are cleaned if(Array.isArray(brew.tags)) { // temporary fix until dud tags are cleaned
brew.tags = brew.tags?.filter(tag => tag); //remove tags that are empty strings brew.tags = brew.tags?.filter((tag)=>tag); //remove tags that are empty strings
} }
const dateFormatString = 'YYYY-MM-DD HH:mm:ss'; const dateFormatString = 'YYYY-MM-DD HH:mm:ss';
@@ -112,7 +112,7 @@ const BrewItem = createClass({
<div className='brewTags' title={`Tags:\n${brew.tags.join('\n')}`}> <div className='brewTags' title={`Tags:\n${brew.tags.join('\n')}`}>
<i className='fas fa-tags'/> <i className='fas fa-tags'/>
{brew.tags.map((tag, idx)=>{ {brew.tags.map((tag, idx)=>{
let matches = tag.match(/^(?:([^:]+):)?([^:]+)$/); const matches = tag.match(/^(?:([^:]+):)?([^:]+)$/);
return <span className={matches[1]}>{matches[2]}</span>; return <span className={matches[1]}>{matches[2]}</span>;
})} })}
</div> </div>

View File

@@ -104,9 +104,14 @@ module.exports = [
gen : WatercolorGen, gen : WatercolorGen,
}, },
{ {
name : 'Watercolor Image Mask', name : 'Watercolor Image Mask Edge',
icon : 'fas fa-fill-drip', icon : 'fas fa-fill-drip',
gen : ImageMaskGen, gen : ImageMaskGen.edge,
},
{
name : 'Watercolor Image Mask Corner',
icon : 'fas fa-fill-drip',
gen : ImageMaskGen.corner,
}, },
{ {
name : 'Watermark', name : 'Watermark',

View File

@@ -1,7 +1,27 @@
const _ = require('lodash'); const _ = require('lodash');
const dedent = require('dedent-tabs').default;
module.exports = {
edge : ()=>{
return dedent`
{{imageMask${_.random(1, 8)},--offset:0cm,--rotation:0
![](https://assets1.ignimgs.com/2019/05/29/dndmobile-br-1559158957902_160w.jpg?width=1280){height:100%}
<!-- Use offset to shift the edge up or down. Use rotation to set rotation angle in degrees. -->
}}\n\n`;
},
corner : ()=>{
return dedent`
{{imageMask_Corner${_.random(1, 8)},--offset:0cm,bottom,left
![](https://assets1.ignimgs.com/2019/05/29/dndmobile-br-1559158957902_160w.jpg?width=1280){height:100%}
<!-- Use offset to shift the edge up or down. Use top, bottom, left, and right to select a corner -->
}}\n\n`;
}
};
()=>{
module.exports = ()=>{
return `{{imageMask${_.random(1, 6)},--offset:0cm,--rotation:0
![](https://assets1.ignimgs.com/2019/05/29/dndmobile-br-1559158957902_160w.jpg?width=1280){height:100%}
}}\n\n`;
}; };

View File

@@ -180,9 +180,11 @@ body {
--rotation : 0; --rotation : 0;
--revealer : none; --revealer : none;
--checkerboard : none; --checkerboard : none;
--scaleX : 1;
--scaleY : 1;
-webkit-mask-image : var(--wc), var(--revealer); -webkit-mask-image : var(--wc), var(--revealer);
-webkit-mask-repeat : repeat-x; -webkit-mask-repeat : repeat-x;
-webkit-mask-size : 50%; -webkit-mask-size : 50%; //Scale only X to fit page width, leave height at aspect ratio, designed to hang off the edge
-webkit-mask-position : 50% calc(50% - var(--offset)); -webkit-mask-position : 50% calc(50% - var(--offset));
mask-image : var(--wc); mask-image : var(--wc);
mask-repeat : repeat-x; mask-repeat : repeat-x;
@@ -191,7 +193,7 @@ body {
background-image : var(--checkerboard); background-image : var(--checkerboard);
background-size : 20px; background-size : 20px;
z-index : -1; z-index : -1;
transform : translateY(50%) translateX(-50%) rotate(calc(1deg * var(--rotation))); transform : translateY(50%) translateX(-50%) rotate(calc(1deg * var(--rotation))) scaleX(var(--scaleX)) scaleY(var(--scaleY));
transition : transform 2s; transition : transform 2s;
& > p:has(img) { & > p:has(img) {
position : absolute; position : absolute;
@@ -199,7 +201,7 @@ body {
height : 50%; height : 50%;
bottom : 50%; bottom : 50%;
left : 50%; left : 50%;
transform : translateX(-50%) translateY(50%) rotate(calc(-1deg * var(--rotation))); transform : translateX(-50%) translateY(50%) rotate(calc(-1deg * var(--rotation))) scaleX(var(--scaleX)) scaleY(var(--scaleY));
transition : transform 2s; transition : transform 2s;
} }
& img { & img {
@@ -238,6 +240,33 @@ body {
.imageMask7 { --wc : url(/assets/waterColorMasks/edge/0007.webp); } .imageMask7 { --wc : url(/assets/waterColorMasks/edge/0007.webp); }
.imageMask8 { --wc : url(/assets/waterColorMasks/edge/0008.webp); } .imageMask8 { --wc : url(/assets/waterColorMasks/edge/0008.webp); }
[class*="imageMask_Corner"] {
-webkit-mask-size : 50% 50%; //Scale both dimensions to fit page size
&.bottom {
--rotation : 0;
}
&.top {
--rotation : 0;
--scaleY : -1;
}
&.left {
--rotation : 0;
}
&.right {
--rotation : 0;
--scaleX : -1;
}
}
.imageMask_Corner1 { --wc : url(/assets/waterColorMasks/corner/0005.webp); }
.imageMask_Corner2 { --wc : url(/assets/waterColorMasks/corner/0006.webp); }
.imageMask_Corner3 { --wc : url(/assets/waterColorMasks/corner/0007.webp); }
.imageMask_Corner4 { --wc : url(/assets/waterColorMasks/corner/0008.webp); }
.imageMask_Corner5 { --wc : url(/assets/waterColorMasks/corner/0009.webp); }
.imageMask_Corner6 { --wc : url(/assets/waterColorMasks/corner/0010.webp); }
.imageMask_Corner7 { --wc : url(/assets/waterColorMasks/corner/0016.webp); }
.imageMask_Corner8 { --wc : url(/assets/waterColorMasks/corner/0017.webp); }
//************************************ //************************************
// * CODE BLOCKS // * CODE BLOCKS
// ************************************/ // ************************************/

Binary file not shown.

After

Width:  |  Height:  |  Size: 366 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 86 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 53 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 56 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 35 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 53 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 33 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 56 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 36 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 43 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 27 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 60 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 39 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 101 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 62 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 124 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 79 KiB