Created
January 21, 2024 11:29
-
-
Save MizR/69193e27cc611f797f176bee9157d4f7 to your computer and use it in GitHub Desktop.
Untitled
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<h3 class="dorik-heading dorik-heading-zivduvqr" id="price-1"> | |
</h3> | |
<span id="price-detail-personal"></span> | |
<h3 class="dorik-heading dorik-heading-o0iwg9p8" id="price-2"> | |
</h3> | |
<span id="price-detail-business"></span> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Function to set USD pricing | |
function setUsdPricing() { | |
document.getElementById('price-1').innerHTML = '<span><sub>$</sub>15<sub>/month</sub></span>'; | |
document.getElementById('price-detail-personal').innerHTML = '<strong>$19/MONTHLY</strong>'; | |
document.getElementById('price-2').innerHTML = '<span><sub>$</sub>39<sub>/month</sub></span>'; | |
document.getElementById('price-detail-business').innerHTML = '<strong>$49/MONTHLY</strong>'; | |
} | |
// Function to update pricing for India | |
function updatePricingForIndia() { | |
document.getElementById('price-1').innerHTML = '<span><sub>₹</sub>599<sub>/month</sub></span>'; | |
document.getElementById('price-detail-personal').innerHTML = '<strong>₹799/MONTHLY</strong>'; | |
document.getElementById('price-2').innerHTML = '<span><sub>₹</sub>1599<sub>/month</sub></span>'; | |
document.getElementById('price-detail-business').innerHTML = '<strong>₹1999/MONTHLY</strong>'; | |
} | |
// Function to detect user's timezone and update pricing | |
function detectTimeZoneAndUpdatePricing() { | |
var timeZone = Intl.DateTimeFormat().resolvedOptions().timeZone; | |
if (timeZone === 'Asia/Calcutta') { | |
updatePricingForIndia(); | |
} else { | |
setUsdPricing(); | |
} | |
} | |
// Ensure the script runs after the DOM is fully loaded | |
document.addEventListener('DOMContentLoaded', (event) => { | |
detectTimeZoneAndUpdatePricing(); | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{"view":"split","fontsize":"100","seethrough":"","prefixfree":"1","page":"html"} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment