Files: ce182a6ed828db9aa940f352cf28de6409530165 / app / page / settings.js
1044 bytesRaw
1 | const nest = require('depnest') |
2 | const { h } = require('mutant') |
3 | const insertCss = require('insert-css') |
4 | const compileCss = require('micro-css') |
5 | |
6 | exports.gives = nest({ |
7 | 'app.html.menuItem': true, |
8 | 'app.page.settings': true |
9 | }) |
10 | |
11 | exports.needs = nest({ |
12 | 'app.sync.goTo': 'first' |
13 | }) |
14 | |
15 | exports.create = function (api) { |
16 | return nest({ |
17 | 'app.html.menuItem': menuItem, |
18 | 'app.page.settings': publicPage |
19 | }) |
20 | |
21 | function menuItem () { |
22 | return h('a', { |
23 | style: { order: 1 }, |
24 | 'ev-click': () => api.app.sync.goTo({ page: 'settings' }) |
25 | }, '/settings') |
26 | } |
27 | |
28 | function publicPage (location) { |
29 | const styles = h('textarea') |
30 | return h('SettingsPage', [ |
31 | styles, |
32 | h('button', {'ev-click': () => peachify(styles)}, 'peachify') |
33 | ]) |
34 | |
35 | function peachify (styles) { |
36 | const css = compileCss(styles.value) |
37 | // body{ |
38 | // background-color: peachpuff; |
39 | // color: indigo; } |
40 | |
41 | // a:link, a:visited, a:active { |
42 | // color: #116a6a; } |
43 | // ` |
44 | insertCss(css) |
45 | } |
46 | } |
47 | |
48 | } |
49 |
Built with git-ssb-web