Rename directory to better suit the moving time.
Kind of also fix the apache conf, but not quite.
This commit is contained in:
43
old-projects/canvas/pr.htm
Normal file
43
old-projects/canvas/pr.htm
Normal file
@@ -0,0 +1,43 @@
|
||||
<!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>Canvas picture rotating</title>
|
||||
<style type='text/css'>
|
||||
* {
|
||||
margin:0;
|
||||
padding:0;
|
||||
}
|
||||
|
||||
canvas {
|
||||
position:absolute;
|
||||
top:50%;
|
||||
left:50%;
|
||||
margin-top:-200px;
|
||||
margin-left:-320px;
|
||||
border:1px solid #000;
|
||||
}
|
||||
</style>
|
||||
<script type='text/javascript'>
|
||||
function ani() {
|
||||
ctx.rotate((Math.PI/180)*21)
|
||||
ctx.drawImage(img,-150,-84)
|
||||
setTimeout("ani()",40)
|
||||
}
|
||||
|
||||
function load() {
|
||||
img=new Image()
|
||||
img.onload=function(){
|
||||
ctx=document.getElementById('canvas').getContext('2d')
|
||||
ctx.translate(320,200)
|
||||
ani()
|
||||
}
|
||||
img.src="img/kr.jpg"
|
||||
}
|
||||
|
||||
window.onload=load
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
<canvas id='canvas' width='640' height='400'></canvas>
|
||||
</body>
|
||||
</html>
|
||||
Reference in New Issue
Block a user