diff --git a/public/data/emblems.json b/public/data/emblems.json index 5362ce3..235b76a 100644 --- a/public/data/emblems.json +++ b/public/data/emblems.json @@ -5,10 +5,10 @@ "format": "SVG", "disable": false, "tags": [ - "Spain", "Coat of arms", "National emblem" ], + "brand": "Spain", "meta": { "description": "The coat of arms of Spain, representing the historical kingdoms and the Pillars of Hercules.", "wikipedia": "https://en.wikipedia.org/wiki/Coat_of_arms_of_Spain" @@ -20,9 +20,9 @@ "format": "SVG", "disable": false, "tags": [ - "Ethiopia", "National emblem" ], + "brand": "Ethiopia", "meta": { "description": "The national emblem of Ethiopia, featuring a lion and a sun.", "wikipedia": "https://en.wikipedia.org/wiki/Emblem_of_Ethiopia" @@ -34,13 +34,64 @@ "format": "SVG", "disable": false, "tags": [ - "Andorra", "Coat of arms", "National emblem" ], + "brand": "Andorra", "meta": { "description": "The coat of arms of Andorra, featuring a shield with the symbols of the four founding families.", "wikipedia": "https://en.wikipedia.org/wiki/Coat_of_arms_of_Andorra" } + }, + { + "name": "Emblem Of The United Arab Emirates", + "path": "Emblem_of_the_United_Arab_Emirates.svg", + "format": "SVG", + "disable": false + }, + { + "name": "Coat Of Arms Of Antigua And Barbuda", + "path": "Coat_of_arms_of_Antigua_and_Barbuda.svg", + "format": "SVG", + "disable": false, + "tags": [ + "Coat of arms", + "National emblem" + ], + "brand": "Antigua and Barbuda", + "meta": { + "description": "The coat of arms of Antigua and Barbuda, featuring a shield with a sun and a palm tree.", + "wikipedia": "https://en.wikipedia.org/wiki/Coat_of_arms_of_Antigua_and_Barbuda" + } + }, + { + "name": "Coat Of Arms Of Albania", + "path": "Coat_of_arms_of_Albania.svg", + "format": "SVG", + "disable": false, + "tags": [ + "Coat of arms", + "National emblem" + ], + "brand": "Albania", + "meta": { + "description": "The coat of arms of Albania, featuring a black double-headed eagle on a red background.", + "wikipedia": "https://en.wikipedia.org/wiki/Coat_of_arms_of_Albania" + } + }, + { + "name": "Coat Of Arms Of Armenia", + "path": "Coat_of_arms_of_Armenia.svg", + "format": "SVG", + "disable": false, + "tags": [ + "Coat of arms", + "National emblem" + ], + "brand": "Armenia", + "meta": { + "description": "The coat of arms of Armenia, featuring a shield with a lion and a sun.", + "wikipedia": "https://en.wikipedia.org/wiki/Coat_of_arms_of_Armenia" + } } -] +] \ No newline at end of file diff --git a/public/data/flags.json b/public/data/flags.json index 4013d42..55ababe 100644 --- a/public/data/flags.json +++ b/public/data/flags.json @@ -8,14 +8,74 @@ "Country", "Europe" ], + "brand": "Andorra", "meta": { + "proportion": "7:10", + "wikipedia flag": "https://en.wikipedia.org/wiki/Flag_of_Andorra", + "design": "A vertical tricolour of blue, yellow and red with the National Coat of Arms centred on the yellow band.", "country": "Andorra", + "wikipedia country": "https://en.wikipedia.org/wiki/Andorra", "capital": "Andorra la Vella", "description": "Andorra is a small, landlocked country in the eastern Pyrenees mountains, bordered by France and Spain. It is known for its ski resorts and a tax-haven status that attracts tourists.", "area": "468 km²", "ISO code": "AD", - "wikipedia": "https://en.wikipedia.org/wiki/Andorra" - } + "Official languages": "Catalan" + }, + "variants": [ + "vertical stripes", + "3 colours", + "blue", + "yellow", + "red", + "drawing" + ] + }, + { + "name": "Andorra (1806–1866)", + "path": "ad-1806–1866.svg", + "format": "SVG", + "disable": false, + "tags": [ + "Historical Flag" + ], + "brand": "Andorra", + "meta": { + "proportion": "2:3", + "design": "Two equally sized red and yellow vertical (sometimes horizontal) bands", + "description": "The flag of Andorra from 1806 to 1866, before the current design was adopted.", + "wikipedia flag": "https://en.wikipedia.org/wiki/Flag_of_Andorra" + }, + "variants": [ + "vertical stripes", + "2 colours", + "yellow", + "red", + "no drawing" + ] + }, + { + "name": "Andorra (1866–1939)", + "path": "ad-1866-1939.svg", + "format": "SVG", + "disable": false, + "tags": [ + "Historical Flag" + ], + "brand": "Andorra", + "meta": { + "proportion": "2:3", + "design": "A vertical tricolour of blue, yellow and red.", + "description": "The flag of Andorra from 1866 to 1939, before the current design was adopted.", + "wikipedia flag": "https://en.wikipedia.org/wiki/Flag_of_Andorra" + }, + "variants": [ + "vertical stripes", + "3 colours", + "blue", + "yellow", + "red", + "drawing" + ] }, { "name": "Chișinău", @@ -261,12 +321,14 @@ "Asia" ], "meta": { + "proportion": "1:2", + "wikipedia flag": "https://en.wikipedia.org/wiki/Flag_of_the_United_Arab_Emirates", "country": "United Arab Emirates", + "wikipedia country": "https://en.wikipedia.org/wiki/United_Arab_Emirates", "capital": "Abu Dhabi", "description": "The United Arab Emirates (UAE) is a federation of seven emirates located on the southeast corner of the Arabian Peninsula. It is known for its modern architecture, luxury shopping, and vibrant culture.", "area": "83,600 km²", - "ISO code": "AE", - "wikipedia": "https://en.wikipedia.org/wiki/United_Arab_Emirates" + "ISO code": "AE" } }, { @@ -296,13 +358,31 @@ "Country", "North America" ], + "brand": "Antigua and Barbuda", "meta": { + "proportion": "2:3", + "wikipedia flag": "https://en.wikipedia.org/wiki/Flag_of_Antigua_and_Barbuda", "country": "Antigua and Barbuda", + "wikipedia country": "https://en.wikipedia.org/wiki/Antigua_and_Barbuda", "capital": "Saint John's", - "description": "", - "area": "", - "ISO code": "AG", - "wikipedia": "https://en.wikipedia.org/wiki/Antigua_and_Barbuda" + "description": "Antigua and Barbuda is a twin-island nation in the Caribbean, known for its beautiful beaches and vibrant culture.", + "area": "442 km²", + "ISO code": "AG" + } + }, + { + "name": "Antigua and Barbuda (1962–1967)", + "path": "ag-1962–1967.svg", + "format": "SVG", + "disable": false, + "tags": [ + "Historical Flag" + ], + "brand": "Antigua and Barbuda", + "meta": { + "proportion": "1:2", + "description": "The flag of Antigua and Barbuda from 1962 to 1967, before the current design was adopted.", + "wikipedia flag": "https://en.wikipedia.org/wiki/Flag_of_Antigua_and_Barbuda" } }, { @@ -334,13 +414,25 @@ "Europe" ], "meta": { + "proportion": "5:7", + "design": "A red field with a black two-headed eagle in the center.", + "wikipedia flag": "https://en.wikipedia.org/wiki/Flag_of_Albania", "country": "Albania", + "wikipedia country": "https://en.wikipedia.org/wiki/Albania", "capital": "Tirana", "description": "Albania is a country in Southeast Europe on the Balkan Peninsula. It is bordered by Montenegro, Kosovo, North Macedonia, and Greece, and has a coastline along the Adriatic and Ionian Seas.", "area": "28,748 km²", - "ISO code": "AL", - "wikipedia": "https://en.wikipedia.org/wiki/Albania" - } + "ISO code": "AL" + }, + "variants": [ + "red", + "black", + "1 colour", + "two-headed", + "eagle", + "drawing" + ], + "brand": "Albania" }, { "name": "Armenia", @@ -352,13 +444,48 @@ "Asia" ], "meta": { + "proportion": "1:2", + "wikipedia flag": "https://en.wikipedia.org/wiki/Flag_of_Armenia", + "design": "Three horizontal stripes of red, blue, and orange, with the red stripe on top.", "country": "Armenia", + "wikipedia": "https://en.wikipedia.org/wiki/Armenia", "capital": "Yerevan", "description": "Armenia is a landlocked country in the South Caucasus region of Eurasia, bordered by Turkey, Georgia, Azerbaijan, and Iran. It is known for its rich cultural heritage and historical significance as one of the first countries to adopt Christianity.", "area": "29,743 km²", - "ISO code": "AM", - "wikipedia": "https://en.wikipedia.org/wiki/Armenia" - } + "ISO code": "AM" + }, + "variants": [ + "horizontal stripes", + "3 colours", + "red", + "blue", + "orange", + "no drawing" + ], + "brand": "Armenia" + }, + { + "name": "Armenia (1952–1990)", + "path": "am-1952–1990.svg", + "format": "SVG", + "disable": false, + "tags": [ + "Historical Flag" + ], + "meta": { + "proportion": "1:2", + "design": "A red field, with a horizontal blue stripe running through the center", + "description": "The flag of Armenia from 1952 to 1990, before the current design was adopted.", + "wikipedia flag": "https://en.wikipedia.org/wiki/Flag_of_Armenia" + }, + "variants": [ + "red", + "blue", + "2 colours", + "horizontal stripes", + "no drawing" + ], + "brand": "Armenia" }, { "name": "Angola", diff --git a/public/images/emblems/Coat_of_arms_of_Albania.svg b/public/images/emblems/Coat_of_arms_of_Albania.svg new file mode 100644 index 0000000..e3fa2c5 --- /dev/null +++ b/public/images/emblems/Coat_of_arms_of_Albania.svg @@ -0,0 +1,209 @@ + + + + + + + + + + + + diff --git a/public/images/emblems/Coat_of_arms_of_Antigua_and_Barbuda.svg b/public/images/emblems/Coat_of_arms_of_Antigua_and_Barbuda.svg new file mode 100644 index 0000000..d2ef3d1 --- /dev/null +++ b/public/images/emblems/Coat_of_arms_of_Antigua_and_Barbuda.svg @@ -0,0 +1,832 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/public/images/emblems/Coat_of_arms_of_Armenia.svg b/public/images/emblems/Coat_of_arms_of_Armenia.svg new file mode 100644 index 0000000..c915ced --- /dev/null +++ b/public/images/emblems/Coat_of_arms_of_Armenia.svg @@ -0,0 +1,110 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/public/images/emblems/Emblem_of_the_United_Arab_Emirates.svg b/public/images/emblems/Emblem_of_the_United_Arab_Emirates.svg new file mode 100644 index 0000000..0ea0a57 --- /dev/null +++ b/public/images/emblems/Emblem_of_the_United_Arab_Emirates.svg @@ -0,0 +1,576 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/public/images/emblems_variants/Coat_of_arms_of_Albania.jpg b/public/images/emblems_variants/Coat_of_arms_of_Albania.jpg new file mode 100644 index 0000000..b1fd5c5 Binary files /dev/null and b/public/images/emblems_variants/Coat_of_arms_of_Albania.jpg differ diff --git a/public/images/emblems_variants/Coat_of_arms_of_Albania.png b/public/images/emblems_variants/Coat_of_arms_of_Albania.png new file mode 100644 index 0000000..9673358 Binary files /dev/null and b/public/images/emblems_variants/Coat_of_arms_of_Albania.png differ diff --git a/public/images/emblems_variants/Coat_of_arms_of_Antigua_and_Barbuda.jpg b/public/images/emblems_variants/Coat_of_arms_of_Antigua_and_Barbuda.jpg new file mode 100644 index 0000000..d7e2816 Binary files /dev/null and b/public/images/emblems_variants/Coat_of_arms_of_Antigua_and_Barbuda.jpg differ diff --git a/public/images/emblems_variants/Coat_of_arms_of_Antigua_and_Barbuda.png b/public/images/emblems_variants/Coat_of_arms_of_Antigua_and_Barbuda.png new file mode 100644 index 0000000..484d2b0 Binary files /dev/null and b/public/images/emblems_variants/Coat_of_arms_of_Antigua_and_Barbuda.png differ diff --git a/public/images/emblems_variants/Coat_of_arms_of_Armenia.jpg b/public/images/emblems_variants/Coat_of_arms_of_Armenia.jpg new file mode 100644 index 0000000..cea7278 Binary files /dev/null and b/public/images/emblems_variants/Coat_of_arms_of_Armenia.jpg differ diff --git a/public/images/emblems_variants/Coat_of_arms_of_Armenia.png b/public/images/emblems_variants/Coat_of_arms_of_Armenia.png new file mode 100644 index 0000000..e474223 Binary files /dev/null and b/public/images/emblems_variants/Coat_of_arms_of_Armenia.png differ diff --git a/public/images/emblems_variants/Emblem_of_the_United_Arab_Emirates.jpg b/public/images/emblems_variants/Emblem_of_the_United_Arab_Emirates.jpg new file mode 100644 index 0000000..a2598ce Binary files /dev/null and b/public/images/emblems_variants/Emblem_of_the_United_Arab_Emirates.jpg differ diff --git a/public/images/emblems_variants/Emblem_of_the_United_Arab_Emirates.png b/public/images/emblems_variants/Emblem_of_the_United_Arab_Emirates.png new file mode 100644 index 0000000..19bf8f2 Binary files /dev/null and b/public/images/emblems_variants/Emblem_of_the_United_Arab_Emirates.png differ diff --git a/public/images/flags/ad-1806–1866.svg b/public/images/flags/ad-1806–1866.svg new file mode 100644 index 0000000..837b6ab --- /dev/null +++ b/public/images/flags/ad-1806–1866.svg @@ -0,0 +1,4 @@ + + + + diff --git a/public/images/flags/ad-1866-1939.svg b/public/images/flags/ad-1866-1939.svg new file mode 100644 index 0000000..e809412 --- /dev/null +++ b/public/images/flags/ad-1866-1939.svg @@ -0,0 +1,5 @@ + + + + + diff --git a/public/images/flags/ae.svg b/public/images/flags/ae.svg index 651ac85..b57c213 100644 --- a/public/images/flags/ae.svg +++ b/public/images/flags/ae.svg @@ -1,6 +1,6 @@ - - - - - + + + + + diff --git a/public/images/flags/ag-1962–1967.svg b/public/images/flags/ag-1962–1967.svg new file mode 100644 index 0000000..4d36347 --- /dev/null +++ b/public/images/flags/ag-1962–1967.svg @@ -0,0 +1,1143 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/public/images/flags/al.svg b/public/images/flags/al.svg index e85d95f..a08302c 100644 --- a/public/images/flags/al.svg +++ b/public/images/flags/al.svg @@ -1,5 +1,9 @@ - - - - + + + + diff --git a/public/images/flags/am-1952–1990.svg b/public/images/flags/am-1952–1990.svg new file mode 100644 index 0000000..6345167 --- /dev/null +++ b/public/images/flags/am-1952–1990.svg @@ -0,0 +1,4 @@ + + + + diff --git a/public/images/flags/am.svg b/public/images/flags/am.svg index 99fa4dc..08833f6 100644 --- a/public/images/flags/am.svg +++ b/public/images/flags/am.svg @@ -1,5 +1,5 @@ - - - - + + + + diff --git a/src/App.svelte b/src/App.svelte index d37e901..f91dfed 100644 --- a/src/App.svelte +++ b/src/App.svelte @@ -50,23 +50,39 @@ console.log("loadCollectionData: fetch status", response.status); if (response.ok) { logos = await response.json(); - console.log("loadCollectionData: loaded", logos.length, "items for", collection); - logos = [...logos]; // trigger reactivity + // Only use the current collection's data + allTags = []; + selectedTags = []; + selectedBrands = []; + selectedVariants = []; filteredLogos = logos; displayLogos = logos; // Reset filters and state for new collection searchQuery = ""; + tagDropdownOpen = false; + compactMode = false; + } else { + logos = []; + filteredLogos = []; + displayLogos = []; + allTags = []; selectedTags = []; selectedBrands = []; selectedVariants = []; tagDropdownOpen = false; compactMode = false; - } else { - logos = []; console.log("loadCollectionData: failed to load data for", collection); } } catch (error) { logos = []; + filteredLogos = []; + displayLogos = []; + allTags = []; + selectedTags = []; + selectedBrands = []; + selectedVariants = []; + tagDropdownOpen = false; + compactMode = false; console.error("loadCollectionData: error loading data for", collection, error); } } diff --git a/src/components/Actions.svelte b/src/components/Actions.svelte index 7883062..f569ec7 100644 --- a/src/components/Actions.svelte +++ b/src/components/Actions.svelte @@ -182,8 +182,7 @@ // Download PNG using the same logic as JPG async function handleDownloadPngClick(e) { e.stopPropagation(); - const varDir = getVarDir(logo); - const pngUrl = `/${varDir}/${getBaseName(logo.path)}.png`; + const pngUrl = `/${collection.varDir}/${getBaseName(logo.path)}.png`; try { const res = await fetch(pngUrl, { method: 'HEAD' }); if (res.ok) { @@ -215,8 +214,7 @@ } async function downloadJpg(logo) { - const varDir = getVarDir(logo); - const jpgUrl = `/${varDir}/${getBaseName(logo.path)}.jpg`; + const jpgUrl = `/${collection.varDir}/${getBaseName(logo.path)}.jpg`; try { const res = await fetch(jpgUrl, { method: 'HEAD' }); if (res.ok) { @@ -265,6 +263,10 @@ console.error('Error copying SVG source:', err); } } + + function getBaseName(filename) { + return filename.replace(/^.*[\\/]/, '').replace(/\.[^/.]+$/, ''); + } diff --git a/src/components/CardFull.svelte b/src/components/CardFull.svelte index 730e01d..abef2af 100644 --- a/src/components/CardFull.svelte +++ b/src/components/CardFull.svelte @@ -86,7 +86,7 @@ $: if (show && logo) { if (logo.format === "SVG" && !svgSource) { isFetchingSvgSource = true; - fetchSvgSource(logo.path) + fetchSvgSource(getImageUrl(logo)) .then((source) => { svgSource = source; isFetchingSvgSource = false;