Use konva to animate a ball
This commit is contained in:
parent
3f085f7e6e
commit
b429cf58f9
26
src/app.js
26
src/app.js
@ -1,4 +1,28 @@
|
||||
import { greet } from "./util.ts";
|
||||
import Konva from "konva";
|
||||
|
||||
console.log("Yolo");
|
||||
console.log("Yolokk");
|
||||
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");
|
||||
|
@ -7,7 +7,7 @@
|
||||
</head>
|
||||
<body>
|
||||
<h1>Spazer</h1>
|
||||
<canvas id="mainCanvas">
|
||||
<div id="mainContainer"></div>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user