feat: move upload button
This commit is contained in:
@@ -1,5 +1,6 @@
|
|||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import { panelStore } from "../stores/panelStore";
|
import { panelStore } from "../stores/panelStore";
|
||||||
|
import { uiStore, setCurrentStep } from "../stores/uiStore";
|
||||||
import type { TextItem } from "../lib/types/panel";
|
import type { TextItem } from "../lib/types/panel";
|
||||||
import { Stage, Layer, Image, Text } from "svelte-konva";
|
import { Stage, Layer, Image, Text } from "svelte-konva";
|
||||||
import { Button } from "../lib/components/ui";
|
import { Button } from "../lib/components/ui";
|
||||||
@@ -10,6 +11,10 @@
|
|||||||
onDownload?: () => void;
|
onDownload?: () => void;
|
||||||
} = $props();
|
} = $props();
|
||||||
|
|
||||||
|
function handleUploadNewImage() {
|
||||||
|
setCurrentStep("upload");
|
||||||
|
}
|
||||||
|
|
||||||
let backgroundImage: HTMLImageElement | undefined = $state(undefined);
|
let backgroundImage: HTMLImageElement | undefined = $state(undefined);
|
||||||
|
|
||||||
$effect(() => {
|
$effect(() => {
|
||||||
@@ -57,6 +62,7 @@
|
|||||||
{#if $panelStore}
|
{#if $panelStore}
|
||||||
<div class="preview-header">
|
<div class="preview-header">
|
||||||
<Button variant="primary" onclick={handleDownload}>Скачать панель</Button>
|
<Button variant="primary" onclick={handleDownload}>Скачать панель</Button>
|
||||||
|
<Button variant="secondary" onclick={handleUploadNewImage}>Загрузить</Button>
|
||||||
</div>
|
</div>
|
||||||
<div class="preview-sections">
|
<div class="preview-sections">
|
||||||
<!-- Превью чистой картинки -->
|
<!-- Превью чистой картинки -->
|
||||||
@@ -119,6 +125,7 @@
|
|||||||
display: flex;
|
display: flex;
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
|
gap: 0.5rem;
|
||||||
padding: 1rem;
|
padding: 1rem;
|
||||||
margin-bottom: 1rem;
|
margin-bottom: 1rem;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -289,6 +289,13 @@
|
|||||||
width: 100%;
|
width: 100%;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.text-manager h2 {
|
||||||
|
margin: 0;
|
||||||
|
color: #333;
|
||||||
|
font-size: 1.5rem;
|
||||||
|
font-weight: 600;
|
||||||
|
}
|
||||||
|
|
||||||
.common-settings-section {
|
.common-settings-section {
|
||||||
background: #f8f9fa;
|
background: #f8f9fa;
|
||||||
border: 2px solid #e9ecef;
|
border: 2px solid #e9ecef;
|
||||||
|
|||||||
+3
-15
@@ -131,10 +131,7 @@
|
|||||||
<ImageCropper imageSrc={uploadedImage} onCropComplete={handleCropComplete} onCancel={handleCropCancel} />
|
<ImageCropper imageSrc={uploadedImage} onCropComplete={handleCropComplete} onCancel={handleCropCancel} />
|
||||||
{:else if $uiStore.currentStep === "text"}
|
{:else if $uiStore.currentStep === "text"}
|
||||||
<div class="text-section">
|
<div class="text-section">
|
||||||
<div class="section-header">
|
<h2>Управление текстом</h2>
|
||||||
<h2>Управление текстом</h2>
|
|
||||||
<button class="btn btn-primary" onclick={handleUploadNewImage}>Загрузить другое изображение</button>
|
|
||||||
</div>
|
|
||||||
<TextManager onTextUpdate={handleTextUpdate} />
|
<TextManager onTextUpdate={handleTextUpdate} />
|
||||||
</div>
|
</div>
|
||||||
{/if}
|
{/if}
|
||||||
@@ -193,18 +190,9 @@
|
|||||||
gap: 1rem;
|
gap: 1rem;
|
||||||
}
|
}
|
||||||
|
|
||||||
.section-header {
|
.text-section h2 {
|
||||||
display: flex;
|
|
||||||
justify-content: space-between;
|
|
||||||
align-items: center;
|
|
||||||
padding: 1rem;
|
|
||||||
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
|
|
||||||
border-radius: 8px;
|
|
||||||
color: white;
|
|
||||||
}
|
|
||||||
|
|
||||||
.section-header h2 {
|
|
||||||
margin: 0;
|
margin: 0;
|
||||||
|
color: #333;
|
||||||
font-size: 1.5rem;
|
font-size: 1.5rem;
|
||||||
font-weight: 600;
|
font-weight: 600;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user