mirror of
https://github.com/scratchfoundation/paper.js.git
synced 2025-01-04 03:45:58 -05:00
27 lines
No EOL
778 B
HTML
27 lines
No EOL
778 B
HTML
<!DOCTYPE html>
|
|
<html>
|
|
<head>
|
|
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
|
|
<title>Example</title>
|
|
<link rel="stylesheet" href="../css/style.css">
|
|
<script type="text/javascript">var root = '../../'</script>
|
|
<script type="text/javascript" src="../../src/load.js"></script>
|
|
<script type="text/paperscript" canvas="canvas">
|
|
var path,
|
|
count = 0,
|
|
rect = new Rectangle([150, 150], [300, 300]);
|
|
document.currentStyle.fillColor = 'black';
|
|
|
|
function onFrame() {
|
|
if (path)
|
|
path.remove();
|
|
var size = Math.abs(Math.sin(count / 40)) * 150 + 10;
|
|
path = new Path.RoundRectangle(rect, size);
|
|
path.position = document.bounds.center;
|
|
count++;
|
|
}
|
|
</script>
|
|
</head>
|
|
<body>
|
|
<canvas id="canvas" resize keepalive="true"></canvas>
|
|
</body> |