mirror of
https://github.com/shadoll/sLogos.git
synced 2026-02-04 11:03:24 +00:00
Enhance logo search and display functionality
- Updated logo filtering to include title in search criteria across multiple components. - Modified CardFull, CardMiddle, CardSmall, and CardTiny components to display title or name as appropriate. - Added support for displaying logo variants in CardFull component. - Improved logo retrieval logic in Preview page to account for title matching.
This commit is contained in:
2
ToDo.md
2
ToDo.md
@@ -4,4 +4,4 @@
|
|||||||
[ ] Improove: In the preview page, add possibility select custom color for each target.
|
[ ] Improove: In the preview page, add possibility select custom color for each target.
|
||||||
[ ] Strategy: Add differents base/collections of images: Flags,
|
[ ] Strategy: Add differents base/collections of images: Flags,
|
||||||
[v] Strategy: WebApp, PWA
|
[v] Strategy: WebApp, PWA
|
||||||
[ ] Improove: Add to filter Image variants - just logo, line logo, square logo
|
[v] Improove: Add to filter Image variants - just logo, line logo, square logo
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@@ -39,6 +39,7 @@
|
|||||||
window.appData.filteredLogos = window.appData.logos.filter((logo) => {
|
window.appData.filteredLogos = window.appData.logos.filter((logo) => {
|
||||||
const matchesSearch =
|
const matchesSearch =
|
||||||
logo.name.toLowerCase().includes(val.toLowerCase()) ||
|
logo.name.toLowerCase().includes(val.toLowerCase()) ||
|
||||||
|
(logo.title && logo.title.toLowerCase().includes(val.toLowerCase())) ||
|
||||||
(logo.brand && logo.brand.toLowerCase().includes(val.toLowerCase()));
|
(logo.brand && logo.brand.toLowerCase().includes(val.toLowerCase()));
|
||||||
const matchesTags =
|
const matchesTags =
|
||||||
!selectedTags.length ||
|
!selectedTags.length ||
|
||||||
@@ -349,6 +350,7 @@
|
|||||||
$: filteredLogos = logos.filter((logo) => {
|
$: filteredLogos = logos.filter((logo) => {
|
||||||
const matchesSearch =
|
const matchesSearch =
|
||||||
logo.name.toLowerCase().includes(searchQuery.toLowerCase()) ||
|
logo.name.toLowerCase().includes(searchQuery.toLowerCase()) ||
|
||||||
|
(logo.title && logo.title.toLowerCase().includes(searchQuery.toLowerCase())) ||
|
||||||
(logo.brand &&
|
(logo.brand &&
|
||||||
logo.brand.toLowerCase().includes(searchQuery.toLowerCase()));
|
logo.brand.toLowerCase().includes(searchQuery.toLowerCase()));
|
||||||
const matchesTags =
|
const matchesTags =
|
||||||
@@ -704,6 +706,7 @@
|
|||||||
window.appData.filteredLogos = window.appData.logos.filter((logo) => {
|
window.appData.filteredLogos = window.appData.logos.filter((logo) => {
|
||||||
const matchesSearch =
|
const matchesSearch =
|
||||||
logo.name.toLowerCase().includes(searchQuery.toLowerCase()) ||
|
logo.name.toLowerCase().includes(searchQuery.toLowerCase()) ||
|
||||||
|
(logo.title && logo.title.toLowerCase().includes(searchQuery.toLowerCase())) ||
|
||||||
(logo.brand && logo.brand.toLowerCase().includes(searchQuery.toLowerCase()));
|
(logo.brand && logo.brand.toLowerCase().includes(searchQuery.toLowerCase()));
|
||||||
const matchesTags =
|
const matchesTags =
|
||||||
!selectedTags.length ||
|
!selectedTags.length ||
|
||||||
|
|||||||
@@ -132,7 +132,7 @@
|
|||||||
{#if logo}
|
{#if logo}
|
||||||
<div class="modal-header">
|
<div class="modal-header">
|
||||||
<div class="header-spacer"></div>
|
<div class="header-spacer"></div>
|
||||||
<h2>{logo.name}</h2>
|
<h2>{logo.title || logo.name}</h2>
|
||||||
<div class="header-spacer"></div>
|
<div class="header-spacer"></div>
|
||||||
</div>
|
</div>
|
||||||
<div class="preview-body">
|
<div class="preview-body">
|
||||||
@@ -149,10 +149,10 @@
|
|||||||
sets={logo.sets}
|
sets={logo.sets}
|
||||||
colors={logo.colors}
|
colors={logo.colors}
|
||||||
activeSet={logo._activeSet}
|
activeSet={logo._activeSet}
|
||||||
alt={logo.name}
|
alt={logo.title || logo.name}
|
||||||
/>
|
/>
|
||||||
{:else}
|
{:else}
|
||||||
<img src={logo.path} alt={logo.name} />
|
<img src={logo.path} alt={logo.title || logo.name} />
|
||||||
{/if}
|
{/if}
|
||||||
</div>
|
</div>
|
||||||
<div class="right-column">
|
<div class="right-column">
|
||||||
@@ -185,6 +185,13 @@
|
|||||||
{/each}
|
{/each}
|
||||||
</div>
|
</div>
|
||||||
{/if}
|
{/if}
|
||||||
|
{#if logo.variants && logo.variants.length}
|
||||||
|
<div class="variants-list">
|
||||||
|
{#each logo.variants as variant}
|
||||||
|
<span class="logo-variant">{variant}</span>
|
||||||
|
{/each}
|
||||||
|
</div>
|
||||||
|
{/if}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="preview-actions-container">
|
<div class="preview-actions-container">
|
||||||
@@ -295,6 +302,13 @@
|
|||||||
flex-wrap: wrap;
|
flex-wrap: wrap;
|
||||||
gap: 0.5rem;
|
gap: 0.5rem;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.variants-list {
|
||||||
|
display: flex;
|
||||||
|
flex-wrap: wrap;
|
||||||
|
gap: 0.5rem;
|
||||||
|
margin-top: 0.5rem;
|
||||||
|
}
|
||||||
.logo-tag {
|
.logo-tag {
|
||||||
display: inline-block;
|
display: inline-block;
|
||||||
background: var(--color-accent);
|
background: var(--color-accent);
|
||||||
@@ -309,6 +323,25 @@
|
|||||||
margin-bottom: 0.2em;
|
margin-bottom: 0.2em;
|
||||||
transition: background 0.2s;
|
transition: background 0.2s;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.logo-variant {
|
||||||
|
display: inline-block;
|
||||||
|
background: #9b59b6;
|
||||||
|
color: white;
|
||||||
|
border-radius: 12px;
|
||||||
|
padding: 0.2em 0.8em;
|
||||||
|
font-size: 0.85em;
|
||||||
|
font-weight: 500;
|
||||||
|
letter-spacing: 0.02em;
|
||||||
|
margin-right: 0.3em;
|
||||||
|
margin-top: 0.2em;
|
||||||
|
margin-bottom: 0.2em;
|
||||||
|
transition: background 0.2s;
|
||||||
|
}
|
||||||
|
|
||||||
|
.logo-variant:hover {
|
||||||
|
background: #8e44ad;
|
||||||
|
}
|
||||||
.preview-actions-container {
|
.preview-actions-container {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
background: var(--color-card);
|
background: var(--color-card);
|
||||||
|
|||||||
@@ -51,16 +51,16 @@
|
|||||||
sets={logo.sets}
|
sets={logo.sets}
|
||||||
colors={logo.colors}
|
colors={logo.colors}
|
||||||
activeSet={logo._activeSet}
|
activeSet={logo._activeSet}
|
||||||
alt={logo.name}
|
alt={logo.title || logo.name}
|
||||||
/>
|
/>
|
||||||
{/key}
|
{/key}
|
||||||
{:else}
|
{:else}
|
||||||
<img src={logo.path} alt={logo.name} />
|
<img src={logo.path} alt={logo.title || logo.name}/>
|
||||||
{/if}
|
{/if}
|
||||||
</div>
|
</div>
|
||||||
<div class="logo-info">
|
<div class="logo-info">
|
||||||
<div class="logo-title-row">
|
<div class="logo-title-row">
|
||||||
<h3>{logo.name}</h3>
|
<h3>{logo.title || logo.name}</h3>
|
||||||
{#if logo.brand}
|
{#if logo.brand}
|
||||||
<button
|
<button
|
||||||
class="brand-filter-btn"
|
class="brand-filter-btn"
|
||||||
|
|||||||
@@ -55,12 +55,12 @@
|
|||||||
/>
|
/>
|
||||||
{/key}
|
{/key}
|
||||||
{:else}
|
{:else}
|
||||||
<img src={logo.path} alt={logo.name} />
|
<img src={logo.path} alt={logo.title || logo.name} />
|
||||||
{/if}
|
{/if}
|
||||||
</div>
|
</div>
|
||||||
<div class="logo-content">
|
<div class="logo-content">
|
||||||
<div class="logo-header">
|
<div class="logo-header">
|
||||||
<h3>{logo.name}</h3>
|
<h3>{logo.title || logo.name}</h3>
|
||||||
{#if logo.brand}
|
{#if logo.brand}
|
||||||
<button
|
<button
|
||||||
class="brand-filter-btn"
|
class="brand-filter-btn"
|
||||||
|
|||||||
@@ -51,10 +51,10 @@
|
|||||||
sets={logo.sets}
|
sets={logo.sets}
|
||||||
colors={logo.colors}
|
colors={logo.colors}
|
||||||
activeSet={logo._activeSet}
|
activeSet={logo._activeSet}
|
||||||
alt={logo.name}
|
alt={logo.title || logo.name}
|
||||||
/>
|
/>
|
||||||
{:else}
|
{:else}
|
||||||
<img src={logo.path} alt={logo.name} />
|
<img src={logo.path} alt={logo.title || logo.name} />
|
||||||
{/if}
|
{/if}
|
||||||
</div>
|
</div>
|
||||||
{#if logo.colors}
|
{#if logo.colors}
|
||||||
@@ -63,7 +63,7 @@
|
|||||||
logo._activeSet = setName;
|
logo._activeSet = setName;
|
||||||
}} />
|
}} />
|
||||||
{/if}
|
{/if}
|
||||||
<div class="name">{logo.name}</div>
|
<div class="name">{logo.title || logo.name}</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<style>
|
<style>
|
||||||
|
|||||||
@@ -22,8 +22,10 @@
|
|||||||
}
|
}
|
||||||
const logoName = params.logoName.replace(/-/g, ' ');
|
const logoName = params.logoName.replace(/-/g, ' ');
|
||||||
logo = logos.find(l =>
|
logo = logos.find(l =>
|
||||||
|
l.name.toLowerCase() === params.logoName.toLowerCase() ||
|
||||||
l.name.toLowerCase().replace(/\s+/g, '-') === params.logoName.toLowerCase() ||
|
l.name.toLowerCase().replace(/\s+/g, '-') === params.logoName.toLowerCase() ||
|
||||||
l.name.toLowerCase() === logoName.toLowerCase()
|
(l.title && l.title.toLowerCase() === logoName.toLowerCase()) ||
|
||||||
|
(l.title && l.title.toLowerCase().replace(/\s+/g, '-') === params.logoName.toLowerCase())
|
||||||
);
|
);
|
||||||
if (!logo) {
|
if (!logo) {
|
||||||
console.error("Logo not found:", params.logoName);
|
console.error("Logo not found:", params.logoName);
|
||||||
|
|||||||
Reference in New Issue
Block a user