PageSourceSearch

https://hicny.org/assets/js/custom.js

js hicny.org collected 2026-10-02 01:07:54 UTC 10,607 bytes, 320 lines download raw bytes

1jQuery(document).ready(function ($) {
2    /***--------  01. slider-home-1   ------- ***/
3    if ($.isFunction($.fn.owlCarousel)) {
4        $(".slider-home-1").owlCarousel({
5            loop: true,
6            arrows: false,
7            autoplay: true,
8            autoplayTimeout: 4000,
9            items: 1,
10        });
11        /***--------  02. slider-ayat   ------- ***/
12        $(".slider-ayat").owlCarousel({
13            loop: true,
14            arrows: false,
15            autoplay: true,
16            autoplayTimeout: 4000,
17            items: 1,
18        });
19        /***--------  03. pdf-slider   ------- ***/
20        $(".pdf-slider").owlCarousel({
21            loop: true,
22            dot: true,
23            nav: false,
24            autoplay: true,
25            autoplayTimeout: 3000,
26            responsive: {
27                0: {
28                    items: 1,
29                },
30                800: {
31                    items: 2,
32                },
33                1200: {
34                    items: 3,
35                },
36            },
37        });
38        /***--------  04. audio-ayat   ------- ***/
39        $(".audio-ayat").owlCarousel({
40            loop: true,
41            nav: true,
42            autoplay: true,
43            navText: [
44                "<i class='fa-solid fa-angles-left'></i>",
45                "<i class='fa-solid fa-angles-right'></i>",
46            ],
47            responsive: {
48                0: {
49                    items: 1,
50                },
51                800: {
52                    items: 2,
53                },
54                1200: {
55                    items: 2,
56                },
57            },
58        });
59    }
60
61    /***--------  05. mobile-nav   ------- ***/
62    jQuery(".mobile-nav .menu-item-has-children").on("click", function (e) {
63        if (jQuery(this).hasClass("active")) {
64            jQuery(this).removeClass("active");
65        } else {
66            jQuery(".mobile-nav .menu-item-has-children").removeClass("active");
67            jQuery(this).addClass("active");
68        }
69    });
70    jQuery("#nav-icon4").click(function ($) {
71        jQuery("#mobile-nav").toggleClass("open");
72    });
73    jQuery(".bar-menu").click(function ($) {
74        jQuery("#mobile-nav").toggleClass("open");
75        jQuery("#mobile-nav").toggleClass("hmburger-menu");
76        jQuery("#mobile-nav").show();
77    });
78    jQuery("#res-cross").click(function ($) {
79        jQuery("#mobile-nav").removeClass("open");
80    });
81    jQuery(".mobile-nav-item").click(function ($) {
82        jQuery("#mobile-nav").removeClass("open");
83    });
84});
85/***--------  06. search-box   ------- ***/
86if (jQuery(".search-box-outer").length) {
87    jQuery(".search-box-outer").on("click", function () {
88        jQuery("body").addClass("search-active");
89    });
90    jQuery(".close-search").on("click", function () {
91        jQuery("body").removeClass("search-active");
92    });
93}
94/***--------  07. progressbar   ------- ***/
95// {
96//     function animateElements() {
97//         $(".progressbar").each(function () {
98//             var elementPos = $(this).offset().top;
99//             var topOfWindow = $(window).scrollTop();
100//             var percent = $(this).find(".circle").attr("data-percent");
101//             var percentage = parseInt(percent, 10) / parseInt(100, 10);
102//             var animate = $(this).data("animate");
103//             if (
104//                 elementPos < topOfWindow + $(window).height() - 10 &&
105//                 !animate
106//             ) {
107//                 $(this).data("animate", true);
108//                 $(this)
109//                     .find(".circle")
110//                     .circleProgress({
111//                         startAngle: -Math.PI / 2,
112//                         value: percent / 100,
113//                         size: 140,
114//                         thickness: 8,
115//                         emptyFill: "rgba(255,255,255, 0)",
116//                         fill: {
117//                             color: "#fbc50b",
118//                         },
119//                     })
120//                     .on(
121//                         "circle-animation-progress",
122//                         function (event, progress, stepValue) {
123//                             $(this)
124//                                 .find("div")
125//                                 .text((stepValue * 100).toFixed() + "%");
126//                         }
127//                     )
128//                     .stop();
129//             }
130//         });
131//     }
132
133//     // Show animated elements
134//     animateElements();
135//     $(window).scroll(animateElements);
136// }
137
138//
139function inVisible(element) {
140    //Checking if the element is
141    //visible in the viewport
142    var WindowTop = $(window).scrollTop();
143    var WindowBottom = WindowTop + $(window).height();
144    var ElementTop = element.offset().top;
145    var ElementBottom = ElementTop + element.height();
146    //animating the element if it is
147    //visible in the viewport
148    if (ElementBottom <= WindowBottom && ElementTop >= WindowTop)
149        animate(element);
150}
151
152function animate(element) {
153    //Animating the element if not animated before
154    if (!element.hasClass("ms-animated")) {
155        var maxval = element.data("max");
156        var html = element.html();
157        element.addClass("ms-animated");
158        $({
159            countNum: element.html(),
160        }).animate(
161            {
162                countNum: maxval,
163            },
164            {
165                //duration 5 seconds
166                duration: 5000,
167                easing: "linear",
168                step: function () {
169                    element.html(Math.floor(this.countNum) + html);
170                },
171                complete: function () {
172                    element.html(this.countNum + html);
173                },
174            }
175        );
176    }
177}
178
179//When the document is ready
180$(function () {
181    $(window).scroll(function () {
182        $("h2[data-max]").each(function () {
183            inVisible($(this));
184        });
185    });
186});
187
188/***--------  08. days   ------- ***/
189
190if (jQuery("#days").length) {
191    (function () {
192        const second = 1000,
193            minute = second * 60,
194            hour = minute * 60,
195            day = hour * 24;
196
197        //I'm adding this section so I don't have to keep updating this pen every year :-)
198        //remove this if you don't need it
199        let today = new Date(),
200            dd = String(today.getDate()).padStart(2, "0"),
201            mm = String(today.getMonth() + 1).padStart(2, "0"),
202            yyyy = today.getFullYear(),
203            nextYear = yyyy + 1,
204            dayMonth = "2/21/",
205            birthday = dayMonth + yyyy;
206
207        today = mm + "/" + dd + "/" + yyyy;
208        if (today > birthday) {
209            birthday = dayMonth + nextYear;
210        }
211        //end
212
213        // const countDown = new Date(birthday).getTime(),
214        //     x = setInterval(function () {
215        //         const now = new Date().getTime(),
216        //             distance = countDown - now;
217
218        //         (document.getElementById("days").innerText = Math.floor(
219        //             distance / day
220        //         )),
221        //             (document.getElementById("hours").innerText = Math.floor(
222        //                 (distance % day) / hour
223        //             )),
224        //             (document.getElementById("minutes").innerText = Math.floor(
225        //                 (distance % hour) / minute
226        //             )),
227        //             (document.getElementById("seconds").innerText = Math.floor(
228        //                 (distance % minute) / second
229        //             ));
230
231        //         //do something later when date is reached
232        //         if (distance < 0) {
233        //             document.getElementById("headline").innerText = "event";
234        //             document.getElementById("countdown").style.display = "none";
235        //             document.getElementById("content").style.display = "block";
236        //             clearInterval(x);
237        //         }
238        //         //seconds
239        //     }, 0);
240    })();
241}
242
243/***--------  09. accordion-item   ------- ***/
244
245jQuery(".accordion-item .heading").on("click", function (e) {
246    e.preventDefault();
247    if (jQuery(this).closest(".accordion-item").hasClass("active")) {
248        jQuery(".accordion-item").removeClass("active");
249    } else {
250        jQuery(".accordion-item").removeClass("active");
251        jQuery(this).closest(".accordion-item").addClass("active");
252    }
253    var $content = $(this).next();
254    $content.slideToggle(600);
255    jQuery(".accordion-item .content").not($content).slideUp("fast");
256});
257
258/****-----------  10. scrollTop -------------****/
259
260function inVisible(element) {
261    var WindowTop = $(window).scrollTop();
262    var WindowBottom = WindowTop + $(window).height();
263    var ElementTop = element.offset().top;
264    var ElementBottom = ElementTop + element.height();
265    if (ElementBottom <= WindowBottom && ElementTop >= WindowTop)
266        animate(element);
267}
268
269function animate(element) {
270    if (!element.hasClass("ms-animated")) {
271        var maxval = element.data("max");
272        var html = element.html();
273        element.addClass("ms-animated");
274        $({
275            countNum: element.html(),
276        }).animate(
277            {
278                countNum: maxval,
279            },
280            {
281                duration: 5000,
282                easing: "linear",
283                step: function () {
284                    element.html(Math.floor(this.countNum) + html);
285                },
286                complete: function () {
287                    element.html(this.countNum + html);
288                },
289            }
290        );
291    }
292}
293$(function () {
294    $(window).scroll(function () {
295        $("h2[data-max]").each(function () {
296            inVisible($(this));
297        });
298    });
299});
300function calcScrollValue() {
301    let scrollProgress = document.getElementById("progress");
302    let progressValue = document.getElementById("progress-value");
303    let pos = document.documentElement.scrollTop;
304    let calcHeight =
305        document.documentElement.scrollHeight -
306        document.documentElement.clientHeight;
307    let scrollValue = Math.round((pos * 100) / calcHeight);
308    if (pos > 100) {
309        scrollProgress.style.display = "grid";
310    } else {
311        scrollProgress.style.display = "none";
312    }
313    scrollProgress.addEventListener("click", () => {
314        document.documentElement.scrollTop = 0;
315    });
316    scrollProgress.style.background = `conic-gradient(#42A5F5 ${scrollValue}%, #fff ${scrollValue}%)`;
317}
318
319window.onscroll = calcScrollValue;
320window.onload = calcScrollValue;

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.