Difference between revisions of "Template:Vilnius-Lithuania/JS/menuOverlay"

m
 
(32 intermediate revisions by 2 users not shown)
Line 1: Line 1:
 
//---------------Checking if the page is content page---------------
 
//---------------Checking if the page is content page---------------
var textSection = null;
+
        var textSection = null;
                var navbar = $('#navbar');
+
        var navbar = document.getElementById("navbar");
                var navbarHeight = navbar.height()
+
        window.addEventListener('load', function() {
window.addEventListener('load', function() {
+
            textSection = document.querySelector('.elevate-navbar');
textSection = $(".elevate-navbar");
+
            checkScrollPos();
                        console.log(textSection)
+
            checkBackToTopPos();
})
+
        })
$(document).on( 'scroll', function(){
+
        window.addEventListener('scroll', function() {
  updateScrollbar();
+
            updateScrollbar();
checkNavbarPos();
+
            checkNavbarPos();
});
+
            checkScrollPos();
 +
            checkBackToTopPos();
 +
        });
  
 +
        function checkScrollPos() {
 +
            var footerTop = document.getElementById("footerWrapper").getBoundingClientRect().top;
 +
            var scrollbarBottom = document.getElementById("scrollbar-container").getBoundingClientRect().bottom;
 +
            let scrollWrapper = document.querySelector('.scroll-wrapper');
 +
            if (scrollbarBottom >= footerTop) {
 +
                if (scrollWrapper.getAttribute("hiddenScroll") == "false") scrollWrapper.setAttribute("hiddenScroll", "true");
 +
            } else {
 +
                if (scrollWrapper.getAttribute("hiddenScroll") == "true") scrollWrapper.setAttribute("hiddenScroll", "false");
 +
            }
 +
        }
  
 +
        function checkBackToTopPos() {
 +
            if ($(window).scrollTop() > 1000) {
 +
                $('#backtotop-wrapper').addClass('scrolled')
 +
            } else $('#backtotop-wrapper').removeClass('scrolled')
 +
        }
  
function checkNavbarPos() {
+
        $(document).ready(function() {
if (textSection != null) {
+
            $('#backtotop-wrapper').on('click', function() {
var navbarTop = navbar.offset().top + navbarHeight;
+
                $('html, body').animate({
var mainTagTop =textSection.offset().top
+
                    'scrollTop': $('body').offset().top
                                console.log(navbarTop, mainTagTop)
+
                }, 2000);
if (navbarTop >= mainTagTop) {
+
            });
document.getElementById("navbar").setAttribute("onText", "true");
+
        });
} else {
+
document.getElementById("navbar").setAttribute("onText", "false");
+
}
+
}
+
var footerTop = document.getElementById("footerWrapper").getBoundingClientRect().top;
+
var scrollbarBottom = document.getElementById("scrollbar-container").getBoundingClientRect().bottom;
+
if (scrollbarBottom >= footerTop) {
+
if (document.getElementById("scrollbar-container").getAttribute("hiddenScroll") == "false") {
+
document.getElementById("scrollbar-container").setAttribute("hiddenScroll", "true");
+
}
+
} else {
+
if (document.getElementById("scrollbar-container").getAttribute("hiddenScroll") == "true") {
+
document.getElementById("scrollbar-container").setAttribute("hiddenScroll", "false");
+
}
+
}
+
}
+
  
//---------------Scrollbar height---------------
 
function updateScrollbar() {
 
var winScroll = document.body.scrollTop || document.documentElement.scrollTop;
 
var height = document.documentElement.scrollHeight - window.innerHeight;
 
var scrolled = (winScroll / height) * 100;
 
document.getElementById("scrollbar").style.height = scrolled + "%";
 
}
 
  
//---------------Closing the menu and returning to default values---------------
+
        function checkNavbarPos() {
function closeMenu() {
+
            if (textSection != null) {
var toggleable = document.querySelectorAll('.toggleable');
+
                var navbarTop = navbar.getBoundingClientRect().top;
for (let item of toggleable) {
+
                var mainTagTop = textSection.getBoundingClientRect().top;
item.classList.remove("active");
+
                if (navbarTop >= mainTagTop) {
}
+
                    if (document.getElementById("bubbles-to-close").getAttribute("open") != true) navbar.setAttribute("onText", "true");
document.getElementById("fixedOverlay").setAttribute("bg", "none");
+
                } else {
document.getElementById("appendable").classList.remove(currentChoice);
+
                    navbar.setAttribute("onText", "false");
currentChoice = null;
+
                }
const myNode = document.getElementById("appendable");
+
            }
while (myNode.firstChild) {
+
        }
myNode.removeChild(myNode.lastChild);
+
}
+
document.getElementById("bubbles-to-close").setAttribute("open", "false");
+
checkNavbarPos();
+
}
+
  
function openSecBubble(link) {
+
        //---------------Scrollbar height---------------
link.classList.add("active");
+
        function updateScrollbar() {
document.getElementById("appendable").classList.remove(currentChoice);
+
            var winScroll = document.body.scrollTop || document.documentElement.scrollTop;
currentChoice = link.id;
+
            var height = document.documentElement.scrollHeight - window.innerHeight;;
document.getElementById("popup-next").classList.add("active");
+
            var scrolled = (winScroll / height) * 100;
var items = menuItems[currentChoice];
+
            document.getElementById("scrollbar").style.height = scrolled + "%";
document.getElementById("appendable").classList.add(currentChoice)
+
        }
let counter = 0;
+
for (const [key, value] of Object.entries(menuItems[currentChoice])) {
+
var node = document.createElement("li");
+
var nodeLink = document.createElement("a");
+
nodeLink.href = value.link;
+
nodeLink.innerHTML = value.name;
+
if (currentChoice = "project") {
+
counter++;
+
if (counter <= 5) node.classList.add('right-align');
+
}
+
node.appendChild(nodeLink);
+
document.getElementById("appendable").appendChild(node);
+
}
+
resizeBubble();
+
}
+
  
var openMenuEls = document.getElementsByClassName("menu-wrapper");
+
        //---------------Closing the menu and returning to default values---------------
for (let el of openMenuEls) {
+
        function closeMenu() {
//---------------Clicking on menu sandwich/close button---------------
+
            var toggleable = document.querySelectorAll('.toggleable');
el.addEventListener('click', function() {
+
            for (let item of toggleable) {
//---------------If menu is open and close button is clicked, close menu---------------
+
                item.classList.remove("active");
if (this.classList.contains("active")) {
+
            }
closeMenu();
+
            document.getElementById("fixedOverlay").setAttribute("bg", "none");
} else {
+
            document.getElementById("popup-next").classList.remove(currentChoice);
document.getElementById("popup-main").classList.add("active");
+
            document.querySelector(".hamb-wrapper").classList.remove("invisible");
this.classList.add("active");
+
            currentChoice = null;
fxdOv = document.getElementById("fixedOverlay");
+
            const myNode = document.getElementById("appendable");
fxdOv.setAttribute("bg", "dark");
+
            document.getElementById("bubbles-to-close").setAttribute("open", "false");
document.getElementById("navbar").setAttribute("onText", "false");
+
            while (myNode.firstChild) {
document.getElementById("bubbles-to-close").setAttribute("open", "true");
+
                myNode.removeChild(myNode.lastChild);
if (fxdOv.classList.length != 0) {
+
            }
console.log("not the main page")
+
            let node = document.querySelector('.center-link');
link = fxdOv.classList[0]
+
            document.querySelector('#popup-next .choices').removeChild(node)
openSecBubble(document.getElementById(link))
+
            checkNavbarPos();
}
+
}
+
})
+
}
+
var currentChoice;
+
var menuLinks = document.getElementsByClassName("main-choice");
+
for (let link of menuLinks) {
+
link.addEventListener('click', function() {
+
for (let lk of menuLinks) {
+
if (lk.classList.contains("active")) {
+
lk.classList.remove("active");
+
const myNode = document.getElementById("appendable");
+
while (myNode.firstChild) {
+
myNode.removeChild(myNode.lastChild);
+
}
+
}
+
}
+
openSecBubble(link)
+
})
+
}
+
  
$('#appendable li a').on("click", function() {
+
        }
closeMenu();
+
})
+
  
$(window).resize(function() {
+
        function openSecBubble(link) {
resizeBubble();
+
            link.classList.add("active");
});
+
            document.getElementById("popup-next").classList.remove(currentChoice);
 +
            currentChoice = link.id;
 +
            document.getElementById("popup-next").classList.add("active");
 +
            var items = menuItems[currentChoice];
 +
            document.getElementById("popup-next").classList.add(currentChoice)
 +
            let counter = 0;
 +
            for (const [key, value] of Object.entries(menuItems[currentChoice])) {
 +
                var node = document.createElement("li");
 +
                var nodeLink = document.createElement("a");
 +
                nodeLink.href = value.link;
 +
                nodeLink.innerHTML = value.name;
 +
                if (link.id == 'wl') {
 +
                    node.classList.add(counter < 3 ? 'right-align' : 'left-align');
 +
                    counter++;
 +
                }
 +
                node.appendChild(nodeLink);
 +
                document.getElementById("appendable").appendChild(node);
 +
            }
 +
            resizeBubble(link.id);
 +
        }
  
function resizeBubble() {
+
        var openMenuEls = document.getElementsByClassName("menu-wrapper");
$(function() {
+
        for (let el of openMenuEls) {
var elementWidth = $("#appendable").width();
+
            //---------------Clicking on menu sandwich/close button---------------
var elementHeight = $("#appendable").height();
+
            el.addEventListener('click', function() {
var resizingConstant = (function() {
+
                //---------------If menu is open and close button is clicked, close menu---------------
if (currentChoice == "hp") {
+
                if (this.classList.contains("active")) {
return 1.4
+
                    closeMenu();
} else if (currentChoice == "team") {
+
                } else {
return 1.7
+
                    document.getElementById("popup-main").classList.add("active");
} else if (currentChoice == "parts") {
+
                    this.classList.add("active");
return 1.45
+
                    document.querySelector(".hamb-wrapper").classList.add("invisible");
} else {
+
                    fxdOv = document.getElementById("fixedOverlay");
return 1.15
+
                    fxdOv.setAttribute("bg", "dark");
}
+
                    document.getElementById("navbar").setAttribute("onText", "false");
})();
+
                    document.getElementById("bubbles-to-close").setAttribute("open", "true");
if (elementHeight > elementWidth) {
+
                    if (fxdOv.classList.length != 0) {
$("#bubbles #popup-next").css("height", elementHeight * resizingConstant);
+
                        link = fxdOv.classList[0]
$("#bubbles #popup-next").css("width", elementHeight * resizingConstant);
+
                        openSecBubble(document.getElementById(link))
} else {
+
                    }
$("#bubbles #popup-next").css("height", elementWidth * resizingConstant);
+
                }
$("#bubbles #popup-next").css("width", elementWidth * resizingConstant);
+
            })
}
+
        }
})
+
        var currentChoice;
}
+
        var menuLinks = document.getElementsByClassName("main-choice");
document.getElementById("bubbles-to-close").addEventListener('click', function() {
+
        for (let link of menuLinks) {
var isOpen = document.getElementById("popup-main");
+
            link.addEventListener('mouseover', initializeSecondBubble);
if (isOpen.classList.contains("active")) {
+
        }
closeMenu();
+
        for (let link of menuLinks) {
}
+
            link.addEventListener('click', function() {
})
+
                for (let linkRecursive of menuLinks) linkRecursive.removeEventListener('mouseover', initializeSecondBubble);
var menuItems = {
+
                for (let linkRecursive of menuLinks) linkRecursive.addEventListener('click', initializeSecondBubble);
project: {
+
                link.initializeSecondBubble;
desc: {
+
                setTimeout(function() {
name: "Description",
+
                    for (let linkRecursive of menuLinks) linkRecursive.addEventListener('mouseover', initializeSecondBubble);
link: "./Description"
+
                }, 3000)
},
+
            })
imp: {
+
        }
name: "Implementation",
+
 
link: "./Implementation",
+
        function initializeSecondBubble() {
},
+
            for (let lk of menuLinks) {
des: {
+
                if (lk.classList.contains("active")) {
name: "Design",
+
                    lk.classList.remove("active");
link: "./Design",
+
                    const myNode = document.getElementById("appendable");
},
+
                    while (myNode.firstChild) {
exp: {
+
                        myNode.removeChild(myNode.lastChild);
name: "Experiments",
+
                    }
link: "./Experiments",
+
                }
},
+
            }
res: {
+
 
name: "Results",
+
            if (document.querySelector('#popup-main').classList.contains('active')) openSecBubble(this)
link: "./Results",
+
        }
},
+
 
eng: {
+
        $('#appendable li a').on("click", function() {
name: "Engineering",
+
            closeMenu();
link: "./Engineering",
+
        })
},
+
 
pof: {
+
        $(window).resize(function() {
name: "Proof of Concept",
+
            resizeBubble();
link: "./ProofOfConcept",
+
        });
},
+
 
mod: {
+
        function resizeBubble(type = "project") {
name: "Model",
+
            $(function() {
link: "./Model",
+
                var elementWidth = $("#appendable").width();
},
+
                var elementHeight = $("#appendable").height();
sof: {
+
                var resizingConstant = (function() {
name: "Software",
+
                    if (type == "hp") {
link: "./Software",
+
                        return 1.5
},
+
                    } else if (type == "team") {
con: {
+
                        return 1.3
name: "Contribution",
+
                    } else if (type == "project") {
link: "./Contribution",
+
                        return 1.45
}
+
                    } else if (type == "dl") {
},
+
                        return 1.6
parts: {
+
                    } else if (type == "wl") {
par: {
+
                        return 1.2
name: "Parts",
+
                    }
link: "./Parts",
+
                })();
},
+
                if (elementHeight > elementWidth) {
col: {
+
                    $("#bubbles #popup-next").css("height", elementHeight * resizingConstant);
name: "Parts Collection",
+
                    $("#bubbles #popup-next").css("width", elementHeight * resizingConstant);
link: "./PartsCollection",
+
                } else {
}
+
                    $("#bubbles #popup-next").css("height", elementWidth * resizingConstant);
},
+
                    $("#bubbles #popup-next").css("width", elementWidth * resizingConstant);
hp: {
+
                }
int: {
+
            })
name: "Integrated<br>Human Practices",
+
        }
link: "./Integrated",
+
        document.getElementById("bubbles-to-close").addEventListener('click', function() {
},
+
            var isOpen = document.getElementById("popup-main");
col: {
+
            if (isOpen.classList.contains("active")) {
name: "Education &<br>Public Engagement",
+
                closeMenu();
link: "./Education",
+
            }
}
+
        })
},
+
        var menuItems = {
team: {
+
            project: {
members: {
+
                desc: {
name: "Members",
+
                    name: "Description",
link: "./Team",
+
                    link: "https://2020.igem.org/Team:Vilnius-Lithuania/Description"
},
+
                },
coll: {
+
                imp: {
name: "Collaborations",
+
                    name: "Implementation",
link: "./Collaborations",
+
                    link: "https://2020.igem.org/Team:Vilnius-Lithuania/Implementation",
},
+
                },
att: {
+
                con: {
name: "Attributions",
+
                    name: "Contribution",
link: "./Attributions",
+
                    link: "https://2020.igem.org/Team:Vilnius-Lithuania/Contribution",
}
+
                },
}
+
                gd: {
}
+
                    name: "Graphic Design",
 +
                    link: "https://2020.igem.org/Team:Vilnius-Lithuania/Graphic_Design"
 +
                },
 +
                aw: {
 +
                    name: "Awards",
 +
                    link: "https://2020.igem.org/Team:Vilnius-Lithuania/Awards"
 +
                }
 +
            },
 +
            wl: {
 +
                des: {
 +
                    name: "Design",
 +
                    link: "https://2020.igem.org/Team:Vilnius-Lithuania/Design",
 +
                },
 +
                eng: {
 +
                    name: "Engineering",
 +
                    link: "https://2020.igem.org/Team:Vilnius-Lithuania/Engineering",
 +
                },
 +
                res: {
 +
                    name: "Results",
 +
                    link: "https://2020.igem.org/Team:Vilnius-Lithuania/Results",
 +
                },
 +
                par: {
 +
                    name: "Parts",
 +
                    link: "https://2020.igem.org/Team:Vilnius-Lithuania/Parts",
 +
                },
 +
                exp: {
 +
                    name: "Experiments",
 +
                    link: "https://2020.igem.org/Team:Vilnius-Lithuania/Experiments",
 +
                },
 +
 
 +
                saf: {
 +
                    name: "Safety",
 +
                    link: "https://2020.igem.org/Team:Vilnius-Lithuania/Safety",
 +
                }
 +
            },
 +
            dl: {
 +
                mod: {
 +
                    name: "Model",
 +
                    link: "https://2020.igem.org/Team:Vilnius-Lithuania/Model",
 +
                },
 +
                sof: {
 +
                    name: "Software",
 +
                    link: "https://2020.igem.org/Team:Vilnius-Lithuania/Software",
 +
                },
 +
                har: {
 +
                    name: "Hardware",
 +
                    link: "https://2020.igem.org/Team:Vilnius-Lithuania/Hardware",
 +
                },
 +
                mes: {
 +
                    name: "Measurement",
 +
                    link: "https://2020.igem.org/Team:Vilnius-Lithuania/Measurement",
 +
                }
 +
            },
 +
            hp: {
 +
                int: {
 +
                    name: "Integrated<br>Human Practices",
 +
                    link: "https://2020.igem.org/Team:Vilnius-Lithuania/Human_Practices",
 +
                },
 +
                col: {
 +
                    name: "Education &<br>Public Engagement",
 +
                    link: "https://2020.igem.org/Team:Vilnius-Lithuania/Education",
 +
                },
 +
                arqr: {
 +
                    name: "The 6th SynBio Sense",
 +
                    link: "https://2020.igem.org/Team:Vilnius-Lithuania/The_6th_SynBio_Sense",
 +
 
 +
                }
 +
            },
 +
            team: {
 +
                members: {
 +
                    name: "Members",
 +
                    link: "https://2020.igem.org/Team:Vilnius-Lithuania/Team",
 +
                },
 +
                coll: {
 +
                    name: "Collaborations",
 +
                    link: "https://2020.igem.org/Team:Vilnius-Lithuania/Collaborations",
 +
                },
 +
                att: {
 +
                    name: "Attributions",
 +
                    link: "https://2020.igem.org/Team:Vilnius-Lithuania/Attributions",
 +
                }
 +
            }
 +
        }

Latest revision as of 16:42, 12 December 2020

//---------------Checking if the page is content page---------------

       var textSection = null;
       var navbar = document.getElementById("navbar");
       window.addEventListener('load', function() {
           textSection = document.querySelector('.elevate-navbar');
           checkScrollPos();
           checkBackToTopPos();
       })
       window.addEventListener('scroll', function() {
           updateScrollbar();
           checkNavbarPos();
           checkScrollPos();
           checkBackToTopPos();
       });
       function checkScrollPos() {
           var footerTop = document.getElementById("footerWrapper").getBoundingClientRect().top;
           var scrollbarBottom = document.getElementById("scrollbar-container").getBoundingClientRect().bottom;
           let scrollWrapper = document.querySelector('.scroll-wrapper');
           if (scrollbarBottom >= footerTop) {
               if (scrollWrapper.getAttribute("hiddenScroll") == "false") scrollWrapper.setAttribute("hiddenScroll", "true");
           } else {
               if (scrollWrapper.getAttribute("hiddenScroll") == "true") scrollWrapper.setAttribute("hiddenScroll", "false");
           }
       }
       function checkBackToTopPos() {
           if ($(window).scrollTop() > 1000) {
               $('#backtotop-wrapper').addClass('scrolled')
           } else $('#backtotop-wrapper').removeClass('scrolled')
       }
       $(document).ready(function() {
           $('#backtotop-wrapper').on('click', function() {
               $('html, body').animate({
                   'scrollTop': $('body').offset().top
               }, 2000);
           });
       });


       function checkNavbarPos() {
           if (textSection != null) {
               var navbarTop = navbar.getBoundingClientRect().top;
               var mainTagTop = textSection.getBoundingClientRect().top;
               if (navbarTop >= mainTagTop) {
                   if (document.getElementById("bubbles-to-close").getAttribute("open") != true) navbar.setAttribute("onText", "true");
               } else {
                   navbar.setAttribute("onText", "false");
               }
           }
       }
       //---------------Scrollbar height---------------
       function updateScrollbar() {
           var winScroll = document.body.scrollTop || document.documentElement.scrollTop;
           var height = document.documentElement.scrollHeight - window.innerHeight;;
           var scrolled = (winScroll / height) * 100;
           document.getElementById("scrollbar").style.height = scrolled + "%";
       }
       //---------------Closing the menu and returning to default values---------------
       function closeMenu() {
           var toggleable = document.querySelectorAll('.toggleable');
           for (let item of toggleable) {
               item.classList.remove("active");
           }
           document.getElementById("fixedOverlay").setAttribute("bg", "none");
           document.getElementById("popup-next").classList.remove(currentChoice);
           document.querySelector(".hamb-wrapper").classList.remove("invisible");
           currentChoice = null;
           const myNode = document.getElementById("appendable");
           document.getElementById("bubbles-to-close").setAttribute("open", "false");
           while (myNode.firstChild) {
               myNode.removeChild(myNode.lastChild);
           }
           let node = document.querySelector('.center-link');
           document.querySelector('#popup-next .choices').removeChild(node)
           checkNavbarPos();
       }
       function openSecBubble(link) {
           link.classList.add("active");
           document.getElementById("popup-next").classList.remove(currentChoice);
           currentChoice = link.id;
           document.getElementById("popup-next").classList.add("active");
           var items = menuItems[currentChoice];
           document.getElementById("popup-next").classList.add(currentChoice)
           let counter = 0;
           for (const [key, value] of Object.entries(menuItems[currentChoice])) {
               var node = document.createElement("li");
               var nodeLink = document.createElement("a");
               nodeLink.href = value.link;
               nodeLink.innerHTML = value.name;
               if (link.id == 'wl') {
                   node.classList.add(counter < 3 ? 'right-align' : 'left-align');
                   counter++;
               }
               node.appendChild(nodeLink);
               document.getElementById("appendable").appendChild(node);
           }
           resizeBubble(link.id);
       }
       var openMenuEls = document.getElementsByClassName("menu-wrapper");
       for (let el of openMenuEls) {
           //---------------Clicking on menu sandwich/close button---------------
           el.addEventListener('click', function() {
               //---------------If menu is open and close button is clicked, close menu---------------
               if (this.classList.contains("active")) {
                   closeMenu();
               } else {
                   document.getElementById("popup-main").classList.add("active");
                   this.classList.add("active");
                   document.querySelector(".hamb-wrapper").classList.add("invisible");
                   fxdOv = document.getElementById("fixedOverlay");
                   fxdOv.setAttribute("bg", "dark");
                   document.getElementById("navbar").setAttribute("onText", "false");
                   document.getElementById("bubbles-to-close").setAttribute("open", "true");
                   if (fxdOv.classList.length != 0) {
                       link = fxdOv.classList[0]
                       openSecBubble(document.getElementById(link))
                   }
               }
           })
       }
       var currentChoice;
       var menuLinks = document.getElementsByClassName("main-choice");
       for (let link of menuLinks) {
           link.addEventListener('mouseover', initializeSecondBubble);
       }
       for (let link of menuLinks) {
           link.addEventListener('click', function() {
               for (let linkRecursive of menuLinks) linkRecursive.removeEventListener('mouseover', initializeSecondBubble);
               for (let linkRecursive of menuLinks) linkRecursive.addEventListener('click', initializeSecondBubble);
               link.initializeSecondBubble;
               setTimeout(function() {
                   for (let linkRecursive of menuLinks) linkRecursive.addEventListener('mouseover', initializeSecondBubble);
               }, 3000)
           })
       }
       function initializeSecondBubble() {
           for (let lk of menuLinks) {
               if (lk.classList.contains("active")) {
                   lk.classList.remove("active");
                   const myNode = document.getElementById("appendable");
                   while (myNode.firstChild) {
                       myNode.removeChild(myNode.lastChild);
                   }
               }
           }
           if (document.querySelector('#popup-main').classList.contains('active')) openSecBubble(this)
       }
       $('#appendable li a').on("click", function() {
           closeMenu();
       })
       $(window).resize(function() {
           resizeBubble();
       });
       function resizeBubble(type = "project") {
           $(function() {
               var elementWidth = $("#appendable").width();
               var elementHeight = $("#appendable").height();
               var resizingConstant = (function() {
                   if (type == "hp") {
                       return 1.5
                   } else if (type == "team") {
                       return 1.3
                   } else if (type == "project") {
                       return 1.45
                   } else if (type == "dl") {
                       return 1.6
                   } else if (type == "wl") {
                       return 1.2
                   }
               })();
               if (elementHeight > elementWidth) {
                   $("#bubbles #popup-next").css("height", elementHeight * resizingConstant);
                   $("#bubbles #popup-next").css("width", elementHeight * resizingConstant);
               } else {
                   $("#bubbles #popup-next").css("height", elementWidth * resizingConstant);
                   $("#bubbles #popup-next").css("width", elementWidth * resizingConstant);
               }
           })
       }
       document.getElementById("bubbles-to-close").addEventListener('click', function() {
           var isOpen = document.getElementById("popup-main");
           if (isOpen.classList.contains("active")) {
               closeMenu();
           }
       })
       var menuItems = {
           project: {
               desc: {
                   name: "Description",
                   link: "https://2020.igem.org/Team:Vilnius-Lithuania/Description"
               },
               imp: {
                   name: "Implementation",
                   link: "https://2020.igem.org/Team:Vilnius-Lithuania/Implementation",
               },
               con: {
                   name: "Contribution",
                   link: "https://2020.igem.org/Team:Vilnius-Lithuania/Contribution",
               },
               gd: {
                   name: "Graphic Design",
                   link: "https://2020.igem.org/Team:Vilnius-Lithuania/Graphic_Design"
               },
               aw: {
                   name: "Awards",
                   link: "https://2020.igem.org/Team:Vilnius-Lithuania/Awards"
               }
           },
           wl: {
               des: {
                   name: "Design",
                   link: "https://2020.igem.org/Team:Vilnius-Lithuania/Design",
               },
               eng: {
                   name: "Engineering",
                   link: "https://2020.igem.org/Team:Vilnius-Lithuania/Engineering",
               },
               res: {
                   name: "Results",
                   link: "https://2020.igem.org/Team:Vilnius-Lithuania/Results",
               },
               par: {
                   name: "Parts",
                   link: "https://2020.igem.org/Team:Vilnius-Lithuania/Parts",
               },
               exp: {
                   name: "Experiments",
                   link: "https://2020.igem.org/Team:Vilnius-Lithuania/Experiments",
               },
               saf: {
                   name: "Safety",
                   link: "https://2020.igem.org/Team:Vilnius-Lithuania/Safety",
               }
           },
           dl: {
               mod: {
                   name: "Model",
                   link: "https://2020.igem.org/Team:Vilnius-Lithuania/Model",
               },
               sof: {
                   name: "Software",
                   link: "https://2020.igem.org/Team:Vilnius-Lithuania/Software",
               },
               har: {
                   name: "Hardware",
                   link: "https://2020.igem.org/Team:Vilnius-Lithuania/Hardware",
               },
               mes: {
                   name: "Measurement",
                   link: "https://2020.igem.org/Team:Vilnius-Lithuania/Measurement",
               }
           },
           hp: {
               int: {
                   name: "Integrated
Human Practices", link: "https://2020.igem.org/Team:Vilnius-Lithuania/Human_Practices", }, col: { name: "Education &
Public Engagement", link: "https://2020.igem.org/Team:Vilnius-Lithuania/Education", }, arqr: { name: "The 6th SynBio Sense", link: "https://2020.igem.org/Team:Vilnius-Lithuania/The_6th_SynBio_Sense",
               }
           },
           team: {
               members: {
                   name: "Members",
                   link: "https://2020.igem.org/Team:Vilnius-Lithuania/Team",
               },
               coll: {
                   name: "Collaborations",
                   link: "https://2020.igem.org/Team:Vilnius-Lithuania/Collaborations",
               },
               att: {
                   name: "Attributions",
                   link: "https://2020.igem.org/Team:Vilnius-Lithuania/Attributions",
               }
           }
       }