PageSourceSearch

http://www.codehouse.com.au/wp-content/themes/workforce/assets/js/custom-script.js?ver=7461

js codehouse.com.au collected 2026-10-05 05:32:12 UTC 9,107 bytes, 404 lines download raw bytes

1$(document).ready(function () {
2
3  // mobile button event
4 const $mobileBtn = $(".mobile-menu-btn");
5  const $nav = $(".main-navigation");
6  const $menuItems = $(".menu-item-has-children");
7
8
9 // -------- RESET ON DESKTOP RESIZE --------
10  $(window).on("resize", function () {
11
12    if ($(window).width() >= 1100) {
13
14      // Reset menu state
15      $nav.removeAttr("style").removeClass("open");
16      $mobileBtn.removeClass("active");
17
18      // Reset all submenu states
19      $(".sub-menu").removeAttr("style");
20      $menuItems.removeClass("open");
21    }
22  });
23
24  // -------- MOBILE MENU TOGGLE (<1100px) --------
25  $mobileBtn.on("click", function (e) {
26    if ($(window).width() >= 1100) return; // block on desktop
27
28    e.stopPropagation();
29    $(this).toggleClass("active");
30
31    if ($(this).hasClass("active")) {
32      $nav.slideDown(300).addClass("open");
33    } else {
34      $nav.slideUp(300).removeClass("open");
35    }
36  });
37
38  // -------- CLOSE ON OUTSIDE CLICK --------
39  $(document).on("click", function (e) {
40
41    if ($(window).width() >= 1100) return; // desktop ignore
42
43    if (
44      !$nav.is(e.target) &&
45      $nav.has(e.target).length === 0 &&
46      !$mobileBtn.is(e.target) &&
47      $mobileBtn.has(e.target).length === 0
48    ) {
49      $mobileBtn.removeClass("active");
50      $nav.slideUp(300).removeClass("open");
51    }
52  });
53
54
55 
56
57  // -------- SUBMENU TOGGLE (menu-arrow) --------
58  $(".menu-item-has-children > .menu-arrow").on("click", function (e) {
59
60    if ($(window).width() >= 1100) return;
61
62    e.preventDefault();
63    e.stopPropagation();
64
65    const $parentItem = $(this).closest(".menu-item-has-children");
66    const $subMenu = $parentItem.children(".sub-menu");
67
68    // Toggle class
69    $parentItem.toggleClass("open");
70
71    if ($parentItem.hasClass("open")) {
72      $subMenu
73        .css("display", "block")
74        .hide()
75        .slideDown(300);
76    } else {
77      $subMenu.slideUp(300, function () {
78        $subMenu.css("display", "none");
79      });
80    }
81
82  });
83
84  // mobile button event
85 
86
87  // // logo slider
88
89  $(".slider-rtl").each(function () {
90    const $slider = $(this);
91    const slideCount = $slider.find(".clients_section__slide").length;
92    if (slideCount > 5) {
93      $slider.slick({
94        dots: false,
95        arrows: false,
96        infinite: true,
97        slidesToShow: 5.5,
98        autoplay: true,
99        autoplaySpeed: 0,
100        cssEase: "linear",
101        speed: 3000,
102        centerMode: false,
103        variableWidth: false,
104       
105        rtl: false,
106        responsive: [
107          {
108            breakpoint: 1024,
109            settings: {
110              slidesToShow: 4,
111            },
112          },
113          {
114            breakpoint: 767,
115            settings: {
116              slidesToShow: 2,
117            },
118          },
119        ],
120      });
121    }
122  });
123
124  // logo slider
125  // Initialize second slider with right-to-left direction
126
127  // Accordion start
128  // ACCORDION CODE IS IN BLOG-AJAX.JS FILE 
129  // Accordion end
130
131  // google review slider
132  $(".rplg").children(":nth-child(2)").slick({
133    dots: true,
134    arrows: true,
135    infinite: true,
136    slidesToShow: 1,
137    slidesToScroll: 1,
138    autoplay: true,
139  });
140
141setTimeout(() => {
142  AOS.init({
143    offset: 200, // default value
144    duration: 600,
145  });
146
147  AOS.refresh();
148}, 1000);
149
150
151let started = false;
152
153const observer = new IntersectionObserver(entries => {
154  if (!started && entries.some(e => e.isIntersecting)) {
155    started = true;
156    observer.disconnect();
157
158    $('.data-counter__icon .count').each(function () {
159      const $el = $(this);
160
161      // Original text (with commas)
162      const originalText = $el.text().trim();
163
164      // Remove commas for number calculation
165      const target = parseFloat(originalText.replace(/,/g, ''));
166
167      if (isNaN(target)) return;
168
169      const decimals = (target.toString().split('.')[1] || '').length;
170
171      $el.prop('Counter', 0).animate(
172        { Counter: target },
173        {
174          duration: 6000,
175          easing: 'swing',
176          step: function (now) {
177            const value = now.toFixed(decimals);
178            $el.text(Number(value).toLocaleString('en-IN', {
179              minimumFractionDigits: decimals,
180              maximumFractionDigits: decimals
181            }));
182          },
183          complete: function () {
184            $el.text(Number(target).toLocaleString('en-IN', {
185              minimumFractionDigits: decimals,
186              maximumFractionDigits: decimals
187            }));
188          }
189        }
190      );
191    });
192  }
193}, { threshold: 0.4 });
194
195$('.data-counter__icon').each((_, el) => observer.observe(el));
196
197
198
199
200  // form popup btn
201  // $('.js-popup-trigger').on('click', function () {
202  //   $('.popup_wrapper').css({ 'display': 'block' }).hide().fadeIn(500);
203  // });
204
205  
206  $(document).on("click", ".js-popup-trigger", function (e) {
207    e.preventDefault();
208    var id = $(this).data("popup-id");
209    $("#" + id).fadeIn(250);
210  });
211
212  $(".popup_close-btn").on("click", function () {
213    $(".popup_wrapper").css({ display: "none" });
214  });
215
216  // cta card slider
217
218  $(".cta-section__slider").slick({
219    dots: true,
220    arrows: true,
221    infinite: true,
222    loop: false,
223    slidesToShow: 1,
224    autoplay: true,
225    autoplaySpeed: 3000,
226    centerMode: false,
227    variableWidth: false,
228    responsive: [
229      {
230        breakpoint: 1024,
231        settings: {
232          slidesToShow: 1,
233        },
234      },
235    ],
236  });
237
238  
239
240
241  
242
243});
244
245
246/*
247document.addEventListener('DOMContentLoaded', function () {
248  
249  
250  //service slider
251  const $reviewliderwrapper = $(".review-slider-wrapper");
252  const reviewslideCount = $reviewliderwrapper.find(".review-slide").length;
253
254  if (reviewslideCount > 1) {
255    $reviewliderwrapper.slick({
256      dots: false,
257      arrows: true,
258      infinite: true,
259      loop: false,
260      slidesToShow: 1,
261
262      autoplay: true,
263      autoplaySpeed: 3000,
264      centerMode: false,
265      variableWidth: false,
266      responsive: [
267        {
268          breakpoint: 1024,
269          settings: {
270            slidesToShow: 1,
271          },
272        },
273        {
274          breakpoint: 767,
275          settings: {
276            slidesToShow: 1,
277          },
278        },
279      ],
280    });
281  }
282  // //service slider
283
284})*/
285
286window.addEventListener('load', function () {
287
288  const $slider = jQuery('.review-slider-wrapper');
289
290  if (!$slider.length) return;
291
292// Attach events ONCE (important)
293  $slider.on('init reInit afterChange setPosition', function () {
294    if (typeof AOS !== 'undefined') {
295      AOS.refreshHard();
296    }
297  });
298  
299  function initSlickWhenReady() {
300
301    const width = $slider.outerWidth();
302
303    // Only init when element has real width
304    if (width > 50) {
305
306      if (!$slider.hasClass('slick-initialized')) {
307
308        console.log('Slick initialized with width:', width);
309
310        $slider.slick({
311          dots: false,
312          arrows: true,
313          infinite: true,
314          slidesToShow: 1,
315          autoplay: true,
316          autoplaySpeed: 3000,
317			 responsive: [
318        {
319          breakpoint: 767,
320          settings: {
321            adaptiveHeight: true
322          },
323        },
324      ],
325        });
326      }
327
328      // After init, force layout fix
329      setTimeout(() => {
330        $slider.slick('setPosition');
331      }, 300);
332
333    } else {
334      // Retry until layout is ready
335      setTimeout(initSlickWhenReady, 200);
336    }
337  }
338
339  initSlickWhenReady();
340
341
342// --- AOS ---
343  function initAOS() {
344    if (typeof AOS === 'undefined') {
345      setTimeout(initAOS, 300);
346      return;
347    }
348
349    AOS.init({
350      offset: 200,
351      duration: 600,
352      once: true
353    });
354
355    setTimeout(() => AOS.refreshHard(), 500);
356  }
357
358//   initAOS();
359
360
361});
362
363
364jQuery(window).on('load', function () {
365    setTimeout(function () {
366
367        if (typeof gsap === 'undefined' || typeof ScrollTrigger === 'undefined') {
368            console.warn('GSAP or ScrollTrigger missing');
369            return;
370        }
371
372        gsap.registerPlugin(ScrollTrigger);
373
374        const historyData = document.querySelectorAll('.history-data');
375        const historyTimelineActive = document.querySelector('.history-timeline-active');
376        const historyWrapper = document.querySelector('.history-data-wrapper');
377
378        if (!historyData.length || !historyTimelineActive || !historyWrapper) return;
379
380        gsap.to(historyTimelineActive, {
381            height: () => historyWrapper.offsetHeight,
382            ease: 'none',
383            scrollTrigger: {
384                trigger: '.history-wrapper-right',
385                start: 'top 30%',
386                end: 'bottom bottom',
387                scrub: true,
388                invalidateOnRefresh: true,
389                onUpdate: self => {
390                    const currentHeight = self.progress * historyWrapper.offsetHeight;
391
392                    historyData.forEach(item => {
393                        const triggerPoint = item.offsetTop + 40;
394                        item.classList.toggle('active', currentHeight >= triggerPoint);
395                    });
396                }
397            }
398        });
399
400        ScrollTrigger.refresh();
401
402    }, 800); // delay allows layout to stabilize
403
404});

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.