2011-02-21 14:31:26 +01:00
|
|
|
<!DOCTYPE html>
|
2011-02-07 20:16:51 +01:00
|
|
|
<html>
|
|
|
|
<head>
|
|
|
|
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
|
2011-06-30 09:57:17 -04:00
|
|
|
<title>Rounded Rectangle</title>
|
2011-05-05 16:25:17 +01:00
|
|
|
<link rel="stylesheet" href="../css/style.css">
|
2011-06-12 19:03:18 +01:00
|
|
|
<script type="text/javascript" src="../../dist/paper.js"></script>
|
2011-03-04 12:38:38 +01:00
|
|
|
<script type="text/paperscript" canvas="canvas">
|
2011-05-15 18:12:56 +01:00
|
|
|
var path;
|
|
|
|
var rect = new Rectangle([150, 150], [300, 300]);
|
2011-05-16 13:33:15 +01:00
|
|
|
project.currentStyle.fillColor = 'black';
|
2011-07-07 16:09:02 +02:00
|
|
|
|
2011-05-15 18:12:56 +01:00
|
|
|
function onFrame(event) {
|
2011-05-06 15:03:21 +01:00
|
|
|
if (path)
|
|
|
|
path.remove();
|
2011-05-15 18:12:56 +01:00
|
|
|
var size = Math.abs(Math.sin(event.count / 40)) * 150 + 10;
|
2011-05-06 15:03:21 +01:00
|
|
|
path = new Path.RoundRectangle(rect, size);
|
2011-05-16 12:51:20 +01:00
|
|
|
path.position = view.center;
|
2011-02-07 20:16:51 +01:00
|
|
|
}
|
|
|
|
</script>
|
|
|
|
</head>
|
|
|
|
<body>
|
2011-06-29 13:44:06 +02:00
|
|
|
<canvas id="canvas" resize></canvas>
|
2011-05-31 00:27:39 +02:00
|
|
|
</body>
|
|
|
|
</html>
|