PageSourceSearch

https://uinssc.ac.id/assets/js/main.js

js uinssc.ac.id collected 2026-10-01 12:40:53 UTC 24,725 bytes, 794 lines download raw bytes

1/*=== Javascript function indexing hear===========
2
301.swiperActivation();
402.counterUp();
503.searchOption();
604.cartBarshow();
705.cartNumberIncDec();
806.niceSelect();
907.backToTopInit();
1008.mesonaryTab();
1109.vedioActivation();
1210.stickyHeader();
1311.progressAvtivation();
1412.wowActive();
1513.stickySidebar();
1614.rtslessonToggle();
1715.filterClickButton();
1816.datePicker();
1917.fileUpload();
2018.countDownTimer();
2119.modalOver();
2220.sideMenu();
2321.metismenu();
2422.autoCompleate();
2523.fitRows();
2624.tabToggle();
2725.shapeMove();
28
29
30==================================================*/
31
32(function ($) {
33  "use strict";
34  let device_width = window.innerWidth;
35
36  var rtsJs = {
37    m: function (e) {
38      rtsJs.d();
39      rtsJs.methods();
40    },
41    d: function (e) {
42      (this._window = $(window)), (this._document = $(document)), (this._body = $("body")), (this._html = $("html"));
43    },
44    methods: function (e) {
45      rtsJs.swiperActivation();
46      rtsJs.counterUp();
47      rtsJs.searchOption();
48      rtsJs.cartBarshow();
49      rtsJs.cartNumberIncDec();
50      rtsJs.niceSelect();
51      rtsJs.backToTopInit();
52      rtsJs.mesonaryTab();
53      rtsJs.vedioActivation();
54      rtsJs.stickyHeader();
55      rtsJs.progressAvtivation();
56      rtsJs.wowActive();
57      rtsJs.stickySidebar();
58      rtsJs.rtslessonToggle();
59      rtsJs.filterClickButton();
60      rtsJs.datePicker();
61      rtsJs.fileUpload();
62      rtsJs.countDownTimer();
63      rtsJs.modalOver();
64      rtsJs.sideMenu();
65      rtsJs.metismenu();
66      rtsJs.autoCompleate();
67      rtsJs.fitRows();
68      rtsJs.tabToggle();
69      rtsJs.shapeMove();
70    },
71
72    swiperActivation: function () {
73      $(document).ready(function () {
74        var swiper = new Swiper(".mySwiper-category-1", {
75          slidesPerView: 6,
76          spaceBetween: 24,
77          loop: true,
78          navigation: {
79            nextEl: ".swiper-button-next",
80            prevEl: ".swiper-button-prev",
81            clickable: true,
82          },
83          pagination: {
84            el: ".swiper-pagination",
85            clickable: true,
86          },
87          breakpoints: {
88            1700: {
89              slidesPerView: 6,
90            },
91            1500: {
92              slidesPerView: 6,
93            },
94            1324: {
95              slidesPerView: 6,
96            },
97            1100: {
98              slidesPerView: 4,
99            },
100            800: {
101              slidesPerView: 3,
102            },
103            768: {
104              slidesPerView: 2,
105            },
106            640: {
107              slidesPerView: 2,
108            },
109            440: {
110              slidesPerView: 2,
111            },
112            320: {
113              slidesPerView: 1,
114            },
115          },
116        });
117      });
118      $(document).ready(function () {
119        var swiper = new Swiper(".mySwiper-testimonials-1", {
120          slidesPerView: 1,
121          spaceBetween: 24,
122          loop: true,
123          navigation: {
124            nextEl: ".swiper-button-next",
125            prevEl: ".swiper-button-prev",
126            clickable: true,
127          },
128          pagination: {
129            el: ".swiper-pagination",
130            clickable: true,
131          },
132        });
133      });
134      $(document).ready(function () {
135        var swiper = new Swiper(".swiper-container-h1", {
136          direction: "horizontal",
137          effect: "slide",
138          autoplay: false,
139          parallax: true,
140          speed: 1600,
141          rtl: true,
142          loop: true,
143          loopFillGroupWithBlank: !0,
144          keyboard: {
145            enabled: true,
146            onlyInViewport: true,
147          },
148          scrollbar: {
149            el: ".swiper-scrollbar",
150            hide: false,
151            draggable: true,
152          },
153          navigation: {
154            nextEl: ".swiper-button-next",
155            prevEl: ".swiper-button-prev",
156          },
157          pagination: {
158            el: ".swiper-pagination",
159            type: "bullets",
160            clickable: "true",
161          },
162        });
163      });
164
165      $(document).ready(function () {
166        let defaults = {
167          spaceBetween: 30,
168          slidesPerView: 2,
169        };
170        // call init function
171        initSwipers(defaults);
172
173        function initSwipers(defaults = {}, selector = ".swiper-data") {
174          let swipers = document.querySelectorAll(selector);
175          swipers.forEach((swiper) => {
176            // get options
177            let optionsData = swiper.dataset.swiper ? JSON.parse(swiper.dataset.swiper) : {};
178            // combine defaults and custom options
179            let options = {
180              ...defaults,
181              ...optionsData,
182            };
183
184            //console.log(options);
185            // init
186            new Swiper(swiper, options);
187          });
188        }
189      });
190    },
191
192    counterUp: function () {
193      $(".counter").counterUp({
194        delay: 10,
195        time: 2000,
196      });
197      $(".counter").addClass("animated fadeInDownBig");
198      $("h3").addClass("animated fadeIn");
199    },
200
201    // search popup
202    searchOption: function () {
203      $(document).on("click", "#search", function () {
204        $(".search-input-area").addClass("show");
205        $("#anywhere-home").addClass("bgshow");
206      });
207      $(document).on("click", "#close", function () {
208        $(".search-input-area").removeClass("show");
209        $("#anywhere-home").removeClass("bgshow");
210      });
211      $(document).on("click", "#anywhere-home", function () {
212        $(".search-input-area").removeClass("show");
213        $("#anywhere-home").removeClass("bgshow");
214      });
215    },
216
217    // cart bar show
218    cartBarshow: function () {
219      // Cart Bar show & hide
220      $(document).on("click", ".cart-icon", function () {
221        $(".cart-bar").addClass("show");
222        $("#anywhere-home").addClass("bgshow");
223      });
224      $(document).on("click", ".close-cart", function () {
225        $(".cart-bar").removeClass("show");
226        $("#anywhere-home").removeClass("bgshow");
227      });
228      $(document).on("click", "#anywhere-home", function () {
229        $(".cart-bar").removeClass("show");
230        $("#anywhere-home").removeClass("bgshow");
231      });
232    },
233
234    cartNumberIncDec: function () {
235      $(document).ready(function () {
236        $(function () {
237          $(".button").on("click", function () {
238            var $button = $(this);
239            var $parent = $button.parent();
240            var oldValue = $parent.find(".input").val();
241
242            if ($button.text() == "+") {
243              var newVal = parseFloat(oldValue) + 1;
244            } else {
245              // Don't allow decrementing below zero
246              if (oldValue > 1) {
247                var newVal = parseFloat(oldValue) - 1;
248              } else {
249                newVal = 1;
250              }
251            }
252            $parent.find("a.add-to-cart").attr("data-quantity", newVal);
253            $parent.find(".input").val(newVal);
254          });
255        });
256      });
257    },
258
259    niceSelect: function () {
260      $(".nice-select").each(function () {
261        var select = $(this),
262          name = select.attr("name");
263
264        select.hide();
265
266        select.wrap('<div class="nice-select-wrap"></div>');
267
268        var parent = select.parent(".nice-select-wrap");
269
270        parent.append("<ul id=" + name + ' style="display:none"></ul>');
271
272        select.find("option").each(function () {
273          var option = $(this),
274            value = option.attr("value"),
275            label = option.text();
276
277          if (option.is(":first-child")) {
278            $('<a href="#" class="drop">' + label + "</a>").insertBefore(parent.find("ul"));
279          } else {
280            parent.find("ul").append('<li><a href="#" id="' + value + '">' + label + "</a></li>");
281          }
282        });
283
284        parent.find("a").on("click", function (e) {
285          parent.toggleClass("down").find("ul").slideToggle(300);
286
287          e.preventDefault();
288        });
289
290        parent.find("ul a").on("click", function (e) {
291          var niceOption = $(this),
292            value = niceOption.attr("id"),
293            text = niceOption.text();
294
295          select.val(value);
296
297          parent.find(".drop").text(text);
298
299          e.preventDefault();
300        });
301      });
302    },
303
304    backToTopInit: function () {
305      $(document).ready(function () {
306        "use strict";
307
308        var progressPath = document.querySelector(".progress-wrap path");
309        if (progressPath) {
310          var pathLength = progressPath.getTotalLength();
311          progressPath.style.transition = progressPath.style.WebkitTransition = "none";
312          progressPath.style.strokeDasharray = pathLength + " " + pathLength;
313          progressPath.style.strokeDashoffset = pathLength;
314          progressPath.getBoundingClientRect();
315          progressPath.style.transition = progressPath.style.WebkitTransition = "stroke-dashoffset 10ms linear";
316          var updateProgress = function () {
317            var scroll = $(window).scrollTop();
318            var height = $(document).height() - $(window).height();
319            var progress = pathLength - (scroll * pathLength) / height;
320            progressPath.style.strokeDashoffset = progress;
321          };
322          updateProgress();
323          $(window).scroll(updateProgress);
324          var offset = 50;
325          var duration = 550;
326          jQuery(window).on("scroll", function () {
327            if (jQuery(this).scrollTop() > offset) {
328              jQuery(".progress-wrap").addClass("active-progress");
329            } else {
330              jQuery(".progress-wrap").removeClass("active-progress");
331            }
332          });
333        }
334        jQuery(".progress-wrap").on("click", function (event) {
335          event.preventDefault();
336          jQuery("html, body").animate({ scrollTop: 0 }, duration);
337          return false;
338        });
339      });
340    },
341
342    mesonaryTab: function () {
343      $(window).on("load", function () {
344        var isotope = $(".main-isotop");
345
346        if (isotope.length) {
347          var iso = new Isotope(".filter", {
348            itemSelector: ".element-item",
349            layoutMode: "fitRows",
350            fitRows: {
351              equalheight: true,
352            },
353          });
354
355          // filter functions
356          var filterFns = {
357            // show if name ends with -ium
358            ium: function (itemElem) {
359              var name = itemElem.querySelector(".name").textContent;
360              return name.match(/ium$/);
361            },
362          };
363
364          // bind filter button click
365          var filtersElem = document.querySelector(".filters-button-group");
366          filtersElem.addEventListener("click", function (event) {
367            // only work with buttons
368            if (!matchesSelector(event.target, "button")) {
369              return;
370            }
371            var filterValue = event.target.getAttribute("data-filter");
372            // use matching filter function
373            filterValue = filterFns[filterValue] || filterValue;
374            iso.arrange({ filter: filterValue });
375          });
376
377          // change is-checked class on buttons
378          var buttonGroups = document.querySelectorAll(".button-group");
379          for (var i = 0, len = buttonGroups.length; i < len; i++) {
380            var buttonGroup = buttonGroups[i];
381            radioButtonGroup(buttonGroup);
382          }
383          function radioButtonGroup(buttonGroup) {
384            buttonGroup.addEventListener("click", function (event) {
385              // only work with buttons
386              if (!matchesSelector(event.target, "button")) {
387                return;
388              }
389              buttonGroup.querySelector(".is-checked").classList.remove("is-checked");
390              event.target.classList.add("is-checked");
391            });
392          }
393        }
394
395        if ($(".grid-masonary").length) {
396          // image loaded portfolio init
397          $(".grid-masonary").imagesLoaded(function () {
398            $(".portfolio-filter").on("click", "button", function () {
399              var filterValue = $(this).attr("data-filter");
400              $grid.isotope({
401                filter: filterValue,
402              });
403            });
404            var $grid = $(".grid-masonary").isotope({
405              itemSelector: ".grid-item-p",
406              percentPosition: true,
407              masonry: {
408                columnWidth: ".grid-item-p",
409              },
410            });
411          });
412        }
413
414        // portfolio Filter
415        $(".portfolio-filter button").on("click", function (event) {
416          $(this).siblings(".is-checked").removeClass("is-checked");
417          $(this).addClass("is-checked");
418          event.preventDefault();
419        });
420      });
421    },
422
423    vedioActivation: function () {
424      $(document).ready(function () {
425        $(".popup-youtube, .popup-video").magnificPopup({
426          type: "iframe",
427          mainClass: "mfp-fade",
428          removalDelay: 160,
429          preloader: false,
430          fixedContentPos: false,
431        });
432      });
433    },
434    // sticky header activation
435
436    stickyHeader: function (e) {
437      $(window).scroll(function () {
438        if ($(this).scrollTop() > 150) {
439          $(".header--sticky").addClass("sticky");
440        } else {
441          $(".header--sticky").removeClass("sticky");
442        }
443      });
444    },
445
446    progressAvtivation: function () {
447      $(window).scroll(function () {
448        if ($(this).scrollTop() > 250) {
449          var bars = document.querySelectorAll(".meter > span");
450          console.clear();
451          setInterval(function () {
452            bars.forEach(function (bar) {
453              var getWidth = parseFloat(bar.dataset.progress);
454              for (var i = 0; i < getWidth; i++) {
455                bar.style.width = i + "%";
456              }
457            });
458          }, 100);
459        }
460      });
461    },
462
463    wowActive: function () {
464      new WOW().init();
465    },
466
467    stickySidebar: function () {
468      if (typeof $.fn.theiaStickySidebar !== "undefined") {
469        $(".rts-sticky-column-item").theiaStickySidebar({
470          additionalMarginTop: 130,
471        });
472      }
473    },
474
475    rtslessonToggle: function () {
476      $("#toggle-left-back").on("click", function () {
477        $(this).toggleClass("sidebar-hide");
478        $(".rts-lession-left").toggleClass("sibebar-none");
479      });
480    },
481
482    filterClickButton: function () {
483      $(".discover-filter-activation").on("click", function () {
484        $(this).toggleClass("open");
485        $(".default-exp-expand").slideToggle("400");
486      });
487
488      function slider() {
489        $("#slider-range").slider({
490          range: true,
491          min: 10,
492          max: 500,
493          values: [100, 300],
494          slide: function (event, ui) {
495            $("#amount").val("$" + ui.values[0] + " - $" + ui.values[1]);
496          },
497        });
498        $("#amount").val("$" + $("#slider-range").slider("values", 0) + " - $" + $("#slider-range").slider("values", 1));
499      }
500    },
501
502    datePicker: function () {
503      jQuery(document).ready(function () {
504        jQuery("#datepicker").datepicker({
505          format: "dd-mm-yyyy",
506          startDate: "+1d",
507        });
508      });
509    },
510
511    fileUpload: function () {
512      var input = document.querySelectorAll("#custom-button");
513      if (input.length) {
514        const realFileBtn = document.getElementById("real-file");
515        const customBtn = document.getElementById("custom-button");
516        const customTxt = document.getElementById("custom-text");
517
518        customBtn.addEventListener("click", function () {
519          realFileBtn.click();
520        });
521
522        realFileBtn.addEventListener("change", function () {
523          if (realFileBtn.value) {
524            customTxt.innerHTML = realFileBtn.value.match(/[\/\\]([\w\d\s\.\-\(\)]+)$/)[1];
525          } else {
526            customTxt.innerHTML = "No file chosen, yet.";
527          }
528        });
529      }
530    },
531
532    countDownTimer: function () {
533      function makeTimer() {
534        //		var endTime = new Date("29 April 2018 9:56:00 GMT+01:00");
535        var endTime = new Date("29 April 2025 9:56:00 GMT+01:00");
536        endTime = Date.parse(endTime) / 1000;
537
538        var now = new Date();
539        now = Date.parse(now) / 1000;
540
541        var timeLeft = endTime - now;
542
543        var days = Math.floor(timeLeft / 86400);
544        var hours = Math.floor((timeLeft - days * 86400) / 3600);
545        var minutes = Math.floor((timeLeft - days * 86400 - hours * 3600) / 60);
546        var seconds = Math.floor(timeLeft - days * 86400 - hours * 3600 - minutes * 60);
547
548        if (hours < "10") {
549          hours = "0" + hours;
550        }
551        if (minutes < "10") {
552          minutes = "0" + minutes;
553        }
554        if (seconds < "10") {
555          seconds = "0" + seconds;
556        }
557
558        $("#days").html(days + "<span>Days</span>");
559        $("#hours").html(hours + "<span>Hours</span>");
560        $("#minutes").html(minutes + "<span>Minutes</span>");
561        $("#seconds").html(seconds + "<span>Seconds</span>");
562      }
563
564      setInterval(function () {
565        makeTimer();
566      }, 1000);
567    },
568
569    modalOver: function () {
570      $(document).ready(function () {
571        // Check if 'popState' is not set in localStorage
572        if (!localStorage.getItem("popState")) {
573          // Show the modal after a delay
574          setTimeout(function () {
575            $("#myModal-1").modal("show");
576          }, 2000);
577          // Set the 'popState' to 'shown' when the modal is closed
578          $("#myModal-1").on("hidden.bs.modal", function () {
579            localStorage.setItem("popState", "shown");
580          });
581        }
582      });
583    },
584
585    sideMenu: function () {
586      $(document).on("click", "#menu-btn", function () {
587        $("#side-bar").addClass("show");
588        $("#anywhere-home").addClass("bgshow");
589      });
590      $(document).on("click", ".close-icon-menu", function () {
591        $("#side-bar").removeClass("show");
592        $("#anywhere-home").removeClass("bgshow");
593      });
594      $(document).on("click", "#anywhere-home", function () {
595        $("#side-bar").removeClass("show");
596        $("#anywhere-home").removeClass("bgshow");
597      });
598      $(document).on("click", ".onepage .mainmenu li a", function () {
599        $("#side-bar").removeClass("show");
600        $("#anywhere-home").removeClass("bgshow");
601      });
602    },
603
604    metismenu: function () {
605      $("#mobile-menu-active").metisMenu();
606    },
607
608    autoCompleate: function () {
609      $(function () {
610        var availableTags = [
611          "Mobile Phone Repair",
612          "How to Write the Ultimate 1 Page",
613          "What to Write the Ultimate 1 Page",
614          "Sunglasses Trading",
615          "Spectacles & Contact Lenses Trading",
616          "Beauty & Personal Care Equipment Trading",
617          "Parties & Entertainments Services",
618          "Art Production Services",
619          "ColdFusion",
620          "Marketing",
621          "Fortran",
622          "Groovy",
623          "Haskell",
624          "Main to Write the Ultimate 1 Page Strategic Business Plan",
625          "JavaScript",
626          "Lisp",
627          "Perl",
628          "How to Write the Ultimate 1 Page",
629          "Python",
630          "Ruby",
631          "Scala",
632          "Scheme",
633          "How to Write the Ultimate 1 Page",
634          "How to Write the Ultimate 1 Page Strategic Business Plan",
635          "The Complete Web Developer in 2023: Zero to Mastery",
636          "How to Write the Ultimate 1 Page Strategic Business Plan",
637          "100 Days Of Code - 2023 Web Development Bootcamp",
638          "User Experience The Ultimate Guide to Usability and UX",
639          "Complete Guitar Lessons System Beginner to Advanced",
640          "How to Market Yourself as Coach or Consultant Market",
641          "How to Run truly Productive in Meetings – and add value",
642          ">Pole Dancing Video Course with Noelle Wood",
643          "free",
644        ];
645        $(".autocomplete").autocomplete({
646          source: availableTags,
647        });
648      });
649    },
650
651    fitRows: function () {
652      //fit rows
653      function fitRowsDefinition(LayoutMode) {
654        var FitRows = LayoutMode.create("fitRows");
655        FitRows.prototype._resetLayout = function () {
656          this.x = 0;
657          this.y = 0;
658          this.maxY = 0;
659          this.row = 0;
660          this.rows = [];
661          this._getMeasurement("gutter", "outerWidth");
662          if (this.options.equalheight) {
663            for (var i = 0; i < this.isotope.items.length; i++) {
664              this.isotope.items[i].css({
665                height: "auto",
666              });
667            }
668          }
669        };
670        /**
671         * Working but glicthy with newly appended element via ajax
672         * must reinvoke isotope('layout') to properly realign the horizontal position
673         * after isotope('appended), not sure why?
674         */
675        FitRows.prototype._getItemLayoutPosition = function (item) {
676          item.getSize();
677
678          var itemWidth = item.size.outerWidth;
679
680          // if this element cannot fit in the current row
681          // need to add extra pixel to avoid layout dropping in some edge
682          // bootstrap grid in firefox
683          var containerWidth = Math.ceil(this.isotope.size.innerWidth + 1);
684          if (this.x !== 0 && itemWidth + this.x > containerWidth) {
685            this.x = 0;
686            this.y = this.maxY;
687          }
688
689          // New row?
690          if (this.x == 0 && this.y != 0) {
691            this.row++;
692          }
693          var position = {
694            x: this.x,
695            y: this.y,
696          };
697          this.maxY = Math.max(this.maxY, this.y + item.size.outerHeight);
698          this.x += itemWidth;
699
700          // Compare Y from this row and previous row
701          if (typeof this.rows[this.row] == "undefined") {
702            this.rows[this.row] = [];
703            this.rows[this.row].start = this.y;
704            this.rows[this.row].end = this.maxY;
705          } else {
706            this.rows[this.row].end = Math.max(this.rows[this.row].end, this.maxY);
707          }
708          // Record row number to item
709          item.row = this.row;
710          return position;
711        };
712        FitRows.prototype._equalHeight = function () {
713          // Should we use this.isotope.filteredItems or this.isotope.items?
714
715          for (var i = 0; i < this.isotope.items.length; i++) {
716            var row = this.isotope.items[i].row,
717              data = this.rows[row];
718
719            if (data) {
720              var height = data.end - data.start;
721              height -= this.isotope.items[i].size.borderTopWidth + this.isotope.items[i].size.borderBottomWidth;
722              height -= this.isotope.items[i].size.marginTop + this.isotope.items[i].size.marginBottom;
723              height -= this.gutter.height || 0;
724
725              if (this.isotope.items[i].size.isBorderBox == false) {
726                height -= this.isotope.items[i].size.paddingTop + this.isotope.items[i].size.paddingBottom;
727              }
728
729              this.isotope.items[i].size.height = height;
730
731              this.isotope.items[i].css({
732                height: height.toString() + "px",
733              });
734            }
735          }
736        };
737        FitRows.prototype._getContainerSize = function () {
738          if (this.options.equalheight) {
739            this._equalHeight();
740          }
741          return { height: this.maxY };
742        };
743        return FitRows;
744      }
745      if (typeof define === "function" && define.amd) {
746        // AMD
747        define(["../layout-mode"], fitRowsDefinition);
748      } else if (typeof exports === "object") {
749        // CommonJS
750        module.exports = fitRowsDefinition(require("../layout-mode"));
751      } else {
752        // browser global
753        fitRowsDefinition(window.Isotope.LayoutMode);
754      }
755    },
756
757    tabToggle: function () {
758      $("#rts-toggle").click(function (event) {
759        $(".plan-toggle-wrap").toggleClass("active");
760      });
761
762      $("#rts-toggle").change(function () {
763        if ($(this).is(":checked")) {
764          $(".tab-content #yearly").hide();
765          $(".tab-content #monthly").show();
766        } else {
767          $(".tab-content #yearly").show();
768          $(".tab-content #monthly").hide();
769        }
770      });
771    },
772
773    shapeMove: function () {
774      $(".shape-move").mousemove(function (e) {
775        var wx = $(window).width();
776        var wy = $(window).height();
777
778        var x = e.pageX - this.offsetLeft;
779        var y = e.pageY - this.offsetTop;
780
781        var newx = x - wx / 2;
782        var newy = y - wy / 2;
783
784        $(".shape-image .shape").each(function () {
785          var speed = $(this).attr("data-speed");
786          if ($(this).attr("data-revert")) speed *= -1;
787          TweenMax.to($(this), 1, { x: 1 - newx * speed, y: 1 - newy * speed });
788        });
789      });
790    },
791  };
792
793  rtsJs.m();
794})(jQuery, window);

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.