Files: d50d366baa6cc2cb6d544429e5f100b7b0c6d604 / modules_basic / scroller.js
607 bytesRaw
1 | const fs = require('fs') |
2 | const h = require('../h') |
3 | |
4 | exports.gives = { |
5 | build_scroller: true, |
6 | mcss: true |
7 | } |
8 | |
9 | exports.create = function (api) { |
10 | return { |
11 | build_scroller, |
12 | mcss: () => fs.readFileSync(__filename.replace(/js$/, 'mcss'), 'utf8') |
13 | } |
14 | |
15 | function build_scroller ({ prepend = [], append = [] } = {}) { |
16 | const content = h('section.content') |
17 | |
18 | const container = h('Scroller', { style: { overflow: 'auto' } }, [ |
19 | h('div.wrapper', [ |
20 | h('header', prepend), |
21 | content, |
22 | h('footer', append) |
23 | ]) |
24 | ]) |
25 | |
26 | return { |
27 | content, |
28 | container |
29 | } |
30 | } |
31 | } |
32 | |
33 |
Built with git-ssb-web