Spaces:
Running
Running
canvas size control
Browse files- src/routes/+page.svelte +4 -3
src/routes/+page.svelte
CHANGED
@@ -13,7 +13,7 @@
|
|
13 |
|
14 |
const animImageDuration = 500 as const;
|
15 |
const animNoiseDuration = 3000 as const;
|
16 |
-
const canvasSize =
|
17 |
|
18 |
async function drawNoise() {
|
19 |
if (!ctx) {
|
@@ -172,7 +172,8 @@
|
|
172 |
{ DrawingMode: { filler: false } },
|
173 |
],
|
174 |
droppable: true,
|
175 |
-
webStorage: false
|
|
|
176 |
});
|
177 |
canvas = drawingBoard.canvas;
|
178 |
ctx = canvas.getContext('2d');
|
@@ -191,7 +192,7 @@
|
|
191 |
|
192 |
<div class="flex flex-wrap gap-x-8 justify-center mt-8">
|
193 |
<div class={isLoading ? 'pointer-events-none' : ''}>
|
194 |
-
<div id="board-container" style="width:
|
195 |
<div class="flex gap-x-2 mt-4 items-center justify-center {isLoading ? 'animate-pulse' : ''}">
|
196 |
<input type="text" class="border-2 " placeholder="Add prompt" bind:value={txt} />
|
197 |
<button
|
|
|
13 |
|
14 |
const animImageDuration = 500 as const;
|
15 |
const animNoiseDuration = 3000 as const;
|
16 |
+
const canvasSize = 300 as const;
|
17 |
|
18 |
async function drawNoise() {
|
19 |
if (!ctx) {
|
|
|
172 |
{ DrawingMode: { filler: false } },
|
173 |
],
|
174 |
droppable: true,
|
175 |
+
webStorage: false,
|
176 |
+
enlargeYourContainer: true,
|
177 |
});
|
178 |
canvas = drawingBoard.canvas;
|
179 |
ctx = canvas.getContext('2d');
|
|
|
192 |
|
193 |
<div class="flex flex-wrap gap-x-8 justify-center mt-8">
|
194 |
<div class={isLoading ? 'pointer-events-none' : ''}>
|
195 |
+
<div id="board-container" style="width: {canvasSize}px;height: {canvasSize}px;" />
|
196 |
<div class="flex gap-x-2 mt-4 items-center justify-center {isLoading ? 'animate-pulse' : ''}">
|
197 |
<input type="text" class="border-2 " placeholder="Add prompt" bind:value={txt} />
|
198 |
<button
|