PageSourceSearch

https://neguswines.com/wp-content/themes/oblo/assets/js/common.js?ver=1.0.0

js neguswines.com collected 2026-10-08 11:06:31 UTC 15,655 bytes, 618 lines download raw bytes

1/**
2*	Oblo - Creative Portfolio Template (HTML)
3*	Version: 1.0
4*	Author: beshleyua
5*	Author URL: http://themeforest.net/user/beshleyua
6*	Copyright © Oblo by beshleyua. All Rights Reserved.
7**/
8
9( function( $ ) {
10	'use strict';
11
12/**
13	Preloader
14**/
15$(window).on("load", function() {
16	$('body').imagesLoaded( {}, function() {
17		var preload = $('.preloader');
18		preload.addClass('loaded');
19		preload.find('.centrize').fadeOut();
20		/*setTimeout(function(){*/
21
22			/**
23				hide Preloader
24
25			preload.fadeOut();**/
26
27			/**
28				init Cursor
29			**/
30			initCursor();
31
32			/**
33				init Scrolla
34			**/
35			$('.elementor-widget-text-editor').attr('data-animate','active');
36			$('.scroll-animate').scrolla({
37				once: true,
38				mobile: true
39			});
40
41			/**
42				init Hero Slider
43			**/
44			if($('.main-slider-items__image_desktop').length) {
45			initMainSlider();
46			}
47			if($('.main-slider-items__image_mobile').length) {
48			initMainSlider_mobile();
49			}
50
51			/**
52				init Full Slider
53			**/
54
55			if($('.full-slider-items__image_desktop').length) {
56			initFullSlider();
57			}
58			if($('.full-slider-items__image_mobile').length) {
59			initFullSlider_mobile();
60			}
61
62			/**
63				init Half Slider
64			**/
65			if($('.half-slider-items__image').length) {
66			initHalfSlider();
67			}
68
69			/**
70				init Hero Started
71			**/
72			if($('.started-items__image').length) {
73			initHeroStarted();
74			}
75
76		/*}, 1200);*/
77	});
78});
79
80$(function() {
81	'use strict';
82
83	/**
84	 	Nav White
85	**/
86	if ($('.elementor-section:first-child .hero-main-slider').length || $('.elementor-section:first-child .main-slider').length || $('.elementor-section:first-child .full-slider').length || $('.elementor-section:first-child .hero-started').length || $('.archive .shop-page-started').length || $('.elementor-section:first-child .section.m-works-carousel.fully').length) {
87		$('body').addClass('nav-white');
88		$('body').addClass('nav-white-logo');
89	}
90	if ($(window).width() < 768) {
91		if ($('.elementor-section:first-child .half-slider').length) {
92			$('body').addClass('nav-white');
93		}
94	}
95
96	/**
97		Cart Popup
98	**/
99	$('.header .cart-btn .cart-icon').on('click', function(){
100		if($(this).closest('.cart-btn').hasClass('opened')){
101			$(this).closest('.cart-btn').removeClass('opened');
102			$(this).closest('.cart-btn').find('.cart-widget').hide();
103		} else {
104			$(this).closest('.cart-btn').addClass('opened');
105			$(this).closest('.cart-btn').find('.cart-widget').fadeIn();
106		}
107
108		return false;
109	});
110
111	/**
112		Sections full height
113	**/
114	setHeightFullSection();
115	$(window).resize(function() {
116		setHeightFullSection();
117	});
118
119	/**
120		Parallax
121	**/
122	$('.js-parallax').jarallax({
123		speed: 0.65,
124		type: 'scroll'
125	});
126
127	/**
128		Splitting
129	**/
130	Splitting();
131
132	/**
133		Skrollr
134	**/
135	if ($(window).width() > 1300 ) {
136	var s = skrollr.init();
137	}
138
139	/**
140		Header Sticky
141	**/
142	if($('.header').length && $('.page-white').length) {
143		$(window).on('scroll', function(event){
144			if ( $(window).scrollTop() > 100 ) {
145				$('.header').addClass('sticky');
146				if ( this.oldScroll < this.scrollY ) {
147					$('.header').addClass('animate-in');
148				} else {
149					if ( $(window).scrollTop() < 200 ) {
150						$('.header').addClass('animate-out');
151					}
152				}
153			} else {
154				$('.header').removeClass('sticky');
155				$('.header').removeClass('animate-in');
156				$('.header').removeClass('animate-out');
157			}
158
159			this.oldScroll = this.scrollY;
160		});
161	}
162
163	function checkScrollDirectionIsUp(event) {
164		if (event.wheelDelta) {
165			return event.wheelDelta > 0;
166		}
167		return event.deltaY < 0;
168	}
169
170	/* Hero Main Slider */
171	var st_mousewheel_option = $('.hero-main-slider .swiper-container').data('mousewheel');
172	var st_auto_val = $('.hero-main-slider .swiper-container').data('autoplay');
173	if (st_auto_val > 1) {
174		var st_auto = true;
175		$('.hero-main-slider .swiper-container .swiper-slide').attr('data-swiper-autoplay', st_auto_val);
176	} else {
177		var st_auto = false;
178	}
179	var st_image_slider = new Swiper('.hero-main-slider .swiper-container', {
180		slidesPerView: 1,
181		spaceBetween: 0,
182		loop: false,
183		rewind: true,
184		autoplay: st_auto,
185		speed: 1000,
186		mousewheel: st_mousewheel_option,
187		watchSlidesProgress: true,
188		pagination: {
189			el: '.hero-main-slider .swiper-pagination',
190		},
191		navigation: {
192			nextEl: '.hero-main-slider .swiper-button-next',
193			prevEl: '.hero-main-slider .swiper-button-prev',
194		},
195		on: {
196			progress: function(){
197				var swiper = this;
198				for (var i = 0; i < swiper.slides.length; i++) {
199					var slideProgress = swiper.slides[i].progress, innerOffset = swiper.width * 0.5, innerTranslate = slideProgress * innerOffset;
200					swiper.slides[i].querySelector(".hero-main-slider .slide").style.transform = "translateX(" 
200+ innerTranslate + "px)";
201				}
202			},
203			touchStart: function() {
204				var swiper = this;
205				for (var i = 0; i < swiper.slides.length; i++) {
206					swiper.slides[i].style.transition = "";
207				}
208			},
209			setTransition: function(swiper, speed) {
210				for (var i = 0; i < swiper.slides.length; i++) {
211					swiper.slides[i].style.transition = speed + "ms";
212					swiper.slides[i].querySelector(".hero-main-slider .slide").style.transition = speed + "ms";
213				}
214			},
215			init: function() {
216				var swiper = this;
217
218				setTimeout(function(){
219					$('.hero-main-slider .swiper-slide.swiper-slide-active').addClass('animate-active');
220				}, 500);
221
222				if ( $('.hero-main-slider .swiper-slide').eq(swiper.realIndex).find('.dark').length ) {
223					if ( ! $('body').hasClass('dark-first') ) {
224						$('body').addClass('dark-first');
225					}
226				} else {
227					$('body').removeClass('dark-first');
228				}
229			},
230			slideChange: function() {
231				var swiper = this;
232
233				$('.hero-main-slider .swiper-slide').removeClass('animate-active');
234				$('.hero-main-slider .swiper-slide').eq(swiper.realIndex).addClass('animate-active');
235
236				if ( $('.hero-main-slider .swiper-slide').eq(swiper.realIndex).find('.dark').length ) {
237					if ( ! $('body').hasClass('dark-first') ) {
238						$('body').addClass('dark-first');
239					}
240				} else {
241					$('body').removeClass('dark-first');
242				}
243			}
244		}
245	});
246
247    /**
248		Works Carousel
249	**/
250	var works_mousewheel_option = $('.m-works-carousel.default .swiper-container').data('mousewheel');
251	var works_carousel = new Swiper('.m-works-carousel.default .swiper-container', {
252		slidesPerView: 3,
253		spaceBetween: 50,
254		centeredSlides: true,
255		speed: 1000,
256		loop: true,
257		mousewheel: works_mousewheel_option,
258		preventInteractionOnTransition: true,
259		navigation: false,
260		pagination: {
261          el: ".swiper-pagination",
262          type: "progressbar",
263        },
264		breakpoints: {
265			0: {
266				slidesPerView: 1,
267			},
268			768: {
269				slidesPerView: 2,
270			},
271			1200: {
272				slidesPerView: 3,
273			},
274		}
275	});
276
277	/**
278		Works Carousel
279	**/
280	var workst_mousewheel_option = $('.m-works-carousel.fully .swiper-container').data('mousewheel');
281	var works_carousel = new Swiper('.m-works-carousel.fully .swiper-container', {
282		slidesPerView: 3,
283		spaceBetween: 0,
284		centeredSlides: true,
285		speed: 1000,
286		loop: true,
287		mousewheel: workst_mousewheel_option,
288		preventInteractionOnTransition: true,
289		navigation: false,
290		pagination: {
291          el: ".swiper-pagination",
292          type: "progressbar",
293        },
294		breakpoints: {
295			0: {
296				slidesPerView: 1,
297			},
298			768: {
299				slidesPerView: 2,
300			},
301			1200: {
302				slidesPerView: 3,
303			},
304		}
305	});
306
307	// Carousel Testimonials
308	$('.js-testimonials').each(function() {
309        var swiperTestimonials = new Swiper('.js-testimonials', {
310            slidesPerView: 2,
311		    spaceBetween: 50,
312		    pagination: {
313                el: '.swiper-pagination',
314			    clickable: true
315            },
316		    breakpoints: {
317			    0: {
318				    slidesPerView: 1,
319			    },
320			    768: {
321				    slidesPerView: 2,
322			    },
323			    1200: {
324				    slidesPerView: 2,
325			    }
326            }
327		});
328    });
329
330	/**
331		Menu Full Overlay
332	**/
333	$('.header').on('click', '.menu-btn.full', function(){
334		if($(this).hasClass('active')) {
335			$(this).removeClass('active');
336			$(this).addClass('no-touch');
337			$('body').removeClass('no-scroll');
338			$('.menu-full-overlay').removeClass('is-open');
339			$('.menu-full-overlay').removeClass('has-scroll');
340			$('.menu-full-overlay').removeClass('animate-active');
341			setTimeout(function(){
342				$('.menu-full-overlay').removeClass('visible');
343				$('.menu-btn.full').removeClass('no-touch');
344				$('.header').removeClass('is-open');
345			}, 1000);
346		}
347		else {
348			$(this).addClass('active no-touch');
349			var height = $(window).height();
350			$('.menu-full-overlay').css({'height': height});
351			$('body').addClass('no-scroll');
352			$('.menu-full-overlay').addClass('is-open visible');
353			$('.header').addClass('is-open');
354			setTimeout(function(){
355				$('.menu-full-overlay').addClass('has-scroll animate-active');
356				$('.menu-btn.full').removeClass('no-touch');
357			}, 1000);
358		}
359		return false;
360	});
361
362	/**
363		Menu Full Overlay Submenu
364	**/
365	$('.menu-full').on('click', '.has-children > a', function(){
366		if($(this).closest('li').hasClass('opened')) {
367			$(this).closest('li').removeClass('opened');
368			$(this).closest('li').addClass('closed');
369			$(this).closest('li').find('> ul').css('max-height', 0);
370		} else {
371			$(this).closest('ul').find('> li').removeClass('closed').removeClass('opened');
372			$(this).closest('ul').find('> li').find('> ul').css('max-height', 0);
373
374			$(this).closest('li').addClass('opened');
375
376			var submenu_h = 0;
377			$(this).closest('li').find('> ul > li').each(function(){
378				submenu_h += $(this).height() + 20;
379			});
380			$(this).closest('li').find('> ul').css('max-height', submenu_h + 20);
381		}
382		return false;
383	});
384
385	/**
386		Gallery Carousel
387	**/
388	var gallery_carousel = new Swiper('.m-gallery-carousel .swiper-container', {
389		slidesPerView: 'auto',
390		spaceBetween: 100,
391		speed: 700,
392		loop: false,
393		pagination: false,
394		navigation: {
395			nextEl: '.m-gallery-carousel .swiper-button-next',
396			prevEl: '.m-gallery-carousel .swiper-button-prev',
397		},
398		breakpoints: {
399			0: {
400				spaceBetween: 30,
401			},
402			768: {
403				spaceBetween: 50,
404			},
405			1200: {
406				spaceBetween: 100,
407			},
408		}
409	});
410
411	/*
412		Initialize gallery items
413	*/
414	var $container_gallery = $('.m-gallery .row');
415	$container_gallery.imagesLoaded(function() {
416		$container_gallery.isotope({
417			itemSelector: '.col-xs-12',
418			percentPosition: true,
419		});
420		$(document).on('lazyloaded', function(e){
421			$container_gallery.isotope( 'reloadItems' ).isotope();
422		});
423	});
424
425	/*
426		Initialize portfolio items
427	*/
428	var $container = $('.works-items');
429	$container.imagesLoaded(function() {
430		$container.isotope({
431			itemSelector: '.works-col',
432			percentPosition: true,
433		});
434		$(document).on('lazyloaded', function(e){
435			$container.isotope( 'reloadItems' ).isotope();
436		});
437	});
438
439	/*
440		Filter items on button click
441	*/
442	$('.filter-links').on( 'click', 'a', function() {
443		var filterValue = $(this).attr('data-href');
444		$container.isotope({ filter: filterValue });
445
446		$('.filter-links a').removeClass('active');
447		$(this).addClass('active');
448
449		if (!$(filterValue).find('.scroll-animate').hasClass('animate__active')) {
450			$(filterValue).find('.scroll-animate').addClass('animate__active');
451		}
452
453		return false;
454	});
455
456	/*
457		Video popup
458	*/
459	$('.has-popup-video').magnificPopup({
460		disableOn: 700,
461		type: 'iframe',
462		iframe: {
463            patterns: {
464                youtube_short: {
465                  index: 'youtu.be/',
466                  id: 'youtu.be/',
467                  src: 'https://www.youtube.com/embed/%id%?autoplay=1'
468                }
469            }
470        },
471		removalDelay: 160,
472		preloader: false,
473		fixedContentPos: false,
474		mainClass: 'mfp-fade',
475		callbacks: {
476			markupParse: function(template, values, item) {
477				template.find('iframe').attr('allow', 'autoplay');
478			}
479		}
480	});
481
482	/*
483		Music popup
484	*/
485	$('.has-popup-audio').magnificPopup({
486		disableOn: 700,
487		type: 'iframe',
488		removalDelay: 160,
489		preloader: false,
490		fixedContentPos: false,
491		mainClass: 'mfp-fade'
492	});
493
494	/*
495		Gallery popup
496	*/
497	$('.has-popup-gallery').on('click', function() {
498        var gallery = $(this).attr('href');
499
500        $(gallery).magnificPopup({
501            delegate: 'a',
502            type:'image',
503            closeOnContentClick: false,
504            mainClass: 'mfp-fade',
505            removalDelay: 160,
506            fixedContentPos: false,
507            gallery: {
508                enabled: true
509            }
510        }).magnificPopup('open');
511
512        return false;
513    });
514
515	/**
516		Tabs
517	**/
518	$('.tab-menu').on('click', '.tab-btn', function(){
519		var tab_bl = $(this).attr('href');
520
521		$(this).closest('.tab-menu').find('li').removeClass('active');
522		$(this).closest('li').addClass('active');
523
524		$(this).closest('.tabs').find('> .tab-item').hide();
525		$(tab_bl).fadeIn();
526
527		return false;
528	});
529
530	/**
531		Collapse
532	**/
533	$('.collapse-item').on('click', '.collapse-btn', function(){
534		if($(this).closest('.collapse-item').hasClass('active')) {
535			$(this).closest('.collapse-item').find('.collapse-content').slideUp();
536			$(this).closest('.collapse-item').removeClass('active');
537			$(this).removeClass('active');
538		}
539		else {
540			$(this).closest('.collapse-item').find('.collapse-content').slideDown();
541			$(this).closest('.collapse-item').addClass('active');
542			$(this).addClass('active');
543		}
544	});
545
546	/**
547		Video
548	**/
549	$('.m-video-large .video').on('click', '.play, .img', function(){
550		$(this).closest('.video').addClass('active');
551		var iframe = $(this).closest('.video').find('.js-video-iframe');
552
553		largeVideoPlay(iframe);
554
555		return false;
556
557	});
558
559	function largeVideoPlay( iframe ) {
560		var src = iframe.data('src');
561		iframe.attr('src', src);
562	}
563});
564
565function initCursor() {
566	var mouseX=window.innerWidth/2, mouseY=window.innerHeight/2;
567
568	var cursor = {
569		el: $('.cursor'),
570		x: window.innerWidth/2,
571		y: window.innerHeight/2,
572		w: 30,
573		h: 30,
574		update:function() {
575			var l = this.x-this.w/2;
576			var t = this.y-this.h/2;
577			this.el.css({ 'transform':'translate3d('+l+'px,'+t+'px, 0)' });
578		}
579	}
580
581	$(window).mousemove (function(e) {
582		mouseX = e.clientX;
583		mouseY = e.clientY;
584	});
585
586	$('a, .swiper-pagination, .swiper-buttons, button, .button, .btn').hover(function() {
587		$('.cursor').addClass("cursor-zoom");
588	}, function(){
589		$('.cursor').removeClass("cursor-zoom");
590	});
591
592	setInterval(move,1000/60);
593
594	function move() {
595		cursor.x = lerp (cursor.x, mouseX, 0.1);
596		cursor.y = lerp (cursor.y, mouseY, 0.1);
597		cursor.update()
598	}
599
600	function lerp (start, end, amt) {
601		return (1-amt)*start+amt*end
602	}
603}
604
605function setHeightFullSection() {
606	var width = $(window).width();
607	var height = $(window).height();
608
609	/* Set full height in started blocks */
610	$('.section.hero-main-slider, .section.main-slider, .section.full-slider, .section.half-slider, .section.m-works-carousel, .section.m-contacts-map, .error-page, .section.hero-started, .menu-full-overlay, .preloader .centrize').css({'height': height});
611	$('.admin-bar .section.hero-main-slider, .admin-bar .section.main-slider, .admin-bar .section.full-slider, .admin-bar .section.half-slider, .admin-bar .section.m-works-carousel, .admin-bar .section.m-contacts-map, .admin-bar .error-page, .admin-bar .section.hero-started').css({'height': height-32});
612	if(width < 783) {
613		$('.section.hero-main-slider, .section.main-slider, .section.full-slider, .section.half-slider, .section.m-works-carousel, .section.m-contacts-map, .error-page, .section.hero-started, .menu-full-overlay, .preloader .centrize').css({'height': height});
614		$('.admin-bar .section.hero-main-slider, .admin-bar .section.main-slider, .admin-bar .section.full-slider, .admin-bar .section.half-slider, .admin-bar .section.m-works-carousel, .admin-bar .section.m-contacts-map, .admin-barn .error-page, .admin-bar .section.hero-started').css({'height': height-46});
615	}
616}
617
618} )( 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.