Skip to content

Commit 015097f

Browse files
committed
feat(frontend): add custom copy icon
1 parent 5c4c272 commit 015097f

2 files changed

Lines changed: 35 additions & 2 deletions

File tree

apps/frontend/src/app/globals.css

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -449,6 +449,38 @@ body {
449449
font-size: 12px;
450450
}
451451

452+
.copy-button {
453+
gap: 8px;
454+
}
455+
456+
.copy-icon {
457+
width: 16px;
458+
height: 16px;
459+
border-radius: 4px;
460+
border: 1.6px solid rgba(15, 24, 46, 0.5);
461+
position: relative;
462+
}
463+
464+
.copy-icon::after {
465+
content: "";
466+
position: absolute;
467+
width: 14px;
468+
height: 14px;
469+
border-radius: 4px;
470+
border: 1.6px solid rgba(15, 24, 46, 0.35);
471+
top: -4px;
472+
left: 4px;
473+
background: rgba(255, 255, 255, 0.6);
474+
}
475+
476+
.copy-button.is-copied .copy-icon {
477+
border-color: rgba(89, 179, 123, 0.9);
478+
}
479+
480+
.copy-button.is-copied .copy-icon::after {
481+
border-color: rgba(89, 179, 123, 0.7);
482+
}
483+
452484
.result-card pre {
453485
margin: 0;
454486
max-height: 220px;

apps/frontend/src/app/page.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -381,7 +381,7 @@ export default function Home() {
381381
Download JSON
382382
</button>
383383
<button
384-
className="ghost-button"
384+
className={`ghost-button copy-button ${copied ? "is-copied" : ""}`}
385385
type="button"
386386
onClick={() => {
387387
if (!rawResult) return;
@@ -391,7 +391,8 @@ export default function Home() {
391391
window.setTimeout(() => setCopied(false), 1500);
392392
}}
393393
>
394-
{copied ? "✓ Copied" : "📋 Copy JSON"}
394+
<span className="copy-icon" aria-hidden="true" />
395+
{copied ? "Copied" : "Copy JSON"}
395396
</button>
396397
</div>
397398
</div>

0 commit comments

Comments
 (0)