Spaces:
Running
Running
File size: 1,342 Bytes
bd5fab7 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 |
<script lang="ts">
export let value: [string, string];
export let samples_dir: string;
export let type: "gallery" | "table";
export let selected = false;
</script>
<!-- TODO: fix -->
<!-- svelte-ignore a11y-missing-attribute -->
<div
class="wrap"
class:table={type === "table"}
class:gallery={type === "gallery"}
class:selected
>
<img src={samples_dir + value[0]} />
<img src={samples_dir + value[1]} />
<span></span>
</div>
<style>
.wrap {
position: relative;
height: var(--size-64);
width: var(--size-40);
overflow: hidden;
border-radius: var(--radius-lg);
}
img {
height: var(--size-64);
width: var(--size-40);
position: absolute;
/* border-radius: var(--radius-lg); */
/* max-width: none; */
object-fit: cover;
}
.wrap.selected {
border-color: var(--color-accent);
}
.wrap img:first-child {
clip-path: inset(0 50% 0 0%);
}
.wrap img:nth-of-type(2) {
clip-path: inset(0 0 0 50%);
}
span {
position: absolute;
top: 0;
left: calc(50% - 0.75px);
height: var(--size-64);
width: 1.5px;
background: var(--border-color-primary);
}
.table {
margin: 0 auto;
border: 2px solid var(--border-color-primary);
border-radius: var(--radius-lg);
}
.gallery {
border: 2px solid var(--border-color-primary);
/* max-height: var(--size-20); */
object-fit: cover;
}
</style>
|