mirror of
https://github.com/shadoll/sLogos.git
synced 2026-02-04 11:03:24 +00:00
Add titles to collections and update image URL resolution in components
- Added 'title' property to collections for 'Logos', 'Flags', and 'Emblems'. - Updated image URL generation in CardMiddle, CardSmall, and CardTiny components to dynamically resolve the current collection based on window.appData.
This commit is contained in:
@@ -1,7 +1,7 @@
|
|||||||
[
|
[
|
||||||
{
|
{
|
||||||
"name": "Escudo De España",
|
"name": "Escudo De España",
|
||||||
"path": "Escudo_de_España.svg",
|
"path": "Escudo_de_Espana.svg",
|
||||||
"format": "SVG",
|
"format": "SVG",
|
||||||
"disable": false,
|
"disable": false,
|
||||||
"tags": [
|
"tags": [
|
||||||
|
|||||||
|
Before Width: | Height: | Size: 80 KiB After Width: | Height: | Size: 80 KiB |
@@ -3,6 +3,7 @@ export const collections = [
|
|||||||
{
|
{
|
||||||
name: 'logos',
|
name: 'logos',
|
||||||
label: 'Logos',
|
label: 'Logos',
|
||||||
|
title: 'Logo Gallery',
|
||||||
baseDir: 'images/logos',
|
baseDir: 'images/logos',
|
||||||
varDir: 'images/logos_variants',
|
varDir: 'images/logos_variants',
|
||||||
dataFile: 'data/logos.json'
|
dataFile: 'data/logos.json'
|
||||||
@@ -10,6 +11,7 @@ export const collections = [
|
|||||||
{
|
{
|
||||||
name: 'flags',
|
name: 'flags',
|
||||||
label: 'Flags',
|
label: 'Flags',
|
||||||
|
title: 'Flag Gallery',
|
||||||
baseDir: 'images/flags',
|
baseDir: 'images/flags',
|
||||||
varDir: 'images/flags_variants',
|
varDir: 'images/flags_variants',
|
||||||
dataFile: 'data/flags.json'
|
dataFile: 'data/flags.json'
|
||||||
@@ -17,6 +19,7 @@ export const collections = [
|
|||||||
{
|
{
|
||||||
name: 'emblems',
|
name: 'emblems',
|
||||||
label: 'Emblems',
|
label: 'Emblems',
|
||||||
|
title: 'Emblem Gallery',
|
||||||
baseDir: 'images/emblems',
|
baseDir: 'images/emblems',
|
||||||
varDir: 'images/emblems_variants',
|
varDir: 'images/emblems_variants',
|
||||||
dataFile: 'data/emblems.json'
|
dataFile: 'data/emblems.json'
|
||||||
|
|||||||
@@ -41,7 +41,12 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
function getImageUrl(logo) {
|
function getImageUrl(logo) {
|
||||||
return `/${collection.baseDir}/${logo.path}`;
|
// Always resolve collection for each logo based on current collection name
|
||||||
|
let currentCollection = collection;
|
||||||
|
if (typeof window !== 'undefined' && window.appData && window.appData.collection) {
|
||||||
|
currentCollection = collections.find(c => c.name === window.appData.collection) || collections[0];
|
||||||
|
}
|
||||||
|
return `/${currentCollection.baseDir}/${logo.path}`;
|
||||||
}
|
}
|
||||||
|
|
||||||
$: getLogoThemeColor = (logo) => getDefaultLogoColor(logo.colors, theme);
|
$: getLogoThemeColor = (logo) => getDefaultLogoColor(logo.colors, theme);
|
||||||
|
|||||||
@@ -44,7 +44,12 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
function getImageUrl(logo) {
|
function getImageUrl(logo) {
|
||||||
return `/${collection.baseDir}/${logo.path}`;
|
// Always resolve collection for each logo based on current collection name
|
||||||
|
let currentCollection = collection;
|
||||||
|
if (typeof window !== 'undefined' && window.appData && window.appData.collection) {
|
||||||
|
currentCollection = collections.find(c => c.name === window.appData.collection) || collections[0];
|
||||||
|
}
|
||||||
|
return `/${currentCollection.baseDir}/${logo.path}`;
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|||||||
@@ -50,7 +50,12 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
function getImageUrl(logo) {
|
function getImageUrl(logo) {
|
||||||
return `/${collection.baseDir}/${logo.path}`;
|
// Always resolve collection for each logo based on current collection name
|
||||||
|
let currentCollection = collection;
|
||||||
|
if (typeof window !== 'undefined' && window.appData && window.appData.collection) {
|
||||||
|
currentCollection = collections.find(c => c.name === window.appData.collection) || collections[0];
|
||||||
|
}
|
||||||
|
return `/${currentCollection.baseDir}/${logo.path}`;
|
||||||
}
|
}
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
Reference in New Issue
Block a user