diff --git a/v3/src/components/common/BasicScripts.astro b/v3/src/components/common/BasicScripts.astro index fa3c9a9..e43d0a6 100644 --- a/v3/src/components/common/BasicScripts.astro +++ b/v3/src/components/common/BasicScripts.astro @@ -177,5 +177,110 @@ import { UI } from 'astrowind:config'; initTheme(); onLoad(); onPageShow(); + loadPrice(); }); + + function loadPrice() { + if (!document.getElementById('users')) return; + let users = 10; + let devices = 100; + window.submit = function () { + redirectUrl = + 'https://rustdesk.com/api/lic/stripe/checkout?type=Customized&users=' + users + '&devices=' + devices; + gotoBuy(redirectUrl); + }; + function calculatePrice() { + users = parseInt(document.getElementById('users').value); + devices = parseInt(document.getElementById('devices').value); + if (!users || users < 10) users = 10; + if (devices < 100) devices = 100; + const price = 19.9 + (users - 10) + (devices - 100) * 0.1; + document.getElementById('cprice').innerText = price.toFixed(price >= 100 ? 1 : 2); + } + + document.getElementById('users').oninput = function () { + document.getElementById('usersSlider').value = this.value; + calculatePrice(); + }; + + document.getElementById('devices').oninput = function () { + document.getElementById('devicesSlider').value = this.value; + calculatePrice(); + }; + + document.getElementById('usersSlider').oninput = function () { + document.getElementById('users').value = this.value; + calculatePrice(); + }; + + document.getElementById('devicesSlider').oninput = function () { + document.getElementById('devices').value = this.value; + calculatePrice(); + }; + + let users2 = 10; + let devices2 = 100; + let conns = 1; + window.submit2 = function () { + redirectUrl = + 'https://rustdesk.com/api/lic/stripe/checkout?type=Customized&users=' + + users2 + + '&devices=' + + devices2 + + '&conns=' + + conns; + gotoBuy(redirectUrl); + }; + function calculatePrice2() { + users2 = parseInt(document.getElementById('users2').value); + devices2 = parseInt(document.getElementById('devices2').value); + conns = parseInt(document.getElementById('conns').value); + if (!users2 || users2 < 10) users2 = 10; + if (devices2 < 100) devices2 = 100; + if (conns < 1) conns = 1; + const price = 19.9 + (users2 - 10) + (devices2 - 100) * 0.1 + (conns - 1) * 20; + document.getElementById('cprice2').innerText = price.toFixed(price >= 100 ? 1 : 2); + } + + if (window.location.href.indexOf('custom2') > 0) { + setTimeout(function () { + window.location = '#custom2'; + }, 150); + } else { + setTimeout(function () { + document.getElementById('custom2').parentElement.parentElement.parentElement.style.display = 'none'; + }, 0); + } + + document.getElementById('users2').oninput = function () { + document.getElementById('usersSlider2').value = this.value; + calculatePrice2(); + }; + + document.getElementById('devices2').oninput = function () { + document.getElementById('devicesSlider2').value = this.value; + calculatePrice2(); + }; + + document.getElementById('conns').oninput = function () { + document.getElementById('connsSlider').value = this.value; + calculatePrice2(); + }; + + document.getElementById('usersSlider2').oninput = function () { + document.getElementById('users2').value = this.value; + calculatePrice2(); + }; + + document.getElementById('devicesSlider2').oninput = function () { + document.getElementById('devices2').value = this.value; + calculatePrice2(); + }; + + document.getElementById('connsSlider').oninput = function () { + document.getElementById('conns').value = this.value; + calculatePrice2(); + }; + } + document.addEventListener('DOMContentLoaded', loadPrice); diff --git a/v3/src/pages/ar/pricing.astro b/v3/src/pages/ar/pricing.astro index cb6564a..8398412 100644 --- a/v3/src/pages/ar/pricing.astro +++ b/v3/src/pages/ar/pricing.astro @@ -192,43 +192,7 @@ const metadata = {
- `, callToAction: { text: 'اشترِ الآن', diff --git a/v3/src/pages/de/pricing.astro b/v3/src/pages/de/pricing.astro index eb88519..bf5f95b 100644 --- a/v3/src/pages/de/pricing.astro +++ b/v3/src/pages/de/pricing.astro @@ -192,43 +192,6 @@ const metadata = {
- `, callToAction: { text: 'Jetzt kaufen', @@ -279,61 +242,7 @@ const metadata = {
- `, callToAction: { text: 'Jetzt kaufen', diff --git a/v3/src/pages/es/pricing.astro b/v3/src/pages/es/pricing.astro index bf0a1a8..5373987 100644 --- a/v3/src/pages/es/pricing.astro +++ b/v3/src/pages/es/pricing.astro @@ -192,43 +192,6 @@ const metadata = {
- `, callToAction: { text: 'Comprar ahora', @@ -279,61 +242,6 @@ const metadata = {
- `, callToAction: { text: 'Comprar ahora', diff --git a/v3/src/pages/fr/pricing.astro b/v3/src/pages/fr/pricing.astro index 6966428..51eece4 100644 --- a/v3/src/pages/fr/pricing.astro +++ b/v3/src/pages/fr/pricing.astro @@ -192,43 +192,6 @@ const metadata = {
- `, callToAction: { text: 'Acheter maintenant', @@ -279,61 +242,6 @@ const metadata = {
- `, callToAction: { text: 'Acheter maintenant', diff --git a/v3/src/pages/it/pricing.astro b/v3/src/pages/it/pricing.astro index 3edec4a..3d47893 100644 --- a/v3/src/pages/it/pricing.astro +++ b/v3/src/pages/it/pricing.astro @@ -192,43 +192,6 @@ const metadata = {
- `, callToAction: { text: 'Acquista ora', @@ -278,61 +241,6 @@ const metadata = {
- `, callToAction: { text: 'Acquista ora', diff --git a/v3/src/pages/ja/pricing.astro b/v3/src/pages/ja/pricing.astro index 862bd74..5039691 100644 --- a/v3/src/pages/ja/pricing.astro +++ b/v3/src/pages/ja/pricing.astro @@ -192,43 +192,6 @@ const metadata = {
- `, callToAction: { text: '今すぐ購入', @@ -278,61 +241,6 @@ const metadata = {
- `, callToAction: { text: '今すぐ購入', diff --git a/v3/src/pages/ko/pricing.astro b/v3/src/pages/ko/pricing.astro index 4645ce0..576d7ea 100644 --- a/v3/src/pages/ko/pricing.astro +++ b/v3/src/pages/ko/pricing.astro @@ -192,43 +192,6 @@ const metadata = {
- `, callToAction: { text: '지금 구매', @@ -278,61 +241,6 @@ const metadata = {
- `, callToAction: { text: '지금 구매', diff --git a/v3/src/pages/pricing.astro b/v3/src/pages/pricing.astro index 9e6497b..c873382 100644 --- a/v3/src/pages/pricing.astro +++ b/v3/src/pages/pricing.astro @@ -192,43 +192,6 @@ const metadata = {
- `, callToAction: { text: 'Buy now', @@ -278,61 +241,6 @@ const metadata = {
- `, callToAction: { text: 'Buy now', diff --git a/v3/src/pages/pt/pricing.astro b/v3/src/pages/pt/pricing.astro index a735ca4..0957c1e 100644 --- a/v3/src/pages/pt/pricing.astro +++ b/v3/src/pages/pt/pricing.astro @@ -192,43 +192,6 @@ const metadata = {
- `, callToAction: { text: 'Comprar agora', @@ -278,61 +241,6 @@ const metadata = {
- `, callToAction: { text: 'Comprar agora', diff --git a/v3/src/pages/zh-cn/pricing.astro b/v3/src/pages/zh-cn/pricing.astro index b76d9aa..1ab956a 100644 --- a/v3/src/pages/zh-cn/pricing.astro +++ b/v3/src/pages/zh-cn/pricing.astro @@ -194,43 +194,6 @@ const metadata = {
- `, callToAction: { text: '立即购买', @@ -281,61 +244,6 @@ const metadata = {
- `, callToAction: { text: '立即购买', diff --git a/v3/src/pages/zh-tw/pricing.astro b/v3/src/pages/zh-tw/pricing.astro index 408d9d0..5e4b871 100644 --- a/v3/src/pages/zh-tw/pricing.astro +++ b/v3/src/pages/zh-tw/pricing.astro @@ -192,43 +192,6 @@ const metadata = {
- `, callToAction: { text: '立即購買', @@ -278,61 +241,6 @@ const metadata = {
- `, callToAction: { text: '立即購買',