Skip to content

Commit

Permalink
Remove SVG
Browse files Browse the repository at this point in the history
  • Loading branch information
Misgar-Numan committed Oct 2, 2024
1 parent f95a252 commit 1901b57
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 11 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ Want to experience the QRazy-sqaures? Check out the live QRazyness: [QRazy Live
- **Pre-set QR Code Sizes**: Pre-defined QR code sizes, making it easier to quickly generate a QR code with common dimesnions.
- **Always Visible Generate Button**: Because nobody likes searching for buttons.
- **Download Button**: Save your QR code and flaunt it!
- **Save QR Codes in Different Formats**: Provides users the option to download the QR code in different formats including PNG,JPEG or SVG.
- **Save QR Codes in Different Formats**: Provides users the option to download the QR code in different formats including PNG and JPEG.
- **No Ads**: You won't suffer throught pop-up ads.
- **Small But Faster**: It's faster than your grandma trying to understand TikTok.
- **Mobile Friendly**: You can generate QR codes while riding a unicycle or just on your phone.
Expand Down
1 change: 0 additions & 1 deletion index.html
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ <h1>QRazy</h1>
<option value="" disabled selected>Select Format</option>
<option value="png">PNG</option>
<option value="jpeg">JPEG</option>
<option value="svg">SVG</option>
</select>
</div>

Expand Down
10 changes: 1 addition & 9 deletions script.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,16 +31,8 @@ document.getElementById('generateButton').addEventListener('click', function ()
} else if (format === 'jpeg') {
mimeType = 'image/jpeg';
dataURL = qr.canvas.toDataURL(mimeType);
} else if (format === 'svg') {
mimeType = 'image/svg+xml';
const svgData = `
<svg xmlns="http://www.w3.org/2000/svg" width="${qrSize}" height="${qrSize}">
<rect width="100%" height="100%" fill="white"/>
<path d="${qr.toSVG()}" fill="black"/>
</svg>`;
dataURL = 'data:image/svg+xml;charset=utf-8,' + encodeURIComponent(svgData);
}

const link = document.createElement('a');
link.href = dataURL;
link.download = `QRazyCode.${format}`;
Expand Down

0 comments on commit 1901b57

Please sign in to comment.