frontend: .......help........
This commit is contained in:
parent
831f3a5f98
commit
ebb7edcc8b
4 changed files with 31 additions and 8 deletions
|
@ -24,7 +24,7 @@
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<style>
|
<style>
|
||||||
/* Вертикальный список */
|
/* Горизонтальный список */
|
||||||
:global(.horisontal-bar) {
|
:global(.horisontal-bar) {
|
||||||
display: flex;
|
display: flex;
|
||||||
overflow-x: scroll;
|
overflow-x: scroll;
|
||||||
|
|
|
@ -1,32 +1,52 @@
|
||||||
<script>
|
<script>
|
||||||
import AddButton from "./add_button.svelte";
|
import AddButton from "./add_button.svelte";
|
||||||
let { direction = "horisontal", image = $bindable() } = $props();
|
let { direction = "horisontal" } = $props();
|
||||||
|
let images = $state();
|
||||||
|
let image = $state();
|
||||||
|
|
||||||
$effect(() => {
|
$effect(() => {
|
||||||
console.log(image);
|
if (images.length > 0) {
|
||||||
|
const reader = new FileReader();
|
||||||
|
reader.addEventListener("load", function () {
|
||||||
|
image.setAttribute("src", reader.result);
|
||||||
|
});
|
||||||
|
reader.readAsDataURL(images[0]);
|
||||||
|
}
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<div class="{direction} input image rounded">
|
<div class="{direction} input img-div rounded">
|
||||||
<AddButton type="image" bind:files={image}/>
|
<AddButton type="image" bind:files={images}/>
|
||||||
|
<img bind:this={image} src="" alt="">
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<style>
|
<style>
|
||||||
/* Вертикальное изображение */
|
/* Вертикальное изображение */
|
||||||
.vertical {
|
.vertical {
|
||||||
aspect-ratio: 11 / 16;
|
aspect-ratio: 11 / 16;
|
||||||
|
padding: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Горизонтальное изображение */
|
/* Горизонтальное изображение */
|
||||||
.horisontal {
|
.horisontal {
|
||||||
aspect-ratio: 16 / 11;
|
aspect-ratio: 16 / 11;
|
||||||
|
padding: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
:global(.image) {
|
:global(.img-div) {
|
||||||
margin-left: auto;
|
margin-left: auto;
|
||||||
margin-right: auto;
|
margin-right: auto;
|
||||||
align-content: center;
|
align-content: center;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
width: 11rem;
|
width: 11rem;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
:global(.img-div) img {
|
||||||
|
object-fit: cover;
|
||||||
|
width: 100%;
|
||||||
|
}
|
||||||
|
|
||||||
|
:global(.img-div) :global(.plus) {
|
||||||
|
z-index: 2;
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|
|
@ -66,6 +66,9 @@ button {
|
||||||
.horisontal-bar * {
|
.horisontal-bar * {
|
||||||
margin: 0;
|
margin: 0;
|
||||||
margin-right: 0.5rem;
|
margin-right: 0.5rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
.horisontal-bar p {
|
||||||
align-content: center;
|
align-content: center;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -16,7 +16,7 @@
|
||||||
color: black;
|
color: black;
|
||||||
}
|
}
|
||||||
|
|
||||||
.cover .image {
|
.cover .img-div {
|
||||||
background-color: white;
|
background-color: white;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -43,7 +43,7 @@
|
||||||
color: white;
|
color: white;
|
||||||
}
|
}
|
||||||
|
|
||||||
.cover .image {
|
.cover .img-div {
|
||||||
background-color: #131A22;
|
background-color: #131A22;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue