feat: ok so i had to implement variants hhhh

no more amogus
This commit is contained in:
Ax333l
2023-01-16 21:29:11 +01:00
parent e1d1e9fbe5
commit cbf523a365
3 changed files with 81 additions and 30 deletions

View File

@@ -1,14 +1,19 @@
<script lang="ts">
import Modal from './Dialogue.svelte';
import Variants from './Variants.svelte';
export let name: string;
export let logo: string;
export let filename: string;
export let id: string;
export let selected: Array<string>;
export let variants;
export let clicked = false;
const handleClick = () => {
clicked = !clicked;
let has_variants = variants.length > 1;
let modalOpen = false;
// TODO: cycle between them.
let current = variants[0];
function select_logo(id) {
// clicked = !clicked;
if (selected.includes(id)) {
selected = selected.filter((e) => e !== id);
} else {
@@ -17,16 +22,36 @@
selected = selected;
}
console.log(selected);
}
const handleClick = () => {
if (!has_variants) {
select_logo(current.id);
} else {
modalOpen = !modalOpen;
}
};
</script>
<Modal bind:modalOpen>
<svelte:fragment slot="title">{name}</svelte:fragment>
<svelte:fragment slot="description">
guhhhhhhhhhhhhhhhhhhhhh
</svelte:fragment>
<Variants />
</Modal>
<!-- SHUT UP -->
<!-- svelte-ignore a11y-no-noninteractive-tabindex -->
<div class="option" on:click={handleClick} on:keypress={handleClick} tabindex="0" class:clicked>
<img src={logo} alt={filename} />
<img src={current.gdrive_direct_url} alt={current.filename} />
<div class="text">
<h2>{name}</h2>
<h6>{filename}</h6>
<h6>{current.filename}</h6>
{#if has_variants}
<h4>This logo has variants</h4>
{/if}
</div>
</div>
@@ -53,6 +78,10 @@
text-overflow: ellipsis;
}
h4 {
font-weight: 800;
}
h6 {
font-size: 0.9rem;
overflow: hidden;

View File

@@ -0,0 +1 @@
<img src="https://cdn.discordapp.com/emojis/1063976228660457552.gif?size=48&quality=lossless" style="width: 20rem;" alt="h">