const Drift = require('drift-zoom')

var demoTrigger = document.querySelector('.js-img-zoom-trigger');
var paneContainer = document.querySelector('.js-img-zoom-preview');

if (demoTrigger !== null) {
  new Drift(demoTrigger, {
    paneContainer: paneContainer,
    inlinePane: false
  });  
}

$('.js-zoom-thumb').on('click', function() {
  var img = $(this)

  $('.js-img-zoom-trigger').attr('src', img.attr('src')).attr('data-zoom', img.attr('data-zoom'))

  img.closest('li').addClass('active').siblings().removeClass('active')
})
