import { greet } from "./util.ts"; import Konva from "konva"; console.log("Yolokk"); greet(); const stage = new Konva.Stage({ container: "mainContainer", width: 500, height: 500, }); const layer = new Konva.Layer(); stage.on("contextmenu", (e) => { e.evt.preventDefault(); }); stage.on("pointerdown", (e) => { const pos = stage.getPointerPosition(); console.log("position", pos); console.log("event", e.evt, e.evt.button); }); const circle = new Konva.Circle({ x: stage.width() /2, y: stage.height() / 2, radius: 10, fill: "blue", stroke: "black", strokeWidth: 2, }); layer.add(circle); stage.add(layer); layer.draw(); const pointerAnim = new Konva.Animation((frame) => { //const pos = stage.getPointerPosition(); const centerX = stage.width() / 2; circle.x(50*Math.sin((frame.time * 2 * Math.PI) / 2000) + centerX); }, layer); pointerAnim.start(); console.log("Ended");