diff --git a/src/App.svelte b/src/App.svelte index 643b308..9c77ec1 100644 --- a/src/App.svelte +++ b/src/App.svelte @@ -1,7 +1,7 @@ + + showModal = false} /> + + + {#each logos as logo} + { selectedLogo = logo; showModal = true; }}> + + + + + {/each} + + + diff --git a/src/components/List.svelte b/src/components/List.svelte new file mode 100644 index 0000000..c19265d --- /dev/null +++ b/src/components/List.svelte @@ -0,0 +1,35 @@ + + + showModal = false} /> + + + {#each logos as logo} + { selectedLogo = logo; showModal = true; }}> + + + + + {/each} + + + diff --git a/src/components/LogoGrid.svelte b/src/components/LogoGrid.svelte deleted file mode 100644 index 88050d8..0000000 --- a/src/components/LogoGrid.svelte +++ /dev/null @@ -1,196 +0,0 @@ - - - - - - {#each logos as logo} - - openPreview(logo)} - on:keydown={(e) => (e.key === 'Enter' || e.key === ' ') && openPreview(logo)} - style="cursor:pointer;" - > - {#if isSvgLogo(logo)} - {#key theme + (logo._activeColor || '')} - - {/key} - {:else} - - {/if} - - - {logo.name} - - Format: {logo.format} - {#if logo.colors} - - logo._activeColor = undefined} - on:keydown|stopPropagation={(e) => (e.key === 'Enter' || e.key === ' ') && (logo._activeColor = undefined)} - > - - - - - - {#each logo.colors as colorObj} - logo._activeColor = colorObj.value} - on:keydown|stopPropagation={(e) => (e.key === 'Enter' || e.key === ' ') && (logo._activeColor = colorObj.value)} - > - {/each} - - {/if} - - - - - - - {:else} - No logos found matching your search criteria. - {/each} - - - diff --git a/src/components/LogoList.svelte b/src/components/LogoList.svelte deleted file mode 100644 index 22fc4d7..0000000 --- a/src/components/LogoList.svelte +++ /dev/null @@ -1,187 +0,0 @@ - - - - - - {#each logos as logo} - - openPreview(logo)} - on:keydown={(e) => (e.key === 'Enter' || e.key === ' ') && openPreview(logo)} - style="cursor:pointer;" - > - {#if isSvgLogo(logo)} - - {:else} - - {/if} - - - {logo.name} - - Format: {logo.format} - - {#if logo.colors} - - logo._activeColor = undefined} - on:keydown|stopPropagation={(e) => (e.key === 'Enter' || e.key === ' ') && (logo._activeColor = undefined)} - > - - - - - - {#each logo.colors as colorObj} - logo._activeColor = colorObj.value} - on:keydown|stopPropagation={(e) => (e.key === 'Enter' || e.key === ' ') && (logo._activeColor = colorObj.value)} - > - {/each} - - {/if} - - - - - - {:else} - No logos found matching your search criteria. - {/each} - - - diff --git a/src/components/LogoModal.svelte b/src/components/Preview.svelte similarity index 86% rename from src/components/LogoModal.svelte rename to src/components/Preview.svelte index 96fcf95..ad6c146 100644 --- a/src/components/LogoModal.svelte +++ b/src/components/Preview.svelte @@ -1,7 +1,9 @@ + + + (e.key === 'Enter' || e.key === ' ') && onPreview && onPreview(e)} + tabindex="0" + role="button" + aria-label="Preview logo" + > + {#if logo.format && logo.format.toLowerCase() === 'svg'} + + {:else} + + {/if} + + + {logo.name} + + Format: {logo.format} + {#if logo.colors} + + logo._activeColor = undefined} + on:keydown|stopPropagation={(e) => (e.key === 'Enter' || e.key === ' ') && (logo._activeColor = undefined)}> + + + + + + {#each logo.colors as colorObj} + logo._activeColor = colorObj.value} + on:keydown|stopPropagation={(e) => (e.key === 'Enter' || e.key === ' ') && (logo._activeColor = colorObj.value)}> + {/each} + + {/if} + + {#if logo.tags && logo.tags.length} + + {#each logo.tags as tag} + {#if getTagObj(tag).color} + {getTagObj(tag).text} + {:else} + {getTagObj(tag).text} + {/if} + {/each} + + {/if} + + + {#if showActions} + + + + {/if} + + +
No logos found matching your search criteria.