metanohi-misc-subsites/old-projects/x/pf.htm

69 lines
1.2 KiB
HTML

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3c.org/1999/xhtml">
<head>
<title>Platform</title>
<style type='text/css'>
div {
position:absolute;
left:50%;
top:50%;
}
div div {
position:static;
left:0;
top:0;
height:1px;
background:#000;
}
</style>
<script type='text/javascript'>
size=400
angle=0
ni=true
ss=true
function load() {
w=size
h=Math.round(size*angle/90)
d=90/angle
dw=w/d
document.body.removeChild(document.body.childNodes[0])
if (ss) {
ssr=w-h
ssh=w
}
else {
ssr=0
ssh=h
}
pfd=document.createElement("div")
pfd.style.width=w+"px"
pfd.style.height=h+"px"
pfd.style.marginLeft=w/-2+"px"
pfd.style.marginTop=ssh/-2+ssr+"px"
document.body.appendChild(pfd)
ld=new Array()
for (i=0;i<h;i++) {
lw=dw+(i*(d-1))
//lw=w/(((h-i-1)/h)*d+1)
ld[i]=document.createElement("div")
ld[i].style.width=lw+"px"
ld[i].style.marginLeft=(w-lw)/2+"px"
pfd.appendChild(ld[i])
}
if (angle<90 && ni) angle++
else if (angle==90) ni=false
if (angle>0 && !ni) angle--
else if (angle==0) ni=true
setTimeout("load()",50)
}
window.onload=load
</script>
</head>
<body><div></div></body>
</html>