PageSourceSearch

https://www.mofa.gov.kn/wp-content/themes/creote/assets/js/main.js?ver=1.0.0

js mofa.gov.kn collected 2026-10-02 10:26:38 UTC 11,629 bytes, 361 lines download raw bytes

1/*-------------------------------------------------------------
2=========================theme-js==============================
3-------------------------------------------------------------*/
4
5(function($) {
6	
7	"use strict";
8	
9/*---====================---preloader---======================---*/
10 
11  function creote_preloader() {
12		if($('.loader-wrap').length){
13			$('.loader-wrap').delay(1000).fadeOut(500);
14		}
15		TweenMax.to($(".loader-wrap .overlay"), 1.2, {
16            force3D: true,
17            left: "100%",
18            ease: Expo.easeInOut,
19        });
20	} 
21	if ($(".preloader-close").length) {
22        $(".preloader-close").on("click", function(){
23            $('.loader-wrap').delay(200).fadeOut(500);
24        })
25  }
26
27 /*---====================---preloader---======================---*/
28  $.fn.creoteProgressbar = function(options){
29      options = $.extend({
30        animate     : true,
31        animateText : true
32      }, options);
33      var $this = $(this);
34      var $progressBar = $this;
35      var $progressCount = $progressBar.find('.ProgressBar-percentage--count');
36      var $circle = $progressBar.find('.ProgressBar-circle');
37      var percentageProgress = $progressBar.attr('data-progress');
38      var percentageRemaining = (100 - percentageProgress);
39      var percentageText = $progressCount.parent().attr('data-progress');
40      //Calcule la circonférence du cercle
41      var radius = $circle.attr('r');
42      var diameter = radius * 2;
43      var circumference = Math.round(Math.PI * diameter);
44      //Calcule le pourcentage d'avancement
45      var percentage =  circumference * percentageRemaining / 100;
46      $circle.css({
47        'stroke-dasharray' : circumference,
48        'stroke-dashoffset' : percentage
49      });
50      //Animation de la barre de progression
51      if(options.animate === true){
52        $circle.css({
53          'stroke-dashoffset' : circumference
54        }).animate({
55          'stroke-dashoffset' : percentage
56        }, 3000)
57      }
58      //Animation du texte (pourcentage)
59      if(options.animateText == true){
60        $({ Counter: 0 }).animate(
61        { Counter: percentageText },
62          { duration: 3000,
63            step: function () {
64              $progressCount.text( Math.ceil(this.Counter) + '%');
65            }
66          });
67        }else{
68          $progressCount.text( percentageText + '%');
69    }
70  };
71$(document).ready(function(){
72  $('.ProgressBar--animateNone').creoteProgressbar({
73    animate : false,
74    animateText : false
75  });
76  $('.ProgressBar--animateCircle').creoteProgressbar({
77    animate : true,
78    animateText : false
79  });
80  $('.ProgressBar--animateText').creoteProgressbar({
81    animate : false,
82    animateText : true
83  });
84  $('.ProgressBar--animateAll').creoteProgressbar();
85});
86/*---====================---header drop down button---======================---*/
87if($('header .navbar_nav li.dropdown ul').length){
88  $('header .navbar_nav li.dropdown').append('<div class="dropdown-btn"><span class="fa fa-angle-down"></span></div>');
89}
90if($('header .navbar_nav li.mega_menu  ul').length){
91  $('header .navbar_nav li.mega_menu a.nav-link').append('<span class="fa fa-angle-down"></span>');
92}
93if($('.crt_mobile_menu .navbar_nav li.dropdown ul').length){
94  $('.crt_mobile_menu .navbar_nav li.dropdown').append('<div class="dropdown-btn"><span class="fa fa-angle-down"></span></div>');
95}
96if($('.crt_mobile_menu .navbar_nav li.mega_menu  ul').length){
97  $('.crt_mobile_menu .navbar_nav li.mega_menu a.nav-link').append('<span class="fa fa-angle-down"></span>');
98}
99/*---====================---mobile navbar append---======================---*/
100	if($('.crt_mobile_menu').length){
101		//Menu Toggle Btn
102		$('.navbar_togglers').on('click', function() {
103			$('body').toggleClass('crt_mobile_menu-visible');
104		});
105		//Menu Toggle Btn
106		$('.crt_mobile_menu .menu-backdrop,.crt_mobile_menu .close-btn').on('click', function() {
107			$('body').removeClass('crt_mobile_menu-visible');
108		});
109	}
110/*---====================---shop min cart side navbar---======================---*/
111if($('.side_bar_cart').length){
112  //Menu Toggle Btn
113  $('.mini_cart_togglers').on('click', function() {
114    $('body').toggleClass('side_bar_cart-visible');
115  });
116  //Menu Toggle Btn
117  $('.side_bar_cart  .close_btn_mini , .side_bar_cart .cart_overlay').on('click', function() {
118    $('body').removeClass('side_bar_cart-visible');
119  });
120}
121/*---====================---header drop down toggle---======================---*/
122  $(function() {
123    $('.crt_mobile_menu li.dropdown .dropdown-btn').on('click', function(event) {
124        event.preventDefault();
125        $(this).toggleClass('open');
126        $(this).parent().find('ul.dropdown-menu').first().toggle(300);
127
128        $(this).parent().siblings().find('ul.dropdown-menu').hide(200);
129
130        //Hide menu when clicked outside
131        $(this).parent().find('ul.dropdown-menu').parent().mouseleave(function() {
132            var thisUI = $(this);
133            $('html').click(function() {
134                thisUI.children(".dropdown-menu").hide();
135                thisUI.children("span").removeClass('open');
136
137                $('html').unbind('click');
138            });
139        });
140    });
141});
142
143/*---====================---creote Parallax---======================---*/
144function creote_parallax() {
145    var image = document.getElementsByClassName('cover-parallax');
146    new simpleParallax(image, {
147      delay: .6,
148      transition: 'cubic-bezier(0,0,0,1)'
149    });
150    var image = document.getElementsByClassName('basic-parallax');
151    new simpleParallax(image, {
152      delay: .6,
153      transition: 'cubic-bezier(0,0,0,1)'
154    });
155    var image = document.getElementsByClassName('horizontal-parallax');
156      new simpleParallax(image, {
157        orientation: 'right'
158    });
159    var image = document.getElementsByClassName('scale-parallax');
160      new simpleParallax(image, {
161        scale: 1.5
162    });
163    var image = document.getElementsByClassName('transition-parallax');
164      new simpleParallax(image, {
165        delay: .6,
166        transition: 'cubic-bezier(0,0,0,1)'
167    });
168    var image = document.getElementsByClassName("overlay_parallax");
169      new simpleParallax(image, {
170      delay: 0.6,
171      transition: "cubic-bezier(0,0,0,1)",
172    });
173}
174
175/*---====================---fixSide_scroll---======================---*/
176  $(document).ready(function() {
177    var $sticky = $('.fixSide_scroll');
178    $sticky.hcSticky({
179      stickTo: '.all_side_bar',
180      responsive: {
181        980: {
182          disable: true
183        }
184      }
185    });
186  });
187
188/*---====================---hamburger_menu---======================---*/
189  $(document).ready(function(){
190    $(".hamburger_menu").click(function(){
191      $(this).toggleClass("is-active");
192    });
193    $('.crt_mobile_menu .menu-backdrop').on('click', function() {
194			$('.hamburger_menu ').removeClass('is-active');
195		});
196  
197  });
198
199 
200 
201/*---====================---back-to-top---======================---*/
202if($('.prgoress_indicator path').length){
203var progressPath = document.querySelector('.prgoress_indicator path');
204var pathLength = progressPath.getTotalLength();
205progressPath.style.transition = progressPath.style.WebkitTransition = 'none';
206progressPath.style.strokeDasharray = pathLength + ' ' + pathLength;
207progressPath.style.strokeDashoffset = pathLength;
208progressPath.getBoundingClientRect();
209progressPath.style.transition = progressPath.style.WebkitTransition = 'stroke-dashoffset 10ms linear';
210var updateProgress = function () {
211  var scroll = $(window).scrollTop();
212  var height = $(document).height() - $(window).height();
213  var progress = pathLength - (scroll * pathLength / height);
214  progressPath.style.strokeDashoffset = progress;
215}
216updateProgress();
217$(window).on('scroll', updateProgress);
218var offset = 250;
219var duration = 550;
220jQuery(window).on('scroll', function () {
221  if (jQuery(this).scrollTop() > offset) {
222    jQuery('.prgoress_indicator').addClass('active-progress');
223  } else {
224    jQuery('.prgoress_indicator').removeClass('active-progress');
225  }
226});
227jQuery('.prgoress_indicator').on('click', function (event) {
228  event.preventDefault();
229  jQuery('html, body').animate({ scrollTop: 0 }, duration);
230  return false;
231});
232}
233/*---====================---creote_related_posts---======================---*/
234function creote_related_posts() {
235  var swiper = new Swiper('.related_posts_swiper', {
236      slidesPerView: 3,
237      loop: false,
238      spaceBetween:30,
239      grabCursor: true,
240      navigation: {
241        nextEl: '.related-button-next',
242        prevEl: '.related-button-prev',
243    },
244      breakpoints: {
245          240: {
246              slidesPerView: 1,
247          },
248          540: {
249              slidesPerView: 1,
250          },
251          768: {
252              slidesPerView: 2,
253          },
254          1024: {
255              slidesPerView: 2,
256          },
257
258          1200: {
259            slidesPerView: 3,
260        },
261          
262      }
263  });
264}
265
266/*---====================---Universal Code for All Owl Carousel Sliders---======================---*/
267	if ($('.theme_carousel').length) {
268    $(".theme_carousel").each(function (index) {
269    var $owlAttr = {},
270    $extraAttr = $(this).data("options");
271    $.extend($owlAttr, $extraAttr);
272    $(this).owlCarousel($owlAttr);
273  });
274}
275/*---====================---related_posts_swiper_two---======================---*/
276function creote_related_posts_two() {
277  var swiper = new Swiper('.related_posts_swiper_two', {
278      slidesPerView: 2,
279      loop: false,
280      spaceBetween:30,
281      grabCursor: true,
282      navigation: {
283        nextEl: '.related-button-next',
284        prevEl: '.related-button-prev',
285    },
286      breakpoints: {
287          240: {
288              slidesPerView: 1,
289          },
290          540: {
291              slidesPerView: 1,
292          },
293          768: {
294              slidesPerView: 2,
295          },
296          1024: {
297              slidesPerView: 2,
298          },
299
300          1200: {
301            slidesPerView: 2,
302        },
303          
304      }
305  });
306}
307
308
309
310function creote_sidemenu_content_bx() {
311  var header = $(".sidemenu_content_bx");
312
313  $(window).scroll(function() {    
314      var scroll = $(window).scrollTop();
315      if (scroll >= 600) {
316          header.addClass("scrolled");
317      } else {
318          header.removeClass("scrolled");
319      }
320  });
321}
322
323
324   
325function onepagemobile_nav() {
326  $(document).ready(function() { 
327      $('.onepage_header_enable .navigation_menu').on('click', 'li a', function() {
328          $('body').removeClass('crt_mobile_menu-visible');
329      });
330   
331  });
332  }
333
334
335
336$(document.body).trigger('wc_fragment_refresh');
337	/*	=========================================================================
338	When document is Scrollig, do
339	========================================================================== */
340
341	jQuery(document).on('ready', function () {
342		(function ($) {
343			// add your functions
344			creote_parallax();
345      creote_related_posts();
346      creote_related_posts_two();
347      creote_sidemenu_content_bx();
348      onepagemobile_nav();
349		})(jQuery);
350	});
351
352
353/* ==========================================================================
354   When document is loaded, do
355========================================================================== */
356
357  $(window).on('load', function() {
358		creote_preloader();
359	});
360
361})(window.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.