(window["webpackJsonp"] = window["webpackJsonp"] || []).push([["/scripts/app"],{

/***/ "./resources/assets/scripts/app.js":
/*!*****************************************!*\
  !*** ./resources/assets/scripts/app.js ***!
  \*****************************************/
/*! no exports provided */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony import */ var swiper__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! swiper */ "./node_modules/swiper/js/swiper.esm.bundle.js");
/* harmony import */ var locomotive_scroll__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! locomotive-scroll */ "./node_modules/locomotive-scroll/dist/locomotive-scroll.esm.js");
/* harmony import */ var gsap__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! gsap */ "./node_modules/gsap/index.js");
/* harmony import */ var gsap_SplitText__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! gsap/SplitText */ "./node_modules/gsap/SplitText.js");
/**
 * External Dependencies
 */




gsap__WEBPACK_IMPORTED_MODULE_2__["default"].registerPlugin(gsap_SplitText__WEBPACK_IMPORTED_MODULE_3__["SplitText"]);
var scroll = new locomotive_scroll__WEBPACK_IMPORTED_MODULE_1__["default"]({
  el: document.querySelector('[data-scroll-container]'),
  smooth: true,
  getDirection: true
});
document.addEventListener("DOMContentLoaded", function () {
  scroll.update();
});
/**
 * Show header
 */

setTimeout(function () {
  document.querySelector('.header').classList.add('show');
}, 300);
/**
 * Nav mobile
 */

var navMobile = document.querySelector('.nav-mobile'),
    burger = document.querySelector('.js-menu-toggle'),
    body = document.querySelector('body');

burger.onclick = function () {
  navMobile.classList.toggle('visible');
  this.classList.toggle('open');
  body.classList.toggle('no-scroll');
};
/**
 * Viewport trick 
 */


var vh = window.innerHeight * 0.01;
document.documentElement.style.setProperty('--vh', "".concat(vh, "px"));
/**
 *  ScrollTo 
 */

var navItems = document.querySelectorAll('.menu-item a');

for (var i = 0; i < navItems.length; i++) {
  var item = navItems[i];

  item.onclick = function (event) {
    event.preventDefault();
    burger.click();
    var sectionId = this.getAttribute('href');
    scroll.scrollTo(sectionId);
  };
}
/**
 *  Reveal logo on scroll
 */


scroll.on('scroll', function (instance) {
  var y = instance.scroll.y,
      header = document.querySelector('.header'),
      heroHeight = document.querySelector('.home-hero').offsetHeight;

  if (y >= heroHeight) {
    header.classList.add('fixed');
  } else {
    header.classList.remove('fixed');
  }

  if (header.classList.contains('fixed') && y >= heroHeight + 200) {
    if (instance.direction == 'down') {
      header.classList.add('hide');
    } else {
      header.classList.remove('hide');
    }
  } else {
    header.classList.remove('hide');
  }
});
/**
 *  Rotating Circle & Scroll Header 
 */

var rotatingText = document.querySelector('.rotating-text');
scroll.on('scroll', function (instance) {
  var circle = rotatingText;
  if (!circle.classList.contains('is-inview')) return;
  var progress = Math.round(1 * instance.scroll.y / window.innerHeight * 100) / 200;
  var rotationTimeline = gsap__WEBPACK_IMPORTED_MODULE_2__["default"].timeline({
    paused: true
  }).fromTo(circle, {
    rotation: 0
  }, {
    rotation: 360,
    ease: 'none',
    duration: 0.3,
    force3D: true
  });
  rotationTimeline.progress(progress);
});
/**
 *  Text animation
 */

scroll.on('call', function (value, way, obj) {
  switch (value) {
    case 'animateText':
      {
        var split = new gsap_SplitText__WEBPACK_IMPORTED_MODULE_3__["SplitText"](obj.el, {
          type: "lines",
          linesClass: "lineParent"
        });
        var lines = split.lines;
        gsap__WEBPACK_IMPORTED_MODULE_2__["default"].set(obj, {
          perspective: 1000
        });
        gsap__WEBPACK_IMPORTED_MODULE_2__["default"].from(lines, 1.2, {
          opacity: 0,
          y: 100,
          ease: 'power3.out',
          stagger: 0.05
        });
        break;
      }

    default:
      break;
  }
});
/**
 *  Zoom background hero
 */

var heroImage = document.querySelector('.hero_image img');
scroll.on('scroll', function (instance) {
  var image = heroImage;
  var progress = Math.round(1 * instance.scroll.y / window.innerHeight * 100) / 200;
  var zoomTimeline = gsap__WEBPACK_IMPORTED_MODULE_2__["default"].timeline({
    paused: true
  }).fromTo(image, {
    scaleX: 1,
    scaleY: 1
  }, {
    scaleX: 1.5,
    scaleY: 1.5,
    ease: 'none',
    duration: 0.3,
    force3D: true
  });
  zoomTimeline.progress(progress);
});
/**
 * Swiper
 */

var productionSlideshow = new swiper__WEBPACK_IMPORTED_MODULE_0__["default"]('.production__slideshow .swiper-container', {
  slidesPerView: 1,
  effect: 'fade',
  observer: true,
  observeParents: true,
  navigation: {
    nextEl: '.pro-nav-next',
    prevEl: '.pro-nav-prev'
  },
  on: {
    init: function init() {
      var caption = document.querySelector('.production__slideshow .swiper-slide-active').getElementsByTagName('img')[0].getAttribute('alt');
      document.querySelector('.prod-slide span').innerHTML = caption;
    },
    slideChangeTransitionEnd: function slideChangeTransitionEnd() {
      var caption = document.querySelector('.production__slideshow .swiper-slide-active').getElementsByTagName('img')[0].getAttribute('alt');
      document.querySelector('.prod-slide span').innerHTML = caption;
    }
  }
});
var servicesSlideshow = new swiper__WEBPACK_IMPORTED_MODULE_0__["default"]('.services__slideshow .swiper-container', {
  slidesPerView: 1,
  effect: 'fade',
  observer: true,
  observeParents: true,
  navigation: {
    nextEl: '.ser-swiper-nav .swiper-button-next',
    prevEl: '.ser-swiper-nav .swiper-button-prev'
  },
  on: {
    init: function init() {
      var currentSlide = this.activeIndex,
          pagCurrent = ('0' + (currentSlide + 1)).slice(-2),
          total = this.slides.length,
          pagTotal = ('0' + total).slice(-2),
          caption = document.querySelector('.services__slideshow .swiper-slide-active').getElementsByTagName('img')[0].getAttribute('alt');
      document.querySelector('.swiper-pagination .active').innerHTML = pagCurrent;
      document.querySelector('.swiper-pagination .total').innerHTML = pagTotal;
      document.querySelector('.ser-slide span').innerHTML = caption;
    },
    slideChangeTransitionEnd: function slideChangeTransitionEnd() {
      var currentSlide = this.activeIndex,
          pagCurrent = ('0' + (currentSlide + 1)).slice(-2),
          total = this.slides.length,
          pagTotal = ('0' + total).slice(-2),
          caption = document.querySelector('.services__slideshow .swiper-slide-active').getElementsByTagName('img')[0].getAttribute('alt');
      document.querySelector('.swiper-pagination .active').innerHTML = pagCurrent;
      document.querySelector('.swiper-pagination .total').innerHTML = pagTotal;
      document.querySelector('.ser-slide span').innerHTML = caption;
    }
  }
});
var testimonialsSlideshow = new swiper__WEBPACK_IMPORTED_MODULE_0__["default"]('.testimonials__slideshow .swiper-container', {
  slidesPerView: 1,
  spaceBetween: 48,
  observer: true,
  observeParents: true,
  pagination: {
    el: '.testimonials__slideshow .swiper-pagination',
    clickable: true
  },
  breakpoints: {
    1024: {
      slidesPerView: 2
    }
  }
});

/***/ }),

/***/ "./resources/assets/styles/app.scss":
/*!******************************************!*\
  !*** ./resources/assets/styles/app.scss ***!
  \******************************************/
/*! no static exports found */
/***/ (function(module, exports) {

// removed by extract-text-webpack-plugin

/***/ }),

/***/ "./resources/assets/styles/editor.scss":
/*!*********************************************!*\
  !*** ./resources/assets/styles/editor.scss ***!
  \*********************************************/
/*! no static exports found */
/***/ (function(module, exports) {

// removed by extract-text-webpack-plugin

/***/ }),

/***/ 0:
/*!************************************************************************************************************************!*\
  !*** multi ./resources/assets/scripts/app.js ./resources/assets/styles/app.scss ./resources/assets/styles/editor.scss ***!
  \************************************************************************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {

__webpack_require__(/*! /Users/joanaac/Sites/fcportuense/wp-content/themes/fcportuense/resources/assets/scripts/app.js */"./resources/assets/scripts/app.js");
__webpack_require__(/*! /Users/joanaac/Sites/fcportuense/wp-content/themes/fcportuense/resources/assets/styles/app.scss */"./resources/assets/styles/app.scss");
module.exports = __webpack_require__(/*! /Users/joanaac/Sites/fcportuense/wp-content/themes/fcportuense/resources/assets/styles/editor.scss */"./resources/assets/styles/editor.scss");


/***/ })

},[[0,"/scripts/manifest","/scripts/vendor"]]]);
//# sourceMappingURL=app.js.map