Difference between revisions of "Team:Hong Kong HKU/JS/Nav"

(Test)
m (Test)
Line 1: Line 1:
function toggleMenu(a){if(!a)var a=window.event;if(a.stopPropagation(),open){open=!open;for(var b=new TimelineLite,c=0;c<items.length;c++)b.to(items[c],.3,{rotation:0,ease:Circ.easeOut},.05);b.to(items,.3,{scale:0,ease:Back.easeIn},.3),svg.style.pointerEvents="none"}else{open=!open;var b=new TimelineLite;b.to(items,.2,{scale:1,ease:Back.easeOut.config(4)},.05);for(var c=0;c<items.length;c++)b.to(items[c],.7,{rotation:c*angle+"deg",ease:Bounce.easeOut},.35);svg.style.pointerEvents="auto"}}var svg=document.getElementById("PlasmidNav"),items=svg.querySelectorAll(".item"),trigger=document.getElementById("Logo"),open=!1,angle=360/7;trigger.addEventListener("click",toggleMenu,!1),document.onload=function(){open=!0;var a=new TimelineLite;a.to(items,.2,{scale:1,ease:Back.easeOut.config(4)},.05);for(var b=0;b<items.length;b++)a.to(items[b],.7,{rotation:b*angle+"deg",ease:Bounce.easeOut},.35);svg.style.pointerEvents="auto"};
+
function toggleMenu(a){if(!a)var a=window.event;if(a.stopPropagation(),open){open=!open;for(var b=new TimelineLite,c=0;c<items.length;c++)b.to(items[c],.3,{rotation:0,ease:Circ.easeOut},.05);b.to(items,.3,{scale:0,ease:Back.easeIn},.3),svg.style.pointerEvents="none"}else{open=!open;var b=new TimelineLite;b.to(items,.2,{scale:1,ease:Back.easeOut.config(4)},.05);for(var c=0;c<items.length;c++)b.to(items[c],.7,{rotation:c*angle+"deg",ease:Bounce.easeOut},.35);svg.style.pointerEvents="auto"}}var svg=document.getElementById("PlasmidNav"),items=svg.querySelectorAll(".item"),trigger=document.getElementById("Logo"),open=!0,angle=360/7;trigger.addEventListener("click",toggleMenu,!1),svg.onload=function(){var a=new TimelineLite;a.to(items,.2,{scale:1,ease:Back.easeOut.config(4)},.05);for(var b=0;b<items.length;b++)a.to(items[b],.7,{rotation:b*angle+"deg",ease:Bounce.easeOut},.35);svg.style.pointerEvents="auto"};

Revision as of 12:08, 10 October 2016

function toggleMenu(a){if(!a)var a=window.event;if(a.stopPropagation(),open){open=!open;for(var b=new TimelineLite,c=0;c<items.length;c++)b.to(items[c],.3,{rotation:0,ease:Circ.easeOut},.05);b.to(items,.3,{scale:0,ease:Back.easeIn},.3),svg.style.pointerEvents="none"}else{open=!open;var b=new TimelineLite;b.to(items,.2,{scale:1,ease:Back.easeOut.config(4)},.05);for(var c=0;c<items.length;c++)b.to(items[c],.7,{rotation:c*angle+"deg",ease:Bounce.easeOut},.35);svg.style.pointerEvents="auto"}}var svg=document.getElementById("PlasmidNav"),items=svg.querySelectorAll(".item"),trigger=document.getElementById("Logo"),open=!0,angle=360/7;trigger.addEventListener("click",toggleMenu,!1),svg.onload=function(){var a=new TimelineLite;a.to(items,.2,{scale:1,ease:Back.easeOut.config(4)},.05);for(var b=0;b<items.length;b++)a.to(items[b],.7,{rotation:b*angle+"deg",ease:Bounce.easeOut},.35);svg.style.pointerEvents="auto"};