git ssb

2+

mixmix / ticktack



Commit 1c95e6d66767b4da13c66d99d302553400ea4698

Merge remote-tracking branch 'origin/onboarding'

Dominic Tarr committed on 12/8/2017, 6:35:39 AM
Parent: 162122b46e57bbd1cb6ff6774e6b40502586e89b
Parent: bf0484208f1c2b6a1538391538398b5d7c38ea7a

Files changed

app/html/app.jschanged
app/html/header.jschanged
app/index.jschanged
app/page/splash.jsadded
app/page/splash.mcssadded
assets/logo_and_name.pngadded
assets/splash.svgadded
router/sync/routes.jschanged
translations/en.jschanged
app/html/app.jsView
@@ -29,28 +29,38 @@
2929 page
3030 ])
3131 }
3232
33- const isOnboarded = api.settings.sync.get('onboarded')
34- if (isOnboarded)
35- api.history.sync.push({page: 'blogIndex'})
36- else {
37- api.history.sync.push({
38- page:'userEdit',
39- feed: api.keys.sync.id(),
40- callback: (err, didEdit) => {
41- if (err) throw new Error ('Error editing profile', err)
33+ startApp()
4234
43- if (didEdit)
44- api.settings.sync.set({ onboarded: true })
35+ return app
36+ }
37+ })
4538
46- api.history.sync.push({ page: 'blogIndex' })
47- }
48- })
49- }
39+ function startApp () {
40+ api.history.sync.push({page: 'splash'})
5041
42+ setTimeout(enterApp, 2000)
43+ }
5144
52- return app
45+ function enterApp() {
46+ const isOnboarded = api.settings.sync.get('onboarded')
47+ if (isOnboarded)
48+ api.history.sync.push({page: 'blogIndex'})
49+ else {
50+ api.history.sync.push({
51+ page:'userEdit',
52+ feed: api.keys.sync.id(),
53+ callback: (err, didEdit) => {
54+ if (err) throw new Error ('Error editing profile', err)
55+
56+ // if they clicked something, just mark them onboarded
57+ api.settings.sync.set({ onboarded: true })
58+
59+ api.history.sync.push({ page: 'blogIndex' })
60+ }
61+ })
5362 }
54- })
63+
64+ }
5565 }
5666
app/html/header.jsView
@@ -17,12 +17,13 @@
1717 const { location, push } = nav
1818
1919 const loc = computed(location, location => {
2020 if (typeof location != 'object') return {}
21-
22- return location || {}
21+ return location
2322 })
2423
24+ if (loc().page === 'splash') return
25+
2526 const isSettings = computed(loc, loc => {
2627 return SETTINGS_PAGES.includes(loc.page)
2728 })
2829
app/index.jsView
@@ -29,8 +29,9 @@
2929 // threadShow: require('./page/threadShow'),
3030 userEdit: require('./page/userEdit'),
3131 // userFind: require('./page/userFind'),
3232 userShow: require('./page/userShow'),
33+ splash: require('./page/splash'),
3334 threadNew: require('./page/threadNew'),
3435 threadShow: require('./page/threadShow'),
3536 },
3637 sync: {
app/page/splash.jsView
@@ -1,0 +1,43 @@
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+}
app/page/splash.mcssView
@@ -1,0 +1,52 @@
1+Splash {
2+ position: fixed
3+ top: 0
4+ bottom: 0
5+ left: 0
6+ right: 0
7+
8+
9+ div.top {
10+ height: 11vh
11+ background-color: #2f5ea1
12+
13+ img.logoName {
14+ margin: 1vw
15+ }
16+ }
17+
18+ div.bottom {
19+ width: 100%
20+ height: 100%
21+ background-size: contain
22+ background-repeat: no-repeat
23+ $backgroundPrimary
24+
25+ padding-top: 26vw
26+ text-align: center
27+
28+ display: flex
29+ flex-direction: column
30+ align-items: center
31+
32+
33+ div.about {
34+ color: #666
35+ font-size: 1.5rem
36+ line-height: 1.5
37+
38+ max-width: 40vw
39+ margin-bottom: 2vw
40+ }
41+
42+ pre.slogan {
43+ color: #2f5ea1
44+ font-size: 2.5rem
45+ font-family: cursive, serif
46+ font-style: italic
47+ line-height: 1.2
48+ }
49+
50+ }
51+}
52+
assets/logo_and_name.png
assets/logo_and_name.png
assets/splash.svg
assets/splash.svg
router/sync/routes.jsView
@@ -19,8 +19,9 @@
1919 // 'app.page.groupShow': 'first',
2020 'app.page.userEdit': 'first',
2121 // 'app.page.userFind': 'first',
2222 'app.page.userShow': 'first',
23+ 'app.page.splash': 'first',
2324 'app.page.threadNew': 'first',
2425 'app.page.threadShow': 'first',
2526 // 'app.page.image': 'first',
2627 'blob.sync.url': 'first',
@@ -31,8 +32,9 @@
3132 const pages = api.app.page
3233 // route format: [ routeValidator, routeFunction ]
3334
3435 const routes = [
36+ [ location => location.page === 'splash', pages.splash ],
3537
3638 // Blog pages
3739 [ location => location.page === 'blogIndex', pages.blogIndex ],
3840 [ location => location.page === 'blogNew', pages.blogNew ],
translations/en.jsView
@@ -1,5 +1,11 @@
11 module.exports = {
2+ splash: {
3+ about: `A new era social network for people who have faith in a decentralized world that values openness, equalty, and freedom`,
4+ slogan: `Connecting the Unconnected
5+Building Honest Communication
6+`
7+ },
28 blogIndex: {
39 title: 'Discover',
410 },
511 blogNav: {

Built with git-ssb-web