git ssb

2+

mixmix / ticktack



Tree: 3d4eca03f309655578710ab4453f309c514268d1

Files: 3d4eca03f309655578710ab4453f309c514268d1 / app / page / splash.js

1081 bytesRaw
1const nest = require('depnest')
2const { h } = require('mutant')
3const path = require('path')
4
5exports.gives = nest('app.page.splash')
6
7exports.needs = nest({
8 'translations.sync.strings': 'first'
9})
10
11exports.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 svg = assetPath('splash.svg')
20
21 const style = {
22 'background': require('../../assets/splash-svg.js'),
23 'background-repeat': 'no-repeat',
24 'background-size': 'contain'
25 }
26
27 return h('Splash', [
28 h('div.top', [
29 h('img.logoName', { src: assetPath('logo_and_name.png') })
30 ]),
31 h('div.bottom', { style }, [
32 h('div.about', random(strings.splash.about)),
33 h('pre.slogan', strings.splash.slogan)
34 ])
35 ])
36 }
37}
38
39function assetPath (name) {
40 return path.join(__dirname, '../../assets', name)
41}
42
43function random (arr) {
44 const i = Math.floor(Math.random() * arr.length)
45 return arr[i]
46}
47
48

Built with git-ssb-web