feat: update SVG logos and enhance color switcher functionality

This commit is contained in:
sha
2025-04-30 22:37:07 +03:00
parent c9d6ae7104
commit 8ce320d3db
23 changed files with 332 additions and 298 deletions
+3 -3
View File
@@ -10,12 +10,12 @@
async function fetchAndColorSvg() {
const res = await fetch(path);
let text = await res.text();
if (!color || !colorConfig) {
// No colorization, render as-is
if (!color) {
// No user-selected color, render as-is (SVG uses fill="currentColor")
svgHtml = text;
return;
}
// Parse and update color
// Parse and update color only if user selected
const parser = new DOMParser();
const doc = parser.parseFromString(text, 'image/svg+xml');
// 1. Parse <style> rules and apply as inline attributes before removing <style>