@somosme/webflowutil 3.1.0 → 3.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/dist/checkout.js +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -221,5 +221,5 @@ The access token must be then placed in a [repository secret](https://docs.githu
|
|
|
221
221
|
#### How to connect NPM Package on Webflow
|
|
222
222
|
|
|
223
223
|
```html
|
|
224
|
-
<script defer src="https://cdn.jsdelivr.net/npm/@somosme/webflowutil@
|
|
224
|
+
<script defer src="https://cdn.jsdelivr.net/npm/@somosme/webflowutil@{version_number}/dist/{file_name}.js"></script>
|
|
225
225
|
```
|
package/dist/checkout.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";(()=>{var
|
|
1
|
+
"use strict";(()=>{var n={planTier:"",sensors:"",sensorQuantity:2},u=1299,T=document.querySelector("#plan-selector"),h=T.querySelectorAll("a");h.forEach(t=>{t.addEventListener("click",function(){H(this.id),y()})});var L=document.querySelectorAll(".minus-counter");L.forEach(t=>{t.addEventListener("click",d)});var f=document.querySelectorAll(".plus-counter");f.forEach(t=>{t.addEventListener("click",d)});b();function H(t){n.planTier=t;let e=document.querySelector("#sensor-summary-free");n.planTier==="yearly-plan"?e.style.display="block":e.style.display="none"}var q=document.querySelectorAll(".sensor-checkout-btn");q.forEach(t=>{t.addEventListener("click",function(){g(this.id),y()})});function g(t){n.sensors=t}function y(){c(n.sensorQuantity);let t=document.querySelector("#next-month-payments"),e=document.querySelector("#sensor-summary-item"),o=document.querySelector("#sensor-summary-free"),s=document.querySelector("#plan-summary-text"),r=document.querySelector("#plan-summary-price"),i=document.querySelector("#current-month-total"),a=document.querySelector("#checkout-btn");n.planTier==="yearly-plan"?(t.style.display="none",s.innerHTML="Membres\xEDa anual",r.innerHTML="$2,990"):(t.style.display="flex",s.innerHTML="Membres\xEDa mensual",r.innerHTML="$290"),n.sensors==="no-sensors"?(e.style.display="none",o.style.display="none"):(e.style.display="grid",n.planTier==="yearly-plan"?o.style.display="block":o.style.display="none");let l="https://somos-smart-wellness.chargebee.com/hosted_pages/checkout?subscription_items[item_price_id][0]=",m="somos-app-MXN-Monthly",p="somos-app-MXN-Yearly",M="&subscription[coupon]=sensorincluido",S=`&subscription_items[item_price_id][1]=freestyle-cgm-MXN&subscription_items[quantity][1]=${n.sensorQuantity}`;n.planTier==="yearly-plan"&&n.sensors==="yes-sensors"?(c(n.sensorQuantity),l+=p+S+M):n.planTier==="yearly-plan"&&n.sensors==="no-sensors"?(i.innerHTML="$2,990",a.innerHTML="Pagar $2,990",l+=p):n.planTier==="monthly-plan"&&n.sensors==="yes-sensors"?(c(n.sensorQuantity),l+=m+S):n.planTier==="monthly-plan"&&n.sensors==="no-sensors"&&(i.innerHTML="$290",a.innerHTML="Pagar $290",l+=m),a.setAttribute("href",l)}function b(){let o=new Date().getMonth()+1,r=["Enero","Febrero","Marzo","Abril","Mayo","Junio","Julio","Agosto","Septiembre","Octubre","Noviembre","Diciembre"][o],i=document.querySelector("#next-month-name");i.innerHTML=r}function d(t){let e=n.sensorQuantity;t.target instanceof HTMLElement&&(t.target.className==="plus-counter"?(e+=1,c(e)):e>1&&(e-=1,c(e))),n.sensorQuantity=e,y(),document.querySelector("#sensor-counter-monthly").innerHTML=e.toString(),document.querySelector("#sensor-counter-yearly").innerHTML=e.toString(),document.querySelector("#title-sensor-counter-monthly").innerHTML=e.toString(),document.querySelector("#title-sensor-counter-yearly").innerHTML=e.toString()}function c(t){let e=t*u;if(n.planTier==="yearly-plan"&&(e-=u),document.querySelector("#total-sensor-price-monthly").innerHTML=e.toLocaleString("en-US"),document.querySelector("#total-sensor-price-yearly").innerHTML=e.toLocaleString("en-US"),document.querySelector("#summary-sensor-quantity").innerHTML=t.toString()+" ",n.planTier==="yearly-plan"){let r=e+u;document.querySelector("#summary-sensor-total").innerHTML="$"+r.toLocaleString("en-US")}else document.querySelector("#summary-sensor-total").innerHTML="$"+e.toLocaleString("en-US");let o=parseInt(document.querySelector("#plan-summary-price").innerHTML.replace(/[$,]/g,"")),s="$"+(e+o).toLocaleString("en-US");return document.querySelector("#checkout-btn").innerHTML="Pagar "+s,e}})();
|