diff --git a/public/data/logos.json b/public/data/logos.json index 764abd0..1d40023 100644 --- a/public/data/logos.json +++ b/public/data/logos.json @@ -73,23 +73,42 @@ "path": "logos/apple.svg", "format": "SVG", "disable": false, - "brand": "Apple", "tags": [ "tech" ], + "brand": "Apple", "colors": { + "green": "#75bd21", + "yellow": "#ffc728", + "orange": "#ff661c", + "red": "#cf0f2b", + "pink": "#b01cab", + "blue": "#00a1de", "silver": "#999", "dark_grey": "#666" }, "targets": { - "main": "path" + "line1": "#line1", + "line2": "#line2", + "line3": "#line3", + "line4": "#line4", + "line5": "#line5", + "line6": "#line6" }, "sets": { - "set_1": { - "main": "silver" + "silver": { + "line1": "silver" }, - "set_2": { - "main": "dark_grey" + "dark_grey": { + "line1": "dark_grey" + }, + "rainbow": { + "line1": "green", + "line2": "yellow", + "line3": "orange", + "line4": "red", + "line5": "pink", + "line6": "blue" } } }, @@ -104,16 +123,6 @@ "storage" ] }, - { - "name": "Apple Rainbow", - "path": "logos/apple_rainbow.svg", - "format": "SVG", - "disable": false, - "tags": [ - "tech" - ], - "brand": "Apple" - }, { "name": "Apple App Store", "path": "logos/apple_app_store.svg", diff --git a/public/logos/apple.svg b/public/logos/apple.svg index 0ba3d10..991c312 100644 --- a/public/logos/apple.svg +++ b/public/logos/apple.svg @@ -1,5 +1,14 @@ - - + + + + + + + + + + + + diff --git a/public/logos/apple_rainbow.svg b/public/logos/apple_rainbow.svg deleted file mode 100644 index e849baa..0000000 --- a/public/logos/apple_rainbow.svg +++ /dev/null @@ -1,19 +0,0 @@ - - - - - - - - - - - - - - - - - - diff --git a/scripts/generate-svg-variants.js b/scripts/generate-svg-variants.js index 6ef27b1..d1a33d6 100644 --- a/scripts/generate-svg-variants.js +++ b/scripts/generate-svg-variants.js @@ -69,11 +69,12 @@ function applySvgColors(svgContent, colorSet, targets) { const elementId = selector.substring(1); // First, remove any existing fill attributes for this element - const removeExistingFillRegex = new RegExp(`(id="${elementId}"[^>]*?)\\s*fill="[^"]*"`, 'g'); - modifiedSvg = modifiedSvg.replace(removeExistingFillRegex, '$1'); + // Updated regex to preserve the closing tag structure + const removeExistingFillRegex = new RegExp(`(id="${elementId}"[^>]*?)\\s*fill="[^"]*"([^>]*>)`, 'g'); + modifiedSvg = modifiedSvg.replace(removeExistingFillRegex, '$1$2'); - // Then add the new fill attribute - const addFillRegex = new RegExp(`(id="${elementId}"[^>]*?)(\s*>)`, 'g'); + // Then add the new fill attribute before the closing > + const addFillRegex = new RegExp(`(id="${elementId}"[^>]*?)(\s*\/?>)`, 'g'); modifiedSvg = modifiedSvg.replace(addFillRegex, `$1 fill="${color}"$2`); } else { // Default: replace all fill attributes (fallback)