PageSourceSearch

https://alainmall.net/wp-content/themes/filmic/js/custom.js

js alainmall.net collected 2026-10-02 19:58:37 UTC 3,737 bytes, 141 lines download raw bytes

1(function ($) {	
2  "use strict";
3  var HT = {},
4    body = $(document.body);
5
6  /*mobile menu*/
7    HT.mobileMenu = function () {
8        if( window.matchMedia( '( max-width: 991px )' ).matches ){
9            $( ".main-navigation" ).filmicMenu({
10                resizeWidth: "991",
11                initiallyVisible: false,
12                animSpeed: "fast",
13                easingEffect: "linear"
14            });
15        }
16    };
17
18  // Menu for header layout 3
19  HT.toggleMenu = function () {
20    $(".js-menu-link").on("click", function (event) {
21      event.preventDefault();
22
23      $(".menu-overlay").toggleClass("open");
24      $(".toggle-menu").toggleClass("open");
25      $("html").toggleClass("hide-scrollbar");
26    });
27
28    $(".menu-overlay a:not(:only-child)").on("click", function (event) {
29      event.preventDefault();
30      $(this)
31        .next()
32        .slideToggle(350);
33
34      $(this).toggleClass("is-active");
35    });
36  };
37
38  // Counter Up
39  HT.counterUp = function () {
40    if ($('.sc-counter__number').length > 0) {
41      $('.sc-counter__number').counterUp({
42        delay: 10,
43        time: 2000
44      });
45    }
46  }
47
48  /*desktop search form*/
49  HT.desktop_search_form = function () {
50    /*search form button*/
51    var _search_box = body.find(".theme-search-box"),
52      _textfiled = _search_box.find("input"),
53      /*action when quickview close*/
54      search_closed_action = function () {
55        body.removeClass("desktop-search-form-opened");
56        _textfiled.val("");
57      };
58
59    $("#theme-search-btn").on("click", function () {
60      body.addClass("desktop-search-form-opened");
61      setTimeout(function () {
62        _textfiled.focus();
63      }, 300);
64    });
65
66    /*Close box by click overlay*/
67    _search_box.on("click", function (e) {
68      if (e.target !== this) return;
69      search_closed_action();
70    });
71
72    /*Close box by click `ESC` or `ENTER` key*/
73    $(document).keyup(function (e) {
74      if (e.keyCode === 27 || e.keyCode === 13) search_closed_action();
75    });
76  };
77
78  /*scroll to top onclick*/
79  $(".scroll-to-top").on("click", function () {
80    $("html, body").animate({ scrollTop: 0 }, 300);
81  });
82
83  /* READY =====================================================*/
84  $(document).ready(function () {
85    HT.mobileMenu();
86    HT.desktop_search_form();
87    HT.toggleMenu();
88    HT.counterUp();
89  });
90
91  /* LOAD ======================================================*/
92  $(window).on("load", function () { });
93
94  /* SCROLL =====================================================*/
95  $(window).on("scroll", function () {
96    /*scroll to top action*/
97    if ($(this).scrollTop() > 100) {
98      $(".scroll-to-top").addClass("scroll-visible");
99    } else {
100      $(".scroll-to-top").removeClass("scroll-visible");
101    }
102  });
103
104  /* FULLPAGE =====================================================*/
105  $("#fullpage").fullpage({
106    sectionSelector: ".vertical-scrolling",
107    slideSelector: ".horizontal-scrolling",
108    navigation: true,
109    controlArrows: false,
110    slidesNavigation: true,
111    responsiveWidth: 768
112  });
113
114  /* CUSTOM SELECT ELEMENT =====================================================*/
115  $(".contact-form-select").dropkick({
116    mobile: true
117  });
118
119  /* STICKY MENU =====================================================*/
120  var sticky = jQuery( '.header-sticky' );
121  if ( sticky ) {
122    var position = sticky.offset();
123    if ( position ) {
124      var height = position.top
125    }
126      
127    jQuery(window).scroll(function() {
128
129        var navTop = jQuery(window).scrollTop();
130        if ( navTop > height ) {
131
132          jQuery( sticky ).addClass('sticky-menu');
133        }else{
134
135          jQuery( sticky ).removeClass( 'sticky-menu' );
136
137        }
138      
139    });
140  }
141})(jQuery);

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.