mirror of
https://github.com/naturalcrit/homebrewery.git
synced 2026-01-27 13:53:09 +00:00
add image selector field type, modal component, and new snippet widgets
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
const _ = require('lodash');
|
||||
const { SNIPPET_TYPE, FIELD_TYPE } = require('../../../shared/naturalcrit/codeEditor/helpers/widget-elements/constants');
|
||||
|
||||
module.exports = [{
|
||||
@@ -36,4 +37,56 @@ module.exports = [{
|
||||
increment : 5,
|
||||
hints : true
|
||||
}]
|
||||
}];
|
||||
}, {
|
||||
name : 'watercolor',
|
||||
type : SNIPPET_TYPE.INLINE,
|
||||
fields : [{
|
||||
name : 'watercolor',
|
||||
type : FIELD_TYPE.IMAGE_SELECTOR,
|
||||
preview : (value)=>`/assets/watercolor/watercolor${value}.png`,
|
||||
values : _.range(1, 13)
|
||||
}, {
|
||||
name : 'top',
|
||||
type : FIELD_TYPE.TEXT,
|
||||
increment : 5,
|
||||
hints : true
|
||||
}, {
|
||||
name : 'left',
|
||||
type : FIELD_TYPE.TEXT,
|
||||
increment : 5,
|
||||
hints : true
|
||||
}, {
|
||||
name : 'width',
|
||||
type : FIELD_TYPE.TEXT,
|
||||
increment : 5,
|
||||
hints : true
|
||||
}, {
|
||||
name : 'opacity',
|
||||
type : FIELD_TYPE.TEXT,
|
||||
increment : 5
|
||||
}]
|
||||
}, {
|
||||
name : 'imageMaskCenter',
|
||||
type : SNIPPET_TYPE.INLINE,
|
||||
fields : [{
|
||||
name : 'imageMaskCenter',
|
||||
type : FIELD_TYPE.IMAGE_SELECTOR,
|
||||
preview : (value)=>`/assets/waterColorMasks/center/${typeof value === 'number' ? (()=>{
|
||||
const str = String(value);
|
||||
return _.range(0, 4 - str.length).map(()=>'0').join('') + str;
|
||||
})() : value}.webp`,
|
||||
values : _.range(1, 17)
|
||||
}, {
|
||||
name : '--offsetX',
|
||||
type : FIELD_TYPE.TEXT,
|
||||
increment : 5,
|
||||
}, {
|
||||
name : '--offsetY',
|
||||
type : FIELD_TYPE.TEXT,
|
||||
increment : 5,
|
||||
}, {
|
||||
name : '--rotation',
|
||||
type : FIELD_TYPE.TEXT,
|
||||
increment : 5,
|
||||
}]
|
||||
}];
|
||||
|
||||
Reference in New Issue
Block a user