Skip to content

Commit

Permalink
Publish 2024-07-01
Browse files Browse the repository at this point in the history
  • Loading branch information
alexanderby committed Jul 1, 2024
1 parent 06e95dd commit 4a985bb
Show file tree
Hide file tree
Showing 5 changed files with 65 additions and 5 deletions.
15 changes: 12 additions & 3 deletions elements/pay-tiers.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,14 @@ const Links = {
CORPORATE: 'https://buy.stripe.com/aEUcO29CueaS5k44gq',
},
PayPal: {
REGULAR: {
REGULAR: {
USD: 'https://www.paypal.com/ncp/payment/6GUZKB3ZK3ZEE',
GBP: 'https://www.paypal.com/ncp/payment/DRE2J7DSGZ3EC',
EUR: 'https://www.paypal.com/ncp/payment/364NSETFEQ4W2',
JPY: 'https://www.paypal.com/ncp/payment/BSDYGW4MNC5WU',
CAD: 'https://www.paypal.com/ncp/payment/6HZMLYQT9KTQA',
CNY: 'https://www.paypal.com/ncp/payment/6GUZKB3ZK3ZEE',
AUD: 'https://www.paypal.com/ncp/payment/V2YBJBHKLR4N4',
},
DISCOUNT: {
USD: 'https://www.paypal.com/ncp/payment/ZGRN4ZD3CYWN8',
Expand All @@ -42,6 +43,7 @@ const Links = {
JPY: 'https://www.paypal.com/ncp/payment/WX44HW8PNN6TN',
CAD: 'https://www.paypal.com/ncp/payment/T632CCSRBWBBU',
CNY: 'https://www.paypal.com/ncp/payment/ZGRN4ZD3CYWN8',
AUD: 'https://www.paypal.com/ncp/payment/3XLHYERV96SLN',
},
},
};
Expand All @@ -54,6 +56,7 @@ const Prices = {
JPY: '¥1,500',
CAD: '$12.99',
CNY: '¥68.00',
AUD: '$14.99',
},
DISCOUNT: {
USD: '$4.99',
Expand All @@ -62,6 +65,7 @@ const Prices = {
JPY: '¥700',
CAD: '$6.99',
CNY: '¥38.00',
AUD: '$7.99',
},
CORPORATE: {
USD: '$9.99/yr',
Expand All @@ -70,10 +74,11 @@ const Prices = {
JPY: '¥1,500/年',
CAD: '$12.99/yr',
CNY: '¥68.00/年',
AUD: '$14.99/yr',
},
};

const DEFAULT_CURRENCY = country === 'GB' ? 'GBP' : country === 'JP' ? 'JPY' : country === 'CA' ? 'CAD' : country === 'CN' ? 'CNY' : isEUCountry ? 'EUR' : 'USD';
const DEFAULT_CURRENCY = country === 'GB' ? 'GBP' : country === 'JP' ? 'JPY' : country === 'CA' ? 'CAD' : country === 'AU' ? 'AUD' : country === 'CN' ? 'CNY' : isEUCountry ? 'EUR' : 'USD';
const DEFAULT_PRICE_REGULAR = Prices.REGULAR[DEFAULT_CURRENCY];
const DEFAULT_PRICE_DISCOUNT = Prices.DISCOUNT[DEFAULT_CURRENCY];
const DEFAULT_PRICE_CORP = Prices.CORPORATE[DEFAULT_CURRENCY];
Expand Down Expand Up @@ -117,6 +122,7 @@ const htmlText = `
${currencyButton('JPY', 'flag-jp')}
${currencyButton('CAD', 'flag-ca')}
${currencyButton('CNY', 'flag-cn')}
${currencyButton('AUD', 'flag-au')}
<span class="currencies__currency-connect"></span>
<span class="currencies__currency-text js-currency-text">${DEFAULT_CURRENCY}</span>
</div>
Expand Down Expand Up @@ -496,7 +502,7 @@ const cssText = `
background-image: url('/images/flags.svg');
background-position-y: center;
background-repeat: no-repeat;
background-size: calc(24px * 6) 18px;
background-size: calc(24px * 7) 18px;
border-radius: 0.25rem;
display: inline-block;
height: 18px;
Expand All @@ -521,6 +527,9 @@ const cssText = `
.flag-cn {
background-position-x: -120px;
}
.flag-au {
background-position-x: -144px;
}
.pr-horizontal {
display: none;
}
Expand Down
17 changes: 16 additions & 1 deletion images/flags.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
26 changes: 26 additions & 0 deletions support-us/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,10 @@ <h4 class="region-title">
<input type="radio" name="region" value="region-ca">
<i class="flag flag-ca"></i> CA
</label>
<label class="radio-button">
<input type="radio" name="region" value="region-au">
<i class="flag flag-au"></i> AU
</label>
<label class="radio-button">
<input type="radio" name="region" value="region-other">
Other
Expand Down Expand Up @@ -147,6 +151,16 @@ <h4 class="region-title">
}).render("#paypal-container-6HZMLYQT9KTQA")
</script>
</div>
<div class="pay-tab" data-region-tab="region-au" data-s="d-sup-pp">
<script
src="https://www.paypal.com/sdk/js?client-id=BAA-OLPq9GbKnbQlmUeauRL56qmH0iFUCnoYQEQfZ_l5_M5ICrlamnuNe5JxTyQb4ApuoPXsHp60xCmIdA&components=hosted-buttons&disable-funding=venmo&currency=AUD"></script>
<div id="paypal-container-V2YBJBHKLR4N4"></div>
<script>
paypal.HostedButtons({
hostedButtonId: "V2YBJBHKLR4N4",
}).render("#paypal-container-V2YBJBHKLR4N4")
</script>
</div>
</fieldset>

<fieldset data-payment-type="corporate">
Expand Down Expand Up @@ -234,6 +248,10 @@ <h4 class="region-title">
<input type="radio" name="region2" value="region-ca">
<i class="flag flag-ca"></i> CA
</label>
<label class="radio-button">
<input type="radio" name="region2" value="region-au">
<i class="flag flag-au"></i> AU
</label>
<label class="radio-button">
<input type="radio" name="region2" value="region-other">
Other
Expand Down Expand Up @@ -293,6 +311,14 @@ <h4 class="region-title">
}).render("#paypal-container-T632CCSRBWBBU")
</script>
</div>
<div class="pay-tab" data-region-tab="region-au" data-s="d-sup-ppred">
<div id="paypal-container-3XLHYERV96SLN"></div>
<script>
paypal.HostedButtons({
hostedButtonId: "3XLHYERV96SLN",
}).render("#paypal-container-3XLHYERV96SLN")
</script>
</div>
</fieldset>

<!--
Expand Down
2 changes: 2 additions & 0 deletions support-us/script.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ if (country === 'GB') {
document.querySelectorAll('[value="region-ca"]').forEach((el) => el.checked = true);
} else if (country === 'JP') {
document.querySelectorAll('[value="region-jp"]').forEach((el) => el.checked = true);
} else if (country === 'AU') {
document.querySelectorAll('[value="region-au"]').forEach((el) => el.checked = true);
} else if (isEUCountry) {
document.querySelectorAll('[value="region-eu"]').forEach((el) => el.checked = true);
} else {
Expand Down
10 changes: 9 additions & 1 deletion support-us/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ fieldset>small:last-child {
background-image: url('/images/flags.svg');
background-position-y: center;
background-repeat: no-repeat;
background-size: 6rem 0.75rem;
background-size: 7rem 0.75rem;
display: inline-block;
height: 0.75rem;
width: 1rem;
Expand Down Expand Up @@ -154,6 +154,10 @@ fieldset>small:last-child {
background-position-x: -5rem;
}

.flag-au {
background-position-x: -6rem;
}

[data-payment-type] {
display: none;
}
Expand Down Expand Up @@ -203,6 +207,10 @@ fieldset>small:last-child {
display: block;
}

:has([value="region-au"]:checked)~[data-region-tab="region-au"] {
display: block;
}

:has([value="region-other"]:checked)~[data-region-tab="region-us"] {
display: block;
}
Expand Down

0 comments on commit 4a985bb

Please sign in to comment.