Team:Heidelberg/Templates/StartPage
From 2013.igem.org
(Difference between revisions)
m |
m |
||
Line 70: | Line 70: | ||
var beta = Math.atan(a / b * Math.tan(t)); | var beta = Math.atan(a / b * Math.tan(t)); | ||
var angle = Math.PI * 0.5 - beta; | var angle = Math.PI * 0.5 - beta; | ||
- | var y = b * Math.sin(t); | + | var y = b - b * Math.sin(t); |
return Array(angle,y); | return Array(angle,y); | ||
} | } | ||
Line 78: | Line 78: | ||
angle[0] *= factor; | angle[0] *= factor; | ||
var root = document.getElementById(id); | var root = document.getElementById(id); | ||
- | root.style = "transform:rotate(" + angle[0] + "rad);position:relative;top:" + | + | var toppos = getComputedStyle(root).top; |
+ | root.style = "transform:rotate(" + angle[0] + "rad);position:relative;top:calc(" + toppos + " + 20px - " + angle[1] + "px);"; | ||
var children = root.children; | var children = root.children; | ||
for (var i = 0; i < children.length; ++i) { | for (var i = 0; i < children.length; ++i) { |
Revision as of 15:00, 21 August 2013