Files: 55335207126eb15c3a0f1834ffb8bbcbd32658a8 / app / html / settings / accessibility.js
1537 bytesRaw
1 | const nest = require('depnest') |
2 | const { h, when } = require('mutant') |
3 | |
4 | exports.gives = nest({ |
5 | 'app.html.settings': true |
6 | }) |
7 | |
8 | exports.needs = nest({ |
9 | 'settings.obs.get': 'first' |
10 | }) |
11 | |
12 | exports.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