Files: 26eb63b836af90470db4e83dd22d952a85c08061 / app / page / splash.js
1039 bytesRaw
1 | const nest = require('depnest') |
2 | const { h } = require('mutant') |
3 | const path = require('path') |
4 | |
5 | exports.gives = nest('app.page.splash') |
6 | |
7 | exports.needs = nest({ |
8 | 'translations.sync.strings': 'first' |
9 | }) |
10 | |
11 | exports.create = (api) => { |
12 | return nest('app.page.splash', splash) |
13 | |
14 | function splash (location) { |
15 | // location is an object { feed, page: 'splash', callback } |
16 | |
17 | const strings = api.translations.sync.strings() |
18 | |
19 | const style = { |
20 | 'background-image': assetUrl('splash.svg') |
21 | } |
22 | |
23 | return h('Splash', [ |
24 | // h('div.top'), |
25 | h('div.top', [ |
26 | // h('div.logoName', { style: { 'background-image': assetUrl('logo_and_name.png')} } ) |
27 | h('img.logoName', { src: assetPath('logo_and_name.png') }) |
28 | ]), |
29 | h('div.bottom', { style }, [ |
30 | h('div.about', strings.splash.about), |
31 | h('pre.slogan', strings.splash.slogan), |
32 | ]) |
33 | ]) |
34 | } |
35 | } |
36 | |
37 | function assetPath (name) { |
38 | return path.join(__dirname, '../../assets', name) |
39 | } |
40 | |
41 | function assetUrl (name) { |
42 | return `url(${assetPath(name)})` |
43 | } |
44 |
Built with git-ssb-web