icons: add support for transform suffixes
This commit is contained in:
parent
2d00aa6fc7
commit
0f8f55165e
3 changed files with 5 additions and 2 deletions
|
|
@ -126,3 +126,4 @@
|
|||
- more detached DOM for lighter nested canvas widgets (ie multixy)
|
||||
- unified (kind of) dom html structure for widgets, known css tricks will require adjustments.
|
||||
- cache and config files are now stored in a folder named `open-stage-control` (located in the system's default location for config file). The `.open-stage-control` is no longer used.
|
||||
- added support for icons rotate/flip transform suffixes (example: `^cog.spin`, `^play.rotate-horizontal`)
|
||||
|
|
|
|||
|
|
@ -3,7 +3,8 @@ module.exports = {
|
|||
|
||||
|
||||
icon: function(i) {
|
||||
return `<i class="fa fa-fw fa-${i}"></i>`
|
||||
var iclass = i.split('.').join(' fa-')
|
||||
return `<i class="fa fa-fw fa-${iclass}"></i>`
|
||||
},
|
||||
iconify:function(string){
|
||||
return String(string).replace(/\^[^\s]{2,}/g,(x)=>{return module.exports.icon(x.substring(1))})
|
||||
|
|
|
|||
|
|
@ -54,7 +54,8 @@ class Widget extends EventEmitter {
|
|||
id: {type: 'string', value: 'auto', help: 'Widgets sharing the same `id` will act as clones and update each other\'s value(s) without sending extra osc messages.' },
|
||||
label: {type: 'string|boolean', value: 'auto', help: [
|
||||
'Set to `false` to hide completely',
|
||||
'Insert icons using the prefix ^ followed by the icon\'s name : ^play, ^pause, etc (see https://fontawesome.com/icons?d=gallery&s=solid&m=free)'
|
||||
'- Insert icons using the prefix ^ followed by the icon\'s name : `^play`, `^pause`, etc (see https://fontawesome.com/icons?d=gallery&s=solid&m=free)',
|
||||
'- Icons can be transformed with the following suffixes: `.flip-[horizontal|vertical|both]`, `.rotate-[90|180|270]`, `.spin`, `.pulse`. Example: `^play.flip-horizontal`',
|
||||
]},
|
||||
visible: {type: 'boolean', value: true, help: 'Set to `false` to hide the widget.'},
|
||||
interaction: {type: 'boolean', value: true, help: 'Set to `false` to disable pointer interactions.'},
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue