Skip to content

Add Download Button for SVGs in Frontend #23

@chinmay29hub

Description

@chinmay29hub

💾 Add Download Button for Haiku SVGs in Frontend

❓ What’s the Issue?

The frontend (frontend/src/App.jsx) currently lacks a button to download haiku SVGs, limiting users’ ability to save them locally.

🌍 Why Is This Important?

A Download SVG button will:

  • 💡 Enhance HaikuReadme’s user experience by allowing users to save their custom haikus.
  • 📤 Make it easier to share haikus in different formats, such as for social media or offline use.

🔧 Suggested Fix

  • Add a “Download SVG” button in frontend/src/App.jsx, placed near the theme preview.
  • Fetch the SVG from the API (e.g., /api?theme=dracula) and trigger the download.
  • Use JavaScript (e.g., Blob, <a> element or your favourite approach) to save the SVG as theme-name.svg.

🧪 Additional Details

  • Test with multiple themes like Nord and Catppuccin Mocha.
  • Ensure the download button matches the existing UI styles (e.g., Dracula theme colors).
  • The filename should include the selected theme, e.g., haiku-dracula.svg.

Metadata

Metadata

Assignees

Labels

enhancementNew feature or requestgood first issueGood for newcomersjavascriptPull requests that update javascript code

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions