diff --git a/src/components/CharacterSelect.svelte b/src/components/CharacterSelect.svelte index 3ba2328d..c10250eb 100644 --- a/src/components/CharacterSelect.svelte +++ b/src/components/CharacterSelect.svelte @@ -2,7 +2,7 @@ import { createEventDispatcher } from 'svelte'; import VirtualList from './VirtualList.svelte'; import { fade } from 'svelte/transition'; - import { mdiChevronDown } from '@mdi/js'; + import { mdiChevronDown, mdiCloseCircle } from '@mdi/js'; import Icon from './Icon.svelte'; import { characters as characterList } from '../data/characters'; @@ -29,6 +29,7 @@ } function select(val) { + console.log('select', val); selected = val; focused = false; hoveredIndex = -1; @@ -132,7 +133,19 @@ {placeholder} value={nothingSelected || focused ? search : label} on:input={onInput} /> - + {#if selected} +
select(null)}> + +
+ {:else} + + {/if} {#if focused}
- + {#if selected} +
select(null)}> + +
+ {:else} + + {/if}
{#if focused}
@@ -98,6 +150,10 @@

※ Click the item image to add it to the todo list

+
+ + +
@@ -109,14 +165,15 @@ Materials {#each Object.entries(dayName) as [day, dayArr]} {#each Object.entries(charactersDays[day]) as [itemName, chars], index} - @@ -146,7 +207,9 @@ {#each Object.entries(weaponsDays[day]) as [itemName, weapons], index} @@ -187,7 +251,7 @@ Material @@ -213,7 +277,8 @@ {charName} + alt={charName} + title={type === 'characters' ? characters[charName].name : weaponList[charName].name} /> {/each}
- Characters + Characters & Weapons
+ {#if index === 0}{dayArr[0]}
{dayArr[1]}{/if}
@@ -137,7 +194,11 @@
- {char} + {char}
{/each}
+ class={index === Object.entries(weaponsDays[day]).length - 1 || Object.entries(charactersDays[day]).length === 0 ? 'border-gray-700 border-b py-2' : 'py-2'}> + {#if index === 0 && Object.entries(charactersDays[day]).length === 0}{dayArr[0]}
{dayArr[1]}{/if} +
- {itemGroup[itemName].name} + {itemGroup[itemName].name}
@@ -168,7 +231,8 @@ {weapon} + alt={weapon} + title={weaponList[weapon].name} /> {/each} - Characters + Characters & Weapons