PageSourceSearch

https://www.pastasipariset.com/js/active.js

js pastasipariset.com collected 2026-09-26 18:04:50 UTC 15,869 bytes, 468 lines download raw bytes

1(function ($) {
2    "use strict";
3
4
5    
6    /*=============================================
7    =            menu sticky and scroll to top            =
8    =============================================*/
9    
10    	
11
12	/*----------  Menu sticky ----------*/
13
14	var windows = $(window);
15	var screenSize = windows.width();
16	var sticky = $('.header-sticky');
17	var stickyAbsolute = $('.header-sticky--absolute');
18	var $html = $('html');
19	var $body = $('body');
20
21
22	windows.on('scroll', function () {
23		var scroll = windows.scrollTop();
24		var headerHeight = sticky.height();
25		var headerHeightAbsolute = stickyAbsolute.height();
26
27		if (screenSize >= 320) {
28			if (scroll < headerHeight) {
29				sticky.removeClass('is-sticky');
30			} else {
31				sticky.addClass('is-sticky');
32            }
33            
34			if (scroll < headerHeightAbsolute) {
35				stickyAbsolute.removeClass('is-sticky--absolute');
36			} else {
37				stickyAbsolute.addClass('is-sticky--absolute');
38			}
39		}
40
41
42
43		//code for scroll top
44
45		if (scroll >= 400) {
46			$('.scroll-top').fadeIn();
47		} else {
48			$('.scroll-top').fadeOut();
49		}
50
51	});
52
53
54
55
56	/*----------  Scroll to top  ----------*/
57
58	$('.scroll-top').on('click', function () {
59		$('html,body').animate({
60			scrollTop: 0
61		}, 2000);
62	});
63
64    
65    /*=====  End of menu sticky and scroll to top  ======*/
66    
67
68    
69    /*=============================================
70    =            dropdown active on click            =
71    =============================================*/
72    
73    $('#user-options').on('click', function(event){
74        event.stopPropagation();
75        $(this).siblings().toggleClass('deactive-dropdown-menu active-dropdown-menu');
76        $("#language-options").siblings().removeClass('active-dropdown-menu');
77        $("#currency-options").siblings().removeClass('active-dropdown-menu');
78        
79    });
80    
81    $('#language-options').on('click', function(event){
82        event.stopPropagation();
83        $(this).siblings().toggleClass('deactive-dropdown-menu active-dropdown-menu');
84        $("#user-options").siblings().removeClass('active-dropdown-menu');
85        $("#currency-options").siblings().removeClass('active-dropdown-menu');
86        
87    });
88    
89    $('#currency-options').on('click', function(event){
90        event.stopPropagation();
91        $(this).siblings().toggleClass('deactive-dropdown-menu active-dropdown-menu');
92        $("#language-options").siblings().removeClass('active-dropdown-menu');
93        $("#user-options").siblings().removeClass('active-dropdown-menu');
94        
95    });
96    
97    $('#small-cart-trigger').on('click', function(event){
98        event.stopPropagation();
99        $(this).toggleClass('active');
100        $(this).siblings().toggleClass('deactive-dropdown-menu active-dropdown-menu');
101        
102    });
103
104 //   $("body").on("click", function () {
105
106
107 //       var container = $(".small-cart");
108 //       if (!container.is(e.target) // if the target of the click isn't the container...
109 //           && container.has(e.target).length === 0) // ... nor a descendant of the container
110 //       {
111 //           $(".header-top-single-dropdown__dropdown-menu-items").removeClass('active-dropdown-menu');
112 //           $(".small-cart").removeClass('active-dropdown-menu');
113 //           $(".small-cart-trigger").removeClass('active');
114 //       }
115
116	//});
117    
118  
119    
120    /*=====  End of dropdown active on click  ======*/
121    
122
123    
124    /*=============================================
125    =            Mean menu active            =
126    =============================================*/
127
128	var mainMenuNav = $('.main-menu nav');
129	mainMenuNav.meanmenu({
130		meanScreenWidth: '991',
131		meanMenuContainer: '.mobile-menu',
132        meanMenuClose: '<span class="mean-menu-text">Pasta Aray&#305;n</span> <span class="menu-close"></span>',
133        meanMenuOpen: '<span class="mean-menu-text">Pasta Aray&#305;n</span> <span class="menu-bar"></span>',
134		meanRevealPosition: 'right',
135		meanMenuCloseSize: '0',
136	});
137    
138    /*=====  End of Mean menu active  ======*/
139
140
141    
142    /*=============================================
143    =            search overlay active            =
144    =============================================*/
145    
146    $('#search-overlay-trigger').on('click', function(){
147        $('#search-overlay').show();
148    });
149    
150    
151    $('#close-search-overlay').on('click', function(){
152        $('#search-overlay').hide();
153    });
154    
155    /*=====  End of search overlay active  ======*/
156
157
158    
159    /*=============================================
160    =            slick slider active            =
161    =============================================*/
162    
163    var $htSlickSlider = $('.ht-slick-slider');
164    
165    /*For RTL*/
166    if( $html.attr("dir") == "rtl" || $body.attr("dir") == "rtl" ){
167        $htSlickSlider.attr("dir", "rtl");
168    }
169    
170    $htSlickSlider.each(function(){
171        
172        /*Setting Variables*/
173        var $this = $(this),
174            $setting = $this.data('slick-setting'),
175            $autoPlay = $setting.autoplay ? $setting.autoplay : false,
176            $autoPlaySpeed = parseInt($setting.autoplaySpeed, 10) || 2000,
177            $speed = parseInt($setting.speed, 10) || 2000,
178            $asNavFor = $setting.asNavFor ? $setting.asNavFor : null,
179            $appendArrows = $setting.appendArrows ? $setting.appendArrows : $this,
180            $appendDots = $setting.appendDots ? $setting.appendDots : $this,
181            $arrows = $setting.arrows ? $setting.arrows : false,
182            $prevArrow = $setting.prevArrow ? '<button class="'+ $setting.prevArrow.buttonClass +'"><i class="'+ $setting.prevArrow.iconClass +'"></i></button>' : '<button class="slick-prev">previous</button>',
183            $nextArrow = $setting.nextArrow ? '<button class="'+ $setting.nextArrow.buttonClass +'"><i class="'+ $setting.nextArrow.iconClass +'"></i></button>' : '<button class="slick-next">next</button>',
184            $centerMode = $setting.centerMode ? $setting.centerMode : false,
185            $centerPadding = $setting.centerPadding ? $setting.centerPadding : '50px',
186            $dots = $setting.dots ? $setting.dots : false,
187            $fade = $setting.fade ? $setting.fade : false,
188            $focusOnSelect = $setting.focusOnSelect ? $setting.focusOnSelect : false,
189            $infinite = $setting.infinite ? $setting.infinite : false,
190            $pauseOnHover = $setting.pauseOnHover ? $setting.pauseOnHover : true,
191            $rows = parseInt($setting.rows, 10) || 1,
192            $slidesToShow = parseInt($setting.slidesToShow, 10) || 1,
193            $slidesToScroll = parseInt($setting.slidesToScroll, 10) || 1,
194            $swipe = $setting.swipe ? $setting.swipe : true,
195            $swipeToSlide = $setting.swipeToSlide ? $setting.swipeToSlide : false,
196            $variableWidth = $setting.variableWidth ? $setting.variableWidth : false,
197            $vertical = $setting.vertical ? $setting.vertical : false,
198            $verticalSwiping = $setting.verticalSwiping ? $setting.verticalSwiping : false,
199            $rtl = $setting.rtl || $html.attr('dir="rtl"') || $body.attr('dir="rtl"') ? true : false;
200        
201        /*Responsive Variable, Array & Loops*/
202        var $responsiveSetting = typeof $this.data('slick-responsive') !== 'undefined' ? $this.data('slick-responsive') : '',
203            $responsiveSettingLength = $responsiveSetting.length,
204            $responsiveArray = [];
205            for (var i = 0; i < $responsiveSettingLength; i++) {
206				$responsiveArray[i] = $responsiveSetting[i];
207				
208			}
209
210        /*Slider Start*/
211        $this.slick({
212            autoplay: $autoPlay,
213			autoplaySpeed: $autoPlaySpeed,
214			speed: $speed,
215            asNavFor: $asNavFor,
216            appendArrows: $appendArrows,
217            appendDots: $appendDots,
218            arrows: $arrows,
219            dots: $dots,
220            centerMode: $centerMode,
221            centerPadding: $centerPadding,
222            fade: $fade,
223            focusOnSelect: $focusOnSelect,
224            infinite: $infinite,
225            pauseOnHover: $pauseOnHover,
226            rows: $rows,
227            slidesToShow: $slidesToShow,
228            slidesToScroll: $slidesToScroll,
229            swipe: $swipe,
230            swipeToSlide: $swipeToSlide,
231            variableWidth: $variableWidth,
232            vertical: $vertical,
233            verticalSwiping: $verticalSwiping,
234            rtl: $rtl,
235            prevArrow: $prevArrow,
236            nextArrow: $nextArrow,
237			responsive: $responsiveArray
238        });
239        
240	});
241	
242    
243    /*=====  End of slick slider active  ======*/
244    
245    
246    
247    
248    /*=============================================
249    =            mailchimp active            =
250    =============================================*/
251    
252    $('#mc-form, #mc-form2').ajaxChimp({
253		language: 'en',
254		callback: mailChimpResponse,
255		// ADD YOUR MAILCHIMP URL BELOW HERE!
256		url: 'http://devitems.us11.list-manage.com/subscribe/post?u=6bbb9b6f5827bd842d9640c82&amp;id=05d85f18ef'
257
258	});
259
260	function mailChimpResponse(resp) {
261
262		if (resp.result === 'success') {
263			$('.mailchimp-success').html('' + resp.msg).fadeIn(900);
264			$('.mailchimp-error').fadeOut(400);
265
266		} else if (resp.result === 'error') {
267			$('.mailchimp-error').html('' + resp.msg).fadeIn(900);
268		}
269	}
270    
271    /*=====  End of mailchimp active  ======*/
272
273
274    
275    /*=============================================
276    =            countdown active            =
277    =============================================*/
278    
279    $('[data-countdown]').each(function () {
280		var $this = $(this),
281		finalDate = $(this).data('countdown');
282		$this.countdown(finalDate, function (event) {
283			$this.html(event.strftime('<div class="single-countdown"><span class="single-countdown__time">%D</span><span class="single-countdown__text">:</span></div><div class="single-countdown"><span class="single-countdown__time">%H</span><span class="single-countdown__text">:</span></div><div class="single-countdown"><span class="single-countdown__time">%M</span><span class="single-countdown__text">:</span></div><div class="single-countdown"><span class="single-countdown__time">%S</span><span class="single-countdown__text"></span></div>'));
284		});
285	});
286    
287    /*=====  End of countdown active  ======*/
288
289
290    
291    /*=============================================
292    =            quantity counter            =
293    =============================================*/
294    
295    $('.pro-qty').append('<a href="#" class="inc qty-btn">+</a>');
296	$('.pro-qty').append('<a href="#" class= "dec qty-btn">-</a>');
297	$('.qty-btn').on('click', function (e) {
298		e.preventDefault();
299		var $button = $(this);
300		var oldValue = $button.parent().find('input').val();
301		if ($button.hasClass('inc')) {
302			var newVal = parseFloat(oldValue) + 1;
303		} else {
304			// Don't allow decrementing below zero
305			if (oldValue > 0) {
306				var newVal = parseFloat(oldValue) - 1;
307			} else {
308				newVal = 0;
309			}
310		}
311		$button.parent().find('input').val(newVal);
312	});
313
314    
315    /*=====  End of quantity counter  ======*/
316
317
318    
319    /*=============================================
320    =            newsletter popup area            =
321    =============================================*/
322    
323    $("#close-newsletter-popup").on("click", function(){
324        $("#newsletter-popup-area").addClass("d-none");
325    });
326    
327    /*=====  End of newsletter popup area  ======*/
328    
329
330    
331    /*=============================================
332    =            zoom active            =
333    =============================================*/
334    
335    $('.big-image-slider99 .big-image-slider-single-item').zoom();
336    $('.big-image-slider-wrapper--gallery-mode .big-image-slider-single-item').zoom();
337    $('.big-image-slider-wrapper--sticky-mode .big-image-slider-single-item').zoom();
338    $('.big-image-slider-wrapper--slider-mode .big-image-slider-single-item').zoom();
339    
340    /*=====  End of zoom active  ======*/
341
342
343    
344    /*=============================================
345    =            nice select active            =
346    =============================================*/
347    
348    $('.nice-select').niceSelect();
349    Sys.WebForms.PageRequestManager.getInstance().add_endRequest(onEndRequest)
350    function onEndRequest(sender, args) {
351        $('.nice-select').niceSelect();
352    };
353    /*=====  End of nice select active  ======*/
354
355    
356    /*=============================================
357    =            sticky sidebar            =
358    =============================================*/
359    
360    $('.single-product-details-sticky').stickySidebar({
361		topSpacing: 90,
362		bottomSpacing: -180,
363		minWidth: 768
364	});
365    
366    /*=====  End of sticky sidebar  ======*/
367
368
369    
370    /*=============================================
371    =            payment  method select            =
372    =============================================*/
373    
374    
375    $('[name="payment-method"]').on('click', function () {
376
377        var $value = $(this).attr('value');
378
379        $('.single-method p').slideUp();
380        $('[data-method="' + $value + '"]').slideDown();
381
382    });
383    
384    
385    /*=====  End of payment  method select  ======*/
386    
387    
388    /*=============================================
389    =            shipping form toggle            =
390    =============================================*/
391    
392	$('[data-shipping]').on('click', function () {
393		if ($('[data-shipping]:checked').length > 0) {
394			$('#shipping-form').slideDown();
395		} else {
396			$('#shipping-form').slideUp();
397		}
398	});
399    /*=====  End of shipping form toggle  ======*/
400
401    
402    /*=============================================
403    =            price range            =
404    =============================================*/
405    
406    
407	$('#price-range').slider({
408		range: true,
409		min: 0,
410		max: 1000,
411		values: [ 0, 900 ],
412		slide: function( event, ui ) {
413			$('#price-amount').val( '$' + ui.values[ 0 ] + ' - $' + ui.values[ 1 ] );
414		}
415	});
416	$('#price-amount').val('$' + $('#price-range').slider( 'values', 0 ) +
417		' - $' + $('#price-range').slider('values', 1 ) ); 
418    
419    /*=====  End of price range  ======*/
420    
421	
422    /*=============================================
423    =            product view mode            =
424    =============================================*/
425
426	$('.grid-icons button').on('click', function (e) {
427		e.preventDefault();
428
429		var shopProductWrap = $('.shop-product-wrap');
430		var viewMode = $(this).data('target');
431
432		$('.grid-icons button').removeClass('active');
433		$(this).addClass('active');
434        shopProductWrap.removeClass('grid three-column four-column list').addClass(viewMode);
435        
436        if(viewMode == 'grid three-column'){
437			shopProductWrap.children().addClass('col-lg-4').removeClass('col-lg-3');
438		}
439
440		if(viewMode == 'grid four-column'){
441			shopProductWrap.children().addClass('col-lg-3').removeClass('col-lg-4');
442		}
443	});
444    /*=====  End of product view mode  ======*/
445    
446    
447    /*----------  product view mode  ----------*/
448    
449    /*----------  blog image gallery slider  ----------*/
450	
451		var blogPostSlider = $('.blog-image-gallery');
452		blogPostSlider.slick({
453			prevArrow: '<button type="button" class="slick-prev"><i class="fa fa-chevron-left"></i></button>',
454			nextArrow: '<button type="button" class="slick-next"><i class="fa fa-chevron-right"></i></button>',
455			arrows: true,
456			autoplay: true,
457			autoplaySpeed: 4000,
458			dots: false,
459			pauseOnFocus: false,
460			pauseOnHover: false,
461			infinite: true,
462			slidesToShow: 1
463		});
464	
465
466
467
468})(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.