This is the repository of JavaScript files for the BYCC website. These files are loaded dynamically on the Webflow site.
Add the following script to your Webflow site's head section:
<!-- BYCC JavaScript Loader -->
<script>
!function(){const e="1.0.1",t={production:{baseUrl:"https://bycc-scripts-prod.bycc-pages.pages.dev/src"},preview:{baseUrl:"https://bycc-scripts-prod.bycc-pages.pages.dev/src"},development:{baseUrl:"https://bycc-scripts-prod.bycc-pages.pages.dev/src"}};function n(e,t){const n=document.createElement("script");return n.type="text/javascript",n.src=e,n.onload=function(){console.log(`Successfully loaded: ${e}`),t&&t(null,n)},n.onerror=function(o){console.error(`Error loading script: ${e}`,o),t&&t(o,n)},document.body.appendChild(n),n}document.addEventListener("DOMContentLoaded",function(){const o=function(){const e=window.location.hostname;return e.includes("webflow.io")||e.includes("localhost")?(console.log("Using development environment"),"development"):e.includes("preview")||e.includes("test")?(console.log("Using preview environment"),"preview"):(console.log("Using production environment"),"production")}(),s=t[o].baseUrl,a=document.body.getAttribute("data-page")||"";console.log(`Loading scripts for page type: ${a}`);const i=`?v=${e}`;n(`${s}/get-products-and-prices.js${i}`,function(e){e&&console.error("Failed to load get-products-and-prices.js");switch(a.toLowerCase()){case"home":n(`${s}/radar-frontend.js${i}`);break;case"quote":case"custom-quote":n(`${s}/generate-quote.js${i}`);break;case"cart":n(`${s}/cart.js${i}`);break;case"checkout":n(`${s}/checkout.js${i}`);break;case"quote-office":n(`${s}/office-quote.js${i}`);break;case"acreage":n(`${s}/acreage-based-landing.js${i}`);break;case"contact":n(`${s}/wanna-chat.js${i}`);break;default:console.log("No specific scripts for this page type")}})})}();
</script>
Then, add the data-page attribute to your Webflow body element on each page, for example:
<body data-page="home">