'use strict'; // import slickCarousel from 'slick-carousel' // $('#langSel').niceSelect(); // new WOW().init(); // mainSlider function mainSlider() { var BasicSlider = $('.hero__slider'); if(BasicSlider) { BasicSlider.on('init', function (e, slick) { var $firstAnimatingElements = $('.movie-slide:first-child').find('[data-animation]'); doAnimations($firstAnimatingElements); }); BasicSlider.on('beforeChange', function (e, slick, currentSlide, nextSlide) { var $animatingElements = $('.movie-slide[data-slick-index="' + nextSlide + '"]').find('[data-animation]'); doAnimations($animatingElements); }); BasicSlider.slick({ autoplay: true, autoplaySpeed: 3000, // lazyLoad: 'ondemand', dots: true, fade: false, arrows: false, slidesToShow: 1, // nextArrow: '', // prevArrow: '', responsive: [ { breakpoint: 1024, settings: { slidesToShow: 1, slidesToScroll: 1, infinite: true, } }, { breakpoint: 991, settings: { slidesToShow: 1, slidesToScroll: 1, arrows: false } }, { breakpoint: 767, settings: { slidesToShow: 1, slidesToScroll: 1, arrows: false } } ] }); } function doAnimations(elements) { var animationEndEvents = 'webkitAnimationEnd mozAnimationEnd MSAnimationEnd oanimationend animationend'; elements.each(function () { var $this = $(this); var $animationDelay = $this.data('delay'); var $animationType = 'animated ' + $this.data('animation'); $this.css({ 'animation-delay': $animationDelay, '-webkit-animation-delay': $animationDelay }); $this.addClass($animationType).one(animationEndEvents, function () { $this.removeClass($animationType); }); }); } } mainSlider(); // $(window).on('load', function() {}) $('.movie-slider-one').slick({ // lazyLoad: 'ondemand', autoplay:true, slidesToShow: 7, slidesToScroll: 1, infinite: true, speed: 700, dots: false, arrows: true, nextArrow: '', prevArrow: '', responsive: [ { breakpoint: 1650, settings: { slidesToShow: 5 } }, { breakpoint: 1200, settings: { slidesToShow: 4 } }, { breakpoint: 992, settings: { slidesToShow: 3 } }, { breakpoint: 768, settings: { slidesToShow: 2 } }, { breakpoint: 512, settings: { slidesToShow: 2 } } ] }); // ///lazy loading image script // function lazyLoading(){ // let images = document.querySelectorAll('.loading-img'); // function preloadImage(image) { // let src = image.getAttribute('data-src'); // image.setAttribute('src', src) // image = $(image); // image.siblings('.thumb_overlay').fadeTo(2500, 0) // } // let imageOptions = { // threshold: 1, // }; // const imageObserver = new IntersectionObserver((entries, imageObserver) => { // entries.forEach(entry => { // if (entry.isIntersecting) { // // setTimeout(() => { // preloadImage(entry.target) // // overlay.style.display = 'none'; // // }, 2000); // imageObserver.unobserve(entry.target) // } // }) // }, imageOptions) // images.forEach(image => { // imageObserver.observe(image) // }, imageOptions) // } // lazyLoading(); (function ($) { "user strict"; })(jQuery); document.addEventListener('readystatechange', event => { if (document.readyState === "complete") { } });