PageSourceSearch

https://www.juliakovalchuk.ru/wp-content/themes/jktheme/assets/js/main.js?ver=1.0

js juliakovalchuk.ru collected 2026-10-03 23:52:40 UTC 20,826 bytes, 621 lines download raw bytes

1jQuery(function ($) {
2    "use strict";
3
4
5    /*============
6     1-Hero Header
7     2-Navigation
8     3-Video Banner
9     4-Gallery
10     5-Fraction Slider
11     6-Parallax
12     7-Carousel fredsel
13     8-Owl Slider
14     9-Vegas Slider
15     10-Tweet
16     11-JPlayer
17     12-Contact Form
18     ==============*/
19
20
21    var isStickyPlayer = $(".sticky_player").attr('data-sticky'),
22        isStickyNav = $("#sticktop").attr('data-sticky'),
23        naviheight = $("#sticktop").height(),
24        playerHeight = $(".sticky_player").height(),
25        navTopSpace = 0, NavOffset = 0;
26    var $winHeight = $(window).height(),
27        $winWidth = $(window).width();
28    /*=======================================
29     1-Hero Header
30     =======================================*/
31
32    $(window).on('resize', function () {
33        $winHeight = $(window).height();
34        $winWidth = $(window).width();
35
36        $('.hero_section').css('height', $winHeight + 'px');
37        var $hero_height = $('.hero_section').height(),
38            $hero_content_height = $('.hero_content').height();
39
40        if ($hero_height < $hero_content_height) {
41            $('.hero_section').css('height', $hero_content_height + 70 + 'px');
42        }
43        $('.hero_section').css('padding-top', ($hero_height / 2) - ($hero_content_height / 2) + 'px');
44
45    }).resize();
46
47    $(".list_scroll").mCustomScrollbar({advanced: {updateOnContentResize: true},});
48
49    /*=======================================
50     2-Navigation
51     =======================================*/
52
53    if (isStickyNav != "false") {
54        NavOffset = naviheight + 10;
55    }
56    if (isStickyPlayer != "false") {
57        NavOffset = playerHeight + 10;
58    }
59    if (isStickyNav != "false" && isStickyPlayer != "false") {
60        NavOffset = naviheight + playerHeight + 10;
61    }
62    $('body').attr('data-offset', NavOffset + 10);
63
64    $(".ScrollTo,.btn-scroll").click(function (e) {
65        e.preventDefault();
66        $('html, body').stop().animate({scrollTop: $($.attr(this, 'href')).offset().top - NavOffset}, 1000, "swing");
67    });
68
69    $(".navbar-nav").onePageNav({
70        currentClass: 'active',
71        changeHash: true
72    });
73
74    $(".members_carousel").onePageNav();
75
76
77    if ($winWidth > 700) {
78        if ($(".sticky_player").attr('data-sticky') != "false") {
79            navTopSpace = playerHeight;
80        }
81        if (isStickyNav != "false") {
82            $("#sticktop").sticky({topSpacing: navTopSpace});
83        }
84        if ($(".sticky_player").attr('data-sticky') != "false") {
85            $(".sticky_player").sticky({topSpacing: 0});
86        }
87        $('#sticktop').on('sticky-start', function () {
88            if ($(".sticky_player").attr('data-sticky') != "false")
89                $('.rock_player').removeClass('pre_sticky');
90        });
91        $('#sticktop').on('sticky-end', function () {
92            if ($(".sticky_player").attr('data-sticky') != "false")
93                $('.rock_player').addClass('pre_sticky');
94        });
95    }
96
97    /*=======================================
98     3-Video Banner
99     =======================================*/
100
101    if ($('.video-banner').length != 0) {
102
103        var videoUrl = HeroVideo.videoUrl,
104            videoID = HeroVideo.videoID,
105            poster = HeroVideo.videoPoster,
106            autoplay = HeroVideo.videoAutoplay !== '0';
107
108        if (HeroVideo.videoID) {
109            initHeroYTPlayer();
110        }
111
112        if (!HeroVideo.videoID && HeroVideo.videoUrl) {
113            initHeroBigVideoPlayer();
114        }
115    }
116
117    function initHeroYTPlayer() {
118        $('.video-banner#section_home').YTPlayer();
119    }
120
121    function initHeroBigVideoPlayer() {
122        var BV = new $.BigVideo({useFlashForFirefox: false});
123        BV.init();
124        BV.getPlayer().poster(poster);
125        BV.getPlayer().src(videoUrl);
126        //BV.show(poster);
127        BV.show(videoUrl, {doLoop: true, ambient: true});
128
129        $('.video-load').show();
130        BV.getPlayer().on('seeking', function () {
131            $('.video-load').hide();
132            $('.video-pause').show();
133            $('.video-play').hide();
134            //console.log("seeking");
135        });
136
137        BV.getPlayer().on('play', function () {
138            $('.video-load').hide();
139            $('.video-pause').show();
140            $('.video-play').hide();
141        });
142        BV.getPlayer().on('ended', function () {
143            $('.video-load').hide();
144            $('.video-play').show();
145            $('.video-pause').hide();
146            //console.log("ended");
147        });
148        BV.getPlayer().on('loadstart', function () {
149            $('.video-load').show();
150            $('.video-pause').hide();
151            $('.video-play').hide();
152            //console.log("loadstart");
153        });
154        BV.getPlayer().on('loadeddata', function () {
155            $('.video-load').hide();
156            $('.video-pause').show();
157            $('.video-play').hide();
158
159            if (!autoplay) {
160                setTimeout(function () {
161                    $('.video-pause').click();
162                    BV.getPlayer().volume(1);
163                }, 350);
164            }
165            else {
166                BV.getPlayer().volume(1);
167            }
168        });
169        $('.video-pause').click(function () {
170            BV.getPlayer().pause();
171            $('.video-load').hide();
172            $('.video-pause').hide();
173            $('.video-play').show();
174        });
175        $('.video-play').click(function () {
176            BV.getPlayer().play();
177            $('.video-play').hide();
178            $('.video-pause').show();
179        });
180    }
181
182    /*=======================================
183     4-Gallery
184     =======================================*/
185
186    $('.sliderGallery,.trigger_slider').click(function (e) {
187        e.preventDefault();
188        $('.gallayoutOption li').removeClass('active');
189        $(this).parent('li').addClass('active');
190        var $this = $(this);
191        $('.gal_list li').each(function () {
192            $(this).removeClass('trigger_slider').addClass('gallery-item');
193        });
194        $('.gal_list').addClass('owl-carousel owl-gallery');
195        $(".owl-gallery").owlCarousel({
196            slideSpeed: 1000,
197            pagination: false,
198            singleItem: true,
199            navigation: true,
200        });
201        $('.social_share').slideDown();
202    });
203
204    $('.gridGallery').on('click', function (e) {
205        $('.gallayoutOption li').removeClass('active');
206        $(this).parent('li').addClass('active');
207        $('.social_share').slideUp();
208        e.preventDefault();
209        if ($(".owl-gallery").length) {
210            $(".owl-gallery").data('owlCarousel').destroy();
211            $('.gal_list li').each(function () {
212                $(this).addClass('trigger_slider').removeClass('gallery-item');
213            });
214            $('.gal_list').removeClass('owl-carousel owl-gallery');
215        }
216    });
217
218    /*=======================================
219     5-Fraction Slider
220     =======================================*/
221
222    $('.fractionSlide').fractionSlider({
223        dimensions: '1970,1000',
224        responsive: true,
225        backgroundAnimation: true,
226        slideTransitionSpeed: 200,
227        pager: true,
228        startCallback: function () {
229            $('.fractionSlide .slide').show();
230        }
231    });
232
233
234    /*=======================================
235     6-Parallax
236     =======================================*/
237    $.stellar({
238        horizontalScrolling: false,
239        verticalOffset: 0,
240        responsive: true,
241    });
242
243    /*=======================================
244     7-Carousel fredsel
245     =======================================*/
246    $('.news_carousel').waitForImages(function () {
247        $('.news_carousel').carouFredSel({
248            width: "100%",
249            circular: false,
250            infinite: false,
251            auto: false,
252            align: "centre",
253
254            scroll: {
255                items: 1, easing: "linear"
256            },
257            prev: {button: "#news-prev", key: "left"},
258            next: {button: "#news-next", key: "right"},
259        });
260    });
261    $('.members_carousel').waitForImages(function () {
262        $('.members_carousel').carouFredSel({
263            width: "100%",
264            circular: false,
265            infinite: false,
266            auto: false,
267            align: false,
268            scroll: {
269                items: 1, easing: "linear"
270            },
271            prev: {button: "#member-prev", key: "left"},
272            next: {button: "#member-next", key: "right"},
273        });
274    });
275    /*==========================================
276     8-Owl Slider
277     =======================================*/
278    $(".testimonial_quotes").owlCarousel({
279        slideSpeed: 1000,
280        paginationSpeed: 500,
281        singleItem: true,
282        navigation: false,
283        transitionStyle: "backSlide",
284        afterAction: function () {
285            $(window).trigger("resize");
286        },
287    });
288
289    /*============================
290     9-Vegas Slider
291     ============================*/
292
293    if ($('.vegas-slides').length) {
294        var vegas_BG_imgs = [],
295            $vegas_img = $('.vegas-slides li img'),
296            vegas_slide_length = $('.vegas-slides li').length;
297
298        for (var i = 0; i < vegas_slide_length; i++) {
299            var new_vegas_img = {};
300            new_vegas_img['src'] = $vegas_img.eq(i).attr('src');
301            new_vegas_img['fade'] = $vegas_img.eq(i).attr('data-fade');
302            vegas_BG_imgs.push(new_vegas_img);
303        }
304
305        var slideSpeed = $('.vegas-slides').data("speed");
306        $.vegas('slideshow', {
307            delay: slideSpeed,
308            backgrounds: vegas_BG_imgs,
309        });
310        $('.vegas-controls a').click(function (e) {
311            e.preventDefault();
312            var $parent = $(this).parent('li');
313            if (!$parent.hasClass('active')) {
314                $('.vegas-controls li').removeClass('active');
315                $parent.addClass('active');
316                $.vegas('jump', $parent.index());
317            }
318        });
319        $('body').bind('vegaswalk',
320            function (e, bg, step) {
321                $('.vegas-controls li').removeClass('active');
322                $('.vegas-controls li').eq(step).addClass('active');
323            });
324    }
325
326    if ($winWidth < 760) {
327        $.vegas('pause');
328    }
329
330    reanimate();
331    function reanimate() {
332        $('.ScrollTo > i').animate({top: 0}, 1000).animate({top: 20}, 1000, function () {
333            setTimeout(reanimate, 100);
334        });
335    }
336
337    /*========================================
338     10-Tweet
339     ===========================================*/
340    if ($('.tweet').length != 0) {
341        var path = $('.tweet').attr("data-path");
342        $('.tweet').twittie({
343            username: 'NewsKovalchuk',
344            dateFormat: '%b. %d, %Y',
345            template: '{{tweet}} <time class="date">{{date}}</time>',
346            count: 3,
347            apiPath: path + "/assets/php/tweet_api/tweet.php",
348        }, function () {
349            $(".tweet ul").addClass("tweet_slider owl-carousel owl-theme");
350            $(".tweet_slider").owlCarousel({
351                slideSpeed: 1000,
352                paginationSpeed: 500,
353                singleItem: true,
354                navigation: false,
355                autoHeight: true,
356            });
357        });
358    }
359
360    /*==========================================
361     11-JPlayer
362     =======================================*/
363
364
365    $('.playlist_expander').click(function (e) {
366        e.preventDefault();
367        $('.play_list').slideToggle();
368    });
369    $("#player-instance").jPlayer({
370        cssSelectorAncestor: ".rock_player", // Remove the ancestor css selector clause
371    });
372    if ($('.playlist-files').length) {
373        var playlist_items = [],
374            $playlist_audio = $('.playlist-files li'),
375            $list_content = $('.player_data li'),
376            playlist_items_length = $playlist_audio.length;
377
378        for (var i = 0; i < playlist_items_length; i++) {
379            var new_playlist_item = {};
380            new_playlist_item['title'] = $playlist_audio.eq(i).attr('data-title');
381            new_playlist_item['artist'] = $playlist_audio.eq(i).attr('data-artist');
382            new_playlist_item['mp3'] = $playlist_audio.eq(i).attr('data-mp3');
383            playlist_items.push(new_playlist_item);
384
385            $list_content.eq(i + 1).children('.track_index').html(i + 1);
386            $list_content.eq(i + 1).children('.track_thumb').html('<img src=' + $playlist_audio.eq(i).attr('data-thumb') + ' alt="track Thumb" />');
387            $list_content.eq(i + 1).children('.track_title').html($playlist_audio.eq(i).attr('data-title'));
388            $list_content.eq(i + 1).children('.track_genre').html($playlist_audio.eq(i).attr('data-genre'));
389            $list_content.eq(i + 1).children('.track_composer').html($playlist_audio.eq(i).attr('data-artist'));
390            $list_content.eq(i + 1).children('.track_length').html($playlist_audio.eq(i).attr('data-length'));
391            $list_content.eq(i + 1).find('.btn_watch_video').attr('href', $playlist_audio.eq(i).attr('data-video'));
392            $list_content.eq(i + 1).find('.itunesLink').attr('href', $playlist_audio.eq(i).attr('data-itunes'));
393        }
394
395        var werock = new jPlayerPlaylist({
396                jPlayer: "#player-instance",
397                cssSelectorAncestor: "",
398            }, playlist_items,
399            {playlistOptions: {autoPlay: false}},
400            {
401                swfPath: "assets/jPlayer/Jplayer.swf",
402                supplied: "mp3",
403            });
404        $('.play_it').click(function (e) {
405            e.preventDefault();
406            werock.play($(this).parents('li').index() - 1);
407        });
408        $('.audio-title').html(werock.playlist[0].title);
409
410        $("#player-instance").bind($.jPlayer.event.play, function (event) {
411            var current = werock.current,
412                playlist = werock.playlist;
413            jQuery.each(playlist, function (index, obj) {
414                if (index == current) {
415                    $('.audio-title').html(obj.title);
416                }
417            });
418        });
419
420        $("#player-instance").jPlayer("volume", '0.8');
421
422        $('.jp-volume li a').click(function (e) {
423            e.preventDefault();
424            $('.jp-volume li').removeClass('active');
425            $("#player-instance").jPlayer("volume", ($(this).parent().index() + 1) / 10 * 2);
426            for (var i = 0; i <= $(this).parent().index(); i++) {
427                $('.jp-volume li').eq(i).addClass('active');
428            }
429        });
430    }
431
432
433    /*
434     function IsEmail(email) {
435     var regex = /^([a-zA-Z0-9_\.\-\+])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/;
436     return regex.test(email);
437     }
438
439     if($("#contactform").length!=0){
440     $("#contactform").submit(function (e) {
441     e.preventDefault();
442     var name = $("#name").val(),
443     email = $("#email").val(),
444     subject = $("#subject").val(),
445     message = $("#message").val(),
446     dataString = 'name=' + name + '&email=' + email+ '&subject=' + subject + '&message=' + message;
447
448     if (name === '' || !IsEmail(email) || message === '') {
449     $('#valid-issue').html('Please Provide Valid Information').slideDown();
450     } else {
451     $.ajax({
452     type: "POST",
453     url: "assets/php/submit.php",
454     data: dataString,
455     success: function () {
456     $('#contactform').slideUp();
457     $('#valid-issue').html('Your message has been sent,<BR> We will contact you back with in next 24 hours.').show();
458     }
459     });
460     }
461     });
462     }
463     */
464
465    /*==========================
466     Ajax Expander
467     ==========================*/
468    $('.triggerTrack').click(function (e) {
469        e.preventDefault();
470        $('.trackLoading').show();
471        console.log($('#tracksAjax').height());
472        var $this = $(this), href = $this.attr('href'), key = $this.attr("data-number");
473        if (!href === '#') {
474            return
475        }
476        $.ajax({
477            url: href,
478            dataType: 'html',
479            success: function (data) {
480                var targetPageContent = $('<div />').html(data).find('.pageContentArea #album' + key);
481                $('#tracksAjax').html(targetPageContent).slideDown();
482                $('.closeTrackAjax').show();
483                $('.trackLoading').hide();
484                $('html, body').stop().animate({scrollTop: $("#tracksAjaxWrapper").offset().top - NavOffset}, 1000, "swing");
485            },
486            error: function (request, status, error) {
487                alert(request.responseText);
488                $('.trackLoading').hide();
489            }
490
491        });
492    });
493
494    $('.closeTrackAjax').click(function (e) {
495        e.preventDefault();
496        $('html, body').stop().animate({scrollTop: $($(this).attr('href')).offset().top - NavOffset}, 500, "swing");
497        $(this).hide();
498        $('#tracksAjax').slideUp();
499    });
500
501    $('.closeNewsAjax').click(function (e) {
502        e.preventDefault();
503        $('html, body').stop().animate({scrollTop: $($(this).attr('href')).offset().top - NavOffset}, 500, "swing");
504        $(this).hide();
505        $('#newsAjax').slideUp();
506    });
507
508
509    $('.triggerNews').click(function (e) {
510        e.preventDefault();
511        $('.trackLoading').show();
512        var $this = $(this), href = $this.attr('href'), key = $this.attr("data-number");
513        if (!href === '#') {
514            return
515        }
516        $.ajax({
517            url: href,
518            dataType: 'html',
519            success: function (data) {
520                var targetPageContent = $('<div />').html(data).find('.pageContentArea #xv-news' + key);
521                $('#newsAjax').html(targetPageContent).slideDown();
522                $('.trackLoading').hide();
523                $('.closeNewsAjax').show();
524                $('html, body').stop().animate({scrollTop: $("#newsAjaxWrapper").offset().top - NavOffset}, 1000, "swing");
525
526            },
527            error: function (request, status, error) {
528                alert(request.responseText);
529                $('.trackLoading').hide();
530            }
531
532        });
533    });
534
535
536    /*==========================
537     Gallery
538     ==========================*/
539    $('.gallery').each(function () {
540        $(this).magnificPopup({
541            delegate: 'a',
542            type: 'image',
543            gallery: {
544                enabled: true,
545                tCounter: '%curr% / %total%'
546            },
547            zoom: {
548                enabled: true,
549                duration: 300,
550                opener: function (element) {
551                    return element.find('img');
552                }
553            },
554        });
555    });
556
557    /*==========================
558     Instagram
559     ==========================*/
560    var $instagramPhotosEl = $('.instagram-feed');
561    if ($instagramPhotosEl.length > 0) {
562        $.fn.spectragram.accessData = {
563            accessToken: '36286274.b9e559e.4824cbc1d0c94c23827dc4a2267a9f6b',
564            clientID: 'b9e559ec7c284375bf41e9a9fb72ae01'
565        };
566
567        $instagramPhotosEl.each(function () {
568            var element = $(this),
569                instaGramUsername = element.attr('data-user'),
570                instaGramTag = element.attr('data-tag'),
571                instaGramCount = element.attr('data-count'),
572                instaGramType = element.attr('data-type');
573
574            if (!instaGramCount) {
575                instaGramCount = 9;
576            }
577
578            if (instaGramType == 'tag') {
579                element.spectragram('getRecentTagged', {
580                    query: instaGramTag,
581                    max: Number(instaGramCount),
582                    size: 'medium',
583                    wrapEachWith: ' '
584                });
585            } else if (instaGramType == 'user') {
586                element.spectragram('getUserFeed', {
587                    query: instaGramUsername,
588                    max: Number(instaGramCount),
589                    size: 'medium',
590                    wrapEachWith: ' '
591                });
592            } else {
593                element.spectragram('getPopular', {
594                    max: Number(instaGramCount),
595                    size: 'medium',
596                    wrapEachWith: ' '
597                });
598            }
599        });
600    }
601
602
603});
604
605document.addEventListener('DOMContentLoaded', () => {
606  if(sessionStorage.getItem('hq-modal-show') !== 'hide') {
607    if(document.querySelector('.hq-modal')) {
608      document.querySelector('.hq-modal').classList.remove('hidden');
609    }
610  }
611
612  if( document.querySelector('.hq-modal__close')) {
613      document.querySelector('.hq-modal__close').addEventListener('click', () => {
614        sessionStorage.setItem('hq-modal-show', 'hide');
615        if(document.querySelector('.hq-modal')) {
616          document.querySelector('.hq-modal').classList.add('hidden');
617        }
618      })
619  }
620
621})

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.