git ssb

2+

mixmix / ticktack



Tree: aed5ebed79d6ab447fb2352806b064238968e9a4

Files: aed5ebed79d6ab447fb2352806b064238968e9a4 / app / page / splash.js

1102 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 console.log(svg)
21
22 const style = {
23 'background': require('../../assets/splash-svg.js'),
24 'background-repeat': 'no-repeat',
25 'background-size': 'contain'
26 }
27
28 return h('Splash', [
29 h('div.top', [
30 h('img.logoName', { src: assetPath('logo_and_name.png') })
31 ]),
32 h('div.bottom', { style }, [
33 h('div.about', random(strings.splash.about)),
34 h('pre.slogan', strings.splash.slogan)
35 ])
36 ])
37 }
38}
39
40function assetPath (name) {
41 return path.join(__dirname, '../../assets', name)
42}
43
44function random (arr) {
45 const i = Math.floor(Math.random() * arr.length)
46 return arr[i]
47}
48
49

Built with git-ssb-web