Helpful Links

Our Social Links

Other Helpful Organizations

Our Supporters

`; printWindow.document.write(htmlContent); printWindow.document.close(); printWindow.onload = function () { printWindow.focus(); setTimeout(() => { printWindow.print(); }, 500); // Delay the print for half a second }; } else { alert("Failed to open print window. Please allow popups for this website."); } } else { console.error('Element with class ".footer_logo-link" or ".img-hero-100vw" not found.'); } } function copyURL() { const url = window.location.href; navigator.clipboard.writeText(url).then(function () { }, function (err) { console.error("Could not copy URL: ", err); }); } function shareOnTwitter() { const url = window.location.href; const text = encodeURIComponent("Check out this page: "); const twitterUrl = `https://twitter.com/intent/tweet?text=${text}&url=${url}`; window.open(twitterUrl, "_blank"); } function shareOnFacebook() { const url = window.location.href; const facebookUrl = `https://www.facebook.com/sharer/sharer.php?u=${url}`; window.open(facebookUrl, "_blank"); } (function waitForWebflow() { if (typeof Webflow !== "undefined" && typeof Webflow.push === "function") { Webflow.push(function () { // Your Webflow-related JavaScript code here $(document).ready(function () { if (!localStorage.getItem("demographicsData")) { $("body").css("overflow", "hidden"); $(".demographics-popup").css("display", "flex").hide().fadeIn(); } $('.demographics-form').submit(function (event) { event.preventDefault(); var demographicsValue = $(this).serialize().split("=")[1]; localStorage.setItem("demographicsData", demographicsValue); window.dataLayer = window.dataLayer || []; window.dataLayer.push({ event: "demographicsFormSubmit", user_age_group: demographicsValue, }); $(".demographics-form").hide(); $("#demoSuccess").css("display", "flex"); setTimeout(function () { $("body").css("overflow", ""); $(".demographics-popup").fadeOut(); }, 3000); return false; }); $('form[fs-cmsfilter-element="filters"]').submit(function (event) { event.preventDefault(); console.log("Filters form submission is disabled"); return false; }); }); }); } else { setTimeout(waitForWebflow, 50); // Check again in 50ms } })(); //click event for continue browsing link in the demographics popup $("#continue-browsing").on("click", function () { $("body").css("overflow", ""); $(".demographics-popup").fadeOut(); }); document.addEventListener("DOMContentLoaded", function () { function checkReferrerAndRedirect() { var referrer, currentDomain = "https://betterplaneteducation.org.uk/"; if (document.referrer.startsWith(currentDomain)) { window.history.back(); } else { window.location.href = currentDomain; } } var backButton = document.getElementById("back-btn"); if (backButton) { backButton.addEventListener("click", function (event) { event.preventDefault(); checkReferrerAndRedirect(); }); } }); window.onload = setInputValue(); window.onresize = setInputValue(); var printButton = document.getElementById("print-btn"); var copyURLButton = document.getElementById("copy-url-btn"); var shareTwitterButton = document.getElementById("share-twitter-btn"); var shareFBButton = document.getElementById("share-fb-btn"); if (printButton) { printButton.addEventListener("click", printContent); } if (copyURLButton) { copyURLButton.addEventListener("click", copyURL); } if (shareTwitterButton) { shareTwitterButton.addEventListener("click", shareOnTwitter); } if (shareFBButton) { shareFBButton.addEventListener("click", shareOnFacebook); } document.addEventListener("DOMContentLoaded", () => { const contentCards = document.querySelectorAll(".medium-content-card, .resource-small-card"); contentCards.forEach(card => { card.addEventListener("click", event => { event.preventDefault(); const link = card.querySelector("a"); if (link) { window.location.href = link.href; } else { console.error("No link found in card:", card); } }); }); });