PageSourceSearch

https://womeninsoccer.org/wp-content/themes/wis/assets/js/main.js?ver=1790318729

js womeninsoccer.org collected 2026-09-25 06:47:39 UTC 7,382 bytes, 267 lines download raw bytes

1jQuery(document).ready(function ($) {
2  let resizeId; // for resize timer
3  const w = $(window);
4  let wWidth = $(window).width(); // for resize
5
6  function disableScrolling() {
7    if ($(document).height() > $(window).height()) {
8      var scrollTop = $("html").scrollTop()
9        ? $("html").scrollTop()
10        : $("body").scrollTop(); // Works for Chrome, Firefox, IE...
11      $("html").addClass("disable-scrolling").css("top", -scrollTop);
12    }
13  }
14  function enableScrolling() {
15    var scrollTop = parseInt($("html").css("top"));
16    $("html").removeClass("disable-scrolling");
17    $("html,body").scrollTop(-scrollTop);
18  }
19
20  function isMobile() {
21    if ($(".is-mobile").css("display") === "block") {
22      return true;
23    } else {
24      return false;
25    }
26  }
27
28  /* Init object fit polyfill */
29  /* To make it work, add 'font-family: 'object-fit: cover;';' to image */
30  if (window.objectFitImages) {
31    window.objectFitImages();
32  }
33
34  if (window.ScrollReveal) {
35    let sr = window.ScrollReveal();
36
37    let slideUp = {
38      distance: "30px",
39      origin: "bottom",
40      opacity: 0,
41      duration: 1200,
42    };
43
44    let slideUpInterval = {
45      distance: "30px",
46      origin: "bottom",
47      opacity: 0,
48      duration: 1200,
49      interval: 300,
50    };
51
52    let fadeIn = {
53      opacity: 0,
54      duration: 1200,
55      debug: true,
56    };
57
58    let fadeInInterval = {
59      opacity: 0,
60      duration: 1200,
61      interval: 300,
62    };
63
64    sr.reveal(".slideUp", slideUp);
65    sr.reveal(".slideUpInterval", slideUpInterval);
66    sr.reveal(".fadeIn", fadeIn);
67    sr.reveal(".fadeInInterval", fadeInInterval);
68  }
69
70  $(".scroll-link").on("click", function (e) {
71    e.preventDefault();
72    let target = $(this).attr("href");
73    $("html,body").animate(
74      {
75        scrollTop: $(target).offset().top,
76      },
77      1000
78    );
79  });
80
81  let ballAnimation;
82
83  function ballAnimationInit() {
84    if (isMobile()) {
85      ballAnimation = bodymovin.loadAnimation({
86        container: document.querySelector("#floating-ball"), // the dom element that will contain the animation
87        renderer: "svg",
88        loop: true,
89        autoplay: false,
90        path: wis_data.url + "/assets/js/ball-animation-mob/data.json", // the path to the animation json
91      });
92    } else {
93      ballAnimation = bodymovin.loadAnimation({
94        container: document.querySelector("#floating-ball"), // the dom element that will contain the animation
95        renderer: "svg",
96        loop: true,
97        autoplay: false,
98        path: wis_data.url + "/assets/js/ball-animation/data.json", // the path to the animation json
99      });
100    }
101  }
102
103  $(document).on("click", ".landing-wrap", function (e) {
104    const wrap = $(".landing-float");
105    const list = $(".landing-float__img.is-hidden");
106    const img = $(".landing-float__img");
107    if (list.length > 0) {
108      list.eq(0).removeClass("is-hidden");
109      wrap.addClass("is-visible");
110      if (list.eq(0).hasClass("landing-float__img-ball")) {
111        setTimeout(function () {
112          ballAnimation.play();
113        }, 300);
114      }
115    } else {
116      img.addClass("is-hidden");
117      wrap.removeClass("is-visible");
118    }
119  });
120
121  $(".landing-wrap").on("mouseleave", function () {
122    $("#landing-cursor__float").css("opacity", "0");
123    return false;
124  });
125  $(".landing-wrap").on("mouseenter", function () {
126    $("#landing-cursor__float").css("opacity", "1");
127    return false;
128  });
129
130  $(".landing-wrap").on("mousemove", function (e) {
131    $("#landing-cursor__float")
132      .css("left", e.clientX - 60)
133      .css("top", e.clientY + w.scrollTop() - 60);
134  });
135
136  $(window).on("load", function (e) {
137    $("#landing-cursor__float")
138      .css("left", wWidth / 2 - 60)
139      .css("top", 100);
140  });
141
142  //soccer pattern animation
143  // const landingScene = document.getElementById('scene');
144  // const parallaxInstance = new Parallax(landingScene,{
145  //   relativeInput: true,
146  //   hoverOnly: true,
147  //   frictionX: 0.2,
148  //   frictionY: 0.2,
149  // });
150
151  setTimeout(function () {
152    $(".landing-main__item").addClass("is-animated");
153  }, 200);
154  setTimeout(function () {
155    $(".pre-footer").addClass("is-visible");
156  }, 1400);
157  setTimeout(function () {
158    $(".landing-wrap").addClass("cursor-active");
159  }, 2500);
160
161  //Function Calls
162  ballAnimationInit();
163
164  /* Trigger resize once */
165  $(window).resize(function () {
166    clearTimeout(resizeId);
167    resizeId = setTimeout(doneResizing(wWidth), 500);
168
169    function doneResizing() {
170      let width = $(window).width();
171      if (wWidth !== width) {
172        wWidth = width;
173      }
174
175      ballAnimationInit();
176    }
177  });
178
179  // Scroll to top
180  $(".back-to-top").on("click", function () {
181    $("html, body").animate({ scrollTop: 0 }, 1000);
182  });
183  $(".um-search-line").on("change", function (e) {
184    let $btnCancel = $(".um-member-directory-search-line .btn-search-cancel");
185    if ("" != this.value) {
186      $btnCancel.addClass("active");
187    } else {
188      $btnCancel.removeClass("active");
189    }
190  });
191  $(".um-member-directory-search-line .btn-search-cancel").on(
192    "click",
193    function () {
194      let url = window.location.href;
195      let regex = /(search_[^=]*)=[^&]*/;
196      let name = url.match(regex);
197      url = url.split(name[0])[0] + name[1] + url.split(name[0])[
1971];
198      window.history.pushState("", "", url);
199      location.href = url;
200    }
201  );
202  
203	// Jobs page Tab link
204	$('.tab-link').on('click', function() {
205		let target = $(this).attr('href');
206		
207		if (!$(this).hasClass('active') && $(this) != $('.tab-link.active')) {
208			$('.tab-link.active').removeClass('active');
209			$('.tab-content.active').removeClass('active');
210		}
211		$(this).toggleClass('active');
212		$(target).toggleClass('active');
213		$('.tab-content').each(function() {
214			if ($(this).hasClass('active')) {
215				$(this).css('display', 'flex').hide().fadeIn('300');
216			}
217			else $(this).fadeOut('300');	
218		})
219		return false;
220	});
221	
222	// 	toggle jobs
223	$('.btn-ajax-jobs').on('click', function() {
224		let category = $(this).attr('data-category');
225		$('.tab-link.active').removeClass('active');
226		$.when($('.tab-content.active').fadeOut('300')).done(function() {
227			$('.tab-content.active').removeClass('active');
228			$([document.documentElement, document.body]).animate({
229				scrollTop: $("#jobs_box").offset().top
230			}, 1000);
231		});
232		// update label
233		if (category == 'on') $('.jobs-box-title').html('Jobs on the field');
234		else $('.jobs-box-title').html('Jobs off the field');
235		
236		$('.job-item a').each(function() {
237			if ($(this).attr('data-type') == category) $(this).show();
238			else $(this).hide();
239		});
240	});
241
242  // Filter Functionality
243  $('.jobs-box').isotope({
244    itemSelector: '.job-item',
245   });
246   
247   // filter items on button click
248   $('.filter-button-group').on( 'click', '.carousel-cell', function() {
249    var filterValue = $(this).attr('data-filter');
250    $('.jobs-box').isotope({ filter: filterValue });
251    $('.filter-button-group .carousel-cell').removeClass('active');
252    $(this).addClass('active');
253   });
254
255
256    $('.m-filters').click(function(){
257      if ($(this).hasClass("active")) {
258        $(".m-filters").removeClass("active");
259        $(".m-filters-btn").removeClass("active");
260      }else {
261        $(".m-filters").removeClass("active");
262        $(this).addClass("active");
263        $(".m-filters-btn").addClass("active");
264      }
265      
266    });
267}); 

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.