big clean, multi point touchstate, auto update check toggle, rm switchers, add state fn to scripts
This commit is contained in:
parent
d776922b24
commit
f797988c64
51 changed files with 735 additions and 3591 deletions
|
|
@ -3,7 +3,7 @@ var Widget = require('../common/widget'),
|
|||
html = require('nanohtml'),
|
||||
{deepEqual, isJSON} = require('../../utils')
|
||||
|
||||
class Toggle extends Widget {
|
||||
class Button extends Widget {
|
||||
|
||||
static description() {
|
||||
|
||||
|
|
@ -16,7 +16,7 @@ class Toggle extends Widget {
|
|||
return super.defaults({
|
||||
|
||||
|
||||
_toggle: 'toggle',
|
||||
_button: 'button',
|
||||
|
||||
on: {type: '*', value: 1, help: [
|
||||
'Set to `null` to send send no argument in the osc message',
|
||||
|
|
@ -177,14 +177,14 @@ class Toggle extends Widget {
|
|||
|
||||
}
|
||||
|
||||
Toggle.cssVariables = Toggle.prototype.constructor.cssVariables.concat(
|
||||
Button.cssVariables = Button.prototype.constructor.cssVariables.concat(
|
||||
{js: 'colorTextOn', css: '--color-text-on'}
|
||||
)
|
||||
|
||||
Toggle.dynamicProps = Toggle.prototype.constructor.dynamicProps.concat(
|
||||
Button.dynamicProps = Button.prototype.constructor.dynamicProps.concat(
|
||||
'on',
|
||||
'off',
|
||||
'norelease'
|
||||
)
|
||||
|
||||
module.exports = Toggle
|
||||
module.exports = Button
|
||||
|
|
@ -18,6 +18,7 @@ class Dropdown extends Widget {
|
|||
|
||||
_dropdown:'dropdown',
|
||||
|
||||
align: {type: 'string', value: 'center', choices: ['center', 'left', 'right'], help: 'Set to `left` or `right` to change text alignment (otherwise center)'},
|
||||
values: {type: 'array|object', value: {'Value 1':1,'Value 2':2}, help: [
|
||||
'`Array` of possible values to switch between : `[1,2,3]`',
|
||||
'`Object` of label:value pairs. Numeric labels must be prepended or appended with a white space (or any other non-numeric character) otherwise the order of the values won\'t be kept',
|
||||
|
|
@ -36,6 +37,9 @@ class Dropdown extends Widget {
|
|||
</inner>
|
||||
`})
|
||||
|
||||
if (this.getProp('align') === 'left') this.widget.classList.add('left')
|
||||
if (this.getProp('align') === 'right') this.widget.classList.add('right')
|
||||
|
||||
this.select = this.widget.appendChild(html`<select class="no-keybinding"></select>`)
|
||||
this.text = DOM.get(this.widget, '.text')[0]
|
||||
|
||||
|
|
@ -18,6 +18,7 @@ module.exports = class File extends Widget {
|
|||
|
||||
_input:'input',
|
||||
|
||||
align: {type: 'string', value: 'center', choices: ['center', 'left', 'right'], help: 'Set to `left` or `right` to change text alignment (otherwise center)'},
|
||||
directory: {type: 'string', value: 'auto', help: 'Default browsing directory'},
|
||||
extension: {type: 'string', value: '*', help: 'Only display files with this extension'},
|
||||
hidePath: {type: 'boolean', value: false, help: 'Set to `true` to only display the filename (the whole path will still be used as value)'},
|
||||
|
|
@ -30,10 +31,16 @@ module.exports = class File extends Widget {
|
|||
constructor(options) {
|
||||
|
||||
super({...options, html: html`
|
||||
<div class="file btn">${raw(icon('folder-open'))}<span></span></div>
|
||||
<inner>
|
||||
<div class="text"></div>
|
||||
<div class="icon"></div>
|
||||
</inner>
|
||||
`})
|
||||
|
||||
this.text = DOM.get(this.widget, 'span')[0]
|
||||
if (this.getProp('align') === 'left') this.widget.classList.add('left')
|
||||
if (this.getProp('align') === 'right') this.widget.classList.add('right')
|
||||
|
||||
this.text = DOM.get(this.widget, '.text')[0]
|
||||
this.widget.addEventListener('fast-click', (e)=>{
|
||||
|
||||
if (e.capturedByEditor === true) return
|
||||
|
|
@ -22,6 +22,7 @@ class Menu extends Widget {
|
|||
'- If `layout` is `circular`: diameter (in px)',
|
||||
'- Else: square size or `[width, height]` array',
|
||||
]},
|
||||
align: {type: 'string', value: 'center', choices: ['center', 'left', 'right'], help: 'Set to `left` or `right` to change text alignment (otherwise center)'},
|
||||
layout: {type: 'string', value: 'circular', choices: ['circular', 'horizontal', 'vertical', 'grid'], help: [
|
||||
'Defines whether the menu\'s layout should be rendered in a circle or in a box'
|
||||
]},
|
||||
|
|
@ -51,6 +52,9 @@ class Menu extends Widget {
|
|||
|
||||
`})
|
||||
|
||||
if (this.getProp('align') === 'left') this.widget.classList.add('left')
|
||||
if (this.getProp('align') === 'right') this.widget.classList.add('right')
|
||||
|
||||
this.menu = html`<menu></menu>`
|
||||
this.text = DOM.get(this.widget, '.text')[0]
|
||||
|
||||
|
|
@ -1,5 +1,4 @@
|
|||
var _matrix_base = require('./_matrix_base'),
|
||||
Panel = require('../containers/panel'),
|
||||
var Panel = require('./panel'),
|
||||
Widget = require('../common/widget'),
|
||||
parser = require('../../parser')
|
||||
|
||||
|
|
@ -1,39 +1,23 @@
|
|||
module.exports.widgets = {
|
||||
// tabs
|
||||
tab: require('./containers/tab'),
|
||||
|
||||
// basics
|
||||
button: require('./basics/button'),
|
||||
switch: require('./basics/switch'),
|
||||
dropdown: require('./basics/dropdown'),
|
||||
menu: require('./basics/menu'),
|
||||
input: require('./basics/input'),
|
||||
file: require('./basics/file'),
|
||||
|
||||
// containers
|
||||
panel: require('./containers/panel'),
|
||||
root: require('./containers/root'),
|
||||
|
||||
// sliders
|
||||
fader: require('./sliders/fader'),
|
||||
knob: require('./sliders/knob'),
|
||||
encoder: require('./sliders/encoder'),
|
||||
range: require('./sliders/range'),
|
||||
|
||||
// buttons
|
||||
toggle: require('./buttons/toggle'),
|
||||
switch: require('./buttons/switch'),
|
||||
dropdown: require('./buttons/dropdown'), // redo as menu derivate ?
|
||||
menu: require('./buttons/menu'), // redo using canvas
|
||||
|
||||
// pads
|
||||
xy: require('./pads/xy'),
|
||||
rgb: require('./pads/rgb'),
|
||||
multixy: require('./pads/multixy'),
|
||||
canvas: require('./pads/canvas'), // implement...
|
||||
|
||||
// matrices
|
||||
keyboard: require('./matrices/keyboard'),
|
||||
patchbay: require('./matrices/patchbay').PatchBay,
|
||||
patchbaynode: require('./matrices/patchbay').PatchBayNode,
|
||||
|
||||
// indicators
|
||||
led: require('./indicators/led'),
|
||||
text: require('./indicators/text'),
|
||||
|
||||
// graphs
|
||||
plot: require('./graphs/plot'),
|
||||
eq: require('./graphs/eq'),
|
||||
visualizer: require('./graphs/visualizer'),
|
||||
tab: require('./containers/tab'),
|
||||
modal: require('./containers/modal'),
|
||||
clone: require('./containers/clone'),
|
||||
matrix: require('./containers/matrix'),
|
||||
keyboard: require('./containers/keyboard'),
|
||||
patchbay: require('./containers/patchbay').PatchBay,
|
||||
patchbaynode: require('./containers/patchbay').PatchBayNode,
|
||||
|
||||
// frames
|
||||
image: require('./frames/image'),
|
||||
|
|
@ -41,37 +25,41 @@ module.exports.widgets = {
|
|||
html: require('./frames/html'),
|
||||
frame: require('./frames/frame'),
|
||||
|
||||
// containers
|
||||
panel: require('./containers/panel'),
|
||||
modal: require('./containers/modal'),
|
||||
clone: require('./containers/clone'),
|
||||
matrix: require('./containers/matrix'),
|
||||
// graphs
|
||||
plot: require('./graphs/plot'),
|
||||
eq: require('./graphs/eq'),
|
||||
visualizer: require('./graphs/visualizer'),
|
||||
|
||||
// state switchers
|
||||
switcher: require('./switchers/switcher'),
|
||||
crossfader: require('./switchers/crossfader'),
|
||||
state: require('./switchers/state'),
|
||||
// indicators
|
||||
led: require('./indicators/led'),
|
||||
text: require('./indicators/text'),
|
||||
|
||||
// inputs
|
||||
input: require('./inputs/input'),
|
||||
keys: require('./inputs/keys'),
|
||||
script: require('./inputs/script'),
|
||||
gyroscope: require('./inputs/gyroscope'),
|
||||
file: require('./inputs/file'),
|
||||
// pads
|
||||
xy: require('./pads/xy'),
|
||||
rgb: require('./pads/rgb'),
|
||||
multixy: require('./pads/multixy'),
|
||||
canvas: require('./pads/canvas'),
|
||||
|
||||
// sliders
|
||||
fader: require('./sliders/fader'),
|
||||
knob: require('./sliders/knob'),
|
||||
encoder: require('./sliders/encoder'),
|
||||
range: require('./sliders/range'),
|
||||
|
||||
// scripts
|
||||
script: require('./scripts/script'),
|
||||
|
||||
}
|
||||
|
||||
module.exports.categories = {
|
||||
'Buttons':['toggle', 'switch', 'dropdown', 'menu'],
|
||||
'Containers':['panel', 'modal', 'clone', 'matrix'],
|
||||
'Basics':['button', 'switch', 'dropdown', 'menu', 'input', 'file'],
|
||||
'Containers':['panel', 'modal', 'clone', 'matrix', 'keyboard', 'patchbay'],
|
||||
'Frames':['frame', 'svg', 'html', 'image'],
|
||||
'Graphs':['plot','eq','visualizer'],
|
||||
'Indicators':['led', 'text'],
|
||||
'Inputs':['input', 'keys', 'script', 'gyroscope', 'file'],
|
||||
'Matrices':['keyboard', 'patchbay'],
|
||||
'Pads':['xy','rgb','multixy', 'canvas'],
|
||||
'Sliders':['fader','knob', 'encoder', 'range'],
|
||||
'Switchers':['state', 'switcher','crossfader'],
|
||||
'Scripts':['script'],
|
||||
}
|
||||
|
||||
var defaults = {}
|
||||
|
|
|
|||
|
|
@ -1,157 +0,0 @@
|
|||
var Widget = require('../common/widget'),
|
||||
{icon} = require('../../ui/utils'),
|
||||
keyboardJS = require('keyboardjs'),
|
||||
html = require('nanohtml'),
|
||||
raw = require('nanohtml/raw')
|
||||
|
||||
class Keys extends Widget {
|
||||
|
||||
static description() {
|
||||
|
||||
return 'Keyboard binding.'
|
||||
|
||||
}
|
||||
|
||||
static defaults() {
|
||||
|
||||
return super.defaults({
|
||||
|
||||
_keys:'keys',
|
||||
|
||||
binding: {type: 'string|array', value: '', help: 'Key combo `string` or `array` of strings (see <a href="https://github.com/RobertWHurst/KeyboardJS">KeyboardJS</a> documentation)'},
|
||||
keydown: {type: 'string', value: '', help: [
|
||||
'This property is evaluated each time the key combo is pressed and defines the widget\'s own value. Formulas are given extras variables in this context:',
|
||||
'- `key`: pressed key name (usefull for handling multiple keys with a single keys widget, lowercased when referencing a character key)',
|
||||
'- `code`: pressed key code name (<a href="https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/code#Code_values">full list</a>)',
|
||||
'- `ctrl`: control key state',
|
||||
'- `alt`: alt key state',
|
||||
'- `shift`: shift key state',
|
||||
'- `meta`: command/windows key state'
|
||||
]},
|
||||
keyup: {type: 'string', value: '', help: 'Same as `keydown`, but evaluated when releasing the key combo'},
|
||||
repeat: {type: 'boolean', value: true, help: 'Set to `false` to prevent keydown repeats when holding the key combo pressed'},
|
||||
|
||||
})
|
||||
|
||||
|
||||
}
|
||||
|
||||
constructor(options) {
|
||||
|
||||
super({...options, html: null})
|
||||
|
||||
if (this.getProp('binding')) {
|
||||
|
||||
this.keyDownHandler = this.keyDown.bind(this)
|
||||
this.keyUpHandler = this.keyUp.bind(this)
|
||||
|
||||
keyboardJS.withContext('global', ()=>{
|
||||
|
||||
keyboardJS.bind(this.getProp('binding'), this.keyDownHandler, this.keyUpHandler)
|
||||
|
||||
})
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
onRemove() {
|
||||
|
||||
super.onRemove()
|
||||
|
||||
if (this.getProp('binding')) {
|
||||
|
||||
keyboardJS.withContext('global', ()=>{
|
||||
|
||||
keyboardJS.unbind(this.getProp('binding'), this.keyDownHandler, this.keyUpHandler)
|
||||
|
||||
})
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
keyDown(e) {
|
||||
|
||||
if (e.target && (e.target.tagName === 'INPUT' || e.target.tabName === 'TEXTAREA' || e.target.tabName === 'SELECT')) return
|
||||
|
||||
if (!this.getProp('repeat') && e) e.preventRepeat()
|
||||
|
||||
e.preventDefault()
|
||||
|
||||
if (this.getProp('keydown') !== '') {
|
||||
|
||||
var context = {
|
||||
key: e.key,
|
||||
code: e.code,
|
||||
ctrl: e.ctrlKey,
|
||||
shift: e.shiftKey,
|
||||
alt: e.altKey,
|
||||
meta: e.metaKey
|
||||
}
|
||||
|
||||
if (context.key.length === 1) {
|
||||
context.key = context.key.toLowerCase()
|
||||
}
|
||||
|
||||
this.setValue(this.resolveProp('keydown', undefined, false, false, false, context), {sync: true, send: true})
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
keyUp(e) {
|
||||
|
||||
if (e.target && (e.target.tagName === 'INPUT' || e.target.tabName === 'TEXTAREA' || e.target.tabName === 'SELECT')) return
|
||||
|
||||
e.preventDefault()
|
||||
|
||||
if (this.getProp('keyup') !== '') {
|
||||
|
||||
var context = {
|
||||
key: e.key,
|
||||
code: e.code,
|
||||
ctrl: e.ctrlKey,
|
||||
shift: e.shiftKey,
|
||||
alt: e.altKey,
|
||||
meta: e.metaKey
|
||||
}
|
||||
|
||||
if (context.key.length === 1) {
|
||||
context.key = context.key.toLowerCase()
|
||||
}
|
||||
|
||||
this.setValue(this.resolveProp('keyup', undefined, false, false, false, context), {sync: true, send: true})
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
setValue(v, options = {}) {
|
||||
|
||||
this.value = v
|
||||
|
||||
// if (options.send) this.sendValue()
|
||||
if (options.sync) this.changed(options)
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Keys.parsersContexts.keydown = Keys.parsersContexts.keyup = {
|
||||
key: 'x',
|
||||
code: 'x',
|
||||
ctrl: false,
|
||||
alt: false,
|
||||
shift: false,
|
||||
meta: false
|
||||
}
|
||||
|
||||
Keys.dynamicProps = Keys.prototype.constructor.dynamicProps.concat(
|
||||
'keydown',
|
||||
'keyup',
|
||||
'repeat'
|
||||
)
|
||||
|
||||
module.exports = Keys
|
||||
|
|
@ -1,179 +0,0 @@
|
|||
var Widget = require('../common/widget'),
|
||||
widgetManager = require('../../managers/widgets'),
|
||||
{icon} = require('../../ui/utils'),
|
||||
html = require('nanohtml'),
|
||||
raw = require('nanohtml/raw'),
|
||||
{urlParser} = require('../utils')
|
||||
|
||||
|
||||
class Script extends Widget {
|
||||
|
||||
static description() {
|
||||
|
||||
return 'Evaluates a script each time it receives a value.'
|
||||
|
||||
}
|
||||
|
||||
static defaults() {
|
||||
|
||||
return super.defaults({
|
||||
|
||||
_script:'script',
|
||||
|
||||
condition: {type: 'string', value: 1, help: [
|
||||
'When the widget receives a value, if this property return a falsy value, the script property won\'t be evaluated. If it\'s non-falsy, it will be evaluated normally. Formulas are given one extra variable in this context:',
|
||||
'- `value`: the value received by the widget'
|
||||
]},
|
||||
script: {type: 'string', value: '', help: [
|
||||
'This property is evaluated each time the widget receives a value* if condition is non-falsy. Formulas are given extras variables in this context:',
|
||||
'- `value`: value received by the widget',
|
||||
'- `id`: id of the widget that triggered the script',
|
||||
'- `send(target, address, arg1, arg2, ...)`: function for sending osc messages (ignores the script\'s targets and the server\'s defaults unless `target` is `false`; ignores the script\'s `preArgs`)',
|
||||
'- `set(id, value)`: function for setting a widget\'s value',
|
||||
'- `get(id)`: function for getting a widget\'s value (dynamic equivalent of @{id})',
|
||||
'- `getProp(id, property)`: function for getting a widget\'s property value ((dynamic equivalent of @{id.property})',
|
||||
'- `httpGet(url, callback)`: function for making http requests (asynchronous "GET" request and local urls only)',
|
||||
'',
|
||||
'* Note: `value` or `linkId` properties can be used to receive other widgets\' values. The `value` property must actually change to trigger the execution, where linked widgets via `linkId` can submit the same value over and over and trigger the execution',
|
||||
]}
|
||||
|
||||
})
|
||||
|
||||
}
|
||||
|
||||
constructor(options) {
|
||||
|
||||
super({...options, html: html`
|
||||
<div class="script">
|
||||
${raw(icon('code'))}
|
||||
</div>
|
||||
`})
|
||||
|
||||
this.scriptLock = false
|
||||
|
||||
}
|
||||
|
||||
|
||||
static scriptSet(id, value, options) {
|
||||
|
||||
if (id == options.id) options.sync = false
|
||||
|
||||
var widgets = widgetManager.getWidgetById(id)
|
||||
|
||||
for (var i = widgets.length - 1; i >= 0; i--) {
|
||||
|
||||
return widgets[i].setValue(value, options)
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
static scriptGet(id) {
|
||||
|
||||
var widgets = widgetManager.getWidgetById(id)
|
||||
|
||||
for (var i = widgets.length - 1; i >= 0; i--) {
|
||||
|
||||
if (widgets[i].getValue) {
|
||||
|
||||
var v = widgets[i].getValue()
|
||||
if (v !== undefined) return v
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
static scriptGetProp(id, prop) {
|
||||
|
||||
var widgets = widgetManager.getWidgetById(id)
|
||||
|
||||
for (var i = widgets.length - 1; i >= 0; i--) {
|
||||
|
||||
var v = widgets[i].getProp(prop)
|
||||
if (v !== undefined) return v
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
scriptSend(target, address, ...args) {
|
||||
|
||||
var overrides = {
|
||||
address,
|
||||
v: args,
|
||||
preArgs: []
|
||||
}
|
||||
|
||||
if (target) overrides.target = Array.isArray(target) ? target : [target]
|
||||
|
||||
this.sendValue(overrides)
|
||||
|
||||
}
|
||||
|
||||
setValue(v, options={} ) {
|
||||
|
||||
if (this.scriptLock) return
|
||||
|
||||
var context = {
|
||||
value: v,
|
||||
id: options.id,
|
||||
send: options.send ? this.scriptSend.bind(this) : ()=>{},
|
||||
set: (id, value)=>{Script.scriptSet(id, value, options)},
|
||||
get: (id)=>{return Script.scriptGet(id)},
|
||||
getProp: (id, prop)=>{return Script.scriptGetProp(id, prop)},
|
||||
httpGet: (url, callback)=>{
|
||||
var parser = urlParser(url),
|
||||
err = (e)=>{console.error(e)}
|
||||
|
||||
if (!parser.isLocal()) return err('httpGet error (' + url + '): non-local url')
|
||||
|
||||
var xhr = new XMLHttpRequest()
|
||||
xhr.open('GET', url, true)
|
||||
xhr.onload = (e)=>{
|
||||
if (xhr.readyState === 4 && xhr.status === 200 && callback) {
|
||||
callback(xhr.responseText)
|
||||
}
|
||||
}
|
||||
xhr.onerror = (e)=>err('httpGet error (' + url + '): ' + xhr.statusText)
|
||||
xhr.send(null)
|
||||
}
|
||||
}
|
||||
|
||||
var condition = this.resolveProp('condition', undefined, false, false, false, {value: v})
|
||||
|
||||
if (condition) {
|
||||
this.scriptLock = true
|
||||
this.resolveProp('script', undefined, false, false, false, context)
|
||||
this.scriptLock = false
|
||||
}
|
||||
|
||||
|
||||
// if (options.send) this.sendValue()
|
||||
if (options.sync) this.changed(options)
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Script.parsersContexts.condition = {
|
||||
value: ''
|
||||
}
|
||||
|
||||
Script.parsersContexts.script = {
|
||||
value: '',
|
||||
id: '',
|
||||
send: ()=>{},
|
||||
set: ()=>{},
|
||||
get: ()=>{},
|
||||
getProp: ()=>{},
|
||||
httpGet: ()=>{}
|
||||
}
|
||||
|
||||
Script.dynamicProps = Script.prototype.constructor.dynamicProps.concat(
|
||||
'condition',
|
||||
'script'
|
||||
)
|
||||
|
||||
module.exports = Script
|
||||
|
|
@ -1,39 +0,0 @@
|
|||
var Container = require('../common/container'),
|
||||
{enableTraversingGestures} = require('../../events/drag'),
|
||||
html = require('nanohtml')
|
||||
|
||||
|
||||
module.exports = class _matrix_base extends Container() {
|
||||
|
||||
constructor(options) {
|
||||
|
||||
super({...options, html: html`<div class="matrix"></div>`})
|
||||
|
||||
this.value = []
|
||||
|
||||
if (this.getProp('traversing')) enableTraversingGestures(this.widget)
|
||||
|
||||
}
|
||||
|
||||
onPropChanged(propName, options, oldPropValue) {
|
||||
|
||||
if (super.onPropChanged(...arguments)) return true
|
||||
|
||||
switch (propName) {
|
||||
|
||||
case 'colorWidget':
|
||||
case 'colorFill':
|
||||
case 'colorStroke':
|
||||
case 'alphaStroke':
|
||||
case 'alphaFillOff':
|
||||
case 'alphaFillOn':
|
||||
for (var w of this.children) {
|
||||
if (w) w.onPropChanged(propName)
|
||||
}
|
||||
return
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -81,7 +81,6 @@ module.exports = class MultiXy extends Pad {
|
|||
|
||||
}
|
||||
|
||||
|
||||
this.value = []
|
||||
|
||||
this.padsCoords = []
|
||||
|
|
@ -119,6 +118,13 @@ module.exports = class MultiXy extends Pad {
|
|||
|
||||
e.stopPropagation = true
|
||||
|
||||
if (this.getProp('touchAddress')) {
|
||||
this.sendValue({
|
||||
address: this.getProp('touchAddress'),
|
||||
v: [parseInt(id), 1],
|
||||
})
|
||||
}
|
||||
|
||||
this.pads[id].trigger('draginit', e)
|
||||
|
||||
}, {element: this.widget, multitouch: true})
|
||||
|
|
@ -143,6 +149,13 @@ module.exports = class MultiXy extends Pad {
|
|||
|
||||
this.pads[i].trigger('dragend', e)
|
||||
|
||||
if (this.getProp('touchAddress')) {
|
||||
this.sendValue({
|
||||
address: this.getProp('touchAddress'),
|
||||
v: [parseInt(this.touchMap[e.pointerId]), 0],
|
||||
})
|
||||
}
|
||||
|
||||
delete this.touchMap[e.pointerId]
|
||||
|
||||
}, {element: this.widget, multitouch: true})
|
||||
|
|
@ -153,7 +166,6 @@ module.exports = class MultiXy extends Pad {
|
|||
this.setValue(this.getValue(), e.options)
|
||||
})
|
||||
|
||||
|
||||
var v = []
|
||||
for (let i = 0; i < this.npoints * 2; i = i + 2) {
|
||||
[v[i],v[i+1]] = this.pads[i/2].getValue()
|
||||
|
|
|
|||
|
|
@ -80,7 +80,10 @@ module.exports = class Xy extends Pad {
|
|||
e.stopPropagation = true
|
||||
})
|
||||
|
||||
this.value = []
|
||||
|
||||
touchstate(this, {element: this.canvas})
|
||||
|
||||
this.active = false
|
||||
|
||||
this.on('draginit',(e)=>{
|
||||
|
|
|
|||
174
src/client/widgets/scripts/script-vm.js
Normal file
174
src/client/widgets/scripts/script-vm.js
Normal file
|
|
@ -0,0 +1,174 @@
|
|||
var widgetManager = require('../../managers/widgets'),
|
||||
stateManager = require('../../managers/state'),
|
||||
{deepCopy} = require('../../utils'),
|
||||
{urlParser} = require('../utils'),
|
||||
Vm = require('../vm')
|
||||
|
||||
|
||||
class ScriptVm extends Vm {
|
||||
|
||||
constructor() {
|
||||
|
||||
super()
|
||||
|
||||
this.valueOptions = []
|
||||
this.sendWidget = []
|
||||
|
||||
}
|
||||
|
||||
getValueOptions() {
|
||||
|
||||
return this.valueOptions[this.valueOptions.length - 1] || {send: true, sync: true}
|
||||
|
||||
}
|
||||
|
||||
setValueOptions(options) {
|
||||
|
||||
if (!options) this.valueOptions.pop()
|
||||
else this.valueOptions.push(options)
|
||||
|
||||
}
|
||||
|
||||
setSendWidget(widget) {
|
||||
|
||||
if (!widget) this.sendWidget.pop()
|
||||
else this.sendWidget.push(widget)
|
||||
|
||||
}
|
||||
|
||||
getSendWidget() {
|
||||
|
||||
return this.sendWidget[this.sendWidget.length - 1]
|
||||
|
||||
}
|
||||
|
||||
registerGlobals() {
|
||||
|
||||
super.registerGlobals()
|
||||
|
||||
this.sandbox.contentWindow.set = (id, value)=>{
|
||||
|
||||
var options = this.getValueOptions()
|
||||
|
||||
if (id === options.id) options.sync = false // loop stop
|
||||
|
||||
var widgets = widgetManager.getWidgetById(id)
|
||||
|
||||
for (var i = widgets.length - 1; i >= 0; i--) {
|
||||
|
||||
return widgets[i].setValue(value, options)
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
this.sandbox.contentWindow.send = (target, address, ...args)=>{
|
||||
|
||||
var options = this.getValueOptions()
|
||||
|
||||
if (!options.send) return
|
||||
|
||||
var overrides = {
|
||||
address,
|
||||
v: args,
|
||||
preArgs: []
|
||||
}
|
||||
|
||||
if (target) overrides.target = Array.isArray(target) ? target : [target]
|
||||
|
||||
this.getSendWidget().sendValue(overrides)
|
||||
|
||||
}
|
||||
|
||||
this.sandbox.contentWindow.get = (id)=>{
|
||||
|
||||
var widgets = widgetManager.getWidgetById(id)
|
||||
|
||||
for (var i = widgets.length - 1; i >= 0; i--) {
|
||||
|
||||
if (widgets[i].getValue) {
|
||||
|
||||
var v = widgets[i].getValue()
|
||||
if (v !== undefined) return v
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
this.sandbox.contentWindow.getProp = (id, prop)=>{
|
||||
|
||||
var widgets = widgetManager.getWidgetById(id)
|
||||
|
||||
for (var i = widgets.length - 1; i >= 0; i--) {
|
||||
|
||||
var v = widgets[i].getProp(prop)
|
||||
if (v !== undefined) return v
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
this.sandbox.contentWindow.httpGet = (url, callback)=>{
|
||||
|
||||
var parser = urlParser(url),
|
||||
err = (e)=>{console.error(e)}
|
||||
|
||||
if (!parser.isLocal()) return err('httpGet error (' + url + '): non-local url')
|
||||
|
||||
var xhr = new XMLHttpRequest()
|
||||
xhr.open('GET', url, true)
|
||||
xhr.onload = (e)=>{
|
||||
if (xhr.readyState === 4 && xhr.status === 200 && callback) {
|
||||
callback(xhr.responseText)
|
||||
}
|
||||
}
|
||||
xhr.onerror = (e)=>err('httpGet error (' + url + '): ' + xhr.statusText)
|
||||
xhr.send(null)
|
||||
|
||||
}
|
||||
|
||||
this.sandbox.contentWindow.stateGet = (filter)=>{
|
||||
|
||||
if (filter) {
|
||||
|
||||
var filter = Array.isArray(filter) ? filter : [filter],
|
||||
containers = this.filter.map(x=>widgetManager.getWidgetById(x)).reduce((a,b)=>a.concat(b), [])
|
||||
if (!containers.length) return
|
||||
filter = (widget)=>{
|
||||
return containers.some(x=>x.contains(widget) || x === widget)
|
||||
}
|
||||
}
|
||||
|
||||
return deepCopy(stateManager.get(filter))
|
||||
|
||||
}
|
||||
|
||||
this.sandbox.contentWindow.stateSet = (state)=>{
|
||||
|
||||
var options = this.getValueOptions()
|
||||
stateManager.set(state, options.send)
|
||||
|
||||
}
|
||||
|
||||
|
||||
this.sandbox.contentWindow.storage = {
|
||||
|
||||
setItem: (k, v)=>localStorage.setItem(k, JSON.stringify(v)),
|
||||
getItem: (k)=>JSON.parse(localStorage.getItem(k)),
|
||||
removeItem: (k)=>localStorage.removeItem(k),
|
||||
clear: ()=>localStorage.clear()
|
||||
|
||||
}
|
||||
|
||||
|
||||
for (var imports of ['set', 'get', 'getProp', 'send', 'httpGet', 'stateGet', 'stateSet', 'storage']) {
|
||||
this.sanitize(this.sandbox.contentWindow[imports])
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
module.exports = ScriptVm
|
||||
|
|
@ -1,20 +1,172 @@
|
|||
var {mapToScale} = require('../utils'),
|
||||
Widget = require('../common/widget'),
|
||||
StaticProperties = require('../mixins/static_properties')
|
||||
var Widget = require('../common/widget'),
|
||||
{icon} = require('../../ui/utils'),
|
||||
html = require('nanohtml'),
|
||||
raw = require('nanohtml/raw'),
|
||||
keyboardJS = require('keyboardjs'),
|
||||
ScriptVm = require('./script-vm'),
|
||||
scriptVm = new ScriptVm()
|
||||
|
||||
module.exports = class Script extends StaticProperties(Widget, {visible: false}) {
|
||||
|
||||
class Script extends Widget {
|
||||
|
||||
static description() {
|
||||
|
||||
return 'Evaluates a script each time it receives a value.'
|
||||
|
||||
}
|
||||
|
||||
static defaults() {
|
||||
|
||||
return super.defaults({
|
||||
|
||||
_script: 'script',
|
||||
|
||||
event: {type: 'string', value: 'value', choices: ['value', 'keyboard']},
|
||||
|
||||
script: {type: 'string', value: '', help: [
|
||||
'This property is evaluated each time the widget receives a value*. Formulas are given extras variables in this context:',
|
||||
'- `value`: value received by the widget',
|
||||
'- `id`: id of the widget that triggered the script',
|
||||
'- `send(target, address, arg1, arg2, ...)`: function for sending osc messages (ignores the script\'s targets and the server\'s defaults unless `target` is `false`; ignores the script\'s `preArgs`)',
|
||||
'- `set(id, value)`: function for setting a widget\'s value',
|
||||
'- `get(id)`: function for getting a widget\'s value (dynamic equivalent of @{id})',
|
||||
'- `getProp(id, property)`: function for getting a widget\'s property value ((dynamic equivalent of @{id.property})',
|
||||
'- `httpGet(url, callback)`: function for making http requests (asynchronous "GET" request and local urls only)',
|
||||
'',
|
||||
'* Note: `value` or `linkId` properties can be used to receive other widgets\' values. The `value` property must actually change to trigger the execution, where linked widgets via `linkId` can submit the same value over and over and trigger the execution',
|
||||
]},
|
||||
|
||||
|
||||
_eventKey: 'event: keyboard',
|
||||
|
||||
keyBinding: {type: 'string|array', value: '', help: 'Key combo `string` or `array` of strings (see <a href="https://github.com/RobertWHurst/KeyboardJS">KeyboardJS</a> documentation)'},
|
||||
keyRepeat: {type: 'boolean', value: true, help: 'Set to `false` to prevent keydown repeats when holding the key combo pressed'},
|
||||
keyType: {type: 'string', value: 'keyDown', choices: ['keydown', 'keyup', 'both'], help: 'Determines which key event trigger the script\'s execution'},
|
||||
|
||||
|
||||
|
||||
}, [
|
||||
|
||||
'visible', 'label', 'interaction',
|
||||
'_geometry', 'left', 'top', 'width', 'height', 'expand',
|
||||
'_style', 'colorText', 'colorWidget', 'colorFill', 'colorStroke', 'alphaStroke', 'alphaFillOn', 'alphaFillOff', 'padding', 'css'
|
||||
|
||||
])
|
||||
|
||||
}
|
||||
|
||||
constructor(options) {
|
||||
|
||||
super(options)
|
||||
super({...options, html: null})
|
||||
|
||||
// compile script
|
||||
this.scriptLock = false
|
||||
|
||||
|
||||
if (this.getProp('event') === 'value') {
|
||||
|
||||
this.script = scriptVm.compile(this.getProp('script'), {
|
||||
id: '',
|
||||
value: 0
|
||||
})
|
||||
|
||||
} else if (this.getProp('event') === 'keyboard' && this.getProp('keyBinding')) {
|
||||
|
||||
this.keyCb = this.keyboardCallback.bind(this)
|
||||
|
||||
keyboardJS.withContext('global', ()=>{
|
||||
|
||||
keyboardJS.bind(this.getProp('keyBinding'), this.getProp('keyType') !== 'keyup' ? this.keyCb : undefined, this.getProp('keyType') !== 'keydown' ? this.keyCb : undefined)
|
||||
|
||||
})
|
||||
|
||||
this.script = scriptVm.compile(this.getProp('script'), {
|
||||
type: '',
|
||||
key: '',
|
||||
code: 0,
|
||||
ctrl: false,
|
||||
shift: false,
|
||||
alt: false,
|
||||
meta: false,
|
||||
})
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
runScript() {
|
||||
run(context) {
|
||||
|
||||
if (this.scriptLock) return
|
||||
|
||||
scriptVm.setSendWidget(this)
|
||||
|
||||
this.scriptLock = true
|
||||
try {
|
||||
this.script(context, this.parsersLocalScope)
|
||||
} catch(e) {
|
||||
console.log(e)
|
||||
}
|
||||
this.scriptLock = false
|
||||
|
||||
scriptVm.setSendWidget()
|
||||
|
||||
|
||||
}
|
||||
|
||||
setValue(v, options={}) {
|
||||
|
||||
if (this.getProp('event') === 'value') {
|
||||
|
||||
scriptVm.setValueOptions(options)
|
||||
|
||||
this.run({
|
||||
value: v,
|
||||
id: options.id,
|
||||
})
|
||||
|
||||
scriptVm.setValueOptions(options)
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
keyboardCallback(e) {
|
||||
|
||||
if (e.target && (e.target.tagName === 'INPUT' || e.target.tabName === 'TEXTAREA' || e.target.tabName === 'SELECT')) return
|
||||
|
||||
if (e && e.type === 'keydown' && !this.getProp('keyRepeat')) e.preventRepeat()
|
||||
|
||||
e.preventDefault()
|
||||
|
||||
this.run({
|
||||
type: e.type,
|
||||
key: e.key,
|
||||
code: e.code,
|
||||
ctrl: e.ctrlKey,
|
||||
shift: e.shiftKey,
|
||||
alt: e.altKey,
|
||||
meta: e.metaKey
|
||||
})
|
||||
|
||||
|
||||
}
|
||||
|
||||
onRemove() {
|
||||
|
||||
|
||||
if (this.getProp('event') === 'keyboard' && this.getProp('keyBinding')) {
|
||||
|
||||
keyboardJS.withContext('global', ()=>{
|
||||
|
||||
keyboardJS.unbind(this.getProp('keyBinding'), this.keyCb, this.keyCb)
|
||||
|
||||
})
|
||||
|
||||
}
|
||||
|
||||
super.onRemove()
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
module.exports = Script
|
||||
|
|
|
|||
|
|
@ -1,7 +1,6 @@
|
|||
var {clip} = require('../utils'),
|
||||
Canvas = require('../common/canvas'),
|
||||
Fader = require('./fader'),
|
||||
Input = require('../inputs/input'),
|
||||
touchstate = require('../mixins/touch_state'),
|
||||
html = require('nanohtml')
|
||||
|
||||
|
|
@ -144,6 +143,13 @@ class Range extends Fader {
|
|||
|
||||
if (!i) return
|
||||
|
||||
if (this.getProp('touchAddress')) {
|
||||
this.sendValue({
|
||||
address: this.getProp('touchAddress'),
|
||||
v: [parseInt(i), 1],
|
||||
})
|
||||
}
|
||||
|
||||
if (e.shiftKey) {
|
||||
this.faders[0].trigger('drag', e)
|
||||
this.faders[1].trigger('drag', e)
|
||||
|
|
@ -161,6 +167,15 @@ class Range extends Fader {
|
|||
|
||||
e.stopPropagation = true
|
||||
this.faders[i].trigger('dragend', e)
|
||||
|
||||
|
||||
if (this.getProp('touchAddress')) {
|
||||
this.sendValue({
|
||||
address: this.getProp('touchAddress'),
|
||||
v: [parseInt(i), 0],
|
||||
})
|
||||
}
|
||||
|
||||
delete this.touchMap[e.pointerId]
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -66,12 +66,12 @@ class Slider extends Canvas {
|
|||
|
||||
this.widget.addEventListener('mousewheel',this.mousewheelHandleProxy.bind(this))
|
||||
|
||||
touchstate(this, {element: this.widget, multitouch: options.multitouch})
|
||||
|
||||
this.on('draginit', this.draginitHandleProxy.bind(this), {element:this.widget, multitouch: options.multitouch})
|
||||
this.on('drag', this.dragHandleProxy.bind(this), {element:this.widget, multitouch: options.multitouch})
|
||||
this.on('dragend', this.dragendHandleProxy.bind(this), {element:this.widget, multitouch: options.multitouch})
|
||||
|
||||
touchstate(this, {element: this.widget, multitouch: options.multitouch})
|
||||
|
||||
this.setSteps()
|
||||
|
||||
this.setValue(this.getSpringValue())
|
||||
|
|
|
|||
|
|
@ -1,115 +0,0 @@
|
|||
var Widget = require('../common/widget'),
|
||||
widgetManager = require('../../managers/widgets'),
|
||||
osc = require('../../osc')
|
||||
|
||||
module.exports = class _switchers_base extends Widget {
|
||||
|
||||
constructor(options) {
|
||||
|
||||
super(options)
|
||||
|
||||
this._isSwitcher = true
|
||||
this.value = {_selected:false}
|
||||
this.linkedWidgets = typeof this.getProp('linkedWidgets') == 'object' ? this.getProp('linkedWidgets') : [this.getProp('linkedWidgets')]
|
||||
|
||||
for (var i in this.getProp('values')) {
|
||||
|
||||
this.value[this.getProp('values')[i]] = {}
|
||||
|
||||
}
|
||||
|
||||
widgetManager.on('change', this.syncHandler.bind(this), {context: this})
|
||||
|
||||
|
||||
}
|
||||
|
||||
syncHandler(e) {
|
||||
|
||||
var {id, widget} = e
|
||||
|
||||
if (widget && this.value._selected !== false && this.value[this.value._selected] && widget._isSwitcher !== true && this.isWatching(id, widget)) {
|
||||
|
||||
this.value[this.value._selected][id] = widget.getValue()
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
isWatching(id, widget) {
|
||||
|
||||
if (this.linkedWidgets.indexOf(id) != -1) return true
|
||||
|
||||
for (var k in this.linkedWidgets) {
|
||||
|
||||
let widgets = widgetManager.getWidgetById(this.linkedWidgets[k])
|
||||
|
||||
for (var i in widgets) {
|
||||
|
||||
if (widgets[i].contains(widget) || widgets[i] === widget) return true
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
setValue(v, options={}) {
|
||||
|
||||
let apply = false
|
||||
|
||||
if (typeof v == 'object') {
|
||||
|
||||
for (var k in this.value) {
|
||||
|
||||
if (v.hasOwnProperty(k)) {
|
||||
|
||||
this.value[k] = v[k]
|
||||
apply = true
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
} else if (this.value[v] && v != '_selected') {
|
||||
|
||||
this.value._selected = v
|
||||
apply = true
|
||||
|
||||
}
|
||||
|
||||
if (apply) this.applyState(this.value[this.value._selected], options)
|
||||
|
||||
}
|
||||
|
||||
|
||||
applyState(state, options) {
|
||||
|
||||
// extra sync routine to ensure linked widgets' props update before osc is sent
|
||||
if (options.sync) this.changed({...options, send:false, sync:false})
|
||||
//
|
||||
|
||||
for (var id in state) {
|
||||
var value = state[id],
|
||||
widgets = widgetManager.getWidgetById(id)
|
||||
for (var i = widgets.length - 1; i >= 0; i--) {
|
||||
if (widgets[i].setValue) {
|
||||
widgets[i].setValue(value,{sync:options.sync, send:options.send})
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (options.sync) this.changed(options)
|
||||
if (options.send) this.sendValue()
|
||||
|
||||
}
|
||||
|
||||
sendValue() {
|
||||
|
||||
osc.sync({
|
||||
h:this.hash,
|
||||
v:this.value
|
||||
})
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -1,158 +0,0 @@
|
|||
var Switcher = require('./switcher'),
|
||||
Widget = require('../common/widget'),
|
||||
Fader = require('../sliders/fader'),
|
||||
{mapToScale} = require('../utils')
|
||||
|
||||
var faderDefaults = Fader.defaults()._props()
|
||||
|
||||
|
||||
module.exports = class Crossfader extends Switcher {
|
||||
|
||||
static description() {
|
||||
|
||||
return 'Switcher with linear interpolation slider.'
|
||||
|
||||
}
|
||||
|
||||
static defaults(){
|
||||
|
||||
return Widget.defaults({
|
||||
|
||||
_crossfader: 'crossfader',
|
||||
|
||||
linkedWidgets: {type: 'string|array', value: '', help: [
|
||||
'- `String`: a widget\'s `id` whose state changes will be stored',
|
||||
'- `Array`: a list of widget `id` string'
|
||||
]},
|
||||
horizontal: {type: 'boolean', value: false, help: 'Set to `true` to display values horizontally'}
|
||||
|
||||
})
|
||||
|
||||
}
|
||||
|
||||
constructor(options) {
|
||||
|
||||
options.props.values = options.props.horizontal ? ['A', 'B'] : ['B', 'A']
|
||||
|
||||
super(options)
|
||||
|
||||
this.fader = new Fader({props:{
|
||||
...faderDefaults,
|
||||
horizontal: this.getProp('horizontal'),
|
||||
range: {min:{'A':0}, '50%':{' ':0.5},max:{'B':1}},
|
||||
input: false
|
||||
}, parent: this})
|
||||
|
||||
this.fader.sendValue = ()=>{}
|
||||
|
||||
this.widget.appendChild(this.fader.widget)
|
||||
|
||||
if (this.getProp('horizontal')) {
|
||||
this.widget.classList.add('horizontal')
|
||||
} else {
|
||||
this.widget.classList.add('vertical')
|
||||
|
||||
}
|
||||
|
||||
this.fader.on('change', (e)=>{
|
||||
|
||||
e.stopPropagation = true
|
||||
|
||||
this.setValue(this.fader.getValue(), e.options)
|
||||
|
||||
})
|
||||
|
||||
this.value._fader = 0
|
||||
|
||||
}
|
||||
|
||||
setValue(v, options={}) {
|
||||
|
||||
v = v <= 0 || v == 'A' ?
|
||||
'A' :
|
||||
v >= 1 || v == 'B' ?
|
||||
'B' :
|
||||
v
|
||||
|
||||
super.setValue(v, options)
|
||||
|
||||
if (typeof v == 'object') {
|
||||
|
||||
this.fader.setValue(this.value._fader, {dragged:options.dragged})
|
||||
|
||||
}
|
||||
|
||||
if (v == 'A') {
|
||||
|
||||
this.fader.setValue(0, {dragged:options.dragged})
|
||||
this.value._fader = 0
|
||||
|
||||
|
||||
} else if (v == 'B') {
|
||||
|
||||
this.fader.setValue(1, {dragged:options.dragged})
|
||||
this.value._fader = 1
|
||||
|
||||
|
||||
} else if (!isNaN(v)) {
|
||||
|
||||
this.fader.setValue(v, {dragged:options.dragged})
|
||||
this.value._fader = this.fader.getValue()
|
||||
this.value._selected = false
|
||||
this.switch.setValue()
|
||||
|
||||
var s = this.getValue(),
|
||||
a = {}
|
||||
|
||||
for (var i in s['A']) {
|
||||
|
||||
if (s['B'][i] === undefined) continue
|
||||
|
||||
if (Array.isArray(s['A'][i])) {
|
||||
|
||||
a[i] = []
|
||||
|
||||
for (var k in s['A'][i]) {
|
||||
|
||||
if (!isNaN(s['A'][i][k])) {
|
||||
|
||||
a[i][k] = mapToScale(v, [0,1], [s['A'][i][k], s['B'][i][k]], -1)
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
} else if (!isNaN(s['A'][i])) {
|
||||
|
||||
a[i] = mapToScale(v, [0,1], [s['A'][i], s['B'][i]], -1)
|
||||
}
|
||||
}
|
||||
|
||||
this.applyState(a, options)
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
onPropChanged(propName, options, oldPropValue) {
|
||||
|
||||
if (super.onPropChanged(...arguments)) return true
|
||||
|
||||
switch (propName) {
|
||||
|
||||
case 'color':
|
||||
for (var w of [this.fader]) {
|
||||
w.onPropChanged('color')
|
||||
}
|
||||
return
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
onRemove() {
|
||||
this.fader.onRemove()
|
||||
super.onRemove()
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -1,161 +0,0 @@
|
|||
var Widget = require('../common/widget'),
|
||||
Toggle = require('../buttons/toggle'),
|
||||
pushDefaults = Toggle.defaults()._props(),
|
||||
html = require('nanohtml'),
|
||||
stateManager = require('../../managers/state'),
|
||||
widgetManager = require('../../managers/widgets'),
|
||||
{deepCopy} = require('../../utils'),
|
||||
osc = require('../../osc')
|
||||
|
||||
|
||||
class State extends Widget {
|
||||
|
||||
static description() {
|
||||
|
||||
return 'Save and recall the state of other widgets.'
|
||||
|
||||
}
|
||||
|
||||
static defaults() {
|
||||
|
||||
return super.defaults({
|
||||
|
||||
_state: 'state',
|
||||
|
||||
filter: {type: 'string|array', value: '', help: [
|
||||
'Only save state from widgets contained in widgets designated by id. If empty, the whole session\'s state is saved. Switchers are always ignored.',
|
||||
'- widget id `string`',
|
||||
'- `array` of widget id strings'
|
||||
]},
|
||||
saveLabel: {type: 'string', value: 'Save', help: 'Label for save button'},
|
||||
loadLabel: {type: 'string', value: 'Load', help: 'Label for load button'},
|
||||
horizontal: {type: 'boolean', value: false, help: 'Set to `true` to display buttons horizontally'},
|
||||
|
||||
}, [], {
|
||||
|
||||
value: {type: 'object|string', value: '', help: [
|
||||
'- `object`: `"widget_id": VALUE` pairs',
|
||||
'- `string`: `"save"` (trigger save action), `"load"` (trigger load action) or `""` (reset value)',
|
||||
'',
|
||||
'Note: the widget\'s actual value is never `"save"` or `"load"`, it\'s either an empty string or an object.'
|
||||
]}
|
||||
|
||||
})
|
||||
|
||||
}
|
||||
|
||||
|
||||
constructor(options) {
|
||||
|
||||
super({...options, html: html`<div class="switch"></div>`})
|
||||
|
||||
this._isSwitcher = true
|
||||
|
||||
if (this.getProp('horizontal')) this.widget.classList.add('horizontal')
|
||||
|
||||
this.saveButton = new Toggle({props: {...pushDefaults, type: 'toggle', mode: 'push', label: this.getProp('saveLabel')}, parent: this, container: true})
|
||||
this.loadButton = new Toggle({props: {...pushDefaults, type: 'toggle', mode: 'push', label: this.getProp('loadLabel')}, parent: this, container: true})
|
||||
|
||||
this.saveButton.container.classList.add('not-editable', 'value')
|
||||
this.loadButton.container.classList.add('not-editable', 'value', 'disabled')
|
||||
|
||||
this.saveButton.sendValue = this.loadButton.sendValue = ()=>{}
|
||||
|
||||
this.widget.appendChild(this.saveButton.container)
|
||||
this.widget.appendChild(this.loadButton.container)
|
||||
|
||||
this.on('change', (e)=>{
|
||||
|
||||
var {widget} = e
|
||||
if (widget === this) return
|
||||
|
||||
e.stopPropagation = true
|
||||
|
||||
if (widget.active) this.setValue(widget === this.saveButton ? 'save' : 'load', {sync: true, send: true})
|
||||
|
||||
})
|
||||
|
||||
this.filter = this.getProp('filter') ? Array.isArray(this.getProp('filter')) ? this.getProp('filter') : [this.getProp('filter')] : false
|
||||
this.value = ''
|
||||
|
||||
}
|
||||
|
||||
save() {
|
||||
|
||||
var filter = (widget)=>{
|
||||
return !widget._isSwitcher
|
||||
}
|
||||
|
||||
if (this.filter) {
|
||||
var containers = this.filter.map(x=>widgetManager.getWidgetById(x)).reduce((a,b)=>a.concat(b), [])
|
||||
if (!containers.length) return
|
||||
filter = (widget)=>{
|
||||
return !widget._isSwitcher && containers.some(x=>x.contains(widget) || x === widget)
|
||||
}
|
||||
}
|
||||
|
||||
if (!this.value) this.loadButton.container.classList.remove('disabled')
|
||||
|
||||
this.value = deepCopy(stateManager.get(filter))
|
||||
|
||||
}
|
||||
|
||||
load(send) {
|
||||
|
||||
if (this.value) stateManager.set(this.value, send)
|
||||
|
||||
}
|
||||
|
||||
setValue(v,options={}) {
|
||||
|
||||
var valid
|
||||
|
||||
if (v === 'save') {
|
||||
|
||||
this.save()
|
||||
valid = true
|
||||
|
||||
} else if (v === 'load') {
|
||||
|
||||
this.load(options.send)
|
||||
valid = true
|
||||
|
||||
} else if (v === '') {
|
||||
|
||||
if (this.value) this.loadButton.container.classList.add('disabled')
|
||||
this.value = ''
|
||||
|
||||
} else if (typeof v === 'object' && !Array.isArray(v)) {
|
||||
|
||||
if (!this.value) this.loadButton.container.classList.remove('disabled')
|
||||
this.value = v
|
||||
valid = true
|
||||
|
||||
}
|
||||
|
||||
if (valid) {
|
||||
if (options.sync) this.changed(options)
|
||||
if (options.send) this.sendValue()
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
sendValue() {
|
||||
|
||||
osc.sync({
|
||||
h:this.hash,
|
||||
v:this.value
|
||||
})
|
||||
|
||||
}
|
||||
|
||||
onRemove() {
|
||||
|
||||
this.saveButton.onRemove()
|
||||
this.loadButton.onRemove()
|
||||
super.onRemove()
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = State
|
||||
|
|
@ -1,94 +0,0 @@
|
|||
var _switchers_base = require('./_switchers_base'),
|
||||
Switch = require('../buttons/switch'),
|
||||
html = require('nanohtml')
|
||||
|
||||
var switchDefaults = Switch.defaults()._props()
|
||||
|
||||
module.exports = class Switcher extends _switchers_base {
|
||||
|
||||
static description() {
|
||||
|
||||
return 'Store other widgets\' values and recall them.'
|
||||
|
||||
}
|
||||
|
||||
static defaults() {
|
||||
|
||||
return super.defaults({
|
||||
|
||||
_switcher: 'switcher',
|
||||
|
||||
linkedWidgets: {type: 'string|array', value: '', help: [
|
||||
'- `String`: a widget\'s `id` whose state changes will be stored',
|
||||
'- `Array`: a list of widget `id` string'
|
||||
]},
|
||||
horizontal: {type: 'boolean', value: false, help: 'Set to `true` to display values horizontally'},
|
||||
values: {type: 'array|object', value: {'Value 1':1,'Value 2':2}, help: [
|
||||
'Each item represents a bank that stores the values from the widgets listed in `linkedWidgets`',
|
||||
'- `Array` of possible values to switch between : `[1,2,3]`',
|
||||
'- `Object` of `"label":value` pairs. Numeric labels must be prepended or appended with a white space (or any other non-numeric character) otherwise the order of the values won\'t be kept',
|
||||
]}
|
||||
})
|
||||
|
||||
}
|
||||
|
||||
constructor(options) {
|
||||
|
||||
super({...options, html: html`<div class="switcher"></div>`})
|
||||
|
||||
if (this.getProp('horizontal')) this.widget.classList.add('horizontal')
|
||||
|
||||
this.switch = new Switch({props:{
|
||||
...switchDefaults,
|
||||
label:false,
|
||||
values:this.getProp('values'),
|
||||
value: this.getProp('value'),
|
||||
horizontal:this.getProp('horizontal')
|
||||
}, parent: this})
|
||||
|
||||
this.switch.sendValue = ()=>{}
|
||||
|
||||
this.widget.appendChild(this.switch.widget)
|
||||
|
||||
this.switch.on('change', (e)=>{
|
||||
|
||||
e.stopPropagation = true
|
||||
e.options.fromSelf = true
|
||||
|
||||
this.setValue(this.switch.getValue(), e.options)
|
||||
|
||||
})
|
||||
|
||||
|
||||
}
|
||||
|
||||
setValue(v, options={}) {
|
||||
|
||||
super.setValue(v, options)
|
||||
|
||||
if (!options.fromSelf) this.switch.setValue(this.value._selected)
|
||||
|
||||
}
|
||||
|
||||
onPropChanged(propName, options, oldPropValue) {
|
||||
|
||||
if (super.onPropChanged(...arguments)) return true
|
||||
|
||||
switch (propName) {
|
||||
|
||||
case 'color':
|
||||
for (var w of [this.switch]) {
|
||||
w.onPropChanged('color')
|
||||
}
|
||||
return
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
onRemove() {
|
||||
this.switch.onRemove()
|
||||
super.onRemove()
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -28,22 +28,32 @@ class Vm {
|
|||
this.sandbox.contentWindow.__protect = loopProtect
|
||||
|
||||
// global context
|
||||
this.registerGlobals()
|
||||
|
||||
// detach sandbox
|
||||
document.documentElement.appendChild(this.sandbox)
|
||||
|
||||
}
|
||||
|
||||
registerGlobals() {
|
||||
|
||||
this.sandbox.contentWindow.console = console
|
||||
this.sandbox.contentWindow.setTimeout =
|
||||
this.sandbox.contentWindow.setInterval = ()=>{
|
||||
throw 'setTimeout and setInterval can\'t be used in the JS sandbox'
|
||||
}
|
||||
this.sandbox.contentWindow.globals = {}
|
||||
|
||||
this.sandbox.contentWindow.globals = {
|
||||
screen: {width: screen.width, height: screen.height},
|
||||
env: deepCopy(ENV),
|
||||
url: document.location.host,
|
||||
platform: navigator.platform
|
||||
}
|
||||
|
||||
// sanitize globals
|
||||
for (var imports of ['__protect', 'console', 'setTimeout', 'setInterval', 'globals']) {
|
||||
this.sanitize(this.sandbox.contentWindow[imports])
|
||||
}
|
||||
|
||||
// detach sandbox
|
||||
document.documentElement.appendChild(this.sandbox)
|
||||
|
||||
}
|
||||
|
||||
sanitize(object) {
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@ var terminal = require('./terminal')
|
|||
|
||||
DOM.get(document, '#osc-greeting-header')[0].appendChild(html`${window.PACKAGE.productName} <span class="version">v${window.PACKAGE.version}</span>`)
|
||||
|
||||
if (navigator.onLine) {
|
||||
if (settings.remote.read('checkForUpdates') && navigator.onLine) {
|
||||
|
||||
var request = new XMLHttpRequest()
|
||||
request.open('GET', 'https://api.github.com/repos/jean-emmanuel/open-stage-control/tags', true)
|
||||
|
|
|
|||
|
|
@ -12,6 +12,7 @@ class Settings {
|
|||
|
||||
constructor() {
|
||||
|
||||
this.remote = settings
|
||||
this.container = DOM.get('#osc-container')[0].appendChild(html`<osc-settings></osc-settings>`)
|
||||
this.names = []
|
||||
this.argv = {}
|
||||
|
|
|
|||
|
|
@ -75,6 +75,14 @@ menu.append(new MenuItem({type: 'submenu' , label: 'Console', submenu: [
|
|||
click: function(e){
|
||||
terminal.autoSroll = e.checked
|
||||
}
|
||||
}),
|
||||
new MenuItem({
|
||||
label: 'Check for updates at startup',
|
||||
type: 'checkbox',
|
||||
checked: settings.remote.read('checkForUpdates'),
|
||||
click: (e)=>{
|
||||
settings.remote.write('checkForUpdates', e.checked)
|
||||
}
|
||||
})
|
||||
]}))
|
||||
menu.append(new MenuItem({
|
||||
|
|
|
|||
|
|
@ -40,7 +40,7 @@ $text: white;
|
|||
--alpha-scrollbar-on: 0.5;
|
||||
--scrollbar-size:12rem;
|
||||
|
||||
// --color-text: #{mix($base, $text, 40)};
|
||||
--color-text-solid: #{$text};
|
||||
--color-text: #{transparentize($text, .4)};
|
||||
|
||||
--color-widget: var(--color-accent);
|
||||
|
|
|
|||
|
|
@ -156,6 +156,7 @@ osc-inspector-checkbox {
|
|||
@include pseudo-fill($z: -1);
|
||||
i {
|
||||
opacity: 1;
|
||||
color: var(--color-text-solid);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -119,7 +119,7 @@ osc-settings-checkbox, osc-settings-reset, osc-settings-file {
|
|||
&.on {
|
||||
--alpha-fill: 0.5;
|
||||
i {
|
||||
color: white;
|
||||
color: var(--color-text-solid);
|
||||
opacity: 1;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,501 +0,0 @@
|
|||
.fader-container {
|
||||
// note: ios doesn't trim css variables defined as follow
|
||||
// we must avoid space after ":" otherwise it breaks the canvas colors
|
||||
--color-pips:var(--color-custom);
|
||||
--color-gauge:var(--color-custom);
|
||||
--color-knob:var(--color-custom);
|
||||
--gauge-width: 2;
|
||||
padding: 1rem;
|
||||
width:100rem;
|
||||
height:300rem;
|
||||
&.horizontal {
|
||||
height:130rem;
|
||||
width:300rem
|
||||
}
|
||||
}
|
||||
|
||||
.panel:not(.tab) > .fader-container {
|
||||
padding: 0rem;
|
||||
--color-border:transparent;
|
||||
> .fader.compact {
|
||||
padding: 1rem;
|
||||
}
|
||||
> .fader.compact > .wrapper {
|
||||
box-shadow: 0 0 0 1rem var(--color-light),
|
||||
0 0 0 1rem var(--color-fg);
|
||||
border: 1rem solid var(--color-bg);
|
||||
}
|
||||
}
|
||||
|
||||
.fader {
|
||||
height:100%;
|
||||
overflow: hidden;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
position: relative;
|
||||
flex: 1;
|
||||
> .input {
|
||||
height: 25rem;
|
||||
flex:initial!important;
|
||||
flex-shrink: 0!important;
|
||||
display: block;
|
||||
background: transparent!important;
|
||||
border: 0!important;
|
||||
}
|
||||
|
||||
.wrapper {
|
||||
overflow: hidden;
|
||||
flex: 1 1 100%;
|
||||
max-height: 100%;
|
||||
width: 100%;
|
||||
position: relative;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
border-radius: inherit;
|
||||
touch-action: none;
|
||||
|
||||
> * {
|
||||
pointer-events: none;
|
||||
}
|
||||
|
||||
> canvas {
|
||||
width: 20rem;
|
||||
image-rendering:pixelated;
|
||||
position: relative;
|
||||
z-index: 1;
|
||||
}
|
||||
|
||||
.meter-container {
|
||||
height: auto;
|
||||
width:6rem!important;
|
||||
min-width: auto;
|
||||
flex-grow: 0;
|
||||
--color-border:transparent;
|
||||
border:0;
|
||||
margin: 20rem 6rem 20rem 0;
|
||||
order: -1
|
||||
}
|
||||
|
||||
.pips {
|
||||
width: 35rem;
|
||||
// background-color: var(--color-light);
|
||||
position: relative;
|
||||
margin: 23rem 0rem 21rem -10rem;
|
||||
z-index: 0;
|
||||
|
||||
.pip {
|
||||
height:1rem;
|
||||
// background: var(--color-track);
|
||||
color:var(--color-fg);
|
||||
position: absolute;
|
||||
left:0;
|
||||
|
||||
&:before {
|
||||
content:"";
|
||||
position: absolute;
|
||||
top:0;
|
||||
left:-12rem;
|
||||
width:5rem;
|
||||
bottom:0;
|
||||
background: var(--color-custom);
|
||||
opacity: 0.5;
|
||||
box-shadow: 0 0 0 1rem var(--color-bg),
|
||||
0 0 0 2rem var(--color-light);
|
||||
}
|
||||
&:after {
|
||||
content:"";
|
||||
position: absolute;
|
||||
top:0;
|
||||
left:7rem;
|
||||
width:5rem;
|
||||
bottom:0;
|
||||
background: var(--color-custom);
|
||||
opacity: 0.5;
|
||||
box-shadow: 0 0 0 1rem var(--color-bg),
|
||||
0 0 0 2rem var(--color-light);
|
||||
}
|
||||
|
||||
span {
|
||||
position: absolute;
|
||||
width:30rem;
|
||||
display: block;
|
||||
text-align: center;
|
||||
font-size:90%;
|
||||
line-height: 12rem;
|
||||
left:15rem;
|
||||
top:-5.5rem;
|
||||
color:var(--color-text-fade);
|
||||
text-transform: none;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
&.align-right {
|
||||
.wrapper {
|
||||
flex-direction: row-reverse;
|
||||
.meter-container {
|
||||
margin: 20rem 0rem 20rem 6rem;
|
||||
}
|
||||
.pips {
|
||||
margin: 23rem -10rem 21rem 0rem;
|
||||
// margin: 23rem 5rem 21rem 12rem;
|
||||
// background-position: top right;
|
||||
.pip {
|
||||
right:0;
|
||||
left:auto;
|
||||
// margin-bottom: 0;
|
||||
span {
|
||||
right:15rem;
|
||||
left:auto;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
&.horizontal {
|
||||
.wrapper {
|
||||
flex-direction: column;
|
||||
> canvas {
|
||||
width: auto;
|
||||
height: 20rem;
|
||||
}
|
||||
|
||||
.meter-container {
|
||||
width: auto!important;
|
||||
height:6rem;
|
||||
min-height: auto;
|
||||
margin: 0 20rem 6rem 20rem;
|
||||
}
|
||||
|
||||
.pips {
|
||||
width:auto;
|
||||
height: 25rem;
|
||||
margin: -10rem 22rem 0 22rem;
|
||||
.pip {
|
||||
width:1rem;
|
||||
height:5rem;
|
||||
&:before {
|
||||
left:0;
|
||||
top:-12rem;
|
||||
height:5rem;
|
||||
right:0;
|
||||
width:1rem;
|
||||
}
|
||||
&:after {
|
||||
left:0;
|
||||
top:7rem;
|
||||
height:5rem;
|
||||
right:0;
|
||||
width:1rem;
|
||||
}
|
||||
span {
|
||||
top:20rem;
|
||||
left:-14rem!important;
|
||||
right:auto;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
&.compact {
|
||||
.wrapper {
|
||||
border: 1rem solid var(--color-bg);
|
||||
> canvas {
|
||||
flex: 1 1 100%;
|
||||
background: var(--color-track);
|
||||
order:1;
|
||||
}
|
||||
.meter-container {
|
||||
order:3;
|
||||
margin: 0;
|
||||
border: 0;
|
||||
box-shadow: none;
|
||||
padding: 0;
|
||||
.fader {
|
||||
border: 0;
|
||||
border-left: 1rem solid var(--color-bg);
|
||||
.wrapper {
|
||||
border: 0;
|
||||
}
|
||||
}
|
||||
.pips {
|
||||
display: none;
|
||||
}
|
||||
}
|
||||
> .pips {
|
||||
overflow: hidden;
|
||||
margin: 0;
|
||||
order:2;
|
||||
background: var(--color-track);
|
||||
border:0;
|
||||
border-left: 1rem solid var(--color-bg);
|
||||
width: 3rem;
|
||||
.pip {
|
||||
left:0;
|
||||
right: 0;
|
||||
span {
|
||||
display: none;
|
||||
}
|
||||
&:before {
|
||||
content:none;
|
||||
}
|
||||
&:after {
|
||||
left:0;
|
||||
right: 0;
|
||||
box-shadow: none;
|
||||
opacity: 1;
|
||||
}
|
||||
&:not(:last-child):not(:first-child) {
|
||||
margin-bottom: -1rem;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
&.align-right {
|
||||
.wrapper {
|
||||
.meter-container {
|
||||
.fader {
|
||||
border: 0;
|
||||
border-right: 1rem solid var(--color-bg);
|
||||
}
|
||||
}
|
||||
.pips {
|
||||
border:0;
|
||||
border-right: 1rem solid var(--color-bg);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
--input-margin:0rem;
|
||||
&.has-meter {
|
||||
--input-margin:-3rem;
|
||||
}
|
||||
&.has-pips {
|
||||
--input-margin:-1rem;
|
||||
}
|
||||
&.has-meter.has-pips {
|
||||
--input-margin:-4rem;
|
||||
}
|
||||
|
||||
.input {
|
||||
pointer-events: none;
|
||||
position: absolute;
|
||||
border:0;
|
||||
background:transparent;
|
||||
overflow: hidden;
|
||||
position: absolute;
|
||||
top:50%;
|
||||
left:50%;
|
||||
z-index: 1;
|
||||
}
|
||||
|
||||
&.horizontal {
|
||||
position:relative;
|
||||
|
||||
.wrapper {
|
||||
.meter-container {
|
||||
.fader {
|
||||
border: 0;
|
||||
border-top: 1rem solid var(--color-bg);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.input {
|
||||
width: 100rem;
|
||||
height: 24rem;
|
||||
margin-left: -50rem;
|
||||
margin-top: calc(-1 * 12rem + var(--input-margin));
|
||||
}
|
||||
|
||||
.pips {
|
||||
height: 3rem;
|
||||
border:0;
|
||||
border-top: 1rem solid var(--color-bg);
|
||||
width: 100%;
|
||||
.pip {
|
||||
margin: 0;
|
||||
&:last-child {
|
||||
left:auto!important;
|
||||
right:0;
|
||||
}
|
||||
&:after {
|
||||
top:0;
|
||||
width: 1rem;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
&:not(.horizontal) {
|
||||
.input {
|
||||
height: 100rem;
|
||||
width: 100rem;
|
||||
margin-top: -50rem;
|
||||
margin-left: calc(-1 * 50rem + var(--input-margin));
|
||||
z-index: 3;
|
||||
input {
|
||||
transform: rotate(-90deg);
|
||||
width: 100rem;
|
||||
}
|
||||
}
|
||||
|
||||
&.align-right {
|
||||
.input {
|
||||
margin-left: calc(-1 * 50rem - var(--input-margin));
|
||||
}
|
||||
}
|
||||
|
||||
.pips {
|
||||
.pip:last-child {
|
||||
top:0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
.range-container {
|
||||
width:100rem;
|
||||
height:300rem;
|
||||
&.horizontal {
|
||||
height:130rem;
|
||||
width:300rem
|
||||
}
|
||||
padding: 1rem;
|
||||
--color-pips: var(--color-custom);
|
||||
--color-gauge: var(--color-custom);
|
||||
--color-knob: var(--color-custom);
|
||||
.range {
|
||||
height:100%;
|
||||
overflow: hidden;
|
||||
display: flex;
|
||||
position: relative;
|
||||
flex-direction: column;
|
||||
flex: 1;
|
||||
> .input {
|
||||
height: 25rem;
|
||||
flex:initial!important;
|
||||
flex-shrink: 0!important;
|
||||
// display: block;
|
||||
background: transparent!important;
|
||||
border: 0!important;
|
||||
}
|
||||
> .wrapper {
|
||||
overflow: hidden;
|
||||
flex: 1 1 100%;
|
||||
max-height: 100%;
|
||||
width: 100%;
|
||||
position: relative;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
border-radius: inherit;
|
||||
.fader {
|
||||
position: absolute;
|
||||
top:0;
|
||||
left:0;
|
||||
right:0;
|
||||
bottom:0;
|
||||
pointer-events: none;
|
||||
.wrapper {
|
||||
// border: 0;
|
||||
}
|
||||
&:first-child {
|
||||
opacity: 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
&.compact {
|
||||
> canvas {
|
||||
background: var(--color-track);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
&.compact {
|
||||
|
||||
--input-margin:0rem;
|
||||
&.has-meter {
|
||||
--input-margin:-3rem;
|
||||
}
|
||||
&.has-pips {
|
||||
--input-margin:-1rem;
|
||||
}
|
||||
&.has-meter.has-pips {
|
||||
--input-margin:-4rem;
|
||||
}
|
||||
|
||||
.input {
|
||||
pointer-events: none;
|
||||
position: absolute;
|
||||
border:0;
|
||||
background:transparent;
|
||||
overflow: hidden;
|
||||
position: absolute;
|
||||
top:50%;
|
||||
left:50%;
|
||||
z-index: 1;
|
||||
}
|
||||
|
||||
&.horizontal {
|
||||
|
||||
.input {
|
||||
width: 100rem;
|
||||
height: 24rem;
|
||||
margin-left: -50rem;
|
||||
margin-top: calc(-1 * 12rem + var(--input-margin));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
&:not(.horizontal) {
|
||||
.input {
|
||||
height: 100rem;
|
||||
width: 100rem;
|
||||
margin-top: -50rem;
|
||||
margin-left: calc(-1 * 50rem + var(--input-margin));
|
||||
z-index: 3;
|
||||
input {
|
||||
transform: rotate(-90deg);
|
||||
width: 100rem;
|
||||
}
|
||||
}
|
||||
|
||||
&.align-right {
|
||||
.input {
|
||||
margin-left: calc(-1 * 50rem - var(--input-margin));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
.panel:not(.tab) > .range-container {
|
||||
padding: 0rem;
|
||||
--color-border:transparent;
|
||||
.fader.compact {
|
||||
padding: 1rem;
|
||||
}
|
||||
.fader.compact > .wrapper {
|
||||
box-shadow: 0 0 0 1rem var(--color-light),
|
||||
0 0 0 1rem var(--color-fg);
|
||||
border: 1rem solid var(--color-bg);
|
||||
}
|
||||
}
|
||||
|
|
@ -1,238 +0,0 @@
|
|||
.input-container {
|
||||
width: 100rem;
|
||||
height: 60rem;
|
||||
padding:1rem;
|
||||
.vertical {
|
||||
position: relative;
|
||||
input {
|
||||
transform: rotate(-90deg);
|
||||
vertical-align: middle;
|
||||
max-width: initial!important;
|
||||
position: absolute;
|
||||
top: 50%;
|
||||
left: 50%;
|
||||
transform: translateX(-50%) translateY(-50%) rotate(-90deg);
|
||||
margin-top: -1px
|
||||
}
|
||||
}
|
||||
.not-editable {
|
||||
@extend .glass-effect;
|
||||
}
|
||||
}
|
||||
.widget {
|
||||
.input {
|
||||
display: flex;
|
||||
flex: 1 1 100%;
|
||||
background:transparent;
|
||||
color:var(--color-text);
|
||||
overflow: hidden;
|
||||
text-align:center;
|
||||
padding:1rem;
|
||||
border: 1rem solid var(--color-bg);
|
||||
background: var(--color-track);
|
||||
&.right {
|
||||
text-align: right;
|
||||
}
|
||||
&.left {
|
||||
text-align: left;
|
||||
}
|
||||
input {
|
||||
display: block;
|
||||
flex:1;
|
||||
max-width: 100%;
|
||||
font: inherit;
|
||||
border:0;
|
||||
padding:0;
|
||||
background: transparent;
|
||||
color:var(--color-accent);
|
||||
border-radius: inherit;
|
||||
-webkit-appearance:none;
|
||||
appearance: none;
|
||||
text-align:inherit;
|
||||
line-height: 50rem;
|
||||
vertical-align: top;
|
||||
letter-spacing: 1rem;
|
||||
-webkit-user-select: text;
|
||||
user-select: text;
|
||||
&:focus {
|
||||
color:var(--color-text-fade);
|
||||
}
|
||||
&:focus::selection {
|
||||
color:var(--color-custom);
|
||||
background: transparent;
|
||||
}
|
||||
}
|
||||
canvas {
|
||||
flex:1;
|
||||
max-width: 100%;
|
||||
}
|
||||
input + canvas {
|
||||
display: none;
|
||||
width: 0;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
.panel:not(.tab) > .input-container {
|
||||
padding: 0rem;
|
||||
> .input {
|
||||
box-shadow: 0 0 0 1rem var(--color-light),
|
||||
0 0 0 1rem var(--color-fg);
|
||||
margin:1rem;
|
||||
border: 1rem solid var(--color-bg);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
.keys-container {
|
||||
width: 100rem;
|
||||
height:60rem;
|
||||
flex-shrink: 0;
|
||||
padding:1rem;
|
||||
--opacity: .75;
|
||||
.keys {
|
||||
flex: 1 1 100%;
|
||||
height:35rem;
|
||||
padding: 10rem;
|
||||
justify-content: center;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
background: var(--color-track);
|
||||
color:var(--color-custom);
|
||||
border: 1rem solid var(--color-bg);
|
||||
@extend .glass-effect;
|
||||
i {
|
||||
opacity: var(--opacity);
|
||||
}
|
||||
span {
|
||||
font-family: monospace;
|
||||
letter-spacing: 0;
|
||||
margin-left: 4rem;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.panel:not(.tab) > .keys-container {
|
||||
--color-border:transparent;
|
||||
padding: 0rem;
|
||||
.keys {
|
||||
margin: 1rem;
|
||||
box-shadow: 0 0 0 1rem var(--color-light),
|
||||
0 0 0 1rem var(--color-fg);
|
||||
border: 1rem solid var(--color-bg);
|
||||
}
|
||||
}
|
||||
|
||||
.script-container {
|
||||
width: 100rem;
|
||||
height:60rem;
|
||||
flex-shrink: 0;
|
||||
padding:1rem;
|
||||
--opacity: .75;
|
||||
.script {
|
||||
flex: 1 1 100%;
|
||||
height:35rem;
|
||||
padding: 10rem;
|
||||
justify-content: center;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
background: var(--color-track);
|
||||
color:var(--color-custom);
|
||||
border: 1rem solid var(--color-bg);
|
||||
@extend .glass-effect;
|
||||
i {
|
||||
opacity: var(--opacity);
|
||||
}
|
||||
span {
|
||||
font-family: monospace;
|
||||
letter-spacing: 0;
|
||||
margin-left: 4rem;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.panel:not(.tab) > .script-container {
|
||||
--color-border:transparent;
|
||||
padding: 0rem;
|
||||
.script {
|
||||
margin: 1rem;
|
||||
box-shadow: 0 0 0 1rem var(--color-light),
|
||||
0 0 0 1rem var(--color-fg);
|
||||
border: 1rem solid var(--color-bg);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
.gyroscope-container {
|
||||
width: 100rem;
|
||||
height:60rem;
|
||||
flex-shrink: 0;
|
||||
padding:1rem;
|
||||
--opacity: .75;
|
||||
.gyroscope {
|
||||
flex: 1 1 100%;
|
||||
height:35rem;
|
||||
padding: 10rem;
|
||||
justify-content: center;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
background: var(--color-track);
|
||||
color:var(--color-custom);
|
||||
border: 1rem solid var(--color-bg);
|
||||
@extend .glass-effect;
|
||||
i {
|
||||
opacity: var(--opacity);
|
||||
}
|
||||
span {
|
||||
font-family: monospace;
|
||||
letter-spacing: 0;
|
||||
margin-left: 4rem;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.panel:not(.tab) > .gyroscope-container {
|
||||
--color-border:transparent;
|
||||
padding: 0rem;
|
||||
.gyroscope {
|
||||
margin: 1rem;
|
||||
box-shadow: 0 0 0 1rem var(--color-light),
|
||||
0 0 0 1rem var(--color-fg);
|
||||
border: 1rem solid var(--color-bg);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
.file-container {
|
||||
width: 100rem;
|
||||
height:60rem;
|
||||
padding:1rem;
|
||||
&.no-label {
|
||||
--color-border:var(--color-bg);
|
||||
padding: 0;
|
||||
.file {
|
||||
border: 0;
|
||||
}
|
||||
}
|
||||
.file {
|
||||
border: 1rem solid var(--color-bg);
|
||||
flex: 1 1 100%;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
padding: 0 10rem;
|
||||
text-transform: none;
|
||||
i {
|
||||
margin: 0 5rem;
|
||||
pointer-events: none;
|
||||
}
|
||||
span {
|
||||
pointer-events: none;
|
||||
text-overflow: ellipsis;
|
||||
overflow: hidden;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -1,116 +0,0 @@
|
|||
.knob-container, .encoder-container {
|
||||
--color-pips:var(--color-custom);
|
||||
--color-gauge:var(--color-custom);
|
||||
--color-knob:var(--color-custom);
|
||||
padding: 1rem;
|
||||
|
||||
width: 100rem;
|
||||
height: 120rem;
|
||||
align-items: center;
|
||||
.input {
|
||||
// display: none!important;
|
||||
}
|
||||
}
|
||||
|
||||
.knob {
|
||||
height:100%;
|
||||
width: 100%;
|
||||
overflow: hidden;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
position: relative;
|
||||
flex: 1;
|
||||
|
||||
> .input {
|
||||
height: 25rem;
|
||||
flex:initial!important;
|
||||
flex-shrink: 0!important;
|
||||
display: block;
|
||||
background: transparent!important;
|
||||
border: 0!important;
|
||||
}
|
||||
|
||||
&.compact {
|
||||
> .input {
|
||||
pointer-events: none;
|
||||
position: absolute;
|
||||
border:0;
|
||||
background:transparent;
|
||||
overflow: hidden;
|
||||
position: absolute;
|
||||
top:50%;
|
||||
left:50%;
|
||||
z-index: 1;
|
||||
width: 100rem;
|
||||
height: 30rem;
|
||||
margin-left:-50rem;
|
||||
margin-top:-15rem;
|
||||
}
|
||||
}
|
||||
|
||||
.wrapper {
|
||||
overflow: hidden;
|
||||
flex: 1 1 100%;
|
||||
max-height: 100%;
|
||||
width: 100%;
|
||||
position: relative;
|
||||
display: flex;
|
||||
touch-action: none;
|
||||
canvas {
|
||||
width: 100%;
|
||||
position: relative;
|
||||
pointer-events: none;
|
||||
image-rendering: pixelated;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
.encoder-container {
|
||||
|
||||
--color-gauge: transparent;
|
||||
|
||||
}
|
||||
|
||||
.encoder {
|
||||
|
||||
height:100%;
|
||||
width: 100%;
|
||||
overflow: hidden;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
position: relative;
|
||||
|
||||
.wrapper {
|
||||
overflow: hidden;
|
||||
flex: 1 1 100%;
|
||||
max-height: 100%;
|
||||
width: 100%;
|
||||
position: relative;
|
||||
display: flex;
|
||||
}
|
||||
|
||||
.input {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.display-knob {
|
||||
position: absolute;
|
||||
top:0;
|
||||
bottom:0;
|
||||
left:0;
|
||||
right:0;
|
||||
pointer-events: none;
|
||||
}
|
||||
|
||||
.drag-knob {
|
||||
opacity: 0;
|
||||
|
||||
// safari fix
|
||||
position: absolute;
|
||||
top:0;
|
||||
bottom:0;
|
||||
left:0;
|
||||
right:0;
|
||||
}
|
||||
}
|
||||
|
|
@ -1,29 +0,0 @@
|
|||
.formula-container {
|
||||
width: 100rem;
|
||||
height:60rem;
|
||||
padding:1rem;
|
||||
.formula {
|
||||
display:flex;
|
||||
height:100%;
|
||||
background: var(--color-track);
|
||||
border:1rem solid var(--color-bg);
|
||||
@extend .glass-effect;
|
||||
.input {
|
||||
background: transparent!important;
|
||||
border: 0!important;
|
||||
--color-text: var(--color-custom);
|
||||
pointer-events: none;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.panel:not(.tab) > .formula-container {
|
||||
--color-border:transparent;
|
||||
padding: 0rem;
|
||||
.formula {
|
||||
margin: 1rem;
|
||||
box-shadow: 0 0 0 1rem var(--color-light),
|
||||
0 0 0 1rem var(--color-fg);
|
||||
border: 1rem solid var(--color-bg);
|
||||
}
|
||||
}
|
||||
|
|
@ -1,163 +0,0 @@
|
|||
/* Multiple widgets (push|toggle|fader) matrix */
|
||||
.matrix-container,
|
||||
.multitoggle-container,
|
||||
.multipush-container,
|
||||
.multifader-container {
|
||||
&.editing {
|
||||
overflow: hidden;
|
||||
}
|
||||
height:200rem;
|
||||
width:200rem;
|
||||
&.no-label .matrix {
|
||||
top:0;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
.matrix {
|
||||
flex: 1 1 100%;
|
||||
overflow: auto;
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
flex-direction: row;
|
||||
padding:1rem 2rem 2rem 1rem;
|
||||
touch-action: none;
|
||||
--color-border:var(--color-bg);
|
||||
--spacing:0;
|
||||
|
||||
> .widget {
|
||||
min-height: 0;
|
||||
min-width: 0;
|
||||
height: auto;
|
||||
width: calc( 100% / var(--columns) - var(--spacing));
|
||||
margin: calc(var(--spacing) / 2);
|
||||
// .label {
|
||||
// background:none;
|
||||
// border:0;
|
||||
// }
|
||||
}
|
||||
|
||||
&.noborders {
|
||||
.widget{
|
||||
border: none;
|
||||
box-shadow:none;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.multifader-container {
|
||||
.matrix {
|
||||
align-items:stretch;
|
||||
flex-wrap: nowrap;
|
||||
&.horizontal {
|
||||
flex-direction: column;
|
||||
display: flex;
|
||||
.fader-container {
|
||||
flex-direction: row;
|
||||
flex:1;
|
||||
.fader {
|
||||
width:100%;
|
||||
}
|
||||
.label {
|
||||
width:30rem;
|
||||
height:auto;
|
||||
max-height: initial;
|
||||
margin-right: -5rem;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
> .widget {
|
||||
height: auto;
|
||||
flex:1;
|
||||
|
||||
> .fader {
|
||||
height: auto;
|
||||
flex: 1 1 100%;
|
||||
|
||||
}
|
||||
}
|
||||
&.compact {
|
||||
> .widget {
|
||||
box-shadow: 1rem 0 0 0 var(--color-bg),
|
||||
0 1rem 0 0 var(--color-bg),
|
||||
1rem 1rem 0 0 var(--color-bg);
|
||||
.label {
|
||||
box-shadow: 0 0 0 1rem var(--color-light) inset;
|
||||
}
|
||||
padding:0;
|
||||
.wrapper {
|
||||
border:0;
|
||||
border-top:1rem solid var(--color-bg);
|
||||
canvas{
|
||||
border:none;
|
||||
}
|
||||
}
|
||||
}
|
||||
&.horizontal {
|
||||
> .widget {
|
||||
.wrapper {
|
||||
border:0;
|
||||
border-left:1rem solid var(--color-bg);
|
||||
}
|
||||
.label {
|
||||
margin-right: 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
.fader-wrapper {
|
||||
padding:10rem 0 20rem!important;
|
||||
.fader {
|
||||
left:0!important;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
.keyboard-container {
|
||||
--color-black-key: var(--color-raised);
|
||||
--color-white-key: #aaa;
|
||||
height:90rem;
|
||||
width:240rem;
|
||||
.matrix {
|
||||
position: relative;
|
||||
overflow: hidden;
|
||||
> .widget {
|
||||
border-radius: 0!important;
|
||||
&.white:first-child {
|
||||
border-top-left-radius:inherit!important;
|
||||
border-bottom-left-radius:inherit!important;
|
||||
}
|
||||
&.white:last-child {
|
||||
border-top-right-radius:inherit!important;
|
||||
border-bottom-right-radius:inherit!important;
|
||||
}
|
||||
}
|
||||
.white {
|
||||
--color-raised: var(--color-white-key);
|
||||
.toggle:before {
|
||||
box-shadow: 0 0 0 1rem var(--color-light) inset,
|
||||
0 0 0 1rem var(--color-light) inset;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
.black {
|
||||
--color-raised: var(--color-black-key);
|
||||
position: absolute;
|
||||
z-index: 2;
|
||||
top:1rem;
|
||||
height: 65%;
|
||||
.toggle:before {
|
||||
border-bottom:2rem solid var(--color-bg);
|
||||
box-shadow: 0 0 0 1rem var(--color-light) inset,
|
||||
0 -1rem 0 0 var(--color-light) inset;
|
||||
}
|
||||
}
|
||||
.on {
|
||||
background: var(--color-custom)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -1,191 +0,0 @@
|
|||
// @keyframes menu-widget-fade {
|
||||
// 0%{opacity: 0; transform: scale(0.9);}
|
||||
// 100%{opacity: 1; transform: scale(1);}
|
||||
// }
|
||||
.menu-container {
|
||||
@extend .modal-container;
|
||||
|
||||
|
||||
border-radius: 0!important; // border radius breaks it somehow
|
||||
z-index: initial!important;
|
||||
contain: style size;
|
||||
|
||||
--size: 300rem;
|
||||
--grid-columns: 2;
|
||||
|
||||
.menu {
|
||||
display:none;
|
||||
&.show {
|
||||
display:block;
|
||||
}
|
||||
// animation: menu-widget-fade .1s forwards;
|
||||
|
||||
position: fixed;
|
||||
z-index: 999999999;
|
||||
|
||||
background: var(--color-fg);
|
||||
|
||||
overflow: hidden;
|
||||
box-shadow: 0 0 0 1rem var(--color-light) inset, 0 0 5rem 0 var(--color-bg) ;
|
||||
|
||||
|
||||
|
||||
.item {
|
||||
|
||||
z-index: 1;
|
||||
overflow: hidden;
|
||||
|
||||
&.on:before {
|
||||
content:"";
|
||||
position: absolute;
|
||||
top:0;
|
||||
left:0;
|
||||
right:0;
|
||||
bottom:0;
|
||||
pointer-events: none;
|
||||
background: var(--color-custom);
|
||||
opacity: 0.3;
|
||||
|
||||
}
|
||||
|
||||
div {
|
||||
text-align: center;
|
||||
pointer-events: none;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
.item.active:after, &.norelease .item:hover:after {
|
||||
content:"";
|
||||
position: absolute;
|
||||
top:0;
|
||||
left:0;
|
||||
right:0;
|
||||
bottom:0;
|
||||
pointer-events: none;
|
||||
background: var(--color-light);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
&.circular .menu {
|
||||
|
||||
border-radius: 100%;
|
||||
width:var(--size);
|
||||
height:var(--size);
|
||||
margin-left: calc(var(--x) - var(--size) / 2);
|
||||
margin-top: calc(var(--y) - var(--size) / 2);
|
||||
|
||||
&:after {
|
||||
content:"";
|
||||
position: absolute;
|
||||
width: calc(var(--size) / 3);
|
||||
height: calc(var(--size) / 3);
|
||||
top:50%;
|
||||
left: 50%;
|
||||
margin-left: calc(-1 * var(--size) / 6);
|
||||
margin-top: calc(-1 * var(--size) / 6);
|
||||
background: var(--color-raised);
|
||||
box-shadow: 0 0 2rem 0 var(--color-bg), 0 0 0 2rem var(--color-light) inset;
|
||||
border-radius: 100%;
|
||||
z-index: 10;
|
||||
}
|
||||
|
||||
.item {
|
||||
top: calc(-1 * var(--size) / 2);
|
||||
left: calc(-1 * var(--size) / 2);
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
transform-origin: 100% 100%;
|
||||
position: absolute;
|
||||
box-shadow: 0 0 0 2.5rem var(--color-light) inset, 0 0 0 1.5rem var(--color-bg) inset;
|
||||
|
||||
&.on div:before {
|
||||
content:"";
|
||||
position: absolute;
|
||||
width: calc(var(--size) / 3);
|
||||
height: calc(var(--size) / 3);
|
||||
left: calc(-1 * var(--size) / 6);
|
||||
top: calc(-1 * var(--size) / 6);
|
||||
border-radius: 100%;
|
||||
pointer-events: none;
|
||||
box-shadow: 0 0 0 4rem var(--color-custom);
|
||||
}
|
||||
|
||||
div {
|
||||
position: absolute;
|
||||
bottom: 0;
|
||||
right: 0;
|
||||
}
|
||||
|
||||
span {
|
||||
position: absolute;
|
||||
top: calc(-1 * var(--size) / 3);
|
||||
width: calc(var(--size) / 2);
|
||||
margin-left: calc(-1 * var(--size) / 4);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
&.box .menu {
|
||||
|
||||
width:var(--size-box-w);
|
||||
height:var(--size-box-h);
|
||||
margin-left: calc(var(--x) - var(--size-box-w) / 2);
|
||||
margin-top: calc(var(--y) - var(--size-box-h) / 2);
|
||||
background: var(--color-bg);
|
||||
|
||||
&.show {
|
||||
display: flex;
|
||||
}
|
||||
|
||||
flex-direction: row;
|
||||
|
||||
.item {
|
||||
position: relative;
|
||||
margin:.5rem;
|
||||
background: var(--color-fg);
|
||||
box-shadow: 0 0 0 1rem var(--color-light) inset;
|
||||
|
||||
&.on div:before {
|
||||
content:"";
|
||||
position: absolute;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
left: 0;
|
||||
top: 0;
|
||||
pointer-events: none;
|
||||
box-shadow: 0 0 0 1rem var(--color-custom) inset;
|
||||
opacity: 0.3;
|
||||
}
|
||||
|
||||
div {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
height: 100%;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
&.grid .menu {
|
||||
|
||||
&.show {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(var(--grid-columns), 1fr);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
&.vertical .menu {
|
||||
|
||||
flex-direction: column;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -1,206 +0,0 @@
|
|||
.xy-container, .rgb-container, .multixy-container {
|
||||
width:200rem;
|
||||
height:230rem;
|
||||
padding:2rem;
|
||||
|
||||
--background: var(--color-track);
|
||||
--pips-opacity: 0.2;
|
||||
--point-opacity: 0.3;
|
||||
|
||||
.label {
|
||||
flex-shrink: 0;
|
||||
z-index: 1;
|
||||
}
|
||||
|
||||
> .pad > .wrapper:after {
|
||||
content:"";
|
||||
position: absolute;
|
||||
pointer-events: none;
|
||||
top:var(--pointSize);
|
||||
left:var(--pointSize);
|
||||
height:calc(100% - 2 * var(--pointSize));
|
||||
width:calc(100% - 2 * var(--pointSize));
|
||||
background: var(--background);
|
||||
box-shadow: 0 0 0 1rem var(--color-light),
|
||||
0 0 0 1rem var(--color-bg) inset;
|
||||
|
||||
}
|
||||
|
||||
.pad {
|
||||
height:100%;
|
||||
width: 100%;
|
||||
overflow: hidden;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
> .input {
|
||||
margin-top: 2rem;
|
||||
height: 25rem;
|
||||
flex:initial!important;
|
||||
flex-shrink: 0!important;
|
||||
background: transparent!important;
|
||||
border: 0!important;
|
||||
}
|
||||
> .wrapper {
|
||||
position: relative;
|
||||
flex:1;
|
||||
touch-action: none;
|
||||
|
||||
> canvas {
|
||||
width:100%;
|
||||
height:100%;
|
||||
position: absolute;
|
||||
pointer-events: none;
|
||||
z-index: 1;
|
||||
}
|
||||
> .fader {
|
||||
pointer-events: none;
|
||||
position: absolute;
|
||||
width:100%;
|
||||
height:100%;
|
||||
z-index: 0;
|
||||
--color-knob:transparent;
|
||||
--color-gauge:transparent;
|
||||
box-shadow: none;
|
||||
border: 0;
|
||||
* {
|
||||
background: transparent!important;
|
||||
|
||||
}
|
||||
.wrapper {
|
||||
border:none;
|
||||
}
|
||||
.input {
|
||||
display: none;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
.rgb-container {
|
||||
|
||||
--point-opacity: .7;
|
||||
|
||||
> .pad {
|
||||
|
||||
> .wrapper {
|
||||
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
|
||||
image-rendering:pixelated;
|
||||
> .pad {
|
||||
--color-custom:var(--color-white);
|
||||
position: absolute;
|
||||
.wrapper {
|
||||
border:0;
|
||||
background: transparent;
|
||||
}
|
||||
canvas {
|
||||
border:0;
|
||||
left:0;
|
||||
background: transparent;
|
||||
}
|
||||
.input {
|
||||
display: none;
|
||||
}
|
||||
}
|
||||
> canvas {
|
||||
top:var(--pointSize);
|
||||
left:var(--pointSize);
|
||||
flex:0;
|
||||
height:calc(100% - 2 * var(--pointSize));
|
||||
width:calc(100% - 2 * var(--pointSize));
|
||||
background-color: red;
|
||||
background-clip: content-box;
|
||||
background-image: linear-gradient(to bottom, rgba(0,0,0,0) 0%,rgba(0,0,0,1) 100%), linear-gradient(to right, rgba(255,255,255,1) 0%, rgba(255,255,255,0) 100%);
|
||||
border: 1rem solid var(--color-bg);
|
||||
}
|
||||
|
||||
background: transparent;
|
||||
border: none;
|
||||
box-shadow: none;
|
||||
|
||||
}
|
||||
.alpha-wrapper, .hue-wrapper {
|
||||
flex-shrink: 0;
|
||||
padding: calc(var(--pointSize) / 2) var(--pointSize);
|
||||
.fader {
|
||||
box-shadow: 0 0 0 1rem var(--color-light);
|
||||
height: calc(2 * var(--pointSize));
|
||||
}
|
||||
}
|
||||
.hue-wrapper {
|
||||
--color-gauge:transparent;
|
||||
--color-knob:var(--color-white);
|
||||
.wrapper {
|
||||
&:after {
|
||||
content:"";
|
||||
display: block;
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
right: 0;
|
||||
bottom: 0;
|
||||
background: linear-gradient(to left, #F00, #FF0080, #F0F, #8000FF, #00F, #0080FF, #0FF, #00FF80, #0F0, #80FF00, #FF0, #FF8000, #F00) repeat scroll 0% 0%;
|
||||
box-shadow: 0 0 0 4rem var(--color-track);
|
||||
// z-index: 1;
|
||||
opacity: 0.7;
|
||||
}
|
||||
canvas {
|
||||
background: transparent;
|
||||
-webkit-background-blend-mode: color-burn;
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
.multixy-container {
|
||||
> .pad {
|
||||
text-align: center;
|
||||
font-size: 109%;
|
||||
|
||||
> .wrapper {
|
||||
|
||||
> canvas {
|
||||
top:0;
|
||||
left:0;
|
||||
z-index: 2;
|
||||
}
|
||||
|
||||
> .pad {
|
||||
pointer-events: none;
|
||||
position: absolute;
|
||||
.wrapper {
|
||||
border:0;
|
||||
background: transparent;
|
||||
}
|
||||
canvas {
|
||||
border:0;
|
||||
left:0;
|
||||
}
|
||||
.input {
|
||||
display: none;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.canvas-container {
|
||||
width:200rem;
|
||||
height:230rem;
|
||||
.canvas {
|
||||
flex: 1;
|
||||
}
|
||||
canvas {
|
||||
width:100%;
|
||||
height: 100%;
|
||||
}
|
||||
}
|
||||
|
|
@ -1,348 +0,0 @@
|
|||
.panel-container-base {
|
||||
--color-border:var(--color-bg);
|
||||
z-index: 1;
|
||||
|
||||
box-shadow: 1rem 0 0 0 var(--color-border),
|
||||
0 1rem 0 0 var(--color-border),
|
||||
1rem 1rem 0 0 var(--color-border);
|
||||
|
||||
> .label {
|
||||
border-bottom:1rem solid var(--color-border);
|
||||
z-index: 20;
|
||||
box-shadow: 0 0 0 1rem var(--color-light) inset;
|
||||
background: var(--color-fg);
|
||||
}
|
||||
|
||||
.panel {
|
||||
overflow: auto;
|
||||
position: absolute;
|
||||
top:29rem;
|
||||
left:-1rem;
|
||||
right:0;
|
||||
bottom:0;
|
||||
background: var(--color-fg);
|
||||
--color-border: var(--color-fg);
|
||||
|
||||
box-shadow: 0 0 0 1rem var(--color-light) inset,
|
||||
0 0 0 1rem var(--color-fg) inset,
|
||||
1rem 1rem 0 1rem var(--color-light) inset;
|
||||
|
||||
&.tab, &.root, &.has-tabs {
|
||||
background: var(--color-bg);
|
||||
--color-border: var(--color-bg);
|
||||
box-shadow: none;
|
||||
|
||||
}
|
||||
&:not(.tab) {
|
||||
> .widget {
|
||||
box-shadow: 1rem 0 0 0 var(--color-border),
|
||||
0 1rem 0 0 var(--color-border),
|
||||
1rem 1rem 0 0 var(--color-border);
|
||||
--default-bg: transparent;
|
||||
}
|
||||
}
|
||||
&.has-tabs {
|
||||
top:30rem;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
background: var(--color-bg);
|
||||
|
||||
> .tabs-wrapper {
|
||||
background: var(--color-fg);
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
left:-1rem;
|
||||
> .widget {
|
||||
background: none;
|
||||
border-top:none;
|
||||
// border-right:1rem solid transparent;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
&.noscroll {
|
||||
overflow: hidden;
|
||||
> .widget {
|
||||
max-width: 100%;
|
||||
max-height: 100%;
|
||||
}
|
||||
}
|
||||
|
||||
> .tabs-wrapper {
|
||||
flex: 1 1 100%;
|
||||
min-height:0;
|
||||
> .tab-container {
|
||||
// width: 100%;
|
||||
> .label {
|
||||
display: none;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
&.no-label {
|
||||
> .panel {
|
||||
top:-1rem;
|
||||
}
|
||||
> .panel.has-tabs {
|
||||
top:0;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
&.noborder {
|
||||
|
||||
--color-border: var(--color-fg);
|
||||
> .panel {
|
||||
box-shadow: none;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
.panel-container {
|
||||
@extend .panel-container-base;
|
||||
|
||||
width: 200rem;
|
||||
height: 200rem;
|
||||
|
||||
background: var(--color-fg);
|
||||
|
||||
}
|
||||
|
||||
.strip-container {
|
||||
@extend .panel-container-base;
|
||||
|
||||
width: 100rem;
|
||||
height: 300rem;
|
||||
|
||||
background: var(--color-fg)!important;
|
||||
|
||||
&.horizontal {
|
||||
width: 300rem;
|
||||
height: 100rem;
|
||||
}
|
||||
|
||||
> .panel {
|
||||
--spacing: 0;
|
||||
> .widget {
|
||||
top:auto!important;
|
||||
left:auto!important;
|
||||
position: relative!important;
|
||||
}
|
||||
}
|
||||
|
||||
&.vertical {
|
||||
> .panel {
|
||||
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: stretch;
|
||||
padding: calc(var(--spacing) / 2);
|
||||
> .widget {
|
||||
width: auto!important;
|
||||
min-width: auto!important;
|
||||
max-width: 100%;
|
||||
margin: calc(var(--spacing) / 2);
|
||||
}
|
||||
}
|
||||
}
|
||||
&.horizontal {
|
||||
> .panel {
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
align-items: stretch;
|
||||
padding: calc(var(--spacing) / 2);
|
||||
> .widget {
|
||||
height: auto!important;
|
||||
min-height: auto!important;
|
||||
max-height: 100%;
|
||||
margin: calc(var(--spacing) / 2);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
&.stretch > .panel > .widget {
|
||||
flex:1 1 100%;
|
||||
}
|
||||
|
||||
}
|
||||
.editor-enabled .strip-container {
|
||||
&.horizontal > .panel > .widget > .ui-resizable-s,
|
||||
&.vertical > .panel > .widget > .ui-resizable-e,
|
||||
> .panel > .widget > .ui-resizable-se {
|
||||
display: none!important;
|
||||
}
|
||||
}
|
||||
|
||||
.modal-container {
|
||||
@extend .toggle-container;
|
||||
|
||||
> .label:after {
|
||||
content:"\f0da";
|
||||
font-family: FontAwesome;
|
||||
transform: rotateZ(-45deg);
|
||||
font-size: 20rem;
|
||||
display: block;
|
||||
width:8rem;
|
||||
height:6rem;
|
||||
right:2rem;
|
||||
top:1rem;
|
||||
line-height: 10rem;
|
||||
text-align: center;
|
||||
float:right;
|
||||
position: absolute;
|
||||
box-shadow: none;
|
||||
background: none!important;
|
||||
color: inherit;
|
||||
opacity: 0.7;
|
||||
}
|
||||
|
||||
> .panel {
|
||||
display: none;
|
||||
}
|
||||
> .popup {
|
||||
padding:0;
|
||||
|
||||
> .popup-wrapper {
|
||||
max-width: 100%;
|
||||
max-height: 100%;
|
||||
width: var(--width, 100%);
|
||||
height: var(--height, 100%);
|
||||
.popup-content {
|
||||
padding:0;
|
||||
background: transparent;
|
||||
> .panel {
|
||||
background-color: var(--color-fg);
|
||||
position: absolute;
|
||||
width: auto;
|
||||
height: auto;
|
||||
top:-1rem;
|
||||
left:-1rem;
|
||||
right:0rem;
|
||||
bottom:0rem;
|
||||
}
|
||||
}
|
||||
.popup-title {
|
||||
z-index: 1;
|
||||
color: var(--color-text);
|
||||
}
|
||||
}
|
||||
|
||||
&.x-positionned {
|
||||
justify-content: flex-start;
|
||||
> .popup-wrapper {
|
||||
left: var(--left);
|
||||
}
|
||||
}
|
||||
&.y-positionned {
|
||||
align-items:flex-start;
|
||||
> .popup-wrapper {
|
||||
top: var(--top);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
&.editing .popup-wrapper:after {
|
||||
content:"";
|
||||
z-index: 999;
|
||||
position: absolute;
|
||||
top:0;
|
||||
left:0;
|
||||
right:0;
|
||||
bottom:0;
|
||||
border:1rem solid var(--color-accent);
|
||||
|
||||
--opa1: rgba(0,0,0, 1);
|
||||
--opa2: rgba(0,0,0, 0.2);
|
||||
--opa3: rgba(0,0,0, 0.8);
|
||||
-webkit-mask: linear-gradient(to right, var(--opa1) 10rem, var(--opa1) 10rem, var(--opa2) 10rem, var(--opa2) calc(100% - 10rem), var(--opa1) calc(100% - 10rem), var(--opa1)),
|
||||
linear-gradient(to bottom, var(--opa2) 10rem, var(--opa2) 10rem, var(--opa3) 10rem, var(--opa3) calc(100% - 10rem), var(--opa2) calc(100% - 10rem), var(--opa2)) ;
|
||||
-webkit-mask-composite: xor;
|
||||
|
||||
pointer-events: none;
|
||||
box-shadow: none!important;
|
||||
opacity: 1!important;
|
||||
}
|
||||
&.on {
|
||||
z-index: initial;
|
||||
> .toggle:after {
|
||||
color:var(--color-custom);
|
||||
}
|
||||
border-radius: 0!important; // border radius breaks it somehow
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
.root-container {
|
||||
@extend .panel-container-base;
|
||||
height: 100%;
|
||||
border:none;
|
||||
> .label {
|
||||
display: none;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
.tab-container, .root-container {
|
||||
height: 100%;
|
||||
flex:1;
|
||||
box-shadow: none;
|
||||
background: var(--color-bg)!important;
|
||||
|
||||
> .panel {
|
||||
transform: rotateZ(0);
|
||||
top:0rem;
|
||||
left:-1rem;
|
||||
right:0rem;
|
||||
&.has-tabs {
|
||||
top:1rem;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.tab-container {
|
||||
display: none;
|
||||
&.show {
|
||||
display: flex;
|
||||
}
|
||||
}
|
||||
|
||||
.clone-container {
|
||||
|
||||
&.empty {
|
||||
width: 100rem;
|
||||
height: 100rem;
|
||||
}
|
||||
|
||||
> .label {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.clone {
|
||||
position: absolute;
|
||||
height: 100%;
|
||||
width: 100%;
|
||||
> .widget {
|
||||
border:0!important;
|
||||
box-shadow: none!important;
|
||||
background: transparent!important;
|
||||
position: relative!important;
|
||||
left:auto!important;
|
||||
bottom:auto!important;
|
||||
right:auto!important;
|
||||
top: auto!important;
|
||||
width: 100%!important;
|
||||
height: 100%!important;
|
||||
min-height: initial!important;
|
||||
max-height: initial!important;
|
||||
min-width: initial!important;
|
||||
max-width: initial!important;
|
||||
padding: 0!important;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -1,265 +0,0 @@
|
|||
.led-container, .rgbled-container {
|
||||
width:100rem;
|
||||
height:100rem;
|
||||
padding:1rem;
|
||||
.led {
|
||||
--opacity: 0;
|
||||
--color-led: var(--color-custom);
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
flex: 1 1 100%;
|
||||
background: var(--color-track);
|
||||
border:1rem solid var(--color-bg);
|
||||
&:before {
|
||||
content:"";
|
||||
width:100%;
|
||||
height: 100%;
|
||||
background: var(--color-led);
|
||||
border-radius: inherit;
|
||||
opacity: var(--opacity);
|
||||
box-shadow: inset 0 0 10rem var(--color-track);
|
||||
}
|
||||
@extend .glass-effect;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
.rgbled-container .led {
|
||||
--opacity: 1;
|
||||
}
|
||||
|
||||
.plot-container, .visualizer-container, .eq-container {
|
||||
height: 200rem;
|
||||
width: 200rem;
|
||||
padding:1rem;
|
||||
.plot {
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
flex: 1 1 100%;
|
||||
background: var(--color-track);
|
||||
border:1rem solid var(--color-bg);
|
||||
@extend .glass-effect;
|
||||
}
|
||||
canvas {
|
||||
flex:1;
|
||||
image-rendering:pixelated;
|
||||
width: 100%;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
.meter-container {
|
||||
@extend .fader-container;
|
||||
--color-knob: transparent;
|
||||
.wrapper {
|
||||
pointer-events: none;
|
||||
@extend .glass-effect;
|
||||
}
|
||||
}
|
||||
|
||||
.text-container {
|
||||
width: 100rem;
|
||||
height:60rem;
|
||||
flex-shrink: 0;
|
||||
padding:1rem;
|
||||
.text {
|
||||
flex: 1 1 100%;
|
||||
height:35rem;
|
||||
padding: 0 10rem;
|
||||
justify-content: center;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
white-space: pre;
|
||||
background: var(--color-track);
|
||||
color:var(--color-custom);
|
||||
border: 1rem solid var(--color-bg);
|
||||
line-height: 100%;
|
||||
overflow: hidden;
|
||||
text-align: center;
|
||||
&.right {
|
||||
text-align: right;
|
||||
justify-content: flex-end;
|
||||
}
|
||||
&.left {
|
||||
text-align: left;
|
||||
justify-content: flex-start;
|
||||
}
|
||||
&.wrap {
|
||||
white-space: pre-wrap;
|
||||
}
|
||||
&.vertical {
|
||||
transform: rotate(180deg);
|
||||
text-overflow: ellipsis;
|
||||
-webkit-writing-mode:vertical-rl;
|
||||
writing-mode:vertical-rl;
|
||||
padding: 10rem 0;
|
||||
&:after {
|
||||
transform: rotate(-180deg);
|
||||
}
|
||||
}
|
||||
@extend .glass-effect;
|
||||
}
|
||||
}
|
||||
|
||||
.image-container {
|
||||
width:100rem;
|
||||
height:100rem;
|
||||
padding:1rem;
|
||||
.image {
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
flex: 1 1 100%;
|
||||
background-size:cover;
|
||||
border:1rem solid var(--color-bg);
|
||||
background-repeat: no-repeat;
|
||||
}
|
||||
&.noborder {
|
||||
--color-border:transparent;
|
||||
--color-light:transparent;
|
||||
--color-light:transparent;
|
||||
background: transparent;
|
||||
padding: 0!important;
|
||||
.image {
|
||||
outline:transparent!important;
|
||||
border:0!important;
|
||||
box-shadow:none!important;
|
||||
margin: 0!important;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.svg-container {
|
||||
width:100rem;
|
||||
height:100rem;
|
||||
padding:1rem;
|
||||
.svg {
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
flex: 1 1 100%;
|
||||
background: var(--color-track);
|
||||
border:1rem solid var(--color-bg);
|
||||
svg {
|
||||
flex: 1 1 100%;
|
||||
}
|
||||
}
|
||||
&.noborder {
|
||||
--color-border:transparent;
|
||||
--color-light:transparent;
|
||||
--color-light:transparent;
|
||||
background: transparent;
|
||||
padding: 0!important;
|
||||
.svg {
|
||||
background: transparent;
|
||||
outline:transparent!important;
|
||||
border:0!important;
|
||||
box-shadow:none!important;
|
||||
margin: 0!important;
|
||||
}
|
||||
}
|
||||
&:not(.noborder) .svg {
|
||||
@extend .glass-effect;
|
||||
}
|
||||
}
|
||||
|
||||
.html-container {
|
||||
width:100rem;
|
||||
height:100rem;
|
||||
padding:1rem;
|
||||
.html {
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
flex: 1 1 100%;
|
||||
background: var(--color-track);
|
||||
border:1rem solid var(--color-bg);
|
||||
}
|
||||
&.noborder {
|
||||
--color-border:transparent;
|
||||
--color-light:transparent;
|
||||
--color-light:transparent;
|
||||
background: transparent;
|
||||
padding: 0!important;
|
||||
.html {
|
||||
background: transparent;
|
||||
outline:transparent!important;
|
||||
border:0!important;
|
||||
box-shadow:none!important;
|
||||
margin: 0!important;
|
||||
}
|
||||
}
|
||||
&:not(.noborder) .html {
|
||||
@extend .glass-effect;
|
||||
}
|
||||
}
|
||||
|
||||
.frame-container {
|
||||
width:100rem;
|
||||
height:100rem;
|
||||
padding:1rem;
|
||||
.frame {
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
flex: 1 1 100%;
|
||||
background-size:cover;
|
||||
border:1rem solid var(--color-bg);
|
||||
background-repeat: no-repeat;
|
||||
iframe {
|
||||
flex: 1 1 100%;
|
||||
height: 100%;
|
||||
width: 100%;
|
||||
border: 0;
|
||||
display: block;
|
||||
}
|
||||
iframe[src=""] {
|
||||
pointer-events: none;
|
||||
}
|
||||
&.error {
|
||||
iframe {
|
||||
display: none;
|
||||
}
|
||||
}
|
||||
}
|
||||
&.noborder {
|
||||
--color-border:transparent;
|
||||
--color-light:transparent;
|
||||
--color-light:transparent;
|
||||
background: transparent;
|
||||
padding: 0!important;
|
||||
.frame {
|
||||
outline:transparent!important;
|
||||
border:0!important;
|
||||
box-shadow:none!important;
|
||||
margin: 0!important;
|
||||
}
|
||||
}
|
||||
}
|
||||
.editor-enabled .frame-container.no-label iframe {
|
||||
pointer-events: none;
|
||||
}
|
||||
|
||||
.panel:not(.tab) > .led-container,
|
||||
.panel:not(.tab) > .rgbled-container,
|
||||
.panel:not(.tab) > .text-container,
|
||||
.panel:not(.tab) > .visualizer-container,
|
||||
.panel:not(.tab) > .eq-container,
|
||||
.panel:not(.tab) > .plot-container,
|
||||
.panel:not(.tab) > .image-container,
|
||||
.panel:not(.tab) > .frame-container,
|
||||
.panel:not(.tab) > .svg-container,
|
||||
.panel:not(.tab) > .html-container {
|
||||
--color-border:transparent;
|
||||
padding: 0rem;
|
||||
.plot, .text, .led, .image, .svg, .html, .frame {
|
||||
margin: 1rem;
|
||||
box-shadow: 0 0 0 1rem var(--color-light),
|
||||
0 0 0 1rem var(--color-fg);
|
||||
border: 1rem solid var(--color-bg);
|
||||
}
|
||||
}
|
||||
|
||||
.panel:not(.tab) > .image-container {
|
||||
.image {
|
||||
background-clip: content-box;
|
||||
}
|
||||
}
|
||||
|
|
@ -1,25 +0,0 @@
|
|||
.push-container {
|
||||
@extend .toggle-container;
|
||||
.toggle {
|
||||
&.active {
|
||||
// background-color: var(--color-fg);
|
||||
&:after {
|
||||
content: "";
|
||||
position: absolute;
|
||||
top:0;
|
||||
left: 0;
|
||||
right: 0;
|
||||
bottom: 0;
|
||||
opacity: 0.4;
|
||||
background: radial-gradient( ellipse at center, var(--color-raised), var(--color-bg));
|
||||
z-index: 2;
|
||||
}
|
||||
}
|
||||
&.on:not(.active) {
|
||||
&:after {
|
||||
opacity: 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -1,226 +0,0 @@
|
|||
.state-container, .switch-container, .switcher-container, .crossfader-container {
|
||||
z-index: 1;
|
||||
width:100rem;
|
||||
height:100rem;
|
||||
padding:1rem;
|
||||
|
||||
&.no-label {
|
||||
--color-border:var(--color-bg);
|
||||
padding: 0;
|
||||
.switch, .switcher {
|
||||
border: 0;
|
||||
}
|
||||
}
|
||||
.switch {
|
||||
cursor: pointer;
|
||||
display: flex;
|
||||
flex-direction:column;
|
||||
align-items: stretch;
|
||||
flex: 1;
|
||||
z-index: 1;
|
||||
background:var(--color-bg);
|
||||
border: 1rem solid var(--color-bg);
|
||||
|
||||
&.horizontal {
|
||||
flex-direction:row;
|
||||
.value {
|
||||
border-top:0;
|
||||
border-right:1rem solid var(--color-bg);
|
||||
height:auto;
|
||||
margin-bottom:0;
|
||||
&:last-child {
|
||||
border-right:0;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
.value {
|
||||
background:var(--color-raised);
|
||||
padding:6rem;
|
||||
color:var(--color-text);
|
||||
width:100%;
|
||||
flex: 1 1 100%;
|
||||
position: relative;
|
||||
// border-top: 1rem solid var(--color-bg);
|
||||
margin-bottom:1rem;
|
||||
white-space: normal;
|
||||
text-align: center;
|
||||
word-break: break-all;
|
||||
overflow: hidden;
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
box-shadow: 0 0 0 1rem var(--color-light) inset,
|
||||
0 1rem 0 0 var(--color-light) inset;
|
||||
|
||||
&:before {
|
||||
content:"";
|
||||
position: absolute;
|
||||
top:0;
|
||||
left: 0;
|
||||
right: 0;
|
||||
bottom: 0;
|
||||
opacity: 0;
|
||||
box-shadow: 0 0 0 1rem var(--color-custom) inset;
|
||||
border-radius: inherit;
|
||||
}
|
||||
|
||||
&.on {
|
||||
// background: var(--color-fg);
|
||||
color: var(--color-custom);
|
||||
&:after {
|
||||
content: "";
|
||||
position: absolute;
|
||||
top:0;
|
||||
left: 0;
|
||||
right: 0;
|
||||
bottom: 0;
|
||||
opacity: 0.4;
|
||||
background: radial-gradient( ellipse at center, transparent, var(--color-bg));
|
||||
}
|
||||
&:before {
|
||||
opacity: 0.3;
|
||||
}
|
||||
}
|
||||
&:first-child {
|
||||
// border-top:0;
|
||||
}
|
||||
|
||||
&:last-child {
|
||||
margin-bottom:0;
|
||||
}
|
||||
|
||||
i {
|
||||
width: auto;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.switcher-container {
|
||||
.switcher {
|
||||
flex:1;
|
||||
display:flex;
|
||||
}
|
||||
}
|
||||
|
||||
.crossfader-container {
|
||||
.switcher {
|
||||
flex: 1 1 100%;
|
||||
width:auto;
|
||||
display:flex;
|
||||
border: 1rem solid var(--color-bg);
|
||||
padding: 2rem;
|
||||
.switch {
|
||||
flex:2;
|
||||
border: 1rem solid var(--color-bg) !important;
|
||||
}
|
||||
.fader {
|
||||
flex: 3;
|
||||
--color-pips: var(--color-custom);
|
||||
--color-gauge: var(--color-custom);
|
||||
--color-knob: var(--color-custom);
|
||||
}
|
||||
&.vertical {
|
||||
flex-direction: row;
|
||||
.fader, .fader canvas {
|
||||
height:auto;
|
||||
}
|
||||
}
|
||||
&.horizontal {
|
||||
flex-direction: column;
|
||||
}
|
||||
}
|
||||
}
|
||||
.panel:not(.tab) > .crossfader-container {
|
||||
--color-border:var(--color-fg);
|
||||
.switcher {
|
||||
border:0!important;
|
||||
}
|
||||
}
|
||||
|
||||
.dropdown-container {
|
||||
|
||||
z-index: 1;
|
||||
width:100rem;
|
||||
height: 60rem;
|
||||
padding:1rem;
|
||||
&.no-label {
|
||||
--color-border:var(--color-bg);
|
||||
padding: 0;
|
||||
.select {
|
||||
border: 0;
|
||||
}
|
||||
}
|
||||
.select {
|
||||
flex: 1 1 100%;
|
||||
position: relative;
|
||||
overflow: hidden;
|
||||
cursor: pointer;
|
||||
border: 1rem solid var(--color-bg);
|
||||
display: flex;
|
||||
border-radius: inherit;
|
||||
|
||||
select {
|
||||
box-shadow: 0 0 0 1rem var(--color-light) inset,
|
||||
0 1rem 0 0 var(--color-light) inset;
|
||||
flex:1;
|
||||
display: flex;
|
||||
vertical-align: middle;
|
||||
background:transparent;
|
||||
padding: 0 30rem 0 10rem;
|
||||
max-width: 100%;
|
||||
-webkit-appearance:none;
|
||||
-moz-appearance:none;
|
||||
appearance:none;
|
||||
background: var(--color-raised);
|
||||
color:inherit;
|
||||
font-size: 109%!important;
|
||||
line-height: 120%!important;
|
||||
text-transform: none;
|
||||
border-radius: inherit;
|
||||
|
||||
&:focus {
|
||||
box-shadow: 0 0 0 1rem var(--color-light) inset,
|
||||
0 1rem 0 0 var(--color-light) inset,
|
||||
0 0 1rem 0 var(--color-custom) inset;
|
||||
|
||||
}
|
||||
}
|
||||
&:after{
|
||||
content:"\f107";
|
||||
font-family: FontAwesome;
|
||||
position: absolute;
|
||||
padding:0 10rem;
|
||||
right:0;
|
||||
top:50%;
|
||||
margin-top:-10rem;
|
||||
font-size: 180%;
|
||||
height: 20rem;
|
||||
line-height: 20rem;
|
||||
pointer-events: none;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
.state-container {
|
||||
.push-container {
|
||||
border:0;
|
||||
}
|
||||
.toggle {
|
||||
height: 100%;
|
||||
z-index: 1;
|
||||
&:before {
|
||||
box-shadow: none;
|
||||
}
|
||||
}
|
||||
.disabled {
|
||||
opacity: 0.65;
|
||||
pointer-events: none;
|
||||
cursor: default;
|
||||
}
|
||||
}
|
||||
|
|
@ -1,100 +0,0 @@
|
|||
.toggle-container {
|
||||
width:100rem;
|
||||
height: 60rem;
|
||||
padding:0!important;
|
||||
--color-border:var(--color-bg);
|
||||
--default-bg: var(--color-raised)#{!important};
|
||||
z-index: 1;
|
||||
|
||||
.toggle {
|
||||
|
||||
cursor: pointer;
|
||||
flex: 1 1 100%;
|
||||
display: flex;
|
||||
border-radius: inherit!important;
|
||||
touch-action: none;
|
||||
|
||||
&:before {
|
||||
content:"";
|
||||
flex: 1 1 100%;
|
||||
opacity: 1;
|
||||
box-shadow: 0 0 0 1rem var(--color-light) inset,
|
||||
0 1rem 0 0 var(--color-light) inset;
|
||||
border-radius: inherit;
|
||||
}
|
||||
|
||||
&.on {
|
||||
&:after {
|
||||
content: "";
|
||||
position: absolute;
|
||||
top:0;
|
||||
left: 0;
|
||||
right: 0;
|
||||
bottom: 0;
|
||||
opacity: 0.4;
|
||||
background: radial-gradient( ellipse at center, transparent, var(--color-bg));
|
||||
}
|
||||
|
||||
&:before {
|
||||
opacity: 0.3;
|
||||
box-shadow: 0 0 0 1rem var(--color-custom) inset;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
> .label {
|
||||
position: absolute;
|
||||
top:2rem;
|
||||
left:2rem;
|
||||
right:2rem;
|
||||
bottom:2rem;
|
||||
height:auto;
|
||||
width: auto;
|
||||
max-height: initial;
|
||||
border:0!important;
|
||||
background: none!important;
|
||||
text-align: center;
|
||||
pointer-events:none;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
z-index: 2;
|
||||
}
|
||||
|
||||
&.on > .label{
|
||||
color: var(--color-custom);
|
||||
}
|
||||
|
||||
&.led {
|
||||
.toggle:after {
|
||||
content:"";
|
||||
opacity: 1;
|
||||
position: absolute;
|
||||
display: block;
|
||||
top:3rem;
|
||||
left:3rem;
|
||||
right:3rem;
|
||||
height: 4rem;
|
||||
background: var(--color-track);
|
||||
box-shadow: 0 0 0 1rem var(--color-light), 0 0 0 1rem var(--color-bg) inset;
|
||||
z-index: 1;
|
||||
border-radius: inherit;
|
||||
opacity: 0.9;
|
||||
}
|
||||
.toggle.on:after {
|
||||
opacity: 0.7;
|
||||
background: var(--color-custom);
|
||||
}
|
||||
.toggle:before {
|
||||
opacity: 1;
|
||||
box-shadow: 0 0 0 1rem var(--color-light) inset,
|
||||
0 1rem 0 0 var(--color-light) inset;
|
||||
}
|
||||
> .label {
|
||||
top:7rem;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -91,13 +91,9 @@
|
|||
}
|
||||
|
||||
|
||||
@import 'widgets/basics';
|
||||
@import 'widgets/containers';
|
||||
@import 'widgets/sliders';
|
||||
@import 'widgets/inputs';
|
||||
@import 'widgets/buttons';
|
||||
@import 'widgets/pads';
|
||||
@import 'widgets/plots';
|
||||
@import 'widgets/graphs';
|
||||
@import 'widgets/indicators';
|
||||
@import 'widgets/frames';
|
||||
@import 'widgets/patchbay';
|
||||
@import 'widgets/keyboard';
|
||||
@import 'widgets/pads';
|
||||
@import 'widgets/sliders';
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
.toggle-container, .push-container {
|
||||
.button-container {
|
||||
|
||||
--alpha-fill-off: 0;
|
||||
--alpha-fill-on: .75;
|
||||
|
|
@ -140,6 +140,13 @@
|
|||
align-items: center;
|
||||
position: relative;
|
||||
@include pseudo-stroke();
|
||||
|
||||
&.right .text {
|
||||
justify-content: flex-end;
|
||||
}
|
||||
&.left .text{
|
||||
justify-content: flex-start;
|
||||
}
|
||||
}
|
||||
|
||||
.text {
|
||||
|
|
@ -148,6 +155,8 @@
|
|||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
padding-left: var(--widget-padding);
|
||||
padding-right: var(--widget-padding);
|
||||
}
|
||||
.icon {
|
||||
order: 1;
|
||||
|
|
@ -373,6 +382,13 @@
|
|||
align-items: stretch;
|
||||
position: relative;
|
||||
@include pseudo-stroke();
|
||||
|
||||
&.right .text {
|
||||
justify-content: flex-end;
|
||||
}
|
||||
&.left .text{
|
||||
justify-content: flex-start;
|
||||
}
|
||||
}
|
||||
|
||||
.text {
|
||||
|
|
@ -381,6 +397,8 @@
|
|||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
padding-left: var(--widget-padding);
|
||||
padding-right: var(--widget-padding);
|
||||
}
|
||||
.icon {
|
||||
order: 1;
|
||||
|
|
@ -419,3 +437,124 @@
|
|||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
.input-container {
|
||||
|
||||
--alpha-fill-off: 0.05;
|
||||
|
||||
inner {
|
||||
position: relative;
|
||||
@include pseudo-stroke();
|
||||
@include pseudo-fill(0.05);
|
||||
|
||||
display: flex;
|
||||
flex: 1;
|
||||
padding: var(--widget-padding);
|
||||
text-align: center;
|
||||
&.right {
|
||||
text-align: right;
|
||||
}
|
||||
&.left {
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
padding-left: calc(var(--widget-padding) * 2);
|
||||
padding-right: calc(var(--widget-padding) * 2);
|
||||
|
||||
}
|
||||
|
||||
input + canvas {
|
||||
display: none;
|
||||
width: 0;
|
||||
}
|
||||
|
||||
canvas {
|
||||
flex:1;
|
||||
max-width: 100%;
|
||||
}
|
||||
|
||||
input {
|
||||
display: block;
|
||||
flex:1;
|
||||
max-width: 100%;
|
||||
font: inherit;
|
||||
border:0;
|
||||
padding:0;
|
||||
background: transparent;
|
||||
border-radius: inherit;
|
||||
-webkit-appearance:none;
|
||||
appearance: none;
|
||||
text-align:inherit;
|
||||
line-height: 50rem;
|
||||
vertical-align: top;
|
||||
letter-spacing: 1rem;
|
||||
-webkit-user-select: text;
|
||||
user-select: text;
|
||||
|
||||
color:var(--color-fill);
|
||||
caret-color: var(--color-fill);
|
||||
|
||||
|
||||
|
||||
&:focus::selection {
|
||||
background: var(--color-fill);
|
||||
color: var(--color-background);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
.file-container {
|
||||
|
||||
--alpha-fill: 0.75;
|
||||
--widget-padding: 1rem;
|
||||
|
||||
inner {
|
||||
flex:1;
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
justify-content: center;
|
||||
align-items: stretch;
|
||||
position: relative;
|
||||
@include pseudo-stroke();
|
||||
|
||||
&.right .text {
|
||||
justify-content: flex-end;
|
||||
}
|
||||
&.left .text{
|
||||
justify-content: flex-start;
|
||||
}
|
||||
}
|
||||
|
||||
.text {
|
||||
flex: 1;
|
||||
text-align: center;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
padding-left: var(--widget-padding);
|
||||
padding-right: var(--widget-padding);
|
||||
min-width: 0;
|
||||
overflow: hidden;
|
||||
}
|
||||
.icon {
|
||||
order: 1;
|
||||
display: block;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
width: 30rem;
|
||||
font-family: FontAwesome;
|
||||
color: var(--color-stroke);
|
||||
font-size: 120%;
|
||||
border-left: 1rem solid var(--color-stroke);
|
||||
opacity: var(--alpha-stroke);
|
||||
&:after {
|
||||
content:"\f07c";
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -473,3 +473,129 @@
|
|||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
.patchbaynode-container {
|
||||
|
||||
justify-content: center;
|
||||
|
||||
|
||||
label {
|
||||
flex: 1;
|
||||
pointer-events: none;
|
||||
display: flex;
|
||||
}
|
||||
|
||||
}
|
||||
.patchbay-container {
|
||||
width: 200rem;
|
||||
height: 200rem;
|
||||
|
||||
|
||||
--alpha-fill-on: .75;
|
||||
--alpha-fill-off: 0.25;
|
||||
|
||||
inner {
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
|
||||
@include pseudo-stroke();
|
||||
padding: var(--widget-padding);
|
||||
|
||||
canvas {
|
||||
flex: 1;
|
||||
width: 0;
|
||||
}
|
||||
.nodes {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items:stretch;
|
||||
margin-bottom: 1rem;
|
||||
width: 25%;
|
||||
}
|
||||
|
||||
.inputs, .outputs {
|
||||
position: relative;
|
||||
@include pseudo-stroke();
|
||||
top: 1rem;
|
||||
}
|
||||
|
||||
.inputs:before {
|
||||
border-width: 0 1rem 0 0;
|
||||
}
|
||||
.outputs:before {
|
||||
border-width: 0 0 0 1rem;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
.keyboard-container {
|
||||
|
||||
--widget-padding: 0rem;
|
||||
--alpha-fill-off: 0;
|
||||
--alpha-fill-on: .75;
|
||||
|
||||
--color-key-on: var(--color-fill);
|
||||
--alpha-key-off: var(--alpha-fill-off);
|
||||
--alpha-key-on: var(--alpha-fill-on);
|
||||
--color-white-key: #ccc;
|
||||
--color-black-key: #1A1A1A;
|
||||
|
||||
--widget-keypad: var(--widget-padding);
|
||||
|
||||
> inner {
|
||||
|
||||
padding: var(--widget-padding);
|
||||
flex: 1;
|
||||
@include pseudo-stroke($z: 2);
|
||||
position: relative;
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.key {
|
||||
|
||||
--alpha-fill-off: var(--alpha-key-off);
|
||||
--alpha-fill-on: var(--alpha-key-on);
|
||||
inner {
|
||||
margin: 1rem 0.5rem!important;
|
||||
--widget-padding: -1rem;
|
||||
&:before {
|
||||
content: none;
|
||||
}
|
||||
&:after {
|
||||
background: var(--color-key-on);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.white {
|
||||
flex: 1;
|
||||
width: auto;
|
||||
min-width: auto;
|
||||
height: auto;
|
||||
inner {
|
||||
background: var(--color-white-key);
|
||||
}
|
||||
}
|
||||
|
||||
.black {
|
||||
position: absolute;
|
||||
z-index: 1;
|
||||
|
||||
left: calc((100% - var(--widget-keypad) * 2) / var(--nkeys) * var(--rank));
|
||||
width: calc(100% / var(--nkeys) * 0.6);
|
||||
margin-left: calc(100% / var(--nkeys) * -0.3 + var(--widget-keypad));
|
||||
height: calc((100% - var(--widget-keypad) * 2) * 0.65);
|
||||
|
||||
inner {
|
||||
margin-left: 0!important;
|
||||
margin-right: 0!important;
|
||||
background: var(--color-black-key);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,63 +0,0 @@
|
|||
|
||||
.input-container {
|
||||
|
||||
--alpha-fill-off: 0.05;
|
||||
|
||||
inner {
|
||||
position: relative;
|
||||
@include pseudo-stroke();
|
||||
@include pseudo-fill(0.05);
|
||||
|
||||
display: flex;
|
||||
flex: 1;
|
||||
padding: var(--widget-padding);
|
||||
text-align: center;
|
||||
&.right {
|
||||
text-align: right;
|
||||
}
|
||||
&.left {
|
||||
text-align: left;
|
||||
}
|
||||
}
|
||||
|
||||
input + canvas {
|
||||
display: none;
|
||||
width: 0;
|
||||
}
|
||||
|
||||
canvas {
|
||||
flex:1;
|
||||
max-width: 100%;
|
||||
}
|
||||
|
||||
input {
|
||||
display: block;
|
||||
flex:1;
|
||||
max-width: 100%;
|
||||
font: inherit;
|
||||
border:0;
|
||||
padding:0;
|
||||
background: transparent;
|
||||
border-radius: inherit;
|
||||
-webkit-appearance:none;
|
||||
appearance: none;
|
||||
text-align:inherit;
|
||||
line-height: 50rem;
|
||||
vertical-align: top;
|
||||
letter-spacing: 1rem;
|
||||
-webkit-user-select: text;
|
||||
user-select: text;
|
||||
|
||||
color:var(--color-fill);
|
||||
caret-color: var(--color-fill);
|
||||
|
||||
|
||||
|
||||
&:focus::selection {
|
||||
background: var(--color-fill);
|
||||
color: var(--color-background);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -1,68 +0,0 @@
|
|||
.keyboard-container {
|
||||
|
||||
--widget-padding: 0rem;
|
||||
--alpha-fill-off: 0;
|
||||
--alpha-fill-on: .75;
|
||||
|
||||
--color-key-on: var(--color-fill);
|
||||
--alpha-key-off: var(--alpha-fill-off);
|
||||
--alpha-key-on: var(--alpha-fill-on);
|
||||
--color-white-key: #ccc;
|
||||
--color-black-key: #1A1A1A;
|
||||
|
||||
--widget-keypad: var(--widget-padding);
|
||||
|
||||
> inner {
|
||||
|
||||
padding: var(--widget-padding);
|
||||
flex: 1;
|
||||
@include pseudo-stroke($z: 2);
|
||||
position: relative;
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.key {
|
||||
|
||||
--alpha-fill-off: var(--alpha-key-off);
|
||||
--alpha-fill-on: var(--alpha-key-on);
|
||||
inner {
|
||||
margin: 1rem 0.5rem!important;
|
||||
--widget-padding: -1rem;
|
||||
&:before {
|
||||
content: none;
|
||||
}
|
||||
&:after {
|
||||
background: var(--color-key-on);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.white {
|
||||
flex: 1;
|
||||
width: auto;
|
||||
min-width: auto;
|
||||
height: auto;
|
||||
inner {
|
||||
background: var(--color-white-key);
|
||||
}
|
||||
}
|
||||
|
||||
.black {
|
||||
position: absolute;
|
||||
z-index: 1;
|
||||
|
||||
left: calc((100% - var(--widget-keypad) * 2) / var(--nkeys) * var(--rank));
|
||||
width: calc(100% / var(--nkeys) * 0.6);
|
||||
margin-left: calc(100% / var(--nkeys) * -0.3 + var(--widget-keypad));
|
||||
height: calc((100% - var(--widget-keypad) * 2) * 0.65);
|
||||
|
||||
inner {
|
||||
margin-left: 0!important;
|
||||
margin-right: 0!important;
|
||||
background: var(--color-black-key);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -1,54 +0,0 @@
|
|||
.patchbaynode-container {
|
||||
|
||||
justify-content: center;
|
||||
|
||||
|
||||
label {
|
||||
flex: 1;
|
||||
pointer-events: none;
|
||||
display: flex;
|
||||
}
|
||||
|
||||
}
|
||||
.patchbay-container {
|
||||
width: 200rem;
|
||||
height: 200rem;
|
||||
|
||||
|
||||
--alpha-fill-on: .75;
|
||||
--alpha-fill-off: 0.25;
|
||||
|
||||
inner {
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
|
||||
@include pseudo-stroke();
|
||||
padding: var(--widget-padding);
|
||||
|
||||
canvas {
|
||||
flex: 1;
|
||||
width: 0;
|
||||
}
|
||||
.nodes {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items:stretch;
|
||||
margin-bottom: 1rem;
|
||||
width: 25%;
|
||||
}
|
||||
|
||||
.inputs, .outputs {
|
||||
position: relative;
|
||||
@include pseudo-stroke();
|
||||
top: 1rem;
|
||||
}
|
||||
|
||||
.inputs:before {
|
||||
border-width: 0 1rem 0 0;
|
||||
}
|
||||
.outputs:before {
|
||||
border-width: 0 0 0 1rem;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -111,7 +111,8 @@ var makeDefaultConfig = function(argv){
|
|||
.filter(i=>i.family === 'IPv4')
|
||||
.map(i=>'http://' + i.address + ':' + (argv['port'] || 8080)),
|
||||
examples: argv['examples'],
|
||||
theme: argv['theme'] || []
|
||||
theme: argv['theme'] || [],
|
||||
checkForUpdates: true
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -122,7 +123,7 @@ module.exports = {
|
|||
options:options,
|
||||
makeDefaultConfig:makeDefaultConfig,
|
||||
read:function(key){
|
||||
var x = config[key] || defaultConfig[key]
|
||||
var x = config[key] !== undefined ? config[key] : defaultConfig[key]
|
||||
return x
|
||||
},
|
||||
write:function(key,value,tmp) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue