/* ----------------- Start JS Document ----------------- */
(function($) {
    "use strict";

    $(document).ready(function() {
        
        //Nav Menu 
        $(".nav > li:has(ul)").addClass("drop");
        $(".nav > li.drop > ul").addClass("dropdown");
        $(".nav > li.drop > ul.dropdown ul").addClass("sup-dropdown");

        // Our client
        var ourClient = $(".client-slider");
        ourClient.owlCarousel({
            items: 3,
            nav: false,
            dots: false,
            autoplay: true,
            center: true,
            loop: true,
            autoplayHoverPause: true,
            responsive:{
                0:{
                    items:3,
                    nav:false
                },
                768:{
                    items:5,
                }

            },
            navText: ['<i class="fa fa-angle-left"></i>', '<i class="fa fa-angle-right"></i>'],
        });
        
        // Widget About
        var aboutSlide = $(".wi-about-slide");
        aboutSlide.owlCarousel({
            items: 1,
            nav: false,
            dots: false,
            autoplay: true,
            center: true,
            loop: true,
            autoplayHoverPause: true,
            navText: ['<i class="fa fa-angle-left"></i>', '<i class="fa fa-angle-right"></i>'],
        });

      
        // Customer Review
        var reviewSlider = $(".review-slider");
        reviewSlider.owlCarousel({
            items: 1,
            nav: true,
            dots: false,
            autoplay: true,
            center: true,
            loop: true,
            autoplayHoverPause: true,
            navText: ['<i class="fa fa-angle-left"></i>', '<i class="fa fa-angle-right"></i>'],
        });

        /* Animated skills Bars */
        function DemoProgressbars(){

            var prog;

            $('.bar-progres').each(function() {
                prog = $(this);
                prog.LineProgressbar({
                    percentage: prog.data('percent'),
                    fillBackgroundColor: prog.data('color'),
                    duration: 2500
                });
            });

        }


        $('.progressbar-start').waypoint(function(){
            DemoProgressbars();
        },{
            offset: '100%',
            triggerOnce: true 
        }); 


        // Video Popup
        $(".various").fancybox({
            maxWidth    : 800,
            maxHeight   : 600,
            fitToView   : false,
            width       : '70%',
            height      : '70%',
            autoSize    : false,
            closeClick  : false,
            openEffect  : 'none',
            closeEffect : 'none'
        });

        $("[data-fancybox]").fancybox({
            // Options will go here
            toolbar : true,
            animationEffect : "zoom-in-out",
            transitionEffect : "circular",
            thumbs : {
                autoStart   : false,                  // Display thumbnails on opening
                hideOnClose : true,                   // Hide thumbnail grid when closing animation starts
                parentEl    : '.fancybox-container',  // Container is injected into this element
                axis        : 'y'                     // Vertical (y) or horizontal (x) scrolling
            },
            buttons : [
                'slideShow',
                'fullScreen',
                'thumbs',
                // 'share',
                //'download',
                //'zoom',
                'close'
            ],

        });
        
         /* Init Counterup */
        $('.counter').counterUp({
            delay: 4,
            time: 100
        });

        // carousel to mobile touchable
        $('.carousel').each(function() {
            var el = $(this);
            el.swiperight(function() {  
                el.carousel('prev');  
            }); 
            el.swipeleft(function() {  
                el.carousel('next');  
            }); 
        }); 


        // Click me to the my section
        $('.click-to-next').on('click',function() {
            var secHeight = $('#main-slider').height();
            $('html').animate({
                scrollTop: secHeight -61
            }, 900);
        });

        // Slick Slider || Testimonial
        $('.slider-for').slick({
            slidesToShow: 1,
            slidesToScroll: 1,
            arrows: true,
            fade: true,
            dots: true,
            centerPadding: 0,
            asNavFor: '.slider-nav'
        });

        $('.slider-nav').slick({
          slidesToShow: 3,
          slidesToScroll: 1,
          asNavFor: '.slider-for',
          dots: false,
          infinite: true,
          centerMode: true,
          centerPadding: 0,
          focusOnSelect: true,
          responsive: [
            {
              breakpoint: 768,
              settings: {
                slidesToShow: 1
              }
            }
          ]
        });

        // Sick Slider || Services
        $('.service-slider-content').slick({
            slidesToShow: 1,
            arrows: false,
            draggable: false,
            speed: 500,
            asNavFor: '.slider-thumb',

        });
        $('.slider-thumb').slick({
            arrows: false,
            asNavFor: '.service-slider-content',
            centerMode: false,
            centerPadding: '15px',
            dots: false,
            infinite: false,
            focusOnSelect: true,
            slidesToShow: 3,
            slidesToScroll: 3,
            responsive: [
                {
                  breakpoint: 768,
                  settings: {
                    slidesToShow: 3,
                  }
                }
            ]
        });

        $('.service-slider-content-2nd').slick({
            slidesToShow: 1,
            arrows: false,
            draggable: false,
            speed: 500,
            asNavFor: '.slider-thumb-2nd',

        });
        $('.slider-thumb-2nd').slick({
            arrows: false,
            asNavFor: '.service-slider-content-2nd',
            centerMode: false,
            centerPadding: '15px',
            dots: false,
            infinite: false,
            focusOnSelect: true,
            slidesToShow: 6,
            slidesToScroll: 6,
            responsive: [
                {
                  breakpoint: 768,
                  settings: {
                    slidesToShow: 6,
                  }
                }
            ]
        });

        
         //Slick Nav 

        $('.wpb-mobile-menu').slicknav({
            prependTo: '.navbar-header',
            parentTag: 'margo',
            allowParentLinks: true,
            duplicate: false,
            label: '',
            closedSymbol: '<i class="fa fa-plus"></i>',
            openedSymbol: '<i class="fa fa-minus"></i>',
        });

        
    }); //$(document).ready


    
    //Back Top Link

    var offset = 200;
    var duration = 500;
    $(window).scroll(function() {
        if ($(this).scrollTop() > offset) {
            $('.back-to-top').fadeIn(400);
        } else {
            $('.back-to-top').fadeOut(400);
        }
    });
    
    $('.back-to-top').on('click',function(event) {
        event.preventDefault();
        $('html, body').animate({
            scrollTop: 0
        }, 600);
        return false;
    });




    $(window).on( 'load', function() {

        $('#loader').fadeOut();
            
       // Isotope portfolio
        var $container = $('.portfolio-container');
        
        $container.isotope({
            filter: '*',
            masonry: {
                horizontalOrder: true
            },
            animationOptions: {
                duration: 750,
                easing: 'linear',
                queue: false
            }
        });

        $('.portfolio-filter a').on('click', function() {
            $('.portfolio-filter .current').removeClass('current');
            $(this).addClass('current');

            var selector = $(this).attr('data-filter');
            $container.isotope({
                filter: selector,
                percentPosition: true,
                animationOptions: {
                    duration: 750,
                    easing: 'linear',
                    queue: false
                }
            });
            return false;
        });
    }); //Window Load End



    // Google Map
    function initMap() {

        $('.init-gmap').each(function() {

            var element = $(this);

            var uluru = {lat: element.data('lat'), lng: element.data('lng')};

            var map = new google.maps.Map( element.get(0), {
                scrollwheel: true,
                zoom: element.data('zoom'),
                center: uluru
            });


            var marker = new google.maps.Marker({
                position: uluru,
                icon: 'assets/images/marker.png',
                map: map,
                title: 'Khulna 9000, Bangladesh'
            });

        });
    }

    $(window).on( 'load', function() {
        initMap();
    });

})(jQuery);


(function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(require,module,exports){
'use strict';

Object.defineProperty(exports, "__esModule", {
  value: true
});

/**
  Direction aware content reveals.

  @param {Object} object - Container for all options.
  @param {string} selector - Container element selector.
  @param {string} itemSelector - Item element selector.
  @param {string} animationName - Animation CSS class.
  @param {bollean} enableTouch  - Adds touch event to show content on first click then follow link on the second click.
  @param {integer} touchThreshold - Touch length must be less than this to trigger reveal which prevents the event triggering if user is scrolling.
*/

var DirectionReveal = function DirectionReveal() {
  var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
      _ref$selector = _ref.selector,
      selector = _ref$selector === undefined ? '.direction-reveal' : _ref$selector,
      _ref$itemSelector = _ref.itemSelector,
      itemSelector = _ref$itemSelector === undefined ? '.direction-reveal__card' : _ref$itemSelector,
      _ref$animationName = _ref.animationName,
      animationName = _ref$animationName === undefined ? 'swing' : _ref$animationName,
      _ref$enableTouch = _ref.enableTouch,
      enableTouch = _ref$enableTouch === undefined ? true : _ref$enableTouch,
      _ref$touchThreshold = _ref.touchThreshold,
      touchThreshold = _ref$touchThreshold === undefined ? 250 : _ref$touchThreshold;

  var containers = document.querySelectorAll(selector);
  var touchStart = void 0;

  var getDirection = function getDirection(e, item) {
    // Width and height of current item
    var w = item.offsetWidth;
    var h = item.offsetHeight;
    var position = getPosition(item);

    // Calculate the x/y value of the pointer entering/exiting, relative to the center of the item.
    var x = e.pageX - position.x - w / 2 * (w > h ? h / w : 1);
    var y = e.pageY - position.y - h / 2 * (h > w ? w / h : 1);

    // Calculate the angle the pointer entered/exited and convert to clockwise format (top/right/bottom/left = 0/1/2/3).  See https://stackoverflow.com/a/3647634 for a full explanation.
    var d = Math.round(Math.atan2(y, x) / 1.57079633 + 5) % 4;

    // console.table([x, y, w, h, e.pageX, e.pageY, item.offsetLeft, item.offsetTop, position.x, position.y]);

    return d;
  };

  // https://www.kirupa.com/html5/get_element_position_using_javascript.htm
  var getPosition = function getPosition(el) {
    var xPos = 0;
    var yPos = 0;

    while (el) {
      xPos += el.offsetLeft + el.clientLeft;
      yPos += el.offsetTop + el.clientTop;

      el = el.offsetParent;
    }
    return {
      x: xPos,
      y: yPos
    };
  };

  var translateDirection = switchcase({
    0: 'top',
    1: 'right',
    2: 'bottom',
    3: 'left'
  })('top');

  var addClass = function addClass(e, state) {
    var currentItem = e.currentTarget;
    var direction = getDirection(e, currentItem);
    var directionString = translateDirection(direction);

    // Remove current animation classes and add new ones e.g. swap --in for --out.
    var currentCssClasses = currentItem.className.split(' ');
    var filteredCssClasses = currentCssClasses.filter(function (cssClass) {
      return !cssClass.startsWith(animationName);
    }).join(' ');
    currentItem.className = filteredCssClasses;
    currentItem.classList.add(animationName + '--' + state + '-' + directionString);
  };

  var bindEvents = function bindEvents(containerItem) {
    var items = containerItem.querySelectorAll(itemSelector);

    items.forEach(function (item) {

      addEventListenerMulti(item, ['mouseenter', 'focus'], function (e) {
        addClass(e, 'in');
      });

      addEventListenerMulti(item, ['mouseleave', 'blur'], function (e) {
        addClass(e, 'out');
      });

      if (enableTouch) {

        item.addEventListener('touchstart', function (e) {
          touchStart = +new Date();
        }, { passive: true });

        item.addEventListener('touchend', function (e) {
          var touchTime = +new Date() - touchStart;

          if (touchTime < touchThreshold && !item.className.includes(animationName + '--in')) {
            e.preventDefault();

            resetVisible(e, items, addClass(e, 'in'));
          }
        });
      }
    });
  };

  var addEventListenerMulti = function addEventListenerMulti(element, events, fn) {
    events.forEach(function (e) {
      return element.addEventListener(e, fn);
    });
  };

  var resetVisible = function resetVisible(e, items, callback) {

    items.forEach(function (item) {
      var currentCssClasses = item.className;

      if (currentCssClasses.includes(animationName + '--in') && item !== e.currentTarget) {
        item.className = currentCssClasses.replace(animationName + '--in', animationName + '--out');
      }
    });

    callback;
  };

  var init = function init() {

    if (containers.length) {
      containers.forEach(function (containerItem) {
        bindEvents(containerItem);
      });
    } else {
      return;
    }
  };

  // Init is called by default
  init();

  // Reveal API
  return {
    init: init
  };
};

exports.default = DirectionReveal;

// Better switch cases - https://hackernoon.com/rethinking-javascript-eliminate-the-switch-statement-for-better-code-5c81c044716d

var switchcase = exports.switchcase = function switchcase(cases) {
  return function (defaultCase) {
    return function (key) {
      return key in cases ? cases[key] : defaultCase;
    };
  };
};

},{}],2:[function(require,module,exports){
'use strict';

var _directionReveal = require('./direction-reveal.js');

var _directionReveal2 = _interopRequireDefault(_directionReveal);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

// Swing animation(Default)
var directionRevealSwing = (0, _directionReveal2.default)({
  selector: '.direction-reveal--demo-swing'
});

// Slide animation with all options specified
var directionRevealSlide = (0, _directionReveal2.default)({
  selector: '.direction-reveal--demo-slide',
  itemSelector: '.direction-reveal__card',
  animationName: 'slide',
  enableTouch: true,
  touchThreshold: 250
});

// Slide & push
var directionRevealSlidePush = (0, _directionReveal2.default)({
  selector: '.direction-reveal--demo-slide-push',
  animationName: 'slide'
});

// Rotate animation
var directionRevealRotate = (0, _directionReveal2.default)({
  selector: '.direction-reveal--demo-rotate',
  animationName: 'rotate'
});

// Flip animation
var directionRevealFlip = (0, _directionReveal2.default)({
  selector: '.direction-reveal--demo-flip',
  animationName: 'flip'
});

// Bootstrap demo
var directionRevealBoostrap = (0, _directionReveal2.default)({
  selector: '.direction-reveal--demo-bootstrap'
});

},{"./direction-reveal.js":1}]},{},[2])

//# sourceMappingURL=bundle.js.map




