Files: fd0e5304bd3777aa0d1bedb42467e378508b89cd / app / html / settings / accessibility.js
1548 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', false) |
19 | const saturation = api.settings.obs.get('patchbay.accessibility.saturation', 100) |
20 | const brightness = api.settings.obs.get('patchbay.accessibility.brightness', 100) |
21 | const contrast = api.settings.obs.get('patchbay.accessibility.contrast', 100) |
22 | |
23 | invert(console.log) |
24 | |
25 | return { |
26 | title: 'Accessibility', |
27 | body: h('AccessibilityStyles', [ |
28 | h('div', { 'ev-click': () => invert.set(!invert()) }, [ |
29 | h('label', 'Invert colors'), |
30 | h('i.fa', { className: when(invert, 'fa-check-square', 'fa-square-o') }) |
31 | ]), |
32 | h('div', [ |
33 | h('label', 'Saturation'), |
34 | h('input', { type: 'range', min: 0, max: 100, value: saturation, 'ev-input': ev => saturation.set(ev.target.value) }) |
35 | ]), |
36 | h('div', [ |
37 | h('label', 'Brightness'), |
38 | h('input', { type: 'range', min: 0, max: 100, value: brightness, 'ev-input': ev => brightness.set(ev.target.value) }) |
39 | ]), |
40 | h('div', [ |
41 | h('label', 'Contrast'), |
42 | h('input', { type: 'range', min: 0, max: 100, value: contrast, 'ev-input': ev => contrast.set(ev.target.value) }) |
43 | ]) |
44 | ]) |
45 | } |
46 | } |
47 | } |
48 | |
49 |
Built with git-ssb-web