tweaks ns tuff

This commit is contained in:
Jill 2022-03-05 15:34:41 +03:00
parent 39c236e920
commit 06451b7efe
1 changed files with 21 additions and 8 deletions

View File

@ -76,6 +76,7 @@
if (response.ok) {
submitting = false;
currentImage = {file: null, name: '', x: 0.5, y: 0.5}
upload = null;
} else {
submitting = false;
if (response.body) {
@ -113,10 +114,6 @@
height: auto;
}
#chart * {
position: relative;
}
#canvas {
position: absolute;
}
@ -138,6 +135,22 @@
height: 100%;
}
.img {
position: relative;
width: 64px;
height: 64px;
}
.img * {
width: 64px;
height: 64px;
}
.img *:last-child, .img *:last-child {
z-index: 999;
height: unset;
}
@media (max-width: 650px) {
#panels {
flex-direction: column;
@ -182,14 +195,14 @@
{#key top + left + right + bot}
<div id="canvas"><Chart topText={top} leftText={left} rightText={right} bottomText={bot} fontSize=14/></div>
{/key}
{#each [...$images, currentImage] as img}
{#each [...$images, currentImage] as img, i}
{#if img && img.file}
<div class="img" style="top: {Math.floor(img.y*512)}px; left: {Math.floor((img.x-0.5)*512)}px">
<div class="img" style="top: {Math.floor(img.y*512)-i*64}px; left: {Math.floor((img.x)*512)}px">
<Popover>
<div class="img-container">
<img class="img-file" src="{img.file}" alt="{img.name}">
</div>
<div slot="popover-content">
<div slot="popover-content" class="popover-content">
<PopoverButton>{img.name}</PopoverButton>
</div>
</Popover>
@ -207,7 +220,7 @@
reader.readAsDataURL(upload);
}}/>
{#if upload != null}
<FileTile file={upload} on:delete={() => upload = null}/>
<FileTile file={upload} on:delete={() => {upload = null; currentImage.file = null}}/>
{/if}
<br>
<FormField