feat: backgorund image shown only once

This commit is contained in:
2026-02-04 09:35:58 +05:00
parent 2fdd98bafe
commit 1e314392af
3 changed files with 39 additions and 24 deletions
-18
View File
@@ -64,29 +64,11 @@
<Button variant="primary" size="sm" onclick={onDownload}>Скачать</Button>
</div>
<div class="preview-sections">
<!-- Превью чистой картинки -->
<div class="preview-section">
<h3>Фон</h3>
<div class="canvas-container">
<Stage width={320} height={panel.height}>
<Layer>
{#if backgroundImage}
<Image image={backgroundImage} width={320} height={panel.height} />
{/if}
</Layer>
</Stage>
</div>
</div>
<!-- Превью с текстом -->
<div class="preview-section">
<h3>Финальный результат</h3>
<div class="canvas-container">
<Stage width={320} height={panel.height}>
<Layer>
{#if backgroundImage}
<Image image={backgroundImage} width={320} height={panel.height} />
{/if}
{#each panel.texts || [] as textItem (textItem.id)}
{@const textPosition = getTextPosition(textItem)}
<Text
+28
View File
@@ -152,6 +152,12 @@
</div>
<div class="sidebar">
{#if $uiStore.currentStep === "text" && backgroundImage}
<div class="background-preview">
<h3>Фоновое изображение</h3>
<img src={backgroundImage} alt="Фон" />
</div>
{/if}
{#if $uiStore.currentStep === "text" && panels.length > 0}
<div class="panels-container">
<div class="panels-header">
@@ -232,6 +238,28 @@
gap: 1.5rem;
}
.background-preview {
display: flex;
flex-direction: column;
gap: 0.5rem;
padding: 1rem;
background: white;
border-radius: 8px;
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}
.background-preview h3 {
margin: 0;
color: #333;
font-size: 1rem;
font-weight: 600;
}
.background-preview img {
width: 100%;
border-radius: 4px;
}
.panels-container {
display: flex;
flex-direction: column;