mirror of
https://github.com/scratchfoundation/paper.js.git
synced 2024-12-29 09:22:22 -05:00
28 lines
767 B
HTML
28 lines
767 B
HTML
<!DOCTYPE html>
|
|
<html>
|
|
<head>
|
|
<meta charset="UTF-8">
|
|
<title>Rounded Rectangle</title>
|
|
<link rel="stylesheet" href="../css/style.css">
|
|
<script type="text/javascript" src="../../dist/paper-full.js"></script>
|
|
<script type="text/paperscript" canvas="canvas">
|
|
var path;
|
|
|
|
function onFrame(event) {
|
|
if (path)
|
|
path.remove();
|
|
path = new Path.Rectangle({
|
|
radius: Math.abs(Math.sin(event.count / 40)) * 150 + 10,
|
|
rectangle: {
|
|
size: [300, 300]
|
|
},
|
|
fillColor: 'black'
|
|
});
|
|
path.position = view.center;
|
|
}
|
|
</script>
|
|
</head>
|
|
<body>
|
|
<canvas id="canvas" resize></canvas>
|
|
</body>
|
|
</html>
|