Spaces:
Runtime error
Runtime error
fix copy
Browse files
frontend/src/lib/ColorPalette.svelte
CHANGED
|
@@ -17,8 +17,10 @@
|
|
| 17 |
// usingo Clipboard API
|
| 18 |
if (isCopying > -1) return;
|
| 19 |
isCopying = n;
|
| 20 |
-
await navigator.permissions.query({ name: 'clipboard-write' });
|
| 21 |
-
await navigator.clipboard.
|
|
|
|
|
|
|
| 22 |
setTimeout(() => {
|
| 23 |
isCopying = -1;
|
| 24 |
}, 800);
|
|
|
|
| 17 |
// usingo Clipboard API
|
| 18 |
if (isCopying > -1) return;
|
| 19 |
isCopying = n;
|
| 20 |
+
// await navigator.permissions.query({ name: 'clipboard-write' });
|
| 21 |
+
await navigator.clipboard.write([
|
| 22 |
+
new ClipboardItem({ 'text/plain': new Blob([text], { type: 'text/plain' }) })
|
| 23 |
+
]);
|
| 24 |
setTimeout(() => {
|
| 25 |
isCopying = -1;
|
| 26 |
}, 800);
|
frontend/src/lib/Palette.svelte
CHANGED
|
@@ -18,8 +18,10 @@
|
|
| 18 |
// usingo Clipboard API
|
| 19 |
if (isCopying) return;
|
| 20 |
isCopying = true;
|
| 21 |
-
await navigator.permissions.query({ name: 'clipboard-write' });
|
| 22 |
-
await navigator.clipboard.
|
|
|
|
|
|
|
| 23 |
setTimeout(() => {
|
| 24 |
isCopying = false;
|
| 25 |
}, 1000);
|
|
@@ -38,7 +40,12 @@
|
|
| 38 |
</div>
|
| 39 |
<div class="row-start-2 col-span-6 md:col-span-2 flex justify-center md:justify-end pb-3">
|
| 40 |
<div class="relative">
|
| 41 |
-
<img
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 42 |
<!-- <div class="absolute flex justify-around w-full">
|
| 43 |
{#each promptData.images as image, i}
|
| 44 |
<button
|
|
|
|
| 18 |
// usingo Clipboard API
|
| 19 |
if (isCopying) return;
|
| 20 |
isCopying = true;
|
| 21 |
+
// await navigator.permissions.query({ name: 'clipboard-write' });
|
| 22 |
+
await navigator.clipboard.write([
|
| 23 |
+
new ClipboardItem({ 'text/plain': new Blob([text], { type: 'text/plain' }) })
|
| 24 |
+
]);
|
| 25 |
setTimeout(() => {
|
| 26 |
isCopying = false;
|
| 27 |
}, 1000);
|
|
|
|
| 40 |
</div>
|
| 41 |
<div class="row-start-2 col-span-6 md:col-span-2 flex justify-center md:justify-end pb-3">
|
| 42 |
<div class="relative">
|
| 43 |
+
<img
|
| 44 |
+
loading="lazy"
|
| 45 |
+
class="relative max-w-[100px] w-full aspect-square"
|
| 46 |
+
src={imageSrc}
|
| 47 |
+
alt={prompt}
|
| 48 |
+
/>
|
| 49 |
<!-- <div class="absolute flex justify-around w-full">
|
| 50 |
{#each promptData.images as image, i}
|
| 51 |
<button
|