Skip to content

Commit fc33697

Browse files
committed
Publish 2024-10-17
1 parent fa01ceb commit fc33697

File tree

25 files changed

+1103
-335
lines changed

25 files changed

+1103
-335
lines changed

elements/mobile-side.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -310,11 +310,16 @@ section {
310310
/* -webkit-text-stroke: 0.0625rem; */
311311
}
312312
313+
/*
313314
@media (max-height: 50rem) {
314315
.mob-qr {
315316
display: none;
316317
}
317318
}
319+
*/
320+
.mob-qr {
321+
display: none;
322+
}
318323
`;
319324

320325
class MobileSideElement extends HTMLElement {

elements/mobile-top-short.js

Lines changed: 70 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import {
77
} from './utils.js';
88
import {clicker} from './stats.js';
99

10+
const edgeURL = 'https://www.microsoft.com/edge/emmx/darkreadercollaboration';
1011
const safariURL = 'https://apps.apple.com/us/app/dark-reader-for-safari/id1438243180?platform=iphone';
1112
// const isEdge = navigator.userAgent.includes('Edg');
1213
const isMobile = navigator.userAgent.includes('Mobile');
@@ -19,30 +20,50 @@ const htmlText = `
1920
<div class="notch"></div>
2021
<div class="top">
2122
<span class="darkreader">Dark Reader</span>
22-
<span class="mobile">for iOS</span>
23+
<span class="mobile">Mobile</span>
2324
</div>
2425
<div class="text js-text">
2526
Take care of your eyes when browsing on your phone
2627
</div>
28+
<div class="qr">
29+
<img src="/images/qr-code.png">
30+
Scan & Install
31+
</div>
32+
</div>
33+
</div>
34+
<div class="links-block">
35+
<div class="android-wrapper">
36+
<strong class="android-new-text">NEW</strong><br>
37+
<i class="edge-icon"></i> <strong>Microsoft Edge</strong><br>
38+
supports browser<br>
39+
add-ons on <i class="android-icon"></i> <strong>Android</strong>
40+
<div class="badge-wrapper">
41+
<a class="badge-link" href="${edgeURL}" target="_blank" rel="noopener" data-s="drand-top-short">
42+
<img src="/images/google-play-badge.svg">
43+
</a>
44+
</div>
45+
</div>
46+
<div class="ios-wrapper">
47+
<strong>Install for iPhone & iPad</strong>
2748
<div class="badge-wrapper">
2849
<a class="badge-link" href="${safariURL}" target="_blank" rel="noopener" data-s="drios-top-short">
2950
<img src="/images/app-store-badge.svg">
3051
</a>
3152
</div>
3253
</div>
33-
<div class="qr">
34-
Scan & Install<br>
35-
<img src="/images/qr-code.png">
36-
</div>
3754
</div>
3855
</section>`;
3956

4057
const cssText = `
4158
:host {
4259
--bezel: 0.125rem;
4360
--color-bezel: var(--color-control, #316d7c);
61+
--phone-height: 18.5rem;
62+
--phone-width: 15rem;
4463
}
4564
.container {
65+
display: flex;
66+
flex-direction: row;
4667
position: relative;
4768
}
4869
.phone {
@@ -53,14 +74,15 @@ const cssText = `
5374
box-shadow: 0 0 1rem black;
5475
box-sizing: border-box;
5576
display: flex;
77+
flex: none;
5678
flex-direction: column;
57-
height: 12.5rem;
79+
height: var(--phone-height);
5880
justify-content: center;
59-
margin-right: 1rem;
60-
margin-top: 1rem;
81+
margin-right: 2rem;
6182
position: relative;
62-
width: 16rem;
83+
width: var(--phone-width);
6384
}
85+
/*
6486
.phone::after {
6587
background-image: linear-gradient(to top, var(--color-bg) 1rem, #141e2400);
6688
bottom: -1rem;
@@ -71,6 +93,7 @@ const cssText = `
7193
position: absolute;
7294
width: 18rem;
7395
}
96+
*/
7497
.screen {
7598
align-items: center;
7699
background-image: linear-gradient(to bottom, var(--color-bg), black);
@@ -80,11 +103,11 @@ const cssText = `
80103
box-sizing: border-box;
81104
display: flex;
82105
flex-direction: column;
83-
height: 12rem;
106+
height: calc(var(--phone-height) - 0.5rem);
84107
justify-content: flex-start;
85108
margin: 0.5rem auto 0 auto;
86-
padding: 2rem 1rem 0 1rem;
87-
width: 15rem;
109+
padding: 2rem 0 0 0;
110+
width: calc(var(--phone-width) - 1rem);
88111
}
89112
.notch {
90113
background-color: black;
@@ -98,7 +121,7 @@ const cssText = `
98121
width: 4rem;
99122
}
100123
.top {
101-
font-size: 1.2rem;
124+
font-size: 1.1rem;
102125
}
103126
.top .darkreader {
104127
color: var(--color-highlight);
@@ -109,8 +132,10 @@ const cssText = `
109132
.top .mobile {
110133
color: white;
111134
font-weight: 400;
135+
text-transform: uppercase;
112136
}
113137
.text {
138+
color: var(--color-text);
114139
margin-top: 0.25rem;
115140
text-align: center;
116141
}
@@ -121,8 +146,6 @@ const cssText = `
121146
border-radius: 0.675rem;
122147
box-shadow: 0 0 0 0.0625rem hsla(0, 0%, 100%, 0), 0 0 0 var(--color-text);
123148
display: inline-flex;
124-
position: relative;
125-
top: 1rem;
126149
transition: all 125ms;
127150
width: 11rem;
128151
z-index: 1;
@@ -135,24 +158,47 @@ const cssText = `
135158
box-shadow: 0 0 0 0.0625rem hsla(0, 0%, 100%, 1), 0 0 0.75rem var(--color-text);
136159
}
137160
.qr {
138-
bottom: 0.5rem;
139-
font-size: 1.2rem;
140-
font-weight: 300;
141-
right: -11rem;
161+
color: white;
162+
font-weight: bold;
142163
margin: 0;
143-
position: absolute;
144164
text-align: center;
145165
}
146166
.qr img {
147167
border-radius: 5%;
148168
box-shadow: 0 0 1rem black;
149169
display: block;
150-
height: 7rem;
170+
height: 8rem;
151171
margin: 0.5rem auto;
152-
width: 7rem;
172+
width: 8rem;
153173
}
154-
.qr {
155-
display: none;
174+
.links-block {
175+
color: var(--color-text);
176+
display: flex;
177+
flex-direction: column;
178+
gap: 0.5rem;
179+
}
180+
.edge-icon {
181+
background-image: url(/images/icon-edge-256x256.svg);
182+
background-position: center;
183+
background-repeat: no-repeat;
184+
background-size: contain;
185+
display: inline-block;
186+
height: 1rem;
187+
width: 1rem;
188+
}
189+
.android-icon {
190+
background-image: url(/images/icon-android-dark.svg);
191+
background-position: center;
192+
background-repeat: no-repeat;
193+
background-size: contain;
194+
display: inline-block;
195+
height: 1rem;
196+
width: 1rem;
197+
}
198+
.android-new-text {
199+
color: var(--color-highlight);
200+
font-size: 1.2rem;
201+
-webkit-text-stroke: 0.0625rem;
156202
}
157203
`;
158204

elements/pay-tiers.js

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,14 +110,21 @@ const locales = {
110110
one_time: '一次性付款',
111111
pay_with: '',
112112
price_per_user: '每位用户价格',
113+
region_currency: '货币',
114+
we_take_care: '我们呵护您的眼睛,并提供尽可能最佳的暗黑模式。您的付款可帮助我们继续改进。',
113115
},
114116
};
115117

116118
const htmlText = `
117119
<section class="pr">
118120
<div class="pr-wrapper">
119121
<h2 class="pr-heading" data-text="heading">Pay for using <span class="pr-heading__darkreader">Dark Reader</span></h2>
122+
<div class="pr-description" data-text="we_take_care">
123+
We take care of your eyes and provide the best dark mode possible.
124+
Your payment helps us continue making enhancements.
125+
</div>
120126
<div class="currencies">
127+
<span class="currencies__text" data-text="region_currency">Currency</span>
121128
${currencyButton('USD', 'flag-us')}
122129
${currencyButton('EUR', 'flag-eu')}
123130
${currencyButton('GBP', 'flag-uk')}
@@ -241,6 +248,12 @@ const cssText = `
241248
width: 2.75rem;
242249
}
243250
*/
251+
.pr-description {
252+
display: none;
253+
line-height: 1;
254+
margin: 0.25rem 0 0.5rem 0;
255+
text-align: center;
256+
}
244257
.tiers {
245258
align-items: stretch;
246259
display: flex;
@@ -513,6 +526,10 @@ const cssText = `
513526
filter: none;
514527
opacity: 0.75;
515528
}
529+
.currencies__text {
530+
display: none;
531+
font-weight: 300;
532+
}
516533
.currencies__currency-connect {
517534
border-bottom: 1px dotted var(--color-text);
518535
/* display: inline-block; */
@@ -638,6 +655,47 @@ const cssText = `
638655
-webkit-text-stroke: unset;
639656
transform: none;
640657
}
658+
659+
/* Verbose */
660+
:host([verbose]) {
661+
container-type: normal;
662+
663+
.pr {
664+
max-width: 100%;
665+
}
666+
.pr-wrapper {
667+
margin: 0 auto;
668+
max-width: 100%;
669+
width: 32rem;
670+
}
671+
.pr-heading {
672+
font-size: 2.1rem;
673+
line-height: 1;
674+
text-align: center;
675+
-webkit-text-stroke: 0.125rem;
676+
}
677+
.pr-description {
678+
display: block;
679+
}
680+
.currencies {
681+
justify-content: center;
682+
}
683+
.currencies__text {
684+
display: inline-block;
685+
}
686+
.tiers {
687+
flex-direction: row;
688+
justify-content: space-between;
689+
margin: 1rem 0;
690+
}
691+
.tier {
692+
padding: 0 1rem;
693+
width: 100%;
694+
}
695+
.button-wrapper {
696+
flex-direction: row;
697+
}
698+
}
641699
`;
642700

643701
class PayTiersElement extends HTMLElement {

elements/sponsors-top-short.js

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,9 @@ const htmlText = `
7878
</span>
7979
</div>
8080
</a>
81+
<div class="pie-rating">
82+
<span class="stars">★★★★★</span> 4.8 stars on Chrome Web Store
83+
</div>
8184
</div>
8285
</section>`;
8386

@@ -330,6 +333,7 @@ const cssText = `
330333
text-transform: uppercase;
331334
}
332335
.pie-top-message {
336+
color: var(--color-text);
333337
text-align: center;
334338
width: 16rem;
335339
}
@@ -340,6 +344,15 @@ const cssText = `
340344
.pie-top-message .text-link:hover {
341345
color: white;
342346
}
347+
.pie-rating {
348+
color: var(--color-text);
349+
font-size: 0.75rem;
350+
line-height: 1;
351+
margin-top: 0.25rem;
352+
}
353+
.stars {
354+
color: #fd2;
355+
}
343356
:host([horizontal]) .container {
344357
height: 9rem;
345358
padding: 1rem;

0 commit comments

Comments
 (0)