$(document).ready(function() {
      $('a').click(function(e){
          var anchor = $(this),
          href = anchor.attr('href'),
          pagename = window.location.href;
          pagename = pagename.replace(/#.*/,'');
          href = href.replace( pagename , '' );
          if( href.search(/^#/) >= 0 ){
            e.preventDefault();
            var speed = 600;
            var target = $(href == "#" || href == "" ? 'html' : href);
            var target= $(this).attr("href");
            var webkit = !document.uniqueID && !window.opera && !window.globalStorage && window.localStorage;
            $("html, body").animate({
                scrollTop: $(target).offset().top},600
            );
            return false;
          }
      });
});

$(function(){
	$(".list-reserve .item h3").on("click", function() {
		$(this).parent('.list-reserve .item').toggleClass("active");
	});
});



// ========================
// スクロールアニメーション
// ========================

window.addEventListener("DOMContentLoaded", () => {
  const boxes = document.querySelectorAll(".fade");
  window.addEventListener("scroll", showBoxes);
  showBoxes();
  function showBoxes() {
    const triggerBottom = (window.innerHeight / 5) * 4;
    boxes.forEach((box) => {
      const boxTop = box.getBoundingClientRect().top;
      if (boxTop < triggerBottom) {
        box.classList.add("scrollin");
      } else {
        box.classList.remove("scrollin");
      }
    });
  }
});