PageSourceSearch

https://www.heygreen.co.uk/_site/js/min/functions.min.js?cache=260715

js heygreen.co.uk collected 2026-09-29 11:33:11 UTC 9,248 bytes, 1 lines download raw bytes

1"use strict";function _toConsumableArray(e){if(Array.isArray(e)){for(var t=0,n=Array(e.length);t<e.length;t++)n[t]=e[t];return n}return Array.from(e)}function inView(){var e=document.querySelectorAll("[data-inview]");if("IntersectionObserver"in window){var n=new IntersectionObserver(function(e){e.forEach(function(e){if(e.isIntersecting){var t=e.target;viewed(t),n.unobserve(t)}})},{threshold:0});e.forEach(function(e){n.observe(e)})}else e.forEach(function(e){viewed(e)})}function addInViewClass(e){e&&e.classList.add("inview")}function executeCallback(e,t){var n=allowedCallbacks[t];n&&"function"==typeof n&&n(e)}function viewed(e){var t=e.getAttribute("data-inview");addInViewClass((t?document.querySelector(t):null)||e),e.hasAttribute("data-callback")&&executeCallback(e,e.getAttribute("data-callback"))}function lazyLoad(){document.querySelectorAll('img[loading="lazy"]').forEach((e=>{e.complete?e.classList.add("lazy--loaded"):(e.addEventListener("load",(function(){e.classList.add("lazy--loaded")})),e.addEventListener("error",(function(){const t=e.getAttribute("data-fallback");t?"false"===t||e.src.includes(t)||(e.src=t,e.classList.add("lazy--loaded")):e.src.includes(strFallbackPath)||(e.src=strFallbackPath,e.classList.add("lazy--loaded"))})))}))}function loadSwiperImages(e){e.el.querySelectorAll(".swiper-slide-visible").forEach(function(e){findSlide(e)})}function findSlide(e){e.querySelectorAll("[data-img]").forEach(function(e){e.classList.contains("lazy--loaded")||writeImg(e)})}function writeImg(e,t){e.classList.add("lazy--prep");var n=getImageContainer(e),a=t||e.getAttribute("data-img"),i=new Image;i.src=a,i.className="fit",i.alt=e.getAttribute("data-alt")||"",i.onload=function(){return imageLoadHandler(i,n,e,a)},"false"!==e.getAttribute("data-fallback")&&(i.onerror=function(){return imageLoadHandler(i,n,e,strFallbackPath)})}function getImageContainer(e){var t=e.querySelector(".lazy__load__img");return t||((t=document.createElement("div")).className="lazy__load__img",e.appendChild(t)),t}function imageLoadHandler(e,t,n,a){n.hasAttribute("data-bg")?t.style.backgroundImage="url("+a+")":t.appendChild(e),setTimeout(function(){return n.classList.add("lazy--loaded")},300)}function itemGrouping(e,t,n,a){for(var i=document.querySelectorAll(e),r=0;r<i.length;r+=t){for(var o=document.createElement(n),l=r;l<r+t&&l<i.length;l++)o.appendChild(i[l].cloneNode(!0));i[r].parentNode&&i[r].parentNode.insertBefore(o,i[r]);for(var c=r;c<r+t&&c<i.length;c++)i[c].remove()}a&&a()}function handleAnchorClick(e){e.preventDefault();var t=e.currentTarget.dataset.anchor,n=document.querySelector(t);n&&n.scrollIntoView({behavior:"smooth"})}function parallax(){var e=document.querySelectorAll("[data-parallax]"),n=new IntersectionObserver(function(e){e.forEach(function(t){parallaxItems.has(t.target)&&parallaxItems.get(t.target).forEach(function(e){e.isIntersecting=t.isIntersecting})})},{rootMargin:"50px 0px 50px 0px"});e.forEach(function(e){var t=document.querySelector(e.getAttribute("data-watch"));parallaxItems.has(t)||(parallaxItems.set(t,[]),n.observe(t)),parallaxItems.get(t).push({element:e,isIntersecting:!1})})}function parallaxScroll(o){parallaxItems.forEach(function(e,t){e.forEach(function(e){if(e.isIntersecting){var t=e.element.getAttribute("data-parallax").split(",").map(function(e){return e.trim()}),n=e.element.getAttribute("data-multiplier")||.1,a=Math.max(1,e.element.getBoundingClientRect().top+o),i=e.element.getBoundingClientRect().height,r=calculateParallax(t,o,a,i,n);applyParallax(e.element,r)}})})}function calculateParallax(e,t,n,a,i){var r=void 0,o={};return e.forEach(function(e){switch(e){case"centre":o.transform=(t-(n-intWinHeight/2))*i;break;case"centreFixed":r=(t-(n-intWinHeight/2))*i,o.transform=Math.max(r,0);break;case"centreInvert":o.transform=(n-intWinHeight/2-t)*i;break;case"centreInvertFixed":r=(t-(n-intWinHeight/2))*i,o.transform=Math.min(r,0);break;case"top":o.transform=t*i;break;case"topInvert":o.transform=-t*i;break;case"bottom":o.transform=(t+intWinHeight-intDocHeight)*i;break;case"bottomInvert":o.transform=-(t+intWinHeight-intDocHeight)*i;break;case"opacityTop":r=1-(t-n)/a,o.opacity=Math.max(0,Math.min(1,r));break;case"heightTop":r=100-100/intWinHeight*t,o.height=Math.max(0,Math.min(100,r))}}),o}function applyParallax(e,t){void 0!==t.transform&&(e.style.transform="translate3D(0,"+t.transform+"px, 0)"),void 0!==t.opacity&&(e.style.opacity=t.opacity),void 0!==t.height&&(e.style.height=t.height+"%")}function stickyMenu(e,t,n,a){var i=document.getElementsByClassName(t)[0],r=i.offsetHeight;(i.offsetTop+r)*n<e?mason.classList.add(a):mason.classList.remove(a)}function setMenuColumns(){var e=document.querySelector(".menu__list"),t=e.getAttribute("data-columns");if(t&&""!==t.trim()){var i=t.split(",").map(function(e){return parseInt(e.trim())}).sort(function(e,t){return e-t});e.querySelectorAll(".menu__list__item__sub").forEach(function(e){var n=e.childElementCount,a="";1===i.length?a=n>i[0]?"menu__list__item--columns":"":i.forEach(function(e,t){0===t&&n<=e?a="":e<n&&(t===i.length-1||n<=i[t+1])&&(a=t===i.length-1?"menu__list__item--columns--wide":"menu__list__item--columns")}),a&&e.parentNode.classList.add(a)})}}function checkAnimationFrame(){(intScrollPosition=window.scrollY)!==prevScrollPosition&&scrollHandle(intScrollPosition),window.requestAnimationFrame(checkAnimationFrame)}function scrollHandle(e){10<=Math.abs(prevScrollPosition-intScrollPosition)&&(prevScrollPosition<intScrollPosition?mason.classList.remove("mason--scrollingup"):mason.classList.add("mason--scrollingup")),stickyMenu(prevScrollPosition=intScrollPosition,"hero",.5,"mason--prep"),stickyMenu(intScrollPosition,"hero",1,"mason--sticky"),"IntersectionObserver"in window&&parallaxScroll(intScrollPosition),"function"==typeof customScroll&&customScroll(intScrollPosition)}
1function loadBackgroundImage(e){var t=e.dataset.img;t&&(e.style.backgroundImage="url("+t+")",setTimeout(function(){return e.classList.add("lazy--loaded")},300))}function runCustomAccordion(e,t,n,a){var i=$(e);if(i.length<1)return!1;i.unbind("click"),i.on("click",t,function(){var e=$(this),t=e.parent();t.siblings().removeClass("active").find(n).slideUp(a),t.hasClass("active")?(t.removeClass("active"),e.next(n).stop().slideUp(a)):(t.addClass("active"),e.next(n).stop().slideDown(a))})}function arraySort(e,n){e.sort(function(e,t){if(n){if(e.priority&&!t.priority)return-1;if(!e.priority&&t.priority)return 1}return new Date(t.date)-new Date(e.date)})}function buildFilters(e,t,n){var a={news:"News",facebook:"Facebook",twitter:"Twitter",instagram:"Instagram",youtube:"YouTube"},i=t.querySelectorAll("[data-type]"),r=new Set;i.forEach(function(e){r.add(e.getAttribute("data-type"))}),r=[].concat(_toConsumableArray(r));var o=function(e,t,n){return'<li class="inline '+(n?"active":"")+'" data-social="'+e+'">'+t+"</li>"},l=o("all","All",!0);r.forEach(function(e){a[e]&&(l+=o(e,a[e],!1))}),e.innerHTML+=l,n&&n()}var _extends=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e},mason=document.getElementsByClassName("mason")[0],$window=$(window),blnAdmin=mason.classList.contains("mason--admin"),blnHome=mason.classList.contains("mason--home"),blnInner=mason.classList.contains("mason--inner"),blnForm=!!$(".content__form, .content__block__form").length,blnReducedMotion=window.matchMedia("(prefers-reduced-motion: reduce)").matches,strFallbackPath="/_site/images/design/thumbnail.jpg",intScrollPosition=0,prevScrollPosition=0,blnTicking=!1,intWinHeight=0,intDocHeight=0,parallaxItems=new Map;document.addEventListener("DOMContentLoaded",function(){lazyLoad(),inView(),scripts(),intScrollPosition=window.scrollY,intWinHeight=window.innerHeight,intDocHeight=document.documentElement.scrollHeight,"IntersectionObserver"in window&&0==blnReducedMotion&&parallax()}),window.onload=function(){scrollHandle(intScrollPosition),mason.classList.add("mason--loaded")};var createSwiper=function(e,t,n){if(e&&e.children){if(!e.classList.contains("swiper")){var a=document.createElement("div");a.classList.add("swiper-wrapper"),Array.from(e.children).forEach(function(e){e.classList.add("swiper-slide"),a.appendChild(e)}),e.appendChild(a),e.classList.add("swiper")}var i=_extends({},n,{on:{init:function(){t&&loadSwiperImages(this)}}}),r=new Swiper(e,i);return t&&r.on("slideChange",function(){loadSwiperImages(r)}),r}};$('[data-popupsource="true"]').each(function(){$(this).e4eDialog({title:"Select Source",width:400,height:450,buttons:[{id:"select",label:"Select",fn:"selectItem()",className:"primary"},"cancel"]})});var arrAnchors=document.querySelectorAll("[data-anchor]");arrAnchors.forEach(function(e){e.addEventListener("click",handleAnchorClick)}),window.requestAnimationFrame(checkAnimationFrame),window.onresize=function(){intWinHeight=window.innerHeight,intDocHeight=document.body.scrollHeight,scrollHandle(intScrollPosition)};var allowedCallbacks={loadBackgroundImage:loadBackgroundImage},newsMarquee=document.querySelector(".urgent__list");if(newsMarquee&&1<newsMarquee.children.length){var newsMarqueeW=newsMarquee.offsetWidth,newsMarqueeDur=newsMarqueeW/100;newsMarquee.style.animationDuration=newsMarqueeDur+"s"}

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.