feat: backgorund image shown only once
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user