PageSourceSearch

https://universitas21.com/wp-content/themes/u21/assets/dev/js/app.min.js?ver=3.2

js universitas21.com collected 2026-10-02 05:52:59 UTC 4,843 bytes, 138 lines download raw bytes

1"use strict";
2
3// noinspection JSDeprecatedSymbols/// ///
4
5(function ($) {
6  let initNav = function () {
7    $('#toggle-nav-site').on('click', function () {
8      $(this).toggleClass('is-active');
9      $('.nav-site').toggleClass('is-active');
10      $('.nav-secondary').toggleClass('is-active');
11      $('.search-site').removeClass('is-active'); //close search
12    });
13    $('#toggle-search-site').on('click', function () {
14      $(this).toggleClass('is-active');
15      $('.nav-site').removeClass('is-active');
16      $('.nav-secondary').removeClass('is-active'); //close nav
17      $('.search-site').toggleClass('is-active'); // open search
18    });
19  };
20  let initFacets = function () {
21    let isTabletOrAbove = window.matchMedia('(min-width: 47.5rem)').matches;
22    if (!isTabletOrAbove) {
23      $('#filters').removeAttr('open');
24    }
25    $(document).on('facetwp-loaded', function () {
26      $('.facetwp-facet').each(function () {
27        let $facet = $(this);
28        let facet_name = $facet.attr('data-name');
29        let facet_label = FWP.settings.labels[facet_name];
30        let excludedFacets = ['result_count', 'load_more'];
31        if (!excludedFacets.includes(facet_name)) {
32          if (!$facet.is(':empty')) {
33            if ($facet.closest('.facet-wrap').length < 1 && $facet.closest('.facetwp-flyout').length < 1) {
34              $facet.wrap('<div class="facet-wrap"></div>');
35              $facet.before('<div class="facet-label">' + facet_label + '</div>');
36            }
37          }
38        }
39      });
40      let facetCounts = $('.facetwp-counts');
41      if (facetCounts.length) {
42        let topOfFilteredResults = facetCounts.offset().top - window.innerHeight / 10;
43        let scrollPos = window.pageYOffset;
44        if (scrollPos > 1) {
45          if (topOfFilteredResults > scrollPos + window.innerHeight / 1.5 || topOfFilteredResults < scrollPos - window.innerHeight / 10) {
46            $('html, body').stop().animate({
47              scrollTop: topOfFilteredResults
48            }, 250);
49          }
50        }
51      }
52    });
53  };
54  let initAlignments = function () {
55    const body = document.querySelector('body');
56    const scrollbar = window.innerWidth - body.clientWidth;
57    body.setAttribute("style", "--scrollbar: ".concat(scrollbar, "px"));
58  };
59  var isTouchDevice = ('ontouchstart' in document.documentElement);
60  if (isTouchDevice) {
61    $('html').removeClass('no-touch').addClass('touch');
62  }
63  let accordionSetup = function () {
64    $(document).on('click', '.accordion-toggle, .js-accordion-toggle', function (e) {
65      e.preventDefault();
66      var opening = !$(this).hasClass('is-toggled');
67      $(this).toggleClass('is-toggled');
68      var target = $($(this).attr('href'));
69      if (!target.length) {
70        target = $(this).parents('.accordion-item, .js-accordion-item').find('.accordion-content, .js-accordion-content');
71      }
72      target.slideToggle('fast').toggleClass('is-open');
73      if (opening) {
74        var elTop = $(this).offset().top - window.innerHeight / 5;
75        var scrollPos = window.pageYOffset;
76        if (elTop > scrollPos + window.innerHeight / 2) {
77          $('html, body').stop().animate({
78            scrollTop: elTop
79          }, 500);
80        }
81      }
82    });
83  };
84  $('body').waypoint(function (direction) {
85    if (direction === 'up') {
86      $('body').addClass('is-unscrolled');
87    }
88    if (direction === 'down') {
89      $('body').removeClass('is-unscrolled');
90    }
91  }, {
92    offset: -50
93  });
94  $('.banner__subfooter').waypoint(function (direction) {
95    if (direction === 'down') {
96      $(this.element).addClass('animate-on-scroll');
97    }
98  }, {
99    offset: '75%' // Adjust the offset as needed
100  });
101  let randomizeList = function () {
102    const list = document.getElementById("randomizer");
103    const items = Array.from(list.children);
104    items.sort(() => Math.random() - 0.5); // Shuffle the items
105    items.forEach(item => list.appendChild(item)); // Reorder the list
106  };
107  $(document).ready(function () {
108    $(".Modern-Slider").slick({
109      lazyLoad: 'ondemand',
110      useTransform: false,
111      infinite: true,
112      speed: 800,
113      pauseOnHover: true,
114      cssEase: 'linear',
115      autoplay: true,
116      autoplaySpeed: 6000,
117      draggable: true
118    });
119    initNav();
120    initAlignments();
121    initFacets();
122    accordionSetup();
123    $('html').removeClass('no-js');
124  });
125
126  /// only run randomizeList function on competitions pages
127
128  $(document).ready(function () {
129    // Check if the body has the class '3mt-competition-template-default'
130    if ($('body').hasClass('3mt-competition-template-default')) {
131      randomizeList();
132    }
133  });
134  $(window).on('load', function () {
135    // correct anything loaded on DOM load which might need adjusting (mostly once images have loaded)
136  });
137})(jQuery);
138//# sourceMappingURL=app.min.js.map

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.