Template:Vilnius-Lithuania/JS/ContentPage

// Set heading text window.addEventListener("load", () => { let text = document.getElementById("headingTitleText").value; document.querySelector(".introContainer div.heading").innerText = text; document.querySelector(".introContainer div.heading.other").innerText = text; });

// Title bubble animation function animate() { let scrollTop = document.body.scrollTop == 0 ? document.documentElement.scrollTop : document.body.scrollTop; let scroll = scrollTop / window.innerHeight; if (scroll > 1) scroll = 1; let unit = "vw"; if (window.innerWidth / window.innerHeight > 1) unit = "vh" $(".introContainer span").css("top", (60 * scroll) + unit); $(".introContainer .heading").css("margin-top", (35 * scroll) + unit);

// if (document.getElementById("indexbutton") == undefined) return; // let onTextBool = document.getElementById("navbar").getAttribute("onText"); // document.getElementById("indexbutton").setAttribute("onText", onTextBool); } window.addEventListener("scroll", animate, {passive: 1}); window.addEventListener("resize", animate, {passive: 1}); document.addEventListener("load", animate, {passive: 1}); animate();