Testing different reveal animation in elevator
This commit is contained in:
sairaj mote 2021-04-17 17:59:20 +05:30
parent 13d2fff495
commit 5e8688d3b6

View File

@ -678,8 +678,10 @@ const siteMapTimeline = gsap.timeline({
paused: true, paused: true,
}); });
siteMapTimeline siteMapTimeline
.from("#elevator_popup", { duration: 0.3, opacity: 0 }) .from("#elevator_popup", { duration: 0.3, opacity: 0, y: 16 })
.from(".floor_list__item", { opacity: 0, scaleY: 0.95, stagger: 0.1 }); .from(".floor_list__item", { opacity: 0, y: 16});
function showSiteMap() { function showSiteMap() {
document.querySelectorAll(".page").forEach((page) => { document.querySelectorAll(".page").forEach((page) => {
@ -689,13 +691,13 @@ function showSiteMap() {
document.body.style.overflow = "hidden"; document.body.style.overflow = "hidden";
document.body.style.top = `-${window.scrollY}px`; document.body.style.top = `-${window.scrollY}px`;
getRef("elevator_popup").classList.remove("hide-completely"); getRef("elevator_popup").classList.remove("hide-completely");
siteMapTimeline.duration(1).play(); siteMapTimeline.duration(0.6).play();
} }
function hideSiteMap() { function hideSiteMap() {
const scrollY = document.body.style.top; const scrollY = document.body.style.top;
window.scrollTo(0, parseInt(scrollY || "0") * -1); window.scrollTo(0, parseInt(scrollY || "0") * -1);
siteMapTimeline.duration(0.4).reverse(); siteMapTimeline.duration(0.3).reverse();
document.querySelectorAll(".page").forEach((page) => { document.querySelectorAll(".page").forEach((page) => {
page.removeAttribute("aria-hidden"); page.removeAttribute("aria-hidden");
}); });