/* accordion */ $(function() { $('.faq_accordion_cont').hide(); $('.faq_accordion_ttl').click(function() { $(this).next().slideToggle(); $(this).toggleClass("open"); }); }); window.addEventListener("DOMContentLoaded", () => { const stars = document.querySelector(".stars"); const createStar = () => { const starEl = document.createElement("span"); starEl.className = "star"; const minSize = 1; const maxSize = 4; const size = Math.random() * (maxSize - minSize) + minSize; starEl.style.width = `${size}px`; starEl.style.height = `${size}px`; starEl.style.left = `${Math.random() * 100}%`; starEl.style.top = `${Math.random() * 100}%`; starEl.style.animationDelay = `${Math.random() * 10}s`; stars.appendChild(starEl); }; for (let i = 0; i <= 300; i++) { createStar(); } }); $(function () { $(window).scroll(function () { const windowHeight = $(window).height(); const scroll = $(window).scrollTop(); $('.element').each(function () { const targetPosition = $(this).offset().top; if (scroll > targetPosition - windowHeight + 100) { $(this).addClass("is-fadein"); } }); }); });