export default () => {
  if (window && document) {
    const sideTitles = document.querySelectorAll('.side-title');

    const handleScroll = function handleScroll() {
      if (window.scrollY > 100) {
        sideTitles.forEach((title) => title.classList.remove('hidden'));
      } else {
        sideTitles.forEach((title) => title.classList.add('hidden'));
      }
    };

    handleScroll();
    window.addEventListener('scroll', handleScroll);
  }
};
