radames commited on
Commit
4665ae6
β€’
1 Parent(s): 9d2090e
frontend/src/lib/ColorPalette.svelte CHANGED
@@ -21,7 +21,7 @@
21
  await navigator.clipboard.writeText(text);
22
  setTimeout(() => {
23
  isCopying = -1;
24
- }, 500);
25
  }
26
  </script>
27
 
@@ -29,7 +29,7 @@
29
  <div class="flex bg-black">
30
  {#each colors as color, i}
31
  <div
32
- class="cursor-pointer aspect-square relative"
33
  on:click={() => copyStringToClipboard(color.formatHex(), i)}
34
  >
35
  <svg class="max-w-full" width="100" viewBox="0 0 50 50">
@@ -37,8 +37,9 @@
37
  </svg>
38
  <span
39
  title="Copy single color"
40
- class="cursor-pointer absolute bottom-0 text-center text-xs pl-1 font-bold uppercase"
41
- style="color:{getLabelColor(color)}">{color.formatHex()}</span
 
42
  >
43
  </div>
44
  {/each}
 
21
  await navigator.clipboard.writeText(text);
22
  setTimeout(() => {
23
  isCopying = -1;
24
+ }, 800);
25
  }
26
  </script>
27
 
 
29
  <div class="flex bg-black">
30
  {#each colors as color, i}
31
  <div
32
+ class="{isCopying === i ? '' : 'cursor-pointer'} aspect-square relative"
33
  on:click={() => copyStringToClipboard(color.formatHex(), i)}
34
  >
35
  <svg class="max-w-full" width="100" viewBox="0 0 50 50">
 
37
  </svg>
38
  <span
39
  title="Copy single color"
40
+ class="absolute bottom-0 text-center text-xs pl-1 font-bold uppercase"
41
+ style="color:{getLabelColor(color)}"
42
+ >{isCopying === i ? 'copied' : color.formatHex()}</span
43
  >
44
  </div>
45
  {/each}