Team:Heidelberg/Templates/StartPage
From 2013.igem.org
(Difference between revisions)
JuliaS1992 (Talk | contribs) m |
|||
Line 60: | Line 60: | ||
} | } | ||
--> | --> | ||
+ | function getMenuAngle(position) | ||
+ | { | ||
+ | var menu = document.getElementById("main-menu"); | ||
+ | var width = menu.offsetWidth; | ||
+ | var a = 0.5 * width; | ||
+ | var b = menu.offsetHeight; | ||
+ | var wpos = width * position; | ||
+ | var t = Math.acos(wpos / a); | ||
+ | var beta = Math.atan(a / b * Math.tan(t)); | ||
+ | var angle = Math.PI * 0.5 - beta; | ||
+ | return angle; | ||
+ | } | ||
+ | window.onload = function() { | ||
+ | document.getElementById("menu-team").style="transform:rotate(" + getMenuAngle(3) + "rad)"; | ||
+ | document.getElementById("menu-project").style="transform:rotate(" + getMenuAngle(2) + "rad)"; | ||
+ | document.getElementById("menu-parts").style="transform:rotate(" + getMenuAngle(1) + "rad)"; | ||
+ | document.getElementById("menu-modelling").style="transform:rotate(-" + getMenuAngle(1) + "rad)"; | ||
+ | document.getElementById("menu-human").style="transform:rotate(-" + getMenuAngle(2) + "rad)"; | ||
+ | document.getElementById("menu-safety").style="transform:rotate(-" + getMenuAngle(3) + "rad)"; | ||
+ | } | ||
</script> | </script> | ||
Revision as of 13:28, 21 August 2013