diff --git a/ToDo.md b/ToDo.md
index 45359db..ac2c41a 100644
--- a/ToDo.md
+++ b/ToDo.md
@@ -1,4 +1,4 @@
-[ ] Improove: To the tiny card add the color chooser. It should be one circle that display current color, on click it should open color picker.
+[v] Improove: To the tiny card add the color chooser. It should be one circle that display current color, on click it should open color picker.
[ ] Improove: In the preview page, add full header.
[ ] Improove: Split header into two parts: static top and dynamic bottom.
[ ] Improove: In the preview page, add possibility select custom color for each target.
diff --git a/src/components/CardFull.svelte b/src/components/CardFull.svelte
index 6e4972f..25fe3de 100644
--- a/src/components/CardFull.svelte
+++ b/src/components/CardFull.svelte
@@ -2,8 +2,8 @@
import { onMount } from "svelte";
import InlineSvg from "./InlineSvg.svelte";
import Actions from "./Actions.svelte";
+ import ColorSwitcher from "./ColorSwitcher.svelte";
import { getDefaultLogoColor, getThemeColor } from "../utils/colorTheme.js";
- import { generateColorSetCircle } from "../utils/colorCircles.js";
import { fetchSvgSource } from "../utils/svgSource.js";
export let show = false;
@@ -27,7 +27,7 @@
// Watch for color changes and update SVG source
function updateSvgSource() {
- if (inlineSvgRef && typeof inlineSvgRef.getSvgSource === 'function') {
+ if (inlineSvgRef && typeof inlineSvgRef.getSvgSource === "function") {
const newSource = inlineSvgRef.getSvgSource();
if (newSource) {
svgSource = newSource;
@@ -39,16 +39,16 @@
return logo && logo.format && logo.format.toLowerCase() === "svg";
}
function copySvgSourceFromTextarea() {
- if (inlineSvgRef && typeof inlineSvgRef.getSvgSource === 'function') {
+ if (inlineSvgRef && typeof inlineSvgRef.getSvgSource === "function") {
// Get the updated SVG source with all color changes applied
const updatedSource = inlineSvgRef.getSvgSource();
try {
- const tempEl = document.createElement('textarea');
+ const tempEl = document.createElement("textarea");
tempEl.value = updatedSource || svgSource;
document.body.appendChild(tempEl);
tempEl.select();
- document.execCommand('copy');
+ document.execCommand("copy");
document.body.removeChild(tempEl);
return true;
} catch (err) {
@@ -157,91 +157,12 @@
- {#if isSvgLogo(logo) && logo.colors}
-
- {
- logo._activeColor = undefined;
- logo._activeSet = undefined; // Reset activeSet too
- setTimeout(updateSvgSource, 100); // Update SVG source after color reset
- }}
- on:keydown|stopPropagation={(e) => {
- if (e.key === "Enter" || e.key === " ") {
- logo._activeColor = undefined;
- logo._activeSet = undefined;
- setTimeout(updateSvgSource, 100);
- }
- }}
- >
-
-
- {#if logo.sets}
- {#each Object.entries(logo.sets) as [setName, setConfig], i}
- {
- logo._activeColor = Object.values(logo.colors)[
- i % Object.keys(logo.colors).length
- ];
- logo._activeSet = setName;
- setTimeout(updateSvgSource, 100); // Update SVG source after color change
- }}
- on:keydown|stopPropagation={(e) => {
- if (e.key === "Enter" || e.key === " ") {
- logo._activeColor = Object.values(logo.colors)[
- i % Object.keys(logo.colors).length
- ];
- logo._activeSet = setName;
- setTimeout(updateSvgSource, 100); // Update SVG source after color change
- }
- }}
- style="padding: 0; overflow: hidden;"
- >
- {@html generateColorSetCircle(logo.colors, setConfig)}
-
- {/each}
- {:else}
- {#each Object.entries(logo.colors) as [colorName, colorValue]}
- {
- logo._activeColor = colorValue;
- logo._activeSet = undefined; // Clear any active set when setting individual color
- setTimeout(updateSvgSource, 100); // Update SVG source after color change
- }}
- on:keydown|stopPropagation={(e) => {
- if (e.key === "Enter" || e.key === " ") {
- logo._activeColor = colorValue;
- logo._activeSet = undefined; // Clear any active set
- setTimeout(updateSvgSource, 100); // Update SVG source after color change
- }
- }}
- >
- {/each}
- {/if}
-