Is your feature request related to a problem? Please describe.
Problem
Currently, users can preview the generated SVG badge, but there is no quick way to copy the SVG markup directly.
Proposed Solution
Add a "Copy SVG" button near the preview section.
Requirements
- Copy raw SVG to clipboard.
- Show a success toast/message after copying.
- Handle clipboard errors gracefully.
- Keep existing download functionality unchanged.
Acceptance Criteria
Difficulty
Good First Issue
Describe the solution you'd like
Implement a "Copy SVG" button using the Clipboard API (navigator.clipboard.writeText). When clicked, the button should copy the generated SVG markup to the clipboard and display a success notification. If copying fails due to browser restrictions or permissions, an appropriate error message should be shown.
The button should only be enabled after a badge has been successfully generated and should integrate seamlessly with the existing badge preview UI without affecting current functionality.
Describe alternatives you've considered
Some alternative approaches considered include:
- Allowing users to manually select and copy the SVG source from a text area.
- Providing a modal that displays the raw SVG code for copying.
- Downloading the SVG first and copying it manually.
However, a dedicated "Copy SVG" button provides the fastest and most user-friendly experience while requiring minimal changes to the existing interface.
Is your feature request related to a problem? Please describe.
Problem
Currently, users can preview the generated SVG badge, but there is no quick way to copy the SVG markup directly.
Proposed Solution
Add a "Copy SVG" button near the preview section.
Requirements
Acceptance Criteria
Difficulty
Good First Issue
Describe the solution you'd like
Implement a "Copy SVG" button using the Clipboard API (
navigator.clipboard.writeText). When clicked, the button should copy the generated SVG markup to the clipboard and display a success notification. If copying fails due to browser restrictions or permissions, an appropriate error message should be shown.The button should only be enabled after a badge has been successfully generated and should integrate seamlessly with the existing badge preview UI without affecting current functionality.
Describe alternatives you've considered
Some alternative approaches considered include:
However, a dedicated "Copy SVG" button provides the fastest and most user-friendly experience while requiring minimal changes to the existing interface.