mirror of
https://github.com/hex248/tsos.git
synced 2026-02-07 18:23:05 +00:00
konva Stage setup
This commit is contained in:
@@ -1,5 +1,26 @@
|
||||
import { Stage, Layer, Circle } from "react-konva";
|
||||
|
||||
const STAGE_SIZE = 0.6;
|
||||
const ASPECT_RATIO = 4 / 3;
|
||||
|
||||
function Index() {
|
||||
return <div className="w-64 h-64 bg-orange-600 rounded-full" />;
|
||||
return (
|
||||
<Stage
|
||||
width={window.innerWidth * STAGE_SIZE * ASPECT_RATIO}
|
||||
height={window.innerWidth * STAGE_SIZE}
|
||||
className="border rounded-lg"
|
||||
>
|
||||
<Layer>
|
||||
<Circle
|
||||
x={(window.innerWidth * STAGE_SIZE * ASPECT_RATIO) / 2}
|
||||
y={(window.innerWidth * STAGE_SIZE) / 2}
|
||||
radius={100}
|
||||
fill="#68d436"
|
||||
draggable
|
||||
/>
|
||||
</Layer>
|
||||
</Stage>
|
||||
);
|
||||
}
|
||||
|
||||
export default Index;
|
||||
|
||||
Reference in New Issue
Block a user