-
Notifications
You must be signed in to change notification settings - Fork 144
/
Copy pathsettings.js
215 lines (210 loc) · 7.56 KB
/
settings.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
/**
* Ghostery Browser Extension
* https://www.ghostery.com/
*
* Copyright 2017-present Ghostery GmbH. All rights reserved.
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0
*/
import { html, router, store } from 'hybrids';
import Options from '/store/options.js';
import Session from '/store/session.js';
import Privacy from './views/privacy.js';
import Websites from './views/websites.js';
import Whotracksme from './views/whotracksme.js';
import Account from './views/account.js';
import Preview from './views/preview.js';
import assets from './assets/index.js';
export default {
stack: router([Privacy, Websites, Whotracksme, Account, Preview]),
session: store(Session),
content: ({ stack, session }) => html`
<template layout="contents">
<ui-settings-layout>
<a
href="${router.url(Privacy, { scrollToTop: true })}"
class="${{ active: router.active(Privacy) }}"
slot="nav"
>
<ui-icon name="shield-menu" color="nav" layout="size:3"></ui-icon>
Privacy protection
</a>
${!!Options.paused &&
html`<a
href="${router.url(Websites, { scrollToTop: true })}"
class="${{ active: router.active(Websites) }}"
slot="nav"
>
<ui-icon name="settings" color="nav" layout="size:3"></ui-icon>
Websites
</a>`}
<a
href="${router.url(Whotracksme, { scrollToTop: true })}"
class="${{ active: router.active(Whotracksme) }}"
slot="nav"
translate="no"
>
<ui-icon name="wtm" color="nav" layout="size:3"></ui-icon>
WhoTracks.Me
</a>
${store.ready(session) &&
html`
<ui-settings-card
layout="hidden"
layout@992px="
area::5/6 self:end:stretch
margin:top:2 padding:2 gap content:center
column
"
slot="nav"
>
${session.contributor
? html`
<img
src="${assets['contributor_badge']}"
layout="size:12"
alt="Contribution"
slot="picture"
/>
<div layout="column gap:0.5">
<ui-text type="label-l" layout="block:center">
You are awesome!
</ui-text>
<ui-text
type="body-s"
color="gray-600"
layout="block:center"
>
Thank you for your support in Ghostery's fight for a web
where privacy is a basic human right!
</ui-text>
</div>
`
: html`
<img
src="${assets['hands']}"
layout="size:12"
alt="Contribution"
slot="picture"
/>
<div layout="column gap:0.5">
<ui-text type="label-l" layout="block:center">
Become a Contributor
</ui-text>
<ui-text
type="body-s"
color="gray-600"
layout="block:center"
>
Help Ghostery fight for a web where privacy is a basic
human right.
</ui-text>
<ui-button layout="margin:top">
<a
href="https://www.ghostery.com/become-a-contributor?utm_source=gbe"
target="_blank"
>
Become a Contributor
</a>
</ui-button>
</div>
`}
</ui-settings-card>
`}
<a
href="${router.url(Account, { scrollToTop: true })}"
class="${{ active: router.active(Account), bottom: true }}"
slot="nav"
>
${store.ready(session) && session.user
? html`
${session.contributor
? html`<ui-icon name="contributor"></ui-icon>`
: html`<ui-icon name="user" color="nav"></ui-icon>`}
<span layout@992px="hidden">My Account</span>
<div
layout="hidden"
layout@992px="column margin:left:2px width::0"
>
<div>My Account</div>
<ui-text type="body-m" ellipsis>${session.email}</ui-text>
</div>
`
: html`<ui-icon name="user" color="nav"></ui-icon> My Account`}
</a>
${stack}
${store.ready(session) &&
html`
<section
layout="grid:1/1 grow items:end:stretch padding:0"
layout@992px="hidden"
>
<ui-settings-card
in-content
layout="column items:center gap"
layout@768px="row gap:5"
>
${session.contributor
? html`
<img
src="${assets['contributor_badge']}"
layout="size:12"
alt="Contribution"
slot="picture"
/>
<div
layout="block:center column gap:0.5"
layout@768px="block:left row grow gap:5 content:space-between"
>
<div layout="column gap:0.5">
<ui-text type="label-l" layout="">
You are awesome!
</ui-text>
<ui-text type="body-s" color="gray-600">
Thank you for your support in Ghostery's fight for a
web where privacy is a basic human right!
</ui-text>
</div>
</div>
`
: html`
<img
src="${assets['hands']}"
layout="size:12"
alt="Contribution"
slot="picture"
/>
<div
layout="block:center column gap:0.5"
layout@768px="block:left row grow gap:5 content:space-between"
>
<div layout="column gap:0.5">
<ui-text type="label-l" layout="">
Become a Contributor
</ui-text>
<ui-text type="body-s" color="gray-600">
Help Ghostery fight for a web where privacy is a basic
human right.
</ui-text>
</div>
<ui-button layout="grow margin:top">
<a
href="https://www.ghostery.com/become-a-contributor?utm_source=gbe"
target="_blank"
>
Become a Contributor
</a>
</ui-button>
</div>
`}
</ui-settings-card>
</section>
`}
</ui-settings-layout>
</template>
`.css`
html, body { height: 100%; }
`,
};