custom color picker
This commit is contained in:
parent
1fadea7a6b
commit
fdc6e1d33d
53 changed files with 988 additions and 519 deletions
|
|
@ -107,7 +107,6 @@ function updateWidget(widget, options={}) {
|
|||
newWidget.container.parentNode.replaceChild(newWidget.container, widget.container)
|
||||
|
||||
if (newWidget.getProp('type') === 'tab') newWidget.parent.trigger('tab-created', {widget: widget})
|
||||
if (newWidget.getProp('id') === 'root') DOM.get('.editor-root')[0].setAttribute('data-widget', newWidget.hash)
|
||||
|
||||
|
||||
if (reuseChildren && !(newWidget instanceof Panel)) {
|
||||
|
|
|
|||
|
|
@ -399,12 +399,8 @@ var Editor = class Editor {
|
|||
|
||||
this.unselect()
|
||||
this.selectedWidgets = []
|
||||
DOM.get('.disable-editor')[0].classList.add('on')
|
||||
DOM.get('.enable-editor')[0].classList.remove('on')
|
||||
document.body.classList.remove('editor-enabled')
|
||||
|
||||
var gridForm = DOM.get('#grid-width-form')[0]
|
||||
if (gridForm) gridForm.parentNode.removeChild(gridForm)
|
||||
document.body.classList.remove('editor-enabled')
|
||||
|
||||
keyboardJS.setContext('global')
|
||||
|
||||
|
|
|
|||
|
|
@ -216,7 +216,7 @@ module.exports = {
|
|||
this._customBindings['drag'] !== 0 ||
|
||||
this._customBindings['draginit'] !== 0 ||
|
||||
this._customBindings['dragend'] !== 0 ||
|
||||
!options
|
||||
!options || options.ignoreCustomBindings
|
||||
) {
|
||||
return
|
||||
}
|
||||
|
|
@ -243,7 +243,7 @@ module.exports = {
|
|||
this._customBindings['drag'] !== 0 ||
|
||||
this._customBindings['draginit'] !== 0 ||
|
||||
this._customBindings['dragend'] !== 0 ||
|
||||
!options
|
||||
!options || options.ignoreCustomBindings
|
||||
) {
|
||||
return
|
||||
}
|
||||
|
|
|
|||
52
src/client/events/transform-coords.js
Normal file
52
src/client/events/transform-coords.js
Normal file
|
|
@ -0,0 +1,52 @@
|
|||
/*
|
||||
|
||||
Adapted from https://gist.github.com/Yaffle/1145197#file-convertpointfrompagetonode-js
|
||||
|
||||
Disabled for now
|
||||
|
||||
*/
|
||||
|
||||
|
||||
var I = new WebKitCSSMatrix()
|
||||
|
||||
function Point(x, y, z) {
|
||||
this.x = x
|
||||
this.y = y
|
||||
this.z = z
|
||||
}
|
||||
|
||||
Point.prototype.transformBy = function(matrix) {
|
||||
var tmp = matrix.multiply(I.translate(this.x, this.y, this.z))
|
||||
return new Point(tmp.m41, tmp.m42, tmp.m43)
|
||||
}
|
||||
|
||||
function getTransformationMatrix(w) {
|
||||
|
||||
var transformationMatrix = I,
|
||||
node = w
|
||||
|
||||
while (node) {
|
||||
if (node._ignore_css_transforms) break
|
||||
if (node._drag_widget) {
|
||||
|
||||
var transform = node._drag_widget.cssTransform || 'none',
|
||||
c = transform === 'none' ? I : new WebKitCSSMatrix(transform)
|
||||
|
||||
transformationMatrix = c.multiply(transformationMatrix)
|
||||
|
||||
}
|
||||
node = node.parentNode
|
||||
|
||||
}
|
||||
|
||||
transformationMatrix = I.multiply(transformationMatrix)
|
||||
|
||||
return transformationMatrix
|
||||
|
||||
}
|
||||
|
||||
module.export = function cssTransformCoords(node, x, y) {
|
||||
|
||||
return new Point(pageX, pageY, 0).transformBy(getTransformationMatrix(element).inverse())
|
||||
|
||||
}
|
||||
|
|
@ -1,4 +1,6 @@
|
|||
const Touch = window.Touch || class Touch {}
|
||||
// const cssTransformCoords = require('./transform-coords')
|
||||
|
||||
|
||||
module.exports = {
|
||||
|
||||
|
|
@ -76,6 +78,12 @@ module.exports = {
|
|||
}
|
||||
|
||||
|
||||
// if (!event.traversing) {
|
||||
// // css transfom fix (doesn't work well with traversing gestures)
|
||||
// var transformedCoords = cssTransformCoords(event.firstTarget, event.movementX, event.movementY)
|
||||
// event.movementX = transformedCoords.x
|
||||
// event.movementY = transformedCoords.y
|
||||
// }
|
||||
|
||||
return event
|
||||
|
||||
|
|
@ -88,6 +96,13 @@ module.exports = {
|
|||
event.offsetX = event.pageX - off.left
|
||||
event.offsetY = event.pageY - off.top
|
||||
|
||||
// if (!event.traversing) {
|
||||
// // css transfom fix (doesn't work well with traversing gestures)
|
||||
// var transformedCoords = cssTransformCoords(event.firstTarget, event.offsetX, event.offsetY)
|
||||
// event.offsetX = transformedCoords.x
|
||||
// event.offsetY = transformedCoords.y
|
||||
// }
|
||||
|
||||
},
|
||||
|
||||
TRAVERSING_SAMEWIDGET: 1
|
||||
|
|
|
|||
|
|
@ -6,7 +6,6 @@ var utils = require('../ui/utils'),
|
|||
editor = require('../editor/'),
|
||||
locales = require('../locales'),
|
||||
{deepCopy} = require('../utils'),
|
||||
sidepanel = require('../ui/sidepanel'),
|
||||
UiModal = require('../ui/ui-modal'),
|
||||
notifications = require('../ui/notifications'),
|
||||
{TRAVERSING_SAMEWIDGET} = require('../events/utils'),
|
||||
|
|
@ -168,8 +167,6 @@ module.exports = {
|
|||
editor.historyState = data.historyState
|
||||
if (data.editorEnabled) editor.enable()
|
||||
|
||||
if (data.sidepanelOpened) sidepanel.open()
|
||||
|
||||
if (data.traversing === TRAVERSING_SAMEWIDGET) {
|
||||
DOM.get('.traversingSmart')[0].click()
|
||||
} else if (data.traversing) {
|
||||
|
|
|
|||
|
|
@ -33,6 +33,11 @@ module.exports = {
|
|||
fs_unnavailable: 'Fullscreen not available',
|
||||
fs_addtohome: 'You must add this page to your home screen to launch it in fullscreen',
|
||||
|
||||
// inspector
|
||||
inspector_title: 'Inspector',
|
||||
inspector_color_confirm: 'Confirm',
|
||||
inspector_color_apply: 'Apply',
|
||||
|
||||
// remote save
|
||||
remotesave_open: 'Open (on the server)',
|
||||
remotesave_save: 'Save (on the server)',
|
||||
|
|
|
|||
|
|
@ -32,6 +32,12 @@ module.exports = {
|
|||
fs_unnavailable: 'Plein écran indisponible',
|
||||
fs_addtohome: 'Vous devez ajouter cette page à votre écran d\'accueil pour pouvoir l\'ouvrir en plein écran.',
|
||||
|
||||
|
||||
// inspector
|
||||
inspector_title: 'Inspecteur',
|
||||
inspector_color_confirm: 'Confirmer',
|
||||
inspector_color_apply: 'Appliquer',
|
||||
|
||||
// remote save
|
||||
remotesave_open: 'Ouvrir (sur le serveur)',
|
||||
remotesave_save: 'Enregistrer (sur le serveur)',
|
||||
|
|
|
|||
|
|
@ -32,6 +32,11 @@ module.exports = { // @https://github.com/suhr
|
|||
fs_unnavailable: 'Полный экран не доступен',
|
||||
fs_addtohome: 'Необходимо добавить эту страницу на главный экран чтобы запустить её в полноэкранном режиме',
|
||||
|
||||
// inspector
|
||||
inspector_title: 'Inspector',
|
||||
inspector_color_confirm: 'Confirm',
|
||||
inspector_color_apply: 'Apply',
|
||||
|
||||
// remote save
|
||||
remotesave_open: 'Open (on the server)',
|
||||
remotesave_save: 'Save (on the server)',
|
||||
|
|
|
|||
|
|
@ -240,7 +240,6 @@ var SessionManager = class SessionManager {
|
|||
|
||||
create() {
|
||||
this.load({type: 'root'},function(){
|
||||
require('../ui/sidepanel').open()
|
||||
editor.enable()
|
||||
editor.select(widgetManager.getWidgetById('root'))
|
||||
})
|
||||
|
|
|
|||
114
src/client/ui/ui-colorpicker.js
Normal file
114
src/client/ui/ui-colorpicker.js
Normal file
|
|
@ -0,0 +1,114 @@
|
|||
var UiWidget = require('./ui-widget'),
|
||||
Rgb = require('../widgets/pads/rgb'),
|
||||
UiModal = require('./ui-modal'),
|
||||
html = require('nanohtml'),
|
||||
raw = require('nanohtml/raw'),
|
||||
chroma = require('chroma-js'),
|
||||
resize = require('../events/resize'),
|
||||
locales = require('../locales')
|
||||
|
||||
|
||||
class ColorPicker extends UiWidget {
|
||||
|
||||
constructor() {
|
||||
|
||||
super({})
|
||||
|
||||
this.name = ''
|
||||
this.value = ''
|
||||
|
||||
this.rgb = new Rgb({props: {
|
||||
...Rgb.defaults()._props(),
|
||||
type: 'rgb',
|
||||
label: false,
|
||||
width: 250,
|
||||
height: 200,
|
||||
alphaStroke: 0,
|
||||
snap: true
|
||||
// height: '100%',
|
||||
}, parent: this})
|
||||
this.rgb.container.classList.add('not-editable')
|
||||
|
||||
this.modal = new UiModal({
|
||||
closable: true,
|
||||
title: '',
|
||||
hide: true,
|
||||
content: html`
|
||||
<div class="color-picker-modal">
|
||||
${this.rgb.container}
|
||||
<div class="actions">
|
||||
<div class="btn color-apply">${locales('inspector_color_apply')}</div>
|
||||
<div class="btn color-confirm">${locales('inspector_color_confirm')}</div>
|
||||
</div>
|
||||
</div>
|
||||
`,
|
||||
enterKey: this.confirm.bind(this)
|
||||
})
|
||||
|
||||
DOM.get(this.modal.container, '.color-confirm')[0].addEventListener('click', this.confirm.bind(this))
|
||||
DOM.get(this.modal.container, '.color-apply')[0].addEventListener('click', this.apply.bind(this))
|
||||
|
||||
this.rgb.on('change', (e)=>{
|
||||
e.stopPropagation = true
|
||||
})
|
||||
// this.rgb.on('dragend', (e)=>{
|
||||
// this.value = chroma(this.rgb.value).hex()
|
||||
// this.trigger('change')
|
||||
// })
|
||||
|
||||
this.opened = 0
|
||||
|
||||
}
|
||||
|
||||
open() {
|
||||
|
||||
this.modal.open()
|
||||
resize.check(this.rgb.container)
|
||||
this.opened = 1
|
||||
|
||||
}
|
||||
|
||||
close() {
|
||||
|
||||
this.modal.close()
|
||||
this.setName()
|
||||
this.opened = 0
|
||||
|
||||
}
|
||||
|
||||
apply() {
|
||||
|
||||
this.value = chroma(this.rgb.value).hex()
|
||||
this.trigger('change')
|
||||
|
||||
}
|
||||
|
||||
confirm() {
|
||||
|
||||
this.value = chroma(this.rgb.value).hex()
|
||||
this.trigger('change')
|
||||
this.close()
|
||||
|
||||
}
|
||||
|
||||
isVisible() {
|
||||
|
||||
return true
|
||||
|
||||
}
|
||||
|
||||
setName(n = '') {
|
||||
|
||||
this.name = n
|
||||
|
||||
}
|
||||
|
||||
setValue(v) {
|
||||
|
||||
this.rgb.setValue(chroma(v).rgb())
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
module.exports = ColorPicker
|
||||
|
|
@ -14,7 +14,6 @@ class UiDragResize extends UiWidget {
|
|||
|
||||
this.container = html`
|
||||
<div id="drag-resize">
|
||||
<div class="position-handle"></div>
|
||||
<div class="helper"></div>
|
||||
<div class="no-widget-select handle nw" data-action="left,top"></div>
|
||||
<div class="no-widget-select handle e" data-action="width"></div>
|
||||
|
|
@ -42,12 +41,13 @@ class UiDragResize extends UiWidget {
|
|||
this.on('draginit', (event)=>{
|
||||
|
||||
var node = event.firstTarget
|
||||
if (!this.handles.includes(node)) return
|
||||
if (event.shiftKey || !this.handles.includes(node)) return
|
||||
|
||||
this.initLeft = this.left
|
||||
this.initTop = this.top
|
||||
this.initWidth = this.width
|
||||
this.initHeight = this.height
|
||||
this.matrix = ''
|
||||
|
||||
this.container.classList.add('dragging')
|
||||
this.dragging = node.getAttribute('data-action').split(',')
|
||||
|
|
@ -94,15 +94,7 @@ class UiDragResize extends UiWidget {
|
|||
|
||||
}, {element: this.container})
|
||||
|
||||
|
||||
// handles appear on top of modal widgets
|
||||
// very special case fix here...
|
||||
this.watchedModalWidget = null
|
||||
this.checkModalState = (e)=>{
|
||||
if (e.widget !== this.watchedModalWidget) return
|
||||
console.log(e.widget.value)
|
||||
this.container.style.display = e.widget.value ? 'none' : ''
|
||||
}
|
||||
// this.handles[0]._ignore_css_transforms = true
|
||||
|
||||
}
|
||||
|
||||
|
|
@ -110,13 +102,6 @@ class UiDragResize extends UiWidget {
|
|||
|
||||
if (!this.mounted) return
|
||||
|
||||
if (this.watchedModalWidget) {
|
||||
// reset modal widget fix
|
||||
this.watchedModalWidget.off('change', this.checkModalState)
|
||||
this.watchedModalWidget = null
|
||||
this.container.style.display = ''
|
||||
}
|
||||
|
||||
this.container.parentNode.removeChild(this.container)
|
||||
this.mounted = false
|
||||
|
||||
|
|
@ -129,13 +114,6 @@ class UiDragResize extends UiWidget {
|
|||
|
||||
var widget = widgets[0]
|
||||
|
||||
if (widget instanceof Modal) {
|
||||
// modal widget fix
|
||||
this.watchedModalWidget = widget
|
||||
widget.on('change', this.checkModalState)
|
||||
if (widget.getValue()) this.container.style.display = 'none'
|
||||
}
|
||||
|
||||
if (
|
||||
widget instanceof Tab ||
|
||||
widget instanceof Root ||
|
||||
|
|
@ -153,8 +131,6 @@ class UiDragResize extends UiWidget {
|
|||
this.handles[i].style.display = handlesVisibility[i] ? '' : 'none'
|
||||
}
|
||||
|
||||
|
||||
|
||||
var parent = widget.parentNode,
|
||||
lefts = widgets.map(w => w.container.offsetLeft),
|
||||
tops = widgets.map(w => w.container.offsetTop),
|
||||
|
|
@ -166,6 +142,9 @@ class UiDragResize extends UiWidget {
|
|||
this.width = (Math.max(...rights) - Math.min(...lefts)) / PXSCALE
|
||||
this.height = (Math.max(...bottoms) - Math.min(...tops)) / PXSCALE
|
||||
|
||||
// this.cssTransform = widget.cssTransform || 'none'
|
||||
// this.cssTransformOrigin = widget.cssTransformOrigin
|
||||
|
||||
this.updateCss()
|
||||
|
||||
parent.appendChild(this.container)
|
||||
|
|
@ -184,6 +163,9 @@ class UiDragResize extends UiWidget {
|
|||
|
||||
this.container.style.setProperty('--' + k, val + 'rem')
|
||||
|
||||
// this.container.style.transform = this.cssTransform
|
||||
// this.container.style.transformOrigin = this.cssTransformOrigin
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -4,13 +4,15 @@ var locales = require('../locales'),
|
|||
ipc = require('../ipc'),
|
||||
doubleClick = require('../events/double-click'),
|
||||
{icon} = require('./utils'),
|
||||
UiModal = require('./ui-modal')
|
||||
UiModal = require('./ui-modal'),
|
||||
keyboardJS = require('keyboardjs')
|
||||
|
||||
|
||||
module.exports = function UiFilebrowser(options, callback) {
|
||||
|
||||
var save = options.save,
|
||||
saveInputFocus = undefined
|
||||
saveInputFocus = undefined,
|
||||
previousKbContext = keyboardJS.getContext()
|
||||
|
||||
var popup = new UiModal({
|
||||
closable: true,
|
||||
|
|
@ -192,6 +194,7 @@ module.exports = function UiFilebrowser(options, callback) {
|
|||
ipc.off('listDir', null, popup)
|
||||
document.removeEventListener('keydown', keyDownHandler)
|
||||
document.removeEventListener('keyup', keyUpHandler)
|
||||
keyboardJS.setContext(previousKbContext)
|
||||
})
|
||||
|
||||
browser.appendChild(ariane)
|
||||
|
|
@ -202,5 +205,6 @@ module.exports = function UiFilebrowser(options, callback) {
|
|||
ipc.send('listDir', {extension: options.extension, path: options.directory ? [options.directory] : null})
|
||||
|
||||
popup.open()
|
||||
keyboardJS.setContext('filebrowser')
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -101,7 +101,7 @@ class UiInspectorField extends UiWidget {
|
|||
val = chroma(style.getPropertyValue('--' + this.name.replace(/([A-Z])/g, (a,s)=>'-' + s.toLowerCase())).trim()).hex('rgb')
|
||||
} catch(e) {console.log(e)}
|
||||
|
||||
let picker = html`<input class="osc-inspector-color" type="color" name="${this.name}" value="${val}"/>`
|
||||
let picker = html`<osc-inspector-color type="text" name="${this.name}" value="${val}" style="--color-picker-value: ${val}"></osc-inspector-color>`
|
||||
|
||||
this.container.appendChild(picker)
|
||||
|
||||
|
|
|
|||
|
|
@ -1,10 +1,14 @@
|
|||
var UiWidget = require('./ui-widget'),
|
||||
UiInspectorField = require('./ui-inspector-field'),
|
||||
UiColorPicker = require('./ui-colorpicker'),
|
||||
morph = require('nanomorph'),
|
||||
{widgets, defaults} = require('../widgets/'),
|
||||
{deepCopy} = require('../utils'),
|
||||
html = require('nanohtml')
|
||||
|
||||
|
||||
|
||||
|
||||
class UiInspector extends UiWidget {
|
||||
|
||||
constructor(options) {
|
||||
|
|
@ -31,6 +35,15 @@ class UiInspector extends UiWidget {
|
|||
|
||||
})
|
||||
|
||||
this.colorPicker = new UiColorPicker()
|
||||
this.colorPicker.on('change', ()=>{
|
||||
var textarea = DOM.get(this.container, `textarea[name="${this.colorPicker.name}"]`)
|
||||
if (textarea) {
|
||||
textarea[0].value = this.colorPicker.value
|
||||
DOM.dispatchEvent(textarea[0], 'change')
|
||||
}
|
||||
})
|
||||
|
||||
this.container.addEventListener('click', (e)=>{
|
||||
|
||||
var node = e.target
|
||||
|
|
@ -45,6 +58,12 @@ class UiInspector extends UiWidget {
|
|||
DOM.dispatchEvent(textarea[0], 'change')
|
||||
}
|
||||
|
||||
} else if (node.tagName === 'OSC-INSPECTOR-COLOR') {
|
||||
|
||||
this.colorPicker.setName(node.getAttribute('name'))
|
||||
this.colorPicker.setValue(node.getAttribute('value'))
|
||||
this.colorPicker.open()
|
||||
|
||||
}
|
||||
|
||||
})
|
||||
|
|
@ -67,6 +86,7 @@ class UiInspector extends UiWidget {
|
|||
this.container.innerHTML = ''
|
||||
this.mounted = false
|
||||
this.clearTimeout = null
|
||||
this.colorPicker.close()
|
||||
})
|
||||
|
||||
}
|
||||
|
|
@ -124,11 +144,6 @@ class UiInspector extends UiWidget {
|
|||
|
||||
} else {
|
||||
|
||||
// if (widget.parent !== widgetManager && widget.parent.getProp('type') === 'strip') {
|
||||
// // special case for widgets in strips
|
||||
// if (propName === 'top' || propName === 'left' || propName === (widget.parent.getProp('horizontal') ? 'height' : 'width')) continue
|
||||
// }
|
||||
|
||||
field = new UiInspectorField({
|
||||
parent: this,
|
||||
widget: widget,
|
||||
|
|
@ -137,6 +152,7 @@ class UiInspector extends UiWidget {
|
|||
default: defaults[w.props.type][propName],
|
||||
tabIndex: tabIndex++
|
||||
}).container
|
||||
|
||||
if (!field) continue
|
||||
|
||||
}
|
||||
|
|
@ -146,6 +162,7 @@ class UiInspector extends UiWidget {
|
|||
content.appendChild(field)
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
if (category) content.appendChild(category)
|
||||
|
|
@ -159,6 +176,17 @@ class UiInspector extends UiWidget {
|
|||
|
||||
this.mounted = true
|
||||
|
||||
if (this.colorPicker.opened) {
|
||||
|
||||
var picker = DOM.get(this.container, `osc-inspector-color[name="${this.colorPicker.name}"]`)
|
||||
if (picker) {
|
||||
this.colorPicker.setValue(picker[0].getAttribute('value'))
|
||||
} else {
|
||||
this.colorPicker.close()
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
onChange(event) {
|
||||
|
|
|
|||
|
|
@ -2,8 +2,9 @@ var UiWidget = require('./ui-widget'),
|
|||
{icon} = require('./utils'),
|
||||
html = require('nanohtml'),
|
||||
raw = require('nanohtml/raw'),
|
||||
SINGLETON = null,
|
||||
CONTAINER = null
|
||||
MODAL_SINGLETON = null,
|
||||
MODAL_CONTAINER = null,
|
||||
OPENED_MODALS = 0
|
||||
|
||||
class UiModal extends UiWidget {
|
||||
|
||||
|
|
@ -11,12 +12,12 @@ class UiModal extends UiWidget {
|
|||
|
||||
super(options)
|
||||
|
||||
if (!CONTAINER) CONTAINER = DOM.get('osc-modal-container')[0]
|
||||
if (!MODAL_CONTAINER) MODAL_CONTAINER = DOM.get('osc-modal-container')[0]
|
||||
|
||||
if (options.closable) {
|
||||
|
||||
if (SINGLETON) SINGLETON.close()
|
||||
SINGLETON = this
|
||||
if (MODAL_SINGLETON) MODAL_SINGLETON.close()
|
||||
MODAL_SINGLETON = this
|
||||
|
||||
}
|
||||
|
||||
|
|
@ -77,7 +78,11 @@ class UiModal extends UiWidget {
|
|||
|
||||
if (this.escKey) document.removeEventListener('keydown', this.escKeyHandler)
|
||||
if (this.enterKey) document.removeEventListener('keydown', this.enterKeyHandler)
|
||||
CONTAINER.removeChild(this.container)
|
||||
|
||||
|
||||
if (--OPENED_MODALS === 0) MODAL_CONTAINER.classList.remove('backdrop')
|
||||
|
||||
MODAL_CONTAINER.removeChild(this.container)
|
||||
|
||||
this.trigger('close')
|
||||
|
||||
|
|
@ -90,7 +95,10 @@ class UiModal extends UiWidget {
|
|||
|
||||
if (this.escKey) document.addEventListener('keydown', this.escKeyHandler)
|
||||
if (this.enterKey) document.addEventListener('keydown', this.enterKeyHandler)
|
||||
CONTAINER.appendChild(this.container)
|
||||
|
||||
if (++OPENED_MODALS === 1) MODAL_CONTAINER.classList.add('backdrop')
|
||||
|
||||
MODAL_CONTAINER.appendChild(this.container)
|
||||
|
||||
this.trigger('open')
|
||||
}
|
||||
|
|
|
|||
|
|
@ -62,6 +62,10 @@ class UiTree extends UiWidget {
|
|||
})
|
||||
}
|
||||
|
||||
widgetManager.on('prop-changed', (e)=>{
|
||||
console.log(e)
|
||||
})
|
||||
|
||||
}
|
||||
|
||||
clear() {
|
||||
|
|
|
|||
|
|
@ -1,64 +1,6 @@
|
|||
var Widget = require('./widget'),
|
||||
resize = require('../../events/resize')
|
||||
|
||||
|
||||
class CanvasQueue {
|
||||
|
||||
constructor() {
|
||||
|
||||
this.queue = {}
|
||||
this.flushed = 0
|
||||
this.running = false
|
||||
this.frameLength = 1000 / CANVAS_FRAMERATE
|
||||
this.lastFrame = 0
|
||||
this.bindedLoop = this.loop.bind(this)
|
||||
|
||||
}
|
||||
|
||||
push(widget) {
|
||||
|
||||
this.queue[widget.hash] = widget
|
||||
this.flushed = 0
|
||||
|
||||
if (!this.running) {
|
||||
this.running = true
|
||||
requestAnimationFrame(this.bindedLoop)
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
flush() {
|
||||
|
||||
for (var h in this.queue) {
|
||||
this.queue[h].draw()
|
||||
}
|
||||
|
||||
this.queue = {}
|
||||
this.flushed++
|
||||
|
||||
}
|
||||
|
||||
loop(timestamp) {
|
||||
|
||||
if (this.flushed >= 10) {
|
||||
this.running = false
|
||||
return
|
||||
}
|
||||
|
||||
requestAnimationFrame(this.bindedLoop)
|
||||
|
||||
var delta = timestamp - this.lastFrame
|
||||
|
||||
if (delta > this.frameLength) {
|
||||
this.lastFrame = timestamp - (delta % this.frameLength)
|
||||
this.flush()
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
var canvasQueue = new CanvasQueue()
|
||||
resize = require('../../events/resize'),
|
||||
canvasQueue = require('./queue')
|
||||
|
||||
|
||||
class Canvas extends Widget {
|
||||
|
|
@ -82,7 +24,7 @@ class Canvas extends Widget {
|
|||
|
||||
this.clearRect = []
|
||||
|
||||
this.visible = false
|
||||
this.hasSize = false
|
||||
|
||||
this.colors = {}
|
||||
this.cssVars = {}
|
||||
|
|
@ -123,7 +65,10 @@ class Canvas extends Widget {
|
|||
|
||||
this.cacheCanvasStyle(style)
|
||||
|
||||
if (!this.visible) this.visible = true
|
||||
if (!this.hasSize) {
|
||||
this.hasSize = true
|
||||
this.setVisibility()
|
||||
}
|
||||
|
||||
this.batchDraw()
|
||||
|
||||
|
|
@ -172,11 +117,15 @@ class Canvas extends Widget {
|
|||
|
||||
}
|
||||
|
||||
isVisible() {
|
||||
|
||||
return this.hasSize && super.isVisible()
|
||||
|
||||
}
|
||||
|
||||
batchDraw() {
|
||||
|
||||
if (this.visible) {
|
||||
canvasQueue.push(this)
|
||||
}
|
||||
if (this.visible) canvasQueue.push(this)
|
||||
|
||||
}
|
||||
|
||||
|
|
|
|||
62
src/client/widgets/common/queue.js
Normal file
62
src/client/widgets/common/queue.js
Normal file
|
|
@ -0,0 +1,62 @@
|
|||
var EventEmitter = require('../../events/event-emitter')
|
||||
|
||||
class CanvasQueue extends EventEmitter{
|
||||
|
||||
constructor() {
|
||||
|
||||
super()
|
||||
|
||||
this.queue = {}
|
||||
this.flushed = 0
|
||||
this.running = false
|
||||
this.frameLength = 1000 / CANVAS_FRAMERATE
|
||||
this.lastFrame = 0
|
||||
this.bindedLoop = this.loop.bind(this)
|
||||
|
||||
}
|
||||
|
||||
push(widget) {
|
||||
|
||||
this.queue[widget.hash] = widget
|
||||
this.flushed = 0
|
||||
|
||||
if (!this.running) {
|
||||
this.running = true
|
||||
requestAnimationFrame(this.bindedLoop)
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
flush() {
|
||||
|
||||
for (var h in this.queue) {
|
||||
this.queue[h].draw()
|
||||
}
|
||||
|
||||
this.queue = {}
|
||||
this.flushed++
|
||||
|
||||
}
|
||||
|
||||
loop(timestamp) {
|
||||
|
||||
if (this.flushed >= 10) {
|
||||
this.running = false
|
||||
return
|
||||
}
|
||||
|
||||
requestAnimationFrame(this.bindedLoop)
|
||||
|
||||
var delta = timestamp - this.lastFrame
|
||||
|
||||
if (delta > this.frameLength) {
|
||||
this.lastFrame = timestamp - (delta % this.frameLength)
|
||||
this.trigger('frame', {timestamp})
|
||||
this.flush()
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
module.exports = new CanvasQueue()
|
||||
|
|
@ -168,6 +168,7 @@ class Widget extends EventEmitter {
|
|||
this.reCreateOptions = options.reCreateOptions
|
||||
this.removed = false
|
||||
this.mounted = false
|
||||
this.visible = true
|
||||
|
||||
this.createPropsCache()
|
||||
|
||||
|
|
@ -197,6 +198,7 @@ class Widget extends EventEmitter {
|
|||
|
||||
this.setContainerStyles()
|
||||
this.setCssVariables()
|
||||
this.setVisibility()
|
||||
|
||||
|
||||
}
|
||||
|
|
@ -758,7 +760,7 @@ class Widget extends EventEmitter {
|
|||
return
|
||||
|
||||
case 'visible':
|
||||
this.setContainerStyles(['visibility'])
|
||||
this.setVisibility()
|
||||
resize.check(this.container)
|
||||
return
|
||||
|
||||
|
|
@ -775,7 +777,6 @@ class Widget extends EventEmitter {
|
|||
|
||||
case 'css':
|
||||
this.setContainerStyles(['css'])
|
||||
this.onPropChanged('color')
|
||||
var re = /width|height|display/
|
||||
if (re.test(oldPropValue) || re.test(this.getProp('css'))) {
|
||||
resize.check(this.container)
|
||||
|
|
@ -821,10 +822,6 @@ class Widget extends EventEmitter {
|
|||
|
||||
setContainerStyles(styles = ['geometry', 'label', 'css', 'visibility']) {
|
||||
|
||||
if (styles.includes('visibility')) {
|
||||
this.container.style.display = this.getProp('visible') ? '' : 'none'
|
||||
}
|
||||
|
||||
if (styles.includes('geometry')) {
|
||||
|
||||
// geometry
|
||||
|
|
@ -941,6 +938,19 @@ class Widget extends EventEmitter {
|
|||
this.extraCssClasses = extraCssClasses
|
||||
}
|
||||
|
||||
|
||||
// store transform matrix if any
|
||||
// if (css.includes('transform')) {
|
||||
// setTimeout(()=>{
|
||||
// var style = window.getComputedStyle(this.container)
|
||||
// this.cssTransform = style.transform || 'none'
|
||||
// this.cssTransformOrigin = style.transformOrigin
|
||||
// })
|
||||
// } else {
|
||||
// this.cssTransform = 'none'
|
||||
// }
|
||||
|
||||
|
||||
}
|
||||
|
||||
return style
|
||||
|
|
@ -960,6 +970,28 @@ class Widget extends EventEmitter {
|
|||
|
||||
}
|
||||
|
||||
isVisible() {
|
||||
|
||||
return this.getProp('visible') && this.parent.isVisible()
|
||||
|
||||
}
|
||||
|
||||
setVisibility() {
|
||||
|
||||
|
||||
var visible = this.isVisible()
|
||||
if (visible !== this.visible) {
|
||||
this.visible = visible
|
||||
this.container.style.display = this.getProp('visible') ? '' : 'none'
|
||||
|
||||
for (var c of this.children) {
|
||||
c.setVisibility()
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
reCreateWidget(options={}){
|
||||
|
||||
if (!this.removed) return updateWidget(this, options)
|
||||
|
|
|
|||
|
|
@ -28,6 +28,7 @@ class Matrix extends StaticProperties(Panel, {scroll: false}) {
|
|||
quantity: {type: 'number', value: 4, help: 'Defines the number of widgets in the matrix'},
|
||||
start: {type: 'integer', value: 0, help: 'First widget\'s index'},
|
||||
traversing: {type: 'boolean', value: true, help: 'Set to `false` to disable traversing gestures'},
|
||||
restrainModals: {type: 'boolean', value: true, help: 'Set to `false` to let modal widgets ignore this container\'s boundaries.'},
|
||||
props: {type: 'object', value: {}, help: [
|
||||
'Defines a set of property to override the widgets\' defaults.',
|
||||
'Formulas in this field are resolved with an extra variable representing each widget\'s index: `$`',
|
||||
|
|
@ -40,7 +41,7 @@ class Matrix extends StaticProperties(Panel, {scroll: false}) {
|
|||
|
||||
constructor(options) {
|
||||
|
||||
super({...options, html: html`<div class="panel"></div>`})
|
||||
super(options)
|
||||
|
||||
this.value = []
|
||||
|
||||
|
|
|
|||
|
|
@ -28,6 +28,7 @@ class Modal extends Panel {
|
|||
popupTop: {type: 'number|percentage', value: 'auto', help: 'Modal popup\'s position'},
|
||||
layout: {type: 'string', value: 'default', choices: ['default', 'vertical', 'horizontal', 'grid'], help:''},
|
||||
gridTemplate: {type: 'string|number', value: '', help:'If `layout` is `grid`, can be either a number of columns of a value css grid-template definition.'},
|
||||
traversing: {type: 'boolean', value: false, help: 'Set to `true` to enable traversing gestures in this widget. Set to `smart` or `auto` to limit affected widgets by the type of the first touched widget'},
|
||||
scroll: {type: 'boolean', value: true, help: 'Set to `false` to disable scrollbars'},
|
||||
variables: {type: '*', value: '@{parent.variables}', help: 'Defines one or more arbitrary variables that can be inherited by children widgets'},
|
||||
|
||||
|
|
@ -47,7 +48,7 @@ class Modal extends Panel {
|
|||
super(options)
|
||||
|
||||
this.popup = html`
|
||||
<div class="popup">
|
||||
<div class="popup backdrop">
|
||||
<div class="popup-wrapper">
|
||||
<div class="popup-title closable"><span class="popup-label"></span><span class="closer">${raw(icon('times'))}</span></div>
|
||||
<div class="popup-content widget panel-container not-editable contains-widgets"></div>
|
||||
|
|
@ -77,14 +78,14 @@ class Modal extends Panel {
|
|||
this.popup.classList.add('y-positionned')
|
||||
}
|
||||
|
||||
this.light = this.container.appendChild(html`<div class="toggle"></div>`)
|
||||
this.toggle = this.container.appendChild(html`<div class="toggle"></div>`)
|
||||
|
||||
if (this.getProp('doubleTap')) {
|
||||
doubletab(this.light, ()=>{
|
||||
doubletab(this.toggle, ()=>{
|
||||
this.setValue(1, {sync:true, send:true})
|
||||
})
|
||||
} else {
|
||||
this.light.addEventListener('fast-click',(e)=>{
|
||||
this.toggle.addEventListener('fast-click',(e)=>{
|
||||
if (e.capturedByEditor === true) return
|
||||
e.detail.preventOriginalEvent = true
|
||||
this.setValue(1, {sync:true, send:true})
|
||||
|
|
@ -113,6 +114,13 @@ class Modal extends Panel {
|
|||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
isVisible() {
|
||||
|
||||
return this.value && super.isVisible()
|
||||
|
||||
}
|
||||
|
||||
setValue(v, options={}) {
|
||||
|
|
@ -132,7 +140,7 @@ class Modal extends Panel {
|
|||
|
||||
this.popup.classList.toggle('show', this.value)
|
||||
this.container.classList.toggle('on', this.value)
|
||||
|
||||
// this.setVisibility()
|
||||
|
||||
this.bindEscKey(this.value)
|
||||
|
||||
|
|
|
|||
|
|
@ -22,8 +22,8 @@ class Panel extends Container() {
|
|||
|
||||
layout: {type: 'string', value: 'default', choices: ['default', 'vertical', 'horizontal', 'grid'], help:''},
|
||||
gridTemplate: {type: 'string|number', value: '', help:'If `layout` is `grid`, can be either a number of columns of a value css grid-template definition.'},
|
||||
scroll: {type: 'boolean', value: true, help: 'Set to `false` to disable scrollbars'},
|
||||
traversing: {type: 'boolean', value: false, help: 'Set to `true` to enable traversing gestures in this widget. Set to `smart` or `auto` to limit affected widgets by the type of the first touched widget'},
|
||||
scroll: {type: 'boolean', value: true, help: 'Set to `false` to disable scrollbars'},
|
||||
variables: {type: '*', value: '@{parent.variables}', help: 'Defines one or more arbitrary variables that can be inherited by children widgets'},
|
||||
|
||||
}, [], {
|
||||
|
|
@ -44,9 +44,9 @@ class Panel extends Container() {
|
|||
constructor(options) {
|
||||
|
||||
|
||||
super({...options, html: html`<div class="panel"></div>`})
|
||||
super({...options, html: html`<inner></inner>`})
|
||||
|
||||
this.container.classList.toggle('noscroll', this.getProp('scroll') === false)
|
||||
this.container.classList.toggle('no-scroll', this.getProp('scroll') === false)
|
||||
this.container.classList.add('layout-' + this.getProp('layout'))
|
||||
|
||||
if (this.getProp('layout') === 'grid') {
|
||||
|
|
@ -157,7 +157,7 @@ class Panel extends Container() {
|
|||
this.tabs.push(widget)
|
||||
this.navigation.appendChild(html`
|
||||
<div class="tablink" data-widget="${widget.hash}" style="${style}">
|
||||
${widget.label.innerHTML}
|
||||
${raw(widget.label.innerHTML)}
|
||||
</div>
|
||||
`)
|
||||
|
||||
|
|
|
|||
|
|
@ -66,6 +66,12 @@ class Root extends StaticProperties(Panel, {scroll: false, label: false, id: 'ro
|
|||
|
||||
}
|
||||
|
||||
isVisible() {
|
||||
|
||||
return true
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -19,8 +19,8 @@ module.exports = class Tab extends Panel {
|
|||
// detached: {type: 'boolean', value: true, help: 'Set to `false` if the tab contains `frame` widgets that should not be reloaded when the tab opens'},
|
||||
layout: {type: 'string', value: 'default', choices: ['default', 'vertical', 'horizontal', 'grid'], help:''},
|
||||
gridTemplate: {type: 'string|number', value: '', help:'If `layout` is `grid`, can be either a number of columns of a value css grid-template definition.'},
|
||||
scroll: {type: 'boolean', value: true, help: 'Set to `false` to disable scrollbars'},
|
||||
traversing: {type: 'boolean', value: false, help: 'Set to `true` to enable traversing gestures in this widget. Set to `smart` or `auto` to limit affected widgets by the type of the first touched widget'},
|
||||
scroll: {type: 'boolean', value: true, help: 'Set to `false` to disable scrollbars'},
|
||||
variables: {type: '*', value: '@{parent.variables}', help: 'Defines one or more arbitrary variables that can be inherited by children widgets'},
|
||||
|
||||
}, [
|
||||
|
|
@ -55,16 +55,24 @@ module.exports = class Tab extends Panel {
|
|||
if (this.getProp('detached')) this.container.removeChild(this.widget)
|
||||
this.container.classList.remove('show')
|
||||
this.detached = true
|
||||
|
||||
this.setVisibility()
|
||||
}
|
||||
|
||||
show() {
|
||||
if (!this.detached) return
|
||||
if (this.getProp('detached')) this.container.appendChild(this.widget)
|
||||
this.container.classList.add('show')
|
||||
this.detached = false
|
||||
this.setVisibility()
|
||||
resize.check(this.widget, true)
|
||||
}
|
||||
|
||||
isVisible() {
|
||||
|
||||
return !this.detached && super.isVisible()
|
||||
|
||||
}
|
||||
|
||||
onPropChanged(propName, options, oldPropValue) {
|
||||
|
||||
if (super.onPropChanged(...arguments)) return true
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@ var {clip} = require('../utils'),
|
|||
StaticProperties = require('../mixins/static_properties')
|
||||
|
||||
|
||||
module.exports = class Eq extends StaticProperties(Plot, {rangeX: {min: 20, max: 22050}}) {
|
||||
module.exports = class Eq extends StaticProperties(Plot, {rangeX: {min: 20, max: 22000}}) {
|
||||
|
||||
static description() {
|
||||
|
||||
|
|
|
|||
|
|
@ -56,8 +56,8 @@ module.exports = class Plot extends StaticProperties(Canvas, {bypass: true, inte
|
|||
this.logScaleY = this.getProp('logScaleY')
|
||||
this.pips = {
|
||||
x : {
|
||||
min: Math.abs(this.rangeX.min)>=1000?this.rangeY.min/1000+'k':this.rangeX.min,
|
||||
max: Math.abs(this.rangeX.max)>=1000?this.rangeY.max/1000+'k':this.rangeX.max
|
||||
min: Math.abs(this.rangeX.min)>=1000?this.rangeX.min/1000+'k':this.rangeX.min,
|
||||
max: Math.abs(this.rangeX.max)>=1000?this.rangeX.max/1000+'k':this.rangeX.max
|
||||
},
|
||||
y : {
|
||||
min: Math.abs(this.rangeY.min)>=1000?this.rangeY.min/1000+'k':this.rangeY.min,
|
||||
|
|
|
|||
|
|
@ -1,7 +1,8 @@
|
|||
var {clip} = require('../utils'),
|
||||
Widget = require('../common/widget'),
|
||||
Plot = require('./plot'),
|
||||
StaticProperties = require('../mixins/static_properties')
|
||||
StaticProperties = require('../mixins/static_properties'),
|
||||
canvasQueue = require('../common/queue')
|
||||
|
||||
|
||||
module.exports = class Visualizer extends StaticProperties(Plot, {rangeX: {min: '', max: ''}, dots: false, smooth: false, interaction: false}) {
|
||||
|
|
@ -42,6 +43,8 @@ module.exports = class Visualizer extends StaticProperties(Plot, {rangeX: {min:
|
|||
this.watchDuration = 1000 * this.getProp('duration')
|
||||
this.ticks = 0
|
||||
|
||||
this.bindedLoop = this.loop.bind(this)
|
||||
|
||||
}
|
||||
|
||||
startLoop() {
|
||||
|
|
@ -49,9 +52,9 @@ module.exports = class Visualizer extends StaticProperties(Plot, {rangeX: {min:
|
|||
this.clock = Date.now()
|
||||
if (!this.looping) {
|
||||
this.lastUpdate = Date.now()
|
||||
canvasQueue.on('frame', this.bindedLoop)
|
||||
this.looping = true
|
||||
this.ticks = 0
|
||||
this.loop()
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -59,11 +62,12 @@ module.exports = class Visualizer extends StaticProperties(Plot, {rangeX: {min:
|
|||
|
||||
var t = Date.now()
|
||||
|
||||
if (t -this.clock >= this.watchDuration) {
|
||||
if (t - this.clock >= this.watchDuration) {
|
||||
canvasQueue.off('frame', this.bindedLoop)
|
||||
this.looping = false
|
||||
}
|
||||
|
||||
this.ticks += (t - this.lastUpdate) / (1000/this.fps)
|
||||
this.ticks += (t - this.lastUpdate) / (1000 / this.fps)
|
||||
|
||||
if (Math.floor(this.ticks) > 0) {
|
||||
this.shiftData(Math.floor(this.ticks))
|
||||
|
|
@ -73,17 +77,11 @@ module.exports = class Visualizer extends StaticProperties(Plot, {rangeX: {min:
|
|||
|
||||
this.lastUpdate = t
|
||||
|
||||
if (!this.looping) return
|
||||
|
||||
setTimeout(()=>{
|
||||
this.loop()
|
||||
}, (1000/this.fps))
|
||||
|
||||
}
|
||||
|
||||
shiftData(n) {
|
||||
|
||||
for (var i=0; i<n; i++) {
|
||||
for (var i = 0; i < n; i++) {
|
||||
this.value.push(this.value[this.length - 1])
|
||||
this.value.splice(0,1)
|
||||
}
|
||||
|
|
@ -98,17 +96,18 @@ module.exports = class Visualizer extends StaticProperties(Plot, {rangeX: {min:
|
|||
|
||||
setValue(v, options={}) {
|
||||
|
||||
if (Array.isArray(v) && v.length == this.length) {
|
||||
|
||||
this.value = v
|
||||
if (typeof(v) === 'number') {
|
||||
|
||||
this.value[this.length - 1] = v
|
||||
this.startLoop()
|
||||
|
||||
if (options.sync) this.changed(options)
|
||||
|
||||
|
||||
} else if (typeof(v) == 'number'){
|
||||
} else if (Array.isArray(v) && v.length === this.length) {
|
||||
|
||||
this.value[this.length - 1] = v
|
||||
this.value = v
|
||||
this.startLoop()
|
||||
|
||||
if (options.sync) this.changed(options)
|
||||
|
|
@ -118,5 +117,14 @@ module.exports = class Visualizer extends StaticProperties(Plot, {rangeX: {min:
|
|||
|
||||
}
|
||||
|
||||
onRemove() {
|
||||
|
||||
if (this.looping) {
|
||||
canvasQueue.off('frame', this.bindedLoop)
|
||||
}
|
||||
super.onRemove()
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -91,7 +91,7 @@ module.exports = class Keyboard extends Panel {
|
|||
data.address = '@{parent.address}'
|
||||
data.preArgs = `JS{{
|
||||
var a = @{parent.preArgs};
|
||||
var b = typeof a === 'string' and a === '' ? [] : Array.isArray(a) ? a : [a];
|
||||
var b = typeof a === 'string' && a === '' ? [] : Array.isArray(a) ? a : [a];
|
||||
return b.concat([${i}])
|
||||
}}`
|
||||
|
||||
|
|
|
|||
|
|
@ -248,12 +248,14 @@ module.exports = class MultiXy extends Pad {
|
|||
|
||||
switch (propName) {
|
||||
|
||||
case 'colorText':
|
||||
case 'colorWidget':
|
||||
case 'colorFill':
|
||||
case 'colorStroke':
|
||||
case 'alphaStroke':
|
||||
case 'alphaFillOff':
|
||||
case 'alphaFillOn':
|
||||
case 'padding':
|
||||
for (var w of this.pads) {
|
||||
w.onPropChanged(propName)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,14 +1,14 @@
|
|||
var Pad = require('./pad'),
|
||||
var Widget = require('../common/widget'),
|
||||
Xy = require('./xy'),
|
||||
Fader = require('./_fake_fader'),
|
||||
Fader = require('../sliders/fader'),
|
||||
{clip, mapToScale, hsbToRgb, rgbToHsb} = require('../utils'),
|
||||
Input = require('../inputs/input'),
|
||||
html = require('nanohtml')
|
||||
|
||||
var faderDefaults = Fader.defaults()._props(),
|
||||
xyDefaults = Xy.defaults()._props()
|
||||
|
||||
module.exports = class Rgb extends Pad {
|
||||
|
||||
module.exports = class Rgb extends Widget {
|
||||
|
||||
static description() {
|
||||
|
||||
|
|
@ -28,8 +28,8 @@ module.exports = class Rgb extends Pad {
|
|||
]},
|
||||
spring: {type: 'boolean', value: false, help: 'When set to `true`, the widget will go back to its default value when released'},
|
||||
range: {type: 'object', value: {min: 0, max: 255}, help: 'Defines the widget\'s output scale.'},
|
||||
input: {type: 'boolean', value: true, help: 'Set to `false` to hide the built-in input widget'},
|
||||
alpha:{type: 'boolean', value: false, help: 'Set to `true` to enable alpha channel'}
|
||||
alpha:{type: 'boolean', value: false, help: 'Set to `true` to enable alpha channel'},
|
||||
rangeAlpha: {type: 'object', value: {min: 0, max: 1}, help: 'Defines the widget\'s output scale for the alpha channel.'},
|
||||
|
||||
}, ['color'], {
|
||||
|
||||
|
|
@ -39,82 +39,81 @@ module.exports = class Rgb extends Pad {
|
|||
|
||||
constructor(options) {
|
||||
|
||||
options.props.pointSize = 10
|
||||
super({...options, html: html`<inner></inner>`})
|
||||
|
||||
super(options)
|
||||
|
||||
this.hueWrapper = this.widget.appendChild(html`<div class="hue-wrapper"></div>`)
|
||||
|
||||
this.hue = new Fader({props:{
|
||||
...faderDefaults,
|
||||
id:'h',
|
||||
compact:true,
|
||||
pips:false,
|
||||
horizontal:true,
|
||||
snap:this.getProp('snap'),
|
||||
range:{min:0,max:360},
|
||||
input:false,
|
||||
precision:2
|
||||
}, cancelDraw: false, parent: this})
|
||||
this.hue.sendValue = ()=>{}
|
||||
this.hueWrapper.appendChild(this.hue.widget)
|
||||
this.hue.on('change',(e)=>{
|
||||
e.stopPropagation = true
|
||||
this.dragHandle(true)
|
||||
})
|
||||
this.container.classList.toggle('contains-alpha', this.getProp('alpha'))
|
||||
|
||||
this.pad = new Xy({props:{
|
||||
...xyDefaults,
|
||||
type: 'xy',
|
||||
label: false,
|
||||
snap:this.getProp('snap'),
|
||||
spring:this.getProp('spring'),
|
||||
rangeX:{min:0,max:100},
|
||||
rangeY:{min:0,max:100},
|
||||
precision:2,
|
||||
pointSize: this.getProp('pointSize'),
|
||||
pointSize: 10,
|
||||
pips: false,
|
||||
input:false
|
||||
}, parent: this})
|
||||
this.pad.sendValue = ()=>{}
|
||||
this.wrapper.appendChild(this.pad.widget)
|
||||
this.pad.container.classList.add('not-editable', 'pad')
|
||||
this.widget.appendChild(this.pad.container)
|
||||
this.pad.on('change',(e)=>{
|
||||
e.stopPropagation = true
|
||||
this.dragHandle()
|
||||
})
|
||||
|
||||
this.hue = new HueFader({props:{
|
||||
...faderDefaults,
|
||||
type: 'fader',
|
||||
mode: 'line',
|
||||
label: false,
|
||||
pips:false,
|
||||
horizontal:false,
|
||||
snap:this.getProp('snap'),
|
||||
range:{min:0,max:360},
|
||||
precision:2
|
||||
}, parent: this})
|
||||
this.hue.container.classList.add('not-editable', 'hue')
|
||||
this.widget.appendChild(this.hue.container)
|
||||
this.hue.on('change',(e)=>{
|
||||
e.stopPropagation = true
|
||||
this.dragHandle(true)
|
||||
})
|
||||
|
||||
if (this.getProp('alpha')) {
|
||||
this.alphaWrapper = this.widget.appendChild(html`<div class="alpha-wrapper"></div>`)
|
||||
this.alpha = new Fader({props:{
|
||||
...faderDefaults,
|
||||
id:'a',
|
||||
compact:true,
|
||||
type: 'fader',
|
||||
label:false,
|
||||
pips:false,
|
||||
horizontal:true,
|
||||
snap:this.getProp('snap'),
|
||||
range:{min:0,max:255},
|
||||
range: this.getProp('rangeAlpha'),
|
||||
default: 255,
|
||||
input:false,
|
||||
precision:2
|
||||
}, cancelDraw: false, parent: this})
|
||||
this.alpha.sendValue = ()=>{}
|
||||
this.alphaWrapper.appendChild(this.alpha.widget)
|
||||
}, parent: this})
|
||||
this.alpha.container.classList.add('not-editable', 'alpha')
|
||||
this.widget.appendChild(this.alpha.container)
|
||||
this.alpha.on('change',(e)=>{
|
||||
e.stopPropagation = true
|
||||
this.dragAlphaHandle()
|
||||
})
|
||||
}
|
||||
|
||||
if (this.getProp('input')) {
|
||||
var initValue = Array.isArray(this.getProp('default')) && this.getProp('default').length >= 3 ? this.getProp('default') : Array(3).fill(this.getProp('range').min)
|
||||
if (this.getProp('alpha') && initValue.length < 4) {
|
||||
initValue[3] = this.getProp('rangeAlpha').min
|
||||
}
|
||||
|
||||
if (this.getProp('spring')) {
|
||||
|
||||
this.on('dragend', (e)=>{
|
||||
|
||||
this.input = new Input({
|
||||
props:{...Input.defaults()._props(), precision:this.getProp('precision'), unit:this.getProp('unit')},
|
||||
parent:this, parentNode:this.widget
|
||||
})
|
||||
this.widget.appendChild(this.input.widget)
|
||||
this.input.on('change', (e)=>{
|
||||
e.stopPropagation = true
|
||||
this.setValue(this.input.getValue(), {sync:true, send:true})
|
||||
this.showValue()
|
||||
})
|
||||
this.setValue(initValue, {sync:true,send:true})
|
||||
|
||||
}, {element: this.widget, ignoreCustomBindings: true})
|
||||
|
||||
}
|
||||
|
||||
|
|
@ -123,7 +122,7 @@ module.exports = class Rgb extends Pad {
|
|||
|
||||
this.hsb = {h:0,s:0,b:0}
|
||||
|
||||
this.setValue([this.getProp('range').min, this.getProp('range').min, this.getProp('range').min])
|
||||
this.setValue(initValue)
|
||||
|
||||
}
|
||||
|
||||
|
|
@ -178,11 +177,14 @@ module.exports = class Rgb extends Pad {
|
|||
if (this.touched && !options.dragged) return this.setValueTouchedQueue = [v, options]
|
||||
|
||||
var value = Array(this.getProp('alpha') ? 4 : 3)
|
||||
for (var i = 0; i < value.length; i++) {
|
||||
|
||||
for (var i = 0; i < 3; i++) {
|
||||
value[i] = clip(v[i], [this.getProp('range').min, this.getProp('range').max])
|
||||
}
|
||||
|
||||
if (value.length === 4 && value[3] === undefined) value[3] = this.alpha.value
|
||||
if (value.length === 4) {
|
||||
value[3] = v[3] === undefined ? this.alpha.value : clip(v[3], [this.getProp('rangeAlpha').min, this.getProp('rangeAlpha').max])
|
||||
}
|
||||
|
||||
var hsb = rgbToHsb({
|
||||
r: value[0],
|
||||
|
|
@ -211,32 +213,12 @@ module.exports = class Rgb extends Pad {
|
|||
if (!options.nohue && !options.dragged) {
|
||||
var hue = hsbToRgb({h:this.hsb.h,s:100,b:100}),
|
||||
hueStr = `rgb(${Math.round(hue.r)},${Math.round(hue.g)},${Math.round(hue.b)})`
|
||||
this.canvas.setAttribute('style',`background-color:${hueStr}`)
|
||||
this.pad.container.setAttribute('style',`background-color:${hueStr}`)
|
||||
this.hue.setValue(this.hsb.h, {sync: false, send:false, dragged:false})
|
||||
}
|
||||
|
||||
|
||||
this.showValue()
|
||||
|
||||
}
|
||||
|
||||
draw() {}
|
||||
|
||||
showValue() {
|
||||
|
||||
if (this.getProp('input')) this.input.setValue(this.value)
|
||||
|
||||
}
|
||||
|
||||
getSplit() {
|
||||
|
||||
return this.getProp('split')?
|
||||
typeof this.getProp('split') == 'object' && this.getProp('split').length == 3 ?
|
||||
this.getProp('split')
|
||||
: [this.getProp('address') + '/r', this.getProp('address') + '/g', this.getProp('address') + '/b']
|
||||
: false
|
||||
|
||||
}
|
||||
|
||||
onPropChanged(propName, options, oldPropValue) {
|
||||
|
||||
|
|
@ -244,24 +226,83 @@ module.exports = class Rgb extends Pad {
|
|||
|
||||
switch (propName) {
|
||||
|
||||
case 'color':
|
||||
case 'colorText':
|
||||
case 'colorWidget':
|
||||
case 'colorFill':
|
||||
case 'colorStroke':
|
||||
case 'alphaStroke':
|
||||
case 'alphaFillOff':
|
||||
case 'alphaFillOn':
|
||||
for (var w of [this.hue, this.pad]) {
|
||||
w.onPropChanged('color')
|
||||
w.onPropChanged(propName)
|
||||
}
|
||||
if (this.input) this.input.onPropChanged('color')
|
||||
if (this.alpha) this.alpha.onPropChanged('color')
|
||||
if (this.alpha) this.alpha.onPropChanged(propName)
|
||||
return
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
setVisibility() {
|
||||
|
||||
super.setVisibility()
|
||||
|
||||
for (var w of [this.hue, this.pad]) {
|
||||
if (w) w.setVisibility()
|
||||
}
|
||||
if (this.alpha) this.alpha.setVisibility()
|
||||
|
||||
}
|
||||
|
||||
onRemove() {
|
||||
this.hue.onRemove()
|
||||
this.pad.onRemove()
|
||||
if (this.input) this.input.onRemove()
|
||||
if (this.alpha) this.alpha.onRemove()
|
||||
super.onRemove()
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
class HueFader extends Fader {
|
||||
|
||||
draw() {
|
||||
|
||||
var width = this.getProp('horizontal') ? this.height : this.width,
|
||||
height = !this.getProp('horizontal') ? this.height : this.width
|
||||
|
||||
var percent = this.getProp('steps') ? this.valueToPercent(this.value) : this.percent,
|
||||
d = Math.round(this.percentToCoord(percent)),
|
||||
o = Math.round(this.percentToCoord(this.valueToPercent(this.originValue))),
|
||||
m = this.getProp('horizontal') ? this.height / 2 : this.width / 2,
|
||||
dashed = this.getProp('dashed'),
|
||||
flat = this.getProp('mode') === 'flat'
|
||||
|
||||
// sharp border trick
|
||||
if (width % 2 && parseInt(m) === m) m -= 0.5
|
||||
|
||||
this.clear()
|
||||
|
||||
|
||||
this.ctx.strokeStyle = this.gaugeGradient || this.cssVars.colorFill
|
||||
|
||||
if (flat) {
|
||||
this.ctx.lineWidth = Math.round(width - this.gaugePadding * 2)
|
||||
} else {
|
||||
this.ctx.lineWidth = 2 * PXSCALE
|
||||
}
|
||||
|
||||
|
||||
// flat knob
|
||||
|
||||
this.ctx.globalAlpha = 1
|
||||
this.ctx.fillStyle = this.cssVars.colorFill
|
||||
|
||||
this.ctx.beginPath()
|
||||
this.ctx.rect(this.gaugePadding, Math.min(d, height - 2 * PXSCALE), width - this.gaugePadding * 2, 2 * PXSCALE)
|
||||
this.ctx.fill()
|
||||
|
||||
this.clearRect = [0, 0, width, height]
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,17 +1,10 @@
|
|||
var Pad = require('./pad'),
|
||||
Fader = require('./_fake_fader'),
|
||||
Fader = require('../sliders/fader'),
|
||||
doubletab = require('../mixins/double_tap'),
|
||||
touchstate = require('../mixins/touch_state')
|
||||
|
||||
var faderDefaults = Fader.defaults()._props()
|
||||
|
||||
class XyFader extends Fader {
|
||||
|
||||
draw(){}
|
||||
batchDraw(){}
|
||||
|
||||
}
|
||||
|
||||
module.exports = class Xy extends Pad {
|
||||
|
||||
static description() {
|
||||
|
|
@ -56,9 +49,10 @@ module.exports = class Xy extends Pad {
|
|||
super(options)
|
||||
|
||||
this.faders = {
|
||||
x: new XyFader({props:{
|
||||
x: new Fader({props:{
|
||||
...faderDefaults,
|
||||
id:0,
|
||||
visible:false,
|
||||
horizontal:true,
|
||||
default:this.getProp('default').length === 2 ? this.getProp('default')[0] : '',
|
||||
snap:this.getProp('snap'),
|
||||
|
|
@ -67,9 +61,10 @@ module.exports = class Xy extends Pad {
|
|||
logScale:this.getProp('logScaleX'),
|
||||
sensitivity: this.getProp('sensitivity'),
|
||||
}, parent: this}),
|
||||
y: new XyFader({props:{
|
||||
y: new Fader({props:{
|
||||
...faderDefaults,
|
||||
id:1,
|
||||
visible:false,
|
||||
horizontal:false,
|
||||
default:this.getProp('default').length === 2 ? this.getProp('default')[1] : '',
|
||||
snap:this.getProp('snap'),
|
||||
|
|
@ -89,10 +84,9 @@ module.exports = class Xy extends Pad {
|
|||
this.active = false
|
||||
|
||||
this.on('draginit',(e)=>{
|
||||
e.stopPropagation = true
|
||||
this.active = true
|
||||
this.faders.x.trigger('draginit', e)
|
||||
this.faders.y.trigger('draginit', e)
|
||||
this.faders.x.trigger('draginit', {...e, stopPropagation: true})
|
||||
this.faders.y.trigger('draginit', {...e, stopPropagation: true})
|
||||
this.dragHandle()
|
||||
}, {element: this.canvas})
|
||||
|
||||
|
|
@ -103,10 +97,9 @@ module.exports = class Xy extends Pad {
|
|||
}, {element: this.canvas})
|
||||
|
||||
this.on('dragend', (e)=>{
|
||||
e.stopPropagation = true
|
||||
this.active = false
|
||||
this.faders.x.trigger('dragend', e)
|
||||
this.faders.y.trigger('dragend', e)
|
||||
this.faders.x.trigger('dragend', {...e, stopPropagation: true})
|
||||
this.faders.y.trigger('dragend', {...e, stopPropagation: true})
|
||||
if (this.getProp('spring')) {
|
||||
this.setValue([this.faders.x.getSpringValue(),this.faders.y.getSpringValue()],{sync:true,send:true})
|
||||
} else {
|
||||
|
|
@ -261,8 +254,9 @@ module.exports = class Xy extends Pad {
|
|||
|
||||
}
|
||||
|
||||
this.ctx.globalAlpha = this.cssVars.alphaStroke
|
||||
this.ctx.globalAlpha = this.cssVars.alphaFillOn
|
||||
this.ctx.stroke()
|
||||
|
||||
}
|
||||
|
||||
if (!pipsDrawn) this.clearRect = [x - this.pointSize - 2 * PXSCALE, y - this.pointSize - 2 * PXSCALE, (this.pointSize + PXSCALE) * 4, (this.pointSize + PXSCALE) * 4]
|
||||
|
|
|
|||
|
|
@ -17,6 +17,7 @@ module.exports = class Fader extends Slider {
|
|||
|
||||
_fader:'fader',
|
||||
|
||||
mode: {type: 'string', value: 'flat', choices: ['flat', 'line'], help: 'Design style'},
|
||||
horizontal: {type: 'boolean', value: false, help: 'Set to `true` to display the fader horizontally'},
|
||||
alignRight: {type: 'boolean', value: false, help: 'Set to `true` to invert the pip\'s and fader\'s position'},
|
||||
pips: {type: 'boolean', value: true, help: 'Set to `false` to hide the scale'},
|
||||
|
|
@ -62,17 +63,9 @@ module.exports = class Fader extends Slider {
|
|||
|
||||
super(options)
|
||||
|
||||
this.widget.classList.add('fader')
|
||||
this.gaugeGradient = null
|
||||
|
||||
if (this.getProp('horizontal')) {
|
||||
this.widget.classList.add('horizontal')
|
||||
this.container.classList.add('horizontal')
|
||||
}
|
||||
|
||||
if (this.getProp('alignRight') && !this.getProp('horizontal')) {
|
||||
this.widget.classList.add('align-right')
|
||||
}
|
||||
this.container.classList.toggle('alt', this.getProp('mode') !== 'flat')
|
||||
|
||||
if (false && this.getProp('pips')) {
|
||||
|
||||
|
|
@ -205,28 +198,41 @@ module.exports = class Fader extends Slider {
|
|||
var percent = this.getProp('steps') ? this.valueToPercent(this.value) : this.percent,
|
||||
d = Math.round(this.percentToCoord(percent)),
|
||||
o = Math.round(this.percentToCoord(this.valueToPercent(this.originValue))),
|
||||
m = this.getProp('horizontal') ? this.height / 2 : this.width / 2
|
||||
m = this.getProp('horizontal') ? this.height / 2 : this.width / 2,
|
||||
dashed = this.getProp('dashed'),
|
||||
flat = this.getProp('mode') === 'flat'
|
||||
|
||||
// sharp border trick
|
||||
if (width % 2 && parseInt(m) === m) m -= 0.5
|
||||
|
||||
var dashed = this.getProp('dashed')
|
||||
|
||||
this.clear()
|
||||
|
||||
|
||||
|
||||
this.ctx.strokeStyle = this.gaugeGradient || this.cssVars.colorFill
|
||||
this.ctx.lineWidth = Math.round(width - this.gaugePadding * 2)
|
||||
|
||||
if (flat) {
|
||||
this.ctx.lineWidth = Math.round(width - this.gaugePadding * 2)
|
||||
} else {
|
||||
this.ctx.lineWidth = 2 * PXSCALE
|
||||
}
|
||||
|
||||
|
||||
if (dashed) this.ctx.setLineDash([PXSCALE, PXSCALE])
|
||||
|
||||
|
||||
if (this.cssVars.alphaFillOff) {
|
||||
// gaugo off
|
||||
this.ctx.globalAlpha = this.cssVars.alphaFillOff
|
||||
this.ctx.beginPath()
|
||||
this.ctx.moveTo(m, height - this.gaugePadding)
|
||||
this.ctx.lineTo(m, this.gaugePadding)
|
||||
this.ctx.stroke()
|
||||
}
|
||||
|
||||
|
||||
if (this.cssVars.alphaFillOn) {
|
||||
// gaugo on
|
||||
this.ctx.globalAlpha = this.cssVars.alphaFillOn
|
||||
this.ctx.beginPath()
|
||||
this.ctx.moveTo(m, o)
|
||||
|
|
@ -236,27 +242,57 @@ module.exports = class Fader extends Slider {
|
|||
|
||||
if (dashed) this.ctx.setLineDash([])
|
||||
|
||||
this.ctx.globalAlpha = this.cssVars.alphaStroke
|
||||
this.ctx.strokeStyle = this.cssVars.colorStroke
|
||||
if (flat) {
|
||||
|
||||
this.ctx.beginPath()
|
||||
this.ctx.moveTo(0, 0)
|
||||
this.ctx.lineTo(width, 0)
|
||||
this.ctx.lineTo(width, height)
|
||||
this.ctx.lineTo(0, height)
|
||||
this.ctx.closePath()
|
||||
this.ctx.lineWidth = 2 * PXSCALE
|
||||
this.ctx.stroke()
|
||||
// stroke
|
||||
|
||||
this.ctx.globalAlpha = this.cssVars.alphaStroke
|
||||
this.ctx.strokeStyle = this.cssVars.colorStroke
|
||||
|
||||
this.ctx.beginPath()
|
||||
this.ctx.moveTo(0, 0)
|
||||
this.ctx.lineTo(width, 0)
|
||||
this.ctx.lineTo(width, height)
|
||||
this.ctx.lineTo(0, height)
|
||||
this.ctx.closePath()
|
||||
this.ctx.lineWidth = 2 * PXSCALE
|
||||
this.ctx.stroke()
|
||||
|
||||
|
||||
this.ctx.globalAlpha = 1
|
||||
this.ctx.fillStyle = this.cssVars.colorFill
|
||||
// flat knob
|
||||
|
||||
this.ctx.globalAlpha = 1
|
||||
this.ctx.fillStyle = this.cssVars.colorFill
|
||||
|
||||
this.ctx.beginPath()
|
||||
this.ctx.rect(this.gaugePadding, Math.min(d, height - 3 * PXSCALE), width - this.gaugePadding * 2, PXSCALE)
|
||||
this.ctx.fill()
|
||||
|
||||
this.clearRect = [0, 0, width, height]
|
||||
|
||||
|
||||
} else {
|
||||
|
||||
this.ctx.globalAlpha = 1
|
||||
this.ctx.fillStyle = this.cssVars.colorFill
|
||||
|
||||
this.ctx.beginPath()
|
||||
this.ctx.arc(m, d, 3 * PXSCALE, 0, 2 * Math.PI)
|
||||
this.ctx.fill()
|
||||
|
||||
this.ctx.globalAlpha = 0.25
|
||||
this.ctx.fillStyle = this.cssVars.colorFill
|
||||
|
||||
this.ctx.beginPath()
|
||||
this.ctx.arc(m, d, 10 * PXSCALE, 0, 2 * Math.PI)
|
||||
this.ctx.fill()
|
||||
|
||||
this.clearRect = [m - 10 * PXSCALE, this.gaugePadding - 10 * PXSCALE, 20 * PXSCALE, height - 2 * this.gaugePadding + 20 * PXSCALE]
|
||||
|
||||
}
|
||||
|
||||
|
||||
this.ctx.beginPath()
|
||||
this.ctx.rect(this.gaugePadding, Math.min(d, height - 3 * PXSCALE), width - this.gaugePadding * 2, PXSCALE)
|
||||
this.ctx.fill()
|
||||
|
||||
this.clearRect = [0, 0, width, height]
|
||||
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -56,8 +56,6 @@ module.exports = class Knob extends Slider {
|
|||
|
||||
super(options)
|
||||
|
||||
this.widget.classList.add('knob')
|
||||
|
||||
this.lastOffsetX = 0
|
||||
this.lastOffsetY = 0
|
||||
this.minDimension = 0
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@
|
|||
}
|
||||
.widget.editing:after,
|
||||
.tablink.editing:after,
|
||||
.modal-container.editing .popup-wrapper:after {
|
||||
.modal-container.editing > .popup > .popup-wrapper:after {
|
||||
content:"";
|
||||
z-index: 999!important;
|
||||
position: absolute;
|
||||
|
|
@ -29,13 +29,18 @@
|
|||
|
||||
.editor-enabled {
|
||||
&:not(.no-grid) {
|
||||
.panel {
|
||||
background-image: linear-gradient(to bottom, var(--color-grid) 1rem, transparent 1rem),
|
||||
linear-gradient(to right, var(--color-grid) 1rem, transparent 1rem);
|
||||
--size: calc(var(--grid-width) * 1rem);
|
||||
background-size: var(--size) var(--size);
|
||||
background-attachment: local;
|
||||
background-position: 0rem 0;
|
||||
.root-container,
|
||||
.tab-container,
|
||||
.modal-container,
|
||||
.panel-container {
|
||||
> inner {
|
||||
background-image: linear-gradient(to bottom, var(--color-grid) 1rem, transparent 1rem),
|
||||
linear-gradient(to right, var(--color-grid) 1rem, transparent 1rem);
|
||||
--size: calc(var(--grid-width) * 1rem);
|
||||
background-size: var(--size) var(--size);
|
||||
background-attachment: local;
|
||||
background-position: 0rem 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -11,13 +11,13 @@
|
|||
input,
|
||||
textarea,
|
||||
{
|
||||
caret-color: var(--color-custom);
|
||||
caret-color: var(--color-widget);
|
||||
}
|
||||
|
||||
input:focus::selection,
|
||||
textarea:focus::selection,
|
||||
{
|
||||
background:var(--color-custom);
|
||||
background:var(--color-widget);
|
||||
color:var(--color-text);
|
||||
}
|
||||
input {
|
||||
|
|
@ -295,54 +295,6 @@ body {
|
|||
|
||||
|
||||
|
||||
#loading {
|
||||
position: fixed;
|
||||
top:50%;
|
||||
left:50%;
|
||||
margin-left:-15rem;
|
||||
margin-top:-15rem;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.spinner {
|
||||
display: block;
|
||||
margin: 0 auto;
|
||||
height:36rem;
|
||||
width:36rem;
|
||||
border-radius: 50%;
|
||||
border:5rem solid var(--color-light);
|
||||
position: relative;
|
||||
|
||||
&:before {
|
||||
content:"";
|
||||
position: absolute;
|
||||
left:-4rem;
|
||||
top:-4rem;
|
||||
right:-4rem;
|
||||
bottom:-4rem;
|
||||
border:4rem solid var(--color-bg);
|
||||
border-radius: 50%;
|
||||
}
|
||||
&:after {
|
||||
content:"";
|
||||
position: absolute;
|
||||
left:-3rem;
|
||||
top:-3rem;
|
||||
right:-3rem;
|
||||
bottom:-3rem;
|
||||
border:2rem solid var(--color-track);
|
||||
border-top:2rem solid var(--color-accent);
|
||||
transform: rotateZ(0deg);
|
||||
animation: spin .5s linear infinite;
|
||||
border-radius: 50%;
|
||||
}
|
||||
}
|
||||
|
||||
@keyframes spin {
|
||||
0% {transform: rotateZ(0deg);}
|
||||
100% {transform: rotateZ(360deg);}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -52,97 +52,97 @@
|
|||
// }
|
||||
// }
|
||||
|
||||
#options {
|
||||
box-shadow: 0 0 0 1rem var(--color-light) inset;
|
||||
background: var(--color-fg);
|
||||
padding: 8rem;
|
||||
flex: 1 1 auto;
|
||||
flex-shrink:0;
|
||||
|
||||
li {
|
||||
display: block;
|
||||
margin-bottom: 8rem;
|
||||
&:last-child {
|
||||
margin-bottom:0;
|
||||
}
|
||||
}
|
||||
}
|
||||
// #options {
|
||||
// box-shadow: 0 0 0 1rem var(--color-light) inset;
|
||||
// background: var(--color-fg);
|
||||
// padding: 8rem;
|
||||
// flex: 1 1 auto;
|
||||
// flex-shrink:0;
|
||||
//
|
||||
// li {
|
||||
// display: block;
|
||||
// margin-bottom: 8rem;
|
||||
// &:last-child {
|
||||
// margin-bottom:0;
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
|
||||
// }
|
||||
.actions {
|
||||
padding:0.5rem;
|
||||
background:var(--color-bg);
|
||||
display: flex;
|
||||
align-items: stretch;
|
||||
flex-wrap:wrap;
|
||||
.title {
|
||||
flex: 1 1 100%;
|
||||
background: var(--color-fg);
|
||||
box-shadow: 0 0 0 1rem var(--color-light) inset;
|
||||
padding: 13rem 10rem;
|
||||
position: relative;
|
||||
margin: 0.5rem;
|
||||
&.disabled {
|
||||
color:var(--color-text-fade);
|
||||
}
|
||||
&:before {
|
||||
content:"";
|
||||
position: absolute;
|
||||
top:0;
|
||||
left:0;
|
||||
right:0;
|
||||
bottom:0;
|
||||
box-shadow: 0 0 0 1rem;
|
||||
color:var(--color-bg);
|
||||
}
|
||||
|
||||
}
|
||||
a {
|
||||
// flex: 4 1 32%;
|
||||
flex:1;
|
||||
min-width: 32%;
|
||||
padding:13rem 10rem;
|
||||
display: block;
|
||||
text-align: center;
|
||||
position: relative;
|
||||
color:var(--color-text);
|
||||
overflow: visible;
|
||||
margin: 0.5rem;
|
||||
&.narrow {
|
||||
width: auto;
|
||||
min-width: 40rem;
|
||||
flex:0;
|
||||
}
|
||||
|
||||
|
||||
&.on {
|
||||
z-index: 0;
|
||||
color: var(--color-custom);
|
||||
&:not(.toggle) {
|
||||
pointer-events: none;
|
||||
}
|
||||
&: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 {
|
||||
content:"";
|
||||
position: absolute;
|
||||
top:0;
|
||||
left: 0;
|
||||
right: 0;
|
||||
bottom: 0;
|
||||
opacity: 0.3;
|
||||
box-shadow: 0 0 0 1rem var(--color-custom) inset;
|
||||
border-radius: inherit;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
// .actions {
|
||||
// padding:0.5rem;
|
||||
// background:var(--color-bg);
|
||||
// display: flex;
|
||||
// align-items: stretch;
|
||||
// flex-wrap:wrap;
|
||||
// .title {
|
||||
// flex: 1 1 100%;
|
||||
// background: var(--color-fg);
|
||||
// box-shadow: 0 0 0 1rem var(--color-light) inset;
|
||||
// padding: 13rem 10rem;
|
||||
// position: relative;
|
||||
// margin: 0.5rem;
|
||||
// &.disabled {
|
||||
// color:var(--color-text-fade);
|
||||
// }
|
||||
// &:before {
|
||||
// content:"";
|
||||
// position: absolute;
|
||||
// top:0;
|
||||
// left:0;
|
||||
// right:0;
|
||||
// bottom:0;
|
||||
// box-shadow: 0 0 0 1rem;
|
||||
// color:var(--color-bg);
|
||||
// }
|
||||
//
|
||||
// }
|
||||
// a {
|
||||
// // flex: 4 1 32%;
|
||||
// flex:1;
|
||||
// min-width: 32%;
|
||||
// padding:13rem 10rem;
|
||||
// display: block;
|
||||
// text-align: center;
|
||||
// position: relative;
|
||||
// color:var(--color-text);
|
||||
// overflow: visible;
|
||||
// margin: 0.5rem;
|
||||
// &.narrow {
|
||||
// width: auto;
|
||||
// min-width: 40rem;
|
||||
// flex:0;
|
||||
// }
|
||||
//
|
||||
//
|
||||
// &.on {
|
||||
// z-index: 0;
|
||||
// color: var(--color-custom);
|
||||
// &:not(.toggle) {
|
||||
// pointer-events: none;
|
||||
// }
|
||||
// &: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 {
|
||||
// content:"";
|
||||
// position: absolute;
|
||||
// top:0;
|
||||
// left: 0;
|
||||
// right: 0;
|
||||
// bottom: 0;
|
||||
// opacity: 0.3;
|
||||
// box-shadow: 0 0 0 1rem var(--color-custom) inset;
|
||||
// border-radius: inherit;
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// }
|
||||
// }
|
||||
|
|
|
|||
|
|
@ -6,45 +6,32 @@ $text: white;
|
|||
|
||||
:root {
|
||||
|
||||
////////////////////// COLOR SCHEME
|
||||
|
||||
--color-text: #{transparentize($text, .4)};
|
||||
--color-text-fade: #{transparentize($text, .6)};
|
||||
|
||||
--color-accent: #{$accent};
|
||||
// --color-grid: #{transparentize($accent, 0.95)};
|
||||
|
||||
--color-bg: #{$base};
|
||||
--color-track: #{desaturate(mix($base, $tone, 95), 2)};
|
||||
--color-fg: #{desaturate(mix($base, $tone, 88), 5)};
|
||||
--color-raised: #{desaturate(mix($base, $tone, 75), 5)};
|
||||
--color-light: #{desaturate(transparentize($tone, 0.90), 50)};
|
||||
////////////////////// old colors
|
||||
|
||||
--color-text-fade: pink;
|
||||
--color-bg: pink;
|
||||
--color-track: pink;
|
||||
--color-fg: pink;
|
||||
--color-raised: pink;
|
||||
--color-light: pink;
|
||||
--color-custom: pink;
|
||||
--color-white: white;
|
||||
|
||||
--color-notification: #{rgba(black, 0.8)};
|
||||
|
||||
////////////////////// AUTO
|
||||
|
||||
--color-custom: var(--color-accent);
|
||||
|
||||
|
||||
////////////////////// GLASS EFFET
|
||||
|
||||
--glass-opacity: 0.15;
|
||||
|
||||
////////////////////// MISC
|
||||
|
||||
--nav-height:40rem;
|
||||
--sidepanel-size:300rem;
|
||||
|
||||
--grid-width:10;
|
||||
--nav-height: 40rem;
|
||||
--grid-width: 10;
|
||||
|
||||
|
||||
--color-text: #{transparentize($text, .4)};
|
||||
|
||||
--color-accent: #{$accent};
|
||||
|
||||
--color-foreground: #{$base};
|
||||
--color-background: #{mix($base, black, 85)};
|
||||
|
||||
--color-grid: rgba(0,0,0, 0.1);
|
||||
--color-notification: #{rgba(black, 0.8)};
|
||||
|
||||
--color-context-menu: #{mix($base, white, 95)};
|
||||
--color-context-menu-text: #{transparentize($text, .2)};
|
||||
|
|
|
|||
|
|
@ -10,3 +10,4 @@
|
|||
@import 'ui/modal';
|
||||
@import 'ui/filebrowser';
|
||||
@import 'ui/lobby';
|
||||
@import 'ui/loading';
|
||||
|
|
|
|||
|
|
@ -210,7 +210,7 @@ osc-inspector-select {
|
|||
}
|
||||
|
||||
|
||||
.osc-inspector-color {
|
||||
osc-inspector-color {
|
||||
padding: 0;
|
||||
border: 0;
|
||||
box-shadow: 0;
|
||||
|
|
@ -218,7 +218,6 @@ osc-inspector-select {
|
|||
position: relative;
|
||||
font-family: mono;
|
||||
line-height: inherit;
|
||||
padding: 4rem;
|
||||
overflow: hidden;
|
||||
height: $field-height;
|
||||
width: $field-height;
|
||||
|
|
@ -227,12 +226,35 @@ osc-inspector-select {
|
|||
|
||||
cursor: pointer;
|
||||
|
||||
--color-fill: var(--color-picker-value);
|
||||
--alpha-fill: 1;
|
||||
--widget-padding: 4rem;
|
||||
@include pseudo-fill();
|
||||
&:after {
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
.color-picker-modal {
|
||||
padding: 8rem;
|
||||
background: var(--color-background);
|
||||
|
||||
.widget {
|
||||
background: var(--color-foreground);
|
||||
}
|
||||
|
||||
.actions {
|
||||
margin-top: 8rem;
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
.btn {
|
||||
flex: 1;
|
||||
text-align: center;
|
||||
}
|
||||
:first-child {
|
||||
margin-right: 8rem;
|
||||
}
|
||||
}
|
||||
|
||||
&::-webkit-color-swatch {
|
||||
border: none;
|
||||
}
|
||||
&::-webkit-color-swatch-wrapper {
|
||||
padding: 0;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
39
src/scss/ui/loading.scss
Normal file
39
src/scss/ui/loading.scss
Normal file
|
|
@ -0,0 +1,39 @@
|
|||
|
||||
#loading {
|
||||
position: fixed;
|
||||
top:50%;
|
||||
left:50%;
|
||||
margin-left:-15rem;
|
||||
margin-top:-15rem;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.spinner {
|
||||
display: block;
|
||||
margin: 0 auto;
|
||||
height:36rem;
|
||||
width:36rem;
|
||||
border-radius: 50%;
|
||||
position: relative;
|
||||
margin: 20rem auto;
|
||||
|
||||
|
||||
&:after {
|
||||
content:"";
|
||||
position: absolute;
|
||||
left:-3rem;
|
||||
top:-3rem;
|
||||
right:-3rem;
|
||||
bottom:-3rem;
|
||||
border:4rem solid var(--color-background);
|
||||
border-top: 2rem solid var(--color-widget);
|
||||
transform: rotateZ(0deg);
|
||||
animation: spin .5s linear infinite;
|
||||
border-radius: 50%;
|
||||
}
|
||||
}
|
||||
|
||||
@keyframes spin {
|
||||
0% {transform: rotateZ(0deg);}
|
||||
100% {transform: rotateZ(360deg);}
|
||||
}
|
||||
|
|
@ -1,5 +1,27 @@
|
|||
@keyframes popup-backdrop-fade-in {
|
||||
0% {opacity: 0}
|
||||
100% {opacity: .1}
|
||||
}
|
||||
|
||||
.popup {
|
||||
|
||||
&:before {
|
||||
|
||||
content: "";
|
||||
position: fixed;
|
||||
top:0rem;
|
||||
left:0;
|
||||
right:0;
|
||||
bottom:0;
|
||||
background: black;
|
||||
opacity: .1;
|
||||
pointer-events: none;
|
||||
animation: popup-backdrop-fade-in .25s forwards;
|
||||
|
||||
}
|
||||
|
||||
// backdrop-filter: blur(1rem);
|
||||
|
||||
position: fixed;
|
||||
top:0;
|
||||
left:0;
|
||||
|
|
@ -10,21 +32,11 @@
|
|||
justify-content: center;
|
||||
z-index: 99999999;
|
||||
display: none;
|
||||
// backdrop-filter: blur(1rem); // perf hit
|
||||
|
||||
&.show {
|
||||
display: flex;
|
||||
}
|
||||
&:before {
|
||||
content: "";
|
||||
position: absolute;
|
||||
top:0rem;
|
||||
left:0;
|
||||
right:0;
|
||||
bottom:0;
|
||||
background: black;
|
||||
opacity: .1;
|
||||
}
|
||||
|
||||
.popup-title {
|
||||
position: relative;
|
||||
min-height: var(--nav-height);
|
||||
|
|
|
|||
|
|
@ -44,7 +44,7 @@ osc-panel-container {
|
|||
::-webkit-scrollbar-thumb, ::-webkit-scrollbar-track-piece {
|
||||
border-color: var(--color-background)!important;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
&.left:after {
|
||||
right: -1rem;
|
||||
|
|
@ -158,8 +158,7 @@ osc-panel-inner {
|
|||
overflow: hidden;
|
||||
z-index: 3;
|
||||
min-width: 0;
|
||||
|
||||
|
||||
position: relative;
|
||||
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -189,11 +189,3 @@
|
|||
}
|
||||
|
||||
}
|
||||
|
||||
.widget.menu-container > .label:after {
|
||||
content:"\f58d";
|
||||
transform: none;
|
||||
font-size: 12rem;
|
||||
top:3rem;
|
||||
right:6rem;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -13,8 +13,14 @@
|
|||
height: 100rem;
|
||||
|
||||
contain: strict;
|
||||
@supports not (contain: strict) {
|
||||
transform: rotateZ(0); // force new stacking context
|
||||
}
|
||||
|
||||
-webkit-tap-highlight-color:transparent;
|
||||
|
||||
// transform-origin: top left;
|
||||
|
||||
--widget-padding: 1rem;
|
||||
|
||||
--color-stroke:var(--color-widget);
|
||||
|
|
@ -60,13 +66,16 @@
|
|||
|
||||
canvas {
|
||||
flex: 1;
|
||||
height: auto;
|
||||
min-height: 0;
|
||||
min-width: 0;
|
||||
}
|
||||
|
||||
> inner {
|
||||
overflow: hidden;
|
||||
position: relative;
|
||||
flex: 1;
|
||||
border-radius: inherit;
|
||||
}
|
||||
|
||||
&.no-interaction {
|
||||
|
|
|
|||
|
|
@ -16,6 +16,7 @@
|
|||
flex: 1;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
z-index: -1;
|
||||
|
||||
@include pseudo-stroke();
|
||||
@include pseudo-fill();
|
||||
|
|
@ -31,7 +32,6 @@
|
|||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
z-index: 1;
|
||||
color: var(--color-text);
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@
|
|||
width: 100%;
|
||||
height: 100%;
|
||||
background-color: var(--color-foreground);
|
||||
> .panel {
|
||||
> inner {
|
||||
|
||||
flex: 1;
|
||||
flex-direction: column;
|
||||
|
|
@ -17,7 +17,7 @@
|
|||
flex: 1;
|
||||
width: 100%;
|
||||
height: auto;
|
||||
> .panel {
|
||||
> inner {
|
||||
margin: calc(var(--widget-spacing) / 2);
|
||||
}
|
||||
}
|
||||
|
|
@ -33,7 +33,7 @@
|
|||
background-clip: content-box;
|
||||
|
||||
|
||||
> .panel {
|
||||
> inner {
|
||||
--widget-spacing: var(--widget-padding);
|
||||
flex: 1;
|
||||
position: relative;
|
||||
|
|
@ -41,20 +41,20 @@
|
|||
margin: calc(var(--widget-spacing) / 2) calc(1rem + var(--widget-spacing) / 2) calc(1rem + var(--widget-spacing) / 2);
|
||||
}
|
||||
|
||||
&.noscroll > .panel {
|
||||
&.no-scroll > inner {
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
&.contains-widgets {
|
||||
|
||||
> .panel > .widget {
|
||||
> inner > .widget {
|
||||
padding: calc(var(--widget-spacing) / 2);
|
||||
}
|
||||
|
||||
&.layout-default > .panel {
|
||||
&.layout-default > inner {
|
||||
display: block;
|
||||
}
|
||||
&.layout-horizontal > .panel {
|
||||
&.layout-horizontal > inner {
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
align-items: stretch;
|
||||
|
|
@ -67,7 +67,7 @@
|
|||
max-height: 100%;
|
||||
}
|
||||
}
|
||||
&.layout-vertical > .panel {
|
||||
&.layout-vertical > inner {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: stretch;
|
||||
|
|
@ -81,7 +81,7 @@
|
|||
}
|
||||
|
||||
}
|
||||
&.layout-grid > .panel {
|
||||
&.layout-grid > inner {
|
||||
display: grid;
|
||||
> .widget {
|
||||
top:auto!important;
|
||||
|
|
@ -101,7 +101,7 @@
|
|||
|
||||
&.contains-tabs {
|
||||
|
||||
> .panel {
|
||||
> inner {
|
||||
|
||||
--widget-spacing: 0;
|
||||
|
||||
|
|
@ -164,11 +164,11 @@
|
|||
}
|
||||
}
|
||||
|
||||
&.contains-widgets.nolabel > .panel {
|
||||
&.contains-widgets.nolabel > inner {
|
||||
border-top: 1rem solid var(--color-foreground);
|
||||
}
|
||||
|
||||
&.contains-tabs > .panel > .navigation {
|
||||
&.contains-tabs > inner > .navigation {
|
||||
margin: 0 1rem;
|
||||
}
|
||||
|
||||
|
|
@ -323,9 +323,10 @@
|
|||
flex: 1;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
border-radius: inherit;
|
||||
|
||||
@include pseudo-stroke();
|
||||
@include pseudo-fill();
|
||||
@include pseudo-fill($z: -1);
|
||||
|
||||
}
|
||||
|
||||
|
|
@ -366,10 +367,13 @@
|
|||
}
|
||||
|
||||
&.on {
|
||||
z-index: 9999999999999!important;
|
||||
contain: size;
|
||||
@supports not (contain: strict) {
|
||||
transform: none; // cancel new stacking context
|
||||
}
|
||||
|
||||
z-index: 9999999999999!important;
|
||||
overflow: visible;
|
||||
border-radius: 0!important; // border radius breaks it somehow
|
||||
> .toggle {
|
||||
--alpha-fill:var(--alpha-fill-on);
|
||||
}
|
||||
|
|
@ -385,7 +389,7 @@
|
|||
|
||||
|
||||
|
||||
> .panel {
|
||||
> inner {
|
||||
display: none;
|
||||
}
|
||||
> .popup {
|
||||
|
|
@ -403,7 +407,7 @@
|
|||
content: none;
|
||||
}
|
||||
|
||||
> .panel {
|
||||
> inner {
|
||||
margin: calc(var(--widget-spacing) / 2) calc(var(--widget-spacing) / 2) calc(var(--widget-spacing) / 2);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -52,13 +52,10 @@
|
|||
caret-color: var(--color-fill);
|
||||
|
||||
|
||||
&:focus {
|
||||
color:var(--color-text-fade);
|
||||
}
|
||||
|
||||
&:focus::selection {
|
||||
color:var(--color-fill);
|
||||
background: transparent;
|
||||
background: var(--color-fill);
|
||||
color: var(--color-foreground);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,18 +1,18 @@
|
|||
.keyboard-container {
|
||||
|
||||
--widget-padding: 0;
|
||||
--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: #ddd;
|
||||
--color-black-key: #111;
|
||||
--color-white-key: #ccc;
|
||||
--color-black-key: #1A1A1A;
|
||||
|
||||
--widget-keypad: var(--widget-padding);
|
||||
|
||||
.panel {
|
||||
> inner {
|
||||
|
||||
padding: var(--widget-padding);
|
||||
flex: 1;
|
||||
|
|
|
|||
|
|
@ -32,3 +32,87 @@
|
|||
}
|
||||
|
||||
}
|
||||
|
||||
.rgb-container {
|
||||
|
||||
--widget-padding: 4rem;
|
||||
|
||||
> inner {
|
||||
|
||||
display: grid;
|
||||
|
||||
@include pseudo-stroke($z: 1);
|
||||
|
||||
--widget-spacing: var(--widget-padding);
|
||||
|
||||
padding: calc(var(--widget-spacing) / 2 + 1rem);
|
||||
|
||||
grid-template:
|
||||
"a a b" auto / 1fr;
|
||||
|
||||
}
|
||||
|
||||
&.contains-alpha > inner {
|
||||
grid-template:
|
||||
"a a b" auto
|
||||
"c c c" 20rem / 1fr;
|
||||
}
|
||||
|
||||
.widget {
|
||||
height: auto;
|
||||
width: auto;
|
||||
margin: calc(var(--widget-spacing) / 2);
|
||||
--widget-padding: 2rem;//calc(var(--widget-spacing) / 2);
|
||||
}
|
||||
|
||||
.pad {
|
||||
grid-area: a;
|
||||
|
||||
background-color: red;
|
||||
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%);
|
||||
--color-fill: black;
|
||||
--color-stroke: white;
|
||||
--alpha-fill-off: 1;
|
||||
--alpha-fill-on: 1;
|
||||
--alpha-stroke: 1;
|
||||
inner {
|
||||
&:after, &:before {
|
||||
content: none;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.hue {
|
||||
grid-area: b;
|
||||
width: 20rem;
|
||||
|
||||
--color-fill: white;
|
||||
// --color-stroke: white;
|
||||
--alpha-fill-off: 0.5;
|
||||
--alpha-fill-on: 0;
|
||||
--alpha-stroke: 0;
|
||||
--widget-padding: -1rem;
|
||||
|
||||
&:after {
|
||||
content:"";
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 2rem;
|
||||
right: 2rem;
|
||||
bottom: 0;
|
||||
background: linear-gradient(to top, #F00, #FF0080, #F0F, #8000FF, #00F, #0080FF, #0FF, #00FF80, #0F0, #80FF00, #FF0, #FF8000, #F00) repeat scroll 0% 0%;
|
||||
opacity: 0.75;
|
||||
z-index: -1;
|
||||
}
|
||||
}
|
||||
|
||||
.alpha {
|
||||
grid-area: c;
|
||||
|
||||
--alpha-stroke: 0;
|
||||
--alpha-fill-off: 0.1;
|
||||
--alpha-fill-on: 0.25;
|
||||
--widget-padding: -1rem;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -20,6 +20,13 @@
|
|||
|
||||
--widget-padding: 1rem;
|
||||
|
||||
&.alt {
|
||||
--widget-padding: 10rem;
|
||||
--alpha-fill-off: 0.25;
|
||||
--alpha-fill-on: 1;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
.knob-container,
|
||||
|
|
|
|||
|
|
@ -99,7 +99,7 @@ if (settings.cli) {
|
|||
app.on('ready',function(){
|
||||
global.settings = settings
|
||||
global.midilist = require('./midi').list
|
||||
launcher = require('./electron-window')({address:address, shortcuts:dev, width:680, height:(100 + 8*3 + 29 * Object.keys(settings.options).filter(x=>settings.options[x].launcher !== false).length), node:true, color:'#253040'})
|
||||
launcher = require('./electron-window')({address:address, shortcuts:dev, width:680, height:(100 + 8*3 + 29 * Object.keys(settings.options).filter(x=>settings.options[x].launcher !== false).length), node:true, color:'#151a24'})
|
||||
launcher.on('close', ()=>{
|
||||
process.stdout.write = stdoutWrite
|
||||
process.stderr.write = stderrWrite
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@ class Theme {
|
|||
this.files = []
|
||||
this.css = []
|
||||
|
||||
this.defaultColor = '#191f2a'
|
||||
this.defaultColor = '#151a24'
|
||||
this.backgroundColor = this.defaultColor
|
||||
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue