Skip to content

Commit 35a1a92

Browse files
committed
Publish 2025-12-24
1 parent 1987eee commit 35a1a92

File tree

5 files changed

+27
-24
lines changed

5 files changed

+27
-24
lines changed

elements/ios-static.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
// @ts-check
22

3+
import {offer} from './locales.js';
34
import {clicker} from './stats.js';
45
import {
56
createHTMLElement as html,
@@ -17,7 +18,7 @@ const htmlText = `
1718
</a>
1819
</div>
1920
<div class="discount-description">
20-
50% off until December 1
21+
50% off until ${offer?.end}
2122
</div>
2223
<div class="badge-wrapper">
2324
<a class="badge-link" href="${safariURL}" target="_blank" rel="noopener">

elements/locales.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -644,3 +644,11 @@ export const isEUCountry = [
644644
'SI',
645645
'SK',
646646
].includes(country);
647+
648+
export const offer = (() => {
649+
const date = new Date();
650+
const y = date.getFullYear();
651+
const m = date.getMonth() + 1;
652+
const d = date.getDate();
653+
return y === 2025 && m === 12 && (d >= 25 && d < 27) ? {end: 'December 26'} : null;
654+
})();

elements/paddle.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
// @ts-check
22

3+
import {offer} from './locales.js';
4+
35
/** @typedef {any} Paddle */
46

57
let didInitializePaddle = false;
@@ -42,10 +44,10 @@ export async function initPaddle(options) {
4244
};
4345

4446
if (options.plusButton) {
45-
initClick(options.plusButton, 'pri_01je4ebmn474jsee5eh2gmfan9');
47+
initClick(options.plusButton, offer ? 'pri_01kb2xz6ag8gjgz8cc2kjzentm' : 'pri_01je4ebmn474jsee5eh2gmfan9');
4648
}
4749
if (options.feeButton) {
48-
initClick(options.feeButton, 'pri_01jf039mt65me4f2exbgpg3p9m');
50+
initClick(options.feeButton, offer ? 'pri_01kb2rp90dtwcfdbj9b72zgtg3' : 'pri_01jf039mt65me4f2exbgpg3p9m');
4951
}
5052
if (options.corpButton) {
5153
initClick(options.corpButton, 'pri_01k0skrfeyprpcmxvfsp5vfnw5');

elements/pay-tiers.js

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// @ts-check
22

3-
import {country, isEdge, isEUCountry} from './locales.js';
3+
import {country, isEdge, isEUCountry, offer} from './locales.js';
44
import {initPaddle} from './paddle.js';
55
import {clicker} from './stats.js';
66
import {
@@ -255,9 +255,9 @@ const htmlText = `
255255
<span class="currencies__currency-text js-currency-text">${DEFAULT_CURRENCY}</span>
256256
</div>
257257
<div class="tiers">
258-
<label class="tier">
258+
<label class="tier"${offer ? ' style="display: none;"' : ''}>
259259
<div class="tier__top">
260-
<input type="radio" name="tier" value="${Tiers.REGULAR}" checked>
260+
<input type="radio" name="tier" value="${Tiers.REGULAR}"${offer ? '' : ' checked'}>
261261
<span class="tier__desc" data-text="regular">Individual use</span>
262262
<span class="tier__connect"></span>
263263
<span class="tier__price js-price-regular">${DEFAULT_PRICE_REGULAR}</span>
@@ -267,14 +267,14 @@ const htmlText = `
267267
One-time payment
268268
</div>
269269
</label>
270-
<label class="tier" style="display: none;">
270+
<label class="tier"${offer ? '' : ' style="display: none;"'}>
271271
<div class="tier__top">
272-
<input type="radio" name="tier" value="${Tiers.DISCOUNT}">
272+
<input type="radio" name="tier" value="${Tiers.DISCOUNT}"${offer ? ' checked' : ''}>
273273
<span class="tier__desc" data-text="discount">Individual use</span>
274274
<span class="tier__connect"></span>
275275
<span class="tier__price js-price-regular tier__price--cross">${DEFAULT_PRICE_REGULAR}</span>
276276
<span class="tier__price js-price-discount">${DEFAULT_PRICE_DISCOUNT}</span>
277-
<span class="tier__save"><strong class="js-price-save-2">${Prices.SAVE_2[DEFAULT_CURRENCY]}</strong> <span data-text="off">off</span> <span data-text="dec-1">until<br>December 1</span></span>
277+
<span class="tier__save"><strong class="js-price-save-2">${Prices.SAVE_2[DEFAULT_CURRENCY]}</strong> <span data-text="off">off</span> <span data-text="dec-1">until<br>${offer?.end}</span></span>
278278
</div>
279279
<div class="tier__bottom" data-text="one_time">
280280
One-time payment
@@ -294,7 +294,7 @@ const htmlText = `
294294
</label>
295295
</div>
296296
<div class="discount-description js-discount-description">
297-
50% off until December 1
297+
50% off until ${offer?.end}
298298
</div>
299299
<div class="button-wrapper button-wrapper-paddle">
300300
<a class="button-link button-link--paypal button-link--inactive js-link-paypal" href="${DEFAULT_LINK_PAYPAL}" target="_blank" rel="noopener" data-s="d-side-paypal">
@@ -310,7 +310,7 @@ const htmlText = `
310310
<a class="button-link button-link--paddle js-link-paddle" href="#pay" data-s="d-side-paddle">
311311
<span class="button-link__text">
312312
<span data-text="pay">Pay</span>
313-
<span class="js-price-regular">${DEFAULT_PRICE_REGULAR}</span>
313+
<span class="${offer ? 'js-price-discount' : 'js-price-regular'}">${offer ? DEFAULT_PRICE_DISCOUNT : DEFAULT_PRICE_REGULAR}</span>
314314
</span>
315315
</a>
316316
<a class="button-link button-link--paddle js-link-paddle-corp" href="#pay-corp" data-s="d-side-paddlecorp" style="display:none;">
@@ -943,7 +943,7 @@ darkreader-donate-mascot {
943943
944944
.discount-description {
945945
color: #63b79f;
946-
display: none;
946+
display: ${offer ? 'block' : 'none'};
947947
font-size: 0.875rem;
948948
font-weight: bold;
949949
text-align: center;

elements/plus-tiers.js

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// @ts-check
22

3-
import {country, isEUCountry} from './locales.js';
3+
import {country, isEUCountry, offer} from './locales.js';
44
import {initPaddle} from './paddle.js';
55
import {clicker} from './stats.js';
66
import {
@@ -164,7 +164,7 @@ const htmlText = `
164164
</label>
165165
</div>
166166
<div class="discount-description">
167-
50% off until December 1
167+
50% off until ${offer?.end}
168168
</div>
169169
<div class="button-wrapper">
170170
<!--
@@ -182,17 +182,9 @@ const htmlText = `
182182
<a class="button-link button-link--paddle js-link-paddle" href="#pay" data-s="d-plus-paddle">
183183
<span class="button-link__text">
184184
<span data-text="pay">Pay</span>
185-
<span class="js-price-regular">${DEFAULT_PRICE_PLUS}</span>
185+
<span class="${offer ? 'js-price-discount' : 'js-price-regular'}">${offer ? DEFAULT_PRICE_DISCOUNT : DEFAULT_PRICE_PLUS}</span>
186186
</span>
187187
</a>
188-
<!--
189-
<a class="button-link button-link--paddle js-link-paddle" href="#pay" data-s="d-plus-paddle">
190-
<span class="button-link__text">
191-
<span data-text="pay">Pay</span>
192-
<span class="js-price-discount">${DEFAULT_PRICE_DISCOUNT}</span>
193-
</span>
194-
</a>
195-
-->
196188
</div>
197189
<div class="payment-methods">
198190
<i class="payment-methods__paypal"></i>
@@ -571,7 +563,7 @@ const cssText = `
571563
572564
.discount-description {
573565
color: #63b79f;
574-
display: none;
566+
display: ${offer ? 'block' : 'none'};
575567
font-size: 0.875rem;
576568
font-weight: bold;
577569
}

0 commit comments

Comments
 (0)