Use konva to animate a ball

This commit is contained in:
Greg Shuflin 2023-10-03 02:26:16 -07:00
parent 3f085f7e6e
commit b429cf58f9
2 changed files with 26 additions and 2 deletions

View File

@ -1,4 +1,28 @@
import { greet } from "./util.ts"; import { greet } from "./util.ts";
import Konva from "konva";
console.log("Yolo"); console.log("Yolokk");
greet(); greet();
const stage = new Konva.Stage({
container: "mainContainer",
width: 500,
height: 500,
});
const layer = new Konva.Layer();
const circle = new Konva.Circle({
x: stage.width() /2,
y: stage.height() / 2,
radius: 10,
fill: "red",
stroke: "black",
strokeWidth: 2,
});
layer.add(circle);
stage.add(layer);
layer.draw();
console.log("Ended");

View File

@ -7,7 +7,7 @@
</head> </head>
<body> <body>
<h1>Spazer</h1> <h1>Spazer</h1>
<canvas id="mainCanvas"> <div id="mainContainer"></div>
</body> </body>
</html> </html>