From b429cf58f9db66b798ecc23322c5edbd48200132 Mon Sep 17 00:00:00 2001 From: Greg Shuflin Date: Tue, 3 Oct 2023 02:26:16 -0700 Subject: [PATCH] Use konva to animate a ball --- src/app.js | 26 +++++++++++++++++++++++++- src/index.html | 2 +- 2 files changed, 26 insertions(+), 2 deletions(-) diff --git a/src/app.js b/src/app.js index 21f1656..6b9bd90 100644 --- a/src/app.js +++ b/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"); diff --git a/src/index.html b/src/index.html index b6d34fb..c1c8e4e 100644 --- a/src/index.html +++ b/src/index.html @@ -7,7 +7,7 @@

Spazer

- +