git ssb

2+

mixmix / ticktack



Commit 2034e26ec445a1737076fd296563818d32051af1

first pass dark them

mix irving committed on 5/9/2018, 12:49:42 AM
Parent: 81bbaa6bd8489fef897a37bb689a642019279f22

Files changed

app/html/header.jschanged
app/html/header.mcsschanged
app/html/sideNav/sideNav.mcsschanged
app/page/settings.jschanged
app/sync/initialize/settings.jschanged
app/sync/initialize/styles.jschanged
package-lock.jsonchanged
package.jsonchanged
translations/en.jschanged
app/html/header.jsView
@@ -28,21 +28,27 @@
2828
2929 return h('Header', [
3030 windowControls(),
3131 h('nav', [
32- h('img.feed', {
33- src: when(isFeed, assetPath('feed_on.png'), assetPath('feed.png')),
34- 'ev-click': () => push({page: 'blogIndex'})
35- }),
36- h('img.addressBook', {
37- src: when(isAddressBook, assetPath('address_bk_on.png'), assetPath('address_bk.png')),
38- 'ev-click': () => push({page: 'addressBook'})
39- }),
40- h('img.settings', {
41- src: when(isSettings, assetPath('settings_on.png'), assetPath('settings.png')),
42- 'ev-click': () => push({page: 'settings'})
43- }),
44- h('i.fa', {
32 + h('i.feed', [
33 + h('img', {
34 + src: when(isFeed, assetPath('feed_on.png'), assetPath('feed.png')),
35 + 'ev-click': () => push({page: 'blogIndex'})
36 + })
37 + ]),
38 + h('i.addressBook', [
39 + h('img', {
40 + src: when(isAddressBook, assetPath('address_bk_on.png'), assetPath('address_bk.png')),
41 + 'ev-click': () => push({page: 'addressBook'})
42 + })
43 + ]),
44 + h('i.settings', [
45 + h('img.settings', {
46 + src: when(isSettings, assetPath('settings_on.png'), assetPath('settings.png')),
47 + 'ev-click': () => push({page: 'settings'})
48 + })
49 + ]),
50 + h('i.notifications.fa', {
4551 className: when(isNotifications, 'fa-bell', 'fa-bell-o'),
4652 'ev-click': () => push({page: 'statsShow'})
4753 })
4854 ])
app/html/header.mcssView
@@ -28,17 +28,19 @@
2828 display: flex
2929 align-items: center
3030 justify-content: center
3131
32- img, i {
32 + i {
3333 cursor: pointer
3434 text-decoration: none
35 + font-size: 1.4rem
3536
37 + display: flex
3638 margin: 0 2rem
3739 }
3840
39- i { font-size: 1.4rem }
40- i.fa-bell-o { color: #7da9ea }
41 + i.notifications { color: #7da9ea }
42 + i.fa-bell.notifications { color: #fff }
4143
4244 (a) {
4345 color: #222
4446 margin-right: 1rem
app/html/sideNav/sideNav.mcssView
@@ -60,8 +60,9 @@
6060 div.spacer {
6161 display: flex
6262 align-self: center
6363 div.alert {
64 + z-index: 99
6465 position: relative
6566 width: 1.2rem
6667 height: 1.2rem
6768 border-radius: 1rem
app/page/settings.jsView
@@ -80,8 +80,12 @@
8080 h('section -zoom', [
8181 h('div.left', strings.settingsPage.section.zoom),
8282 h('div.right', [zoomButton(-0.1, '-'), zoomButton(+0.1, '+')])
8383 ]),
84 + h('section -theme', [
85 + h('div.left', strings.settingsPage.section.theme),
86 + h('div.right', ['light', 'dark'].map(Theme))
87 + ]),
8488 h('section -sharing', [
8589 h('div.left', strings.share.settings.caption),
8690 h('div.right', [].concat(
8791 webSharingOption('public', strings.share.settings.publicOption),
@@ -108,8 +112,21 @@
108112 strings.languages[lang]
109113 )
110114 }
111115
116 + function Theme (theme) {
117 + const currentTheme = api.settings.obs.get('ticktack.theme')
118 + const className = computed(currentTheme, t => t === theme ? '-strong' : '')
119 +
120 + return h('Button -language',
121 + {
122 + 'ev-click': () => currentTheme.set(theme),
123 + className
124 + },
125 + strings.themes[theme]
126 + )
127 + }
128 +
112129 function zoomButton (increment, symbol) {
113130 const { getCurrentWebContents } = electron.remote
114131 return h('Button -zoom',
115132 {
app/sync/initialize/settings.jsView
@@ -14,9 +14,10 @@
1414 ticktack: {
1515 websharemetrics: 'public',
1616 electron: {
1717 zoomFactor: 1
18- }
18 + },
19 + theme: 'light'
1920 }
2021 }
2122
2223 exports.create = function (api) {
app/sync/initialize/styles.jsView
@@ -1,19 +1,43 @@
11 const nest = require('depnest')
2-const insertCss = require('insert-css')
2 +const { h, computed } = require('mutant')
33 const values = require('lodash/values')
44
55 exports.gives = nest('app.sync.initialize')
66
77 exports.needs = nest({
8- 'styles.css': 'reduce'
8 + 'styles.css': 'reduce',
9 + 'settings.obs.get': 'first'
910 })
1011
12 +const darkMod = `
13 +body {
14 + filter: invert(88%);
15 +}
16 +
17 +body .Page img {
18 + filter: invert();
19 +}
20 +div.Thumbnail {
21 + filter: invert();
22 +}
23 +body .Lightbox img {
24 + filter: invert();
25 +}
26 +`
27 +
1128 exports.create = (api) => {
1229 return nest({
1330 'app.sync.initialize': function initializeStyles () {
1431 console.log('> initialise: styles')
1532 const css = values(api.styles.css()).join('\n')
16- insertCss(css)
33 +
34 + document.head.appendChild(
35 + h('style', {
36 + innerHTML: computed(api.settings.obs.get('ticktack.theme'), theme => {
37 + return [css, theme === 'dark' ? darkMod : ''].join('\n')
38 + })
39 + })
40 + )
1741 }
1842 })
1943 }
package-lock.jsonView
The diff is too large to show. Use a local git client to view these changes.
Old file size: 283856 bytes
New file size: 283679 bytes
package.jsonView
@@ -32,9 +32,8 @@
3232 "html-escape": "^2.0.0",
3333 "human-time": "0.0.1",
3434 "hyper-nav": "^2.0.0",
3535 "hypermore": "^2.0.0",
36- "insert-css": "^2.0.0",
3736 "libnested": "^1.2.1",
3837 "lodash": "^4.17.4",
3938 "markdown-summary": "^1.0.3",
4039 "medium-editor": "^5.23.3",
translations/en.jsView
@@ -2,8 +2,12 @@
22 stats: 'Stats',
33 comments: 'Comments',
44 likes: 'Likes',
55 shares: 'Shares',
6 + themes: {
7 + light: 'Light',
8 + dark: 'Dark'
9 + },
610 splash: {
711 about: [
812 'A social network that values openness, equality, and freedom.',
913 'A new social network for people seeking an equitable world that values the value people create and successfully balances freedom, solidarity, privacy, and openness.',
@@ -74,9 +78,10 @@
7478 name: 'Name',
7579 introduction: 'Introduction',
7680 language: 'Language',
7781 zoom: 'Zoom',
78- version: 'Version'
82 + version: 'Version',
83 + theme: 'Theme (beta)'
7984 }
8085 },
8186 addressBook: {
8287 action: {

Built with git-ssb-web