git ssb

16+

Dominic / patchbay



Tree: 1e573fd55bd3d16562c5727c0fbc36d3b65328ee

Files: 1e573fd55bd3d16562c5727c0fbc36d3b65328ee / app / html / settings / accessibility.js

1537 bytesRaw
1const nest = require('depnest')
2const { h, when } = require('mutant')
3
4exports.gives = nest({
5 'app.html.settings': true
6})
7
8exports.needs = nest({
9 'settings.obs.get': 'first'
10})
11
12exports.create = function (api) {
13 return nest({
14 'app.html.settings': accessibility
15 })
16
17 function accessibility () {
18 const invert = api.settings.obs.get('patchbay.accessibility.invert')
19 const saturation = api.settings.obs.get('patchbay.accessibility.saturation')
20 const brightness = api.settings.obs.get('patchbay.accessibility.brightness')
21 const contrast = api.settings.obs.get('patchbay.accessibility.contrast')
22
23 return {
24 group: 'accessibility',
25 title: 'Accessibility Styles',
26 body: h('AccessibilityStyles', [
27 h('div', { 'ev-click': () => invert.set(!invert()) }, [
28 h('label', 'Invert colors'),
29 h('i.fa', { className: when(invert, 'fa-check-square', 'fa-square-o') })
30 ]),
31 h('div', [
32 h('label', 'Saturation'),
33 h('input', { type: 'range', min: 0, max: 100, value: saturation, 'ev-input': ev => saturation.set(ev.target.value) })
34 ]),
35 h('div', [
36 h('label', 'Brightness'),
37 h('input', { type: 'range', min: 0, max: 100, value: brightness, 'ev-input': ev => brightness.set(ev.target.value) })
38 ]),
39 h('div', [
40 h('label', 'Contrast'),
41 h('input', { type: 'range', min: 0, max: 100, value: contrast, 'ev-input': ev => contrast.set(ev.target.value) })
42 ])
43 ])
44 }
45 }
46}
47

Built with git-ssb-web