text: 
  function delay(n) {
      n = n || 2000;
      return new Promise((done) => {
          setTimeout(() => {
              done();
          }, n);
      });
  }
  var carousel = document.querySelector('.carousel');
  var flkty = new Flickity( carousel, {
    imagesLoaded: true,
    percentPosition: false,
  });
  
  var imgs = carousel.querySelectorAll('.carousel-cell img');
  // get transform property
  var docStyle = document.documentElement.style;
  var transformProp = typeof docStyle.transform == 'string' ?
    'transform' : 'WebkitTransform';
  
  flkty.on( 'scroll', function() {
    flkty.slides.forEach( function( slide, i ) {
      var img = imgs[i];
      var x = ( slide.target + flkty.x ) * -1/3;
      img.style[ transformProp ] = 'translateX(' + x  + 'px)';
    });
  });
  function pageTransition() {
      var tl = gsap.timeline();
      tl.to(".loading-screen", {
          duration: 1.2,
          width: "100%",
          left: "0%",
          ease: "Expo.easeInOut",
      });
  
      tl.to(".loading-screen", {
          duration: 1,
          width: "100%",
          left: "100%",
          ease: "Expo.easeInOut",
          delay: 0.3,
      });
      tl.set(".loading-screen", { left: "-100%" });
  }
  
  function contentAnimation() {
      var tl = gsap.timeline();
      tl.from(".animate-this", { duration: 1, y: 30, opacity: 0, stagger: 0.4, delay: 0.2 });
  }
  
  
  $(function () {
      barba.init({
          sync: true,
  
          transitions: [
              {
                  async leave(data) {
                      const done = this.async();
  
                      pageTransition();
                      await delay(1000);
                      done();
                  },
  
                  async enter(data) {
                      contentAnimation();
                  },
  
                  async once(data) {
                      contentAnimation();
                  },
              },
          ],
          views: [{
              namespace: 'home-section',
              beforeEnter({ next }) {
      
              // load your script
              let script = document.createElement('script');
              script.src = './js/draggable.js'; // location of your draggable js file that is responsible for that image loading and dragging functionality
              next.container.appendChild(script);
              },
              
          },{
              namespace: 'catalog-section',
              beforeEnter({ next }) {
      
              // load your script
              let script = document.createElement('script');
              script.src = './draggable1.js'; // location of your draggable js file that is responsible for that image loading and dragging functionality
              next.container.appendChild(script);
              },
              
          },{
              namespace: 'product-section',
              beforeEnter({ next }) {
      
              // load your script
              let script = document.createElement('script');
              script.src = './js/draggable2.js'; // location of your draggable js file that is responsible for that image loading and dragging functionality
              next.container.appendChild(script);
              },
              
          },
      ]
      });
  });
  $('.special.cards .image').dimmer({
      on: 'hover'
    });
    