Script Header

document.addEventListener(‘DOMContentLoaded’, function() { const firstHeader = document.querySelector(‘.first-header’); const secondHeader = document.querySelector(‘.second-header’); if (!firstHeader || !secondHeader) return; // Check if mobile const isMobile = window.innerWidth SCROLL_THRESHOLD && !isSecondHeaderVisible) { isSecondHeaderVisible = true; // First header slides up and fades firstHeader.style.transition =…Continue reading

Open external links in new tab

document.addEventListener(“DOMContentLoaded”, function() { var links = document.querySelectorAll(“a[href]”); links.forEach(function(link) { if (link.hostname !== window.location.hostname) { link.setAttribute(“target”, “_blank”); link.setAttribute(“rel”, “noopener noreferrer”); } }); });Continue reading

Jostar Kitchen Reno Budget Calculator

(function(){ /* ===== Gravity Forms settings: replace the numbers with your form and field IDs ===== */ var JKR_GF={ formId: 0, /* e.g. 7 */ fields:{ /* Hidden field IDs from the form editor */ home:0, scope:0, budget:0, contingency:0, total:0,…Continue reading

Jostar Kitchen Reno Budget Calculator

(function(){ /* ===== Gravity Forms settings: replace the numbers with your form and field IDs ===== */ var JKR_GF={ formId: 0, /* e.g. 7 */ fields:{ /* Hidden field IDs from the form editor */ home:0, scope:0, budget:0, contingency:0, total:0,…Continue reading

GSAP Data Scroll Speed X+Y and Opacity (JS)

gsap.registerPlugin(ScrollTrigger); (() => { const maxScroll = () => ScrollTrigger.maxScroll(window); const H_DIR = 1; // flip all horizontal directions by setting to -1 // Any element with these attributes will be animated const targets = gsap.utils.toArray( “[data-speed], [data-speed-x], [data-speed-y], [data-opacity],…Continue reading

Add GA click events

document.addEventListener(‘click’, function (e) { const a = e.target.closest(‘a’); if (!a) return; if (a.href.startsWith(‘tel:’)) { gtag(‘event’, ‘click_phone’, { link_url: a.href }); } if (a.href.startsWith(‘mailto:’)) { gtag(‘event’, ‘click_email’, { link_url: a.href }); } });Continue reading

Cookie Consent Event

(function () { var dl = window.dataLayer = window.dataLayer || []; var push = dl.push; dl.push = function () { var r = push.apply(this, arguments); try { var a = arguments[0]; if (a && a[0] === ‘consent’ && a[1] ===…Continue reading