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