Sid Gifari File Manager
🏠Root
/
home
/
u527040259
/
domains
/
techamber.in
/
public_html
/
js
/
📝 Editing: app.js
// Initialize Lenis only if the device width is 700px or larger let lenis = null; if (window.innerWidth >= 700) { lenis = new Lenis({ autoRaf: true, }); // Optional: Scroll event listener placeholder lenis.on('scroll', (e) => { // console.log(e); }); } function changeActive(page) { let active = document.querySelector(".links a.active"); let links = document.querySelectorAll(".links a"); let nav_cta = document.querySelector(".cta-wrap a"); let mobnav_cta = document.querySelector(".menu-bg .links .pr-btn"); if(page == "CONTACT US") { nav_cta.classList.add("priority"); mobnav_cta.classList.add("priority"); links.forEach(element => { element.classList.remove("active"); }); } else { links.forEach(element => { if(element.innerHTML == page) { element.classList.add("active"); } else { element.classList.remove("active"); } }); } } // Cursor follower logic const move = document.querySelector(".cursor-follower"); document.body.onpointermove = (event) => { const { clientX, clientY } = event; move.animate( { left: `${clientX + 10}px`, top: `${clientY + 25}px`, }, { duration: 300, fill: "forwards" } ); }; // Menu toggle logic let mbtn = document.getElementById("menu-btn"); let links = document.querySelectorAll(".menu-bg .links a"); let menuWrap = document.querySelector(".menu-bg"); let body = document.body; mbtn.addEventListener("click", () => { mbtn.classList.toggle("active"); if (mbtn.classList.contains("active")) { // Open the menu if (lenis && window.innerWidth >= 700) { lenis.stop(); // Stop Lenis scrolling only on larger devices } body.style.overflow = "hidden"; menuWrap.style.height = "100vh"; setTimeout(() => { links.forEach((link, index) => { setTimeout(() => { link.style.opacity = "1"; link.style.filter = "blur(0)"; }, index * 100); // Delay for each link }); }, 500); } else { // Close the menu links.forEach((link, index) => { setTimeout(() => { link.style.filter = "blur(100%)"; link.style.opacity = "0"; }, index * 100); // Delay for each link }); setTimeout(() => { menuWrap.style.height = "0"; if (lenis && window.innerWidth >= 700) { lenis.start(); // Resume Lenis scrolling only on larger devices } body.style.overflow = "auto"; }, links.length * 100); // Wait for all links to animate out } }); // Sticky navigation logic window.addEventListener("scroll", () => { let nav = document.querySelector("nav"); let scroll = window.scrollY; if (scroll > 100) { nav.classList.add("scrolled"); } else { nav.classList.remove("scrolled"); } }); ScrollTrigger.matchMedia({ // Desktop and larger screens "(min-width: 700px)": function () { const feature_box = document.querySelectorAll('.box-type'); feature_box.forEach((box, i) => { gsap.from(box, { scrollTrigger: { trigger: box, start: 'top 100%', end: 'top 60%', scrub: true, markers: false, }, marginTop: "50px", opacity: 0.5, }); }); const paras = document.querySelectorAll('.para'); paras.forEach((para) => { const split = new SplitType(para, { types: 'lines' }); gsap.from(split.lines, { scrollTrigger: { trigger: para, start: 'top 100%', end: 'top 50%', scrub: true, markers: false, }, opacity: 0, marginTop: "10px", stagger: 0.1, }); }); }, "(max-width: 699px)": function () { // No animations on smaller screens } })
đź’ľ Save
❌ Cancel
Sid Gifari File Manager v1.0 | Terminal Auto-Sync Enabled | Current Path: /home/u527040259/domains/techamber.in/public_html/js