(function () {
  'use strict';

  const modern_bakery_shop_observer = new IntersectionObserver((entries) => {
    entries.forEach((entry) => {
      if (entry.isIntersecting) {
        entry.target.classList.add('animations-show-item');
        modern_bakery_shop_observer.unobserve(entry.target);
      } else {
        entry.target.classList.remove('animations-show-item');
      }
    });
  });

  const modern_bakery_shop_hiddenElements = document.querySelectorAll('.animations-hidden-item');

  modern_bakery_shop_hiddenElements.forEach((el) =>
    modern_bakery_shop_observer.observe(el)
  );

})();