-
-
Notifications
You must be signed in to change notification settings - Fork 3.9k
[FEATURE] styled QR codes #8640
Comments
To reduce notifications, issues are locked until they are https://github.com/EddieHubCommunity/LinkFree/labels/%F0%9F%8F%81%20status%3A%20ready%20for%20dev and to be assigned. You can learn more in our contributing guide https://github.com/EddieHubCommunity/LinkFree/blob/main/CONTRIBUTING.md |
The issue has been unlocked and is now ready for dev. If you would like to work on this issue, you can comment to have it assigned to you. You can learn more in our contributing guide https://github.com/EddieHubCommunity/LinkFree/blob/main/CONTRIBUTING.md |
Great idea, thank you for the suggestion. |
Hi, I would like to work upon this. Can you assign this to me? |
This would look awesome. Great idea @loftwah |
I've just created my account, I miss the qr code generator !! |
can you assign me the problem? |
@mishra-nikhil0110 you have another Issue assigned to you and as reflected in our Contributing Guide we only assign one Issue per person at any one time. I appreciate you have opened a PR for your existing Issue but this will need to be reviewed/accepted/merged by one of the maintainers before we assign anything else to you. |
@Akhilbisht798 I have assigned this to you |
@krol3 the generated QR code still exists for Profiles, please see screenshot. You can find it by clicking the orange arrow on your profile picture. If you have queries on your Profile generally it is best to chat in the EddieHub Discord channel. |
Hey, i think there is a problem with this QR library or its fork. ReferenceError: self is not defined
This error happened while generating the page. Any console logs will be displayed in the terminal window.
Call Stack
Object.<anonymous>
file:/usr/src/app/node_modules/styled-qr-code/lib/styled-qr-code.js (1:208) This is a long error. I just posted above part of it. without even changing anything other in the file. I tried to install a random library to check if i was doing something wrong so i imported If anyone can confirm this issue. OR point out if i am doing something wrong. |
If this is true for anyone else. We can find another good QR code library for making styled QR. |
Okay now this is getting fun. (code for this one) <!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Enhanced QR Code Styling</title>
<script type="text/javascript" src="https://unpkg.com/[email protected]/lib/qr-code-styling.js"></script>
<style>
/* Optional: add some styling to center the QR code on the page */
body {
display: flex;
justify-content: center;
align-items: center;
height: 100vh;
background-color: #f7f9fc;
}
#canvas {
box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
border-radius: 16px;
overflow: hidden;
}
</style>
</head>
<body>
<div id="canvas"></div>
<script type="text/javascript">
const qrCode = new QRCodeStyling({
width: 300,
height: 300,
type: "svg",
data: "https://linkfree.io/",
image: "https://linkfree.io/_next/image?url=%2Flogo192.png&w=32&q=75",
dotsOptions: {
color: {
type: "radial-gradient",
value: ["#EA580C", "#F87171"]
},
type: "rounded"
},
cornersSquareOptions: {
color: {
type: "radial-gradient",
value: ["#F87171", "#EA580C"]
},
},
cornersDotOptions: {
color: "#F87171"
},
backgroundOptions: {
color: "#e9ebee",
},
borderOptions: {
color: "#EA580C",
width: 6
},
imageOptions: {
crossOrigin: "anonymous",
margin: 20
}
});
qrCode.append(document.getElementById("canvas"));
// You can uncomment this line if you wish to auto-download the QR Code
// qrCode.download({ name: "enhanced_qr", extension: "svg" });
</script>
</body>
</html> I made a GitHub repo to show it here |
@loftwah. I understand that this is working on simple html and css. But i think it is not working on LinkFree due to server side rendering (or maybe not as it has useState) or due to some other reason. |
I get you, good point. I tried the example here for React and it wouldn't run when I used the latest NodeJS. I had to change back to version 14. It might be more complicated than I first thought. It worked for me on v14.21.3 in React. I just checked our Fork 1 and Fork 2 could potentially work. Can confirm I get the same issue on NodeJS v18. I can't build LinkFree on the older version of NodeJS (not that it is an option either). |
I have been searching for other option for qr code. The fork you have suggest seems great. I will now try to work with them. |
Hey, @loftwah. I have checked your option that you have provided for qr code. |
Hey, I have tried this issue. If anyone want to work on this go ahead. |
It is a tough one. I tried implementing it in my Rails project and had to put it on hold because it was a bit much for me. |
I think there is no actively maintained library for the styled QR Code. All the libraries are giving the same error which was mentioned above. |
That is the case with this issue. They are not seem to work with our project. |
@Akhilbisht798 what's the issue, did you face any difficulty in doing this. I am a beginner in JS and wanted to know if I will be able to do this issue? |
@vishalsingh2972, All the library mentioned in the issue, are not working properly. I think the main issue here can be that these library are not actively maintained. |
Hello, I have a approach to work on this using the same package. Here's how i'm approaching it
What do you think, let me know |
I managed to get this working using a different approach than @bikrantjajware , by dynamic importing the required library so that it gets loaded on the client side only. See link below as a reference. If you prefer this method, do assign this issue to me. Thanks. |
Also just in case if it helps I found another react qrcode library. |
We load the map dynamically, you can do something similar https://github.com/EddieHubCommunity/BioDrop/blob/main/pages/map.js#L16 |
Just realized this issue is unassigned. Can this be worked on? If so, do consider assigning it to me. My approach is the same as what Eddie suggested. Thank you. |
@ckelwin I have assigned this to you. |
Great collaboration everyone! We have had some challenges with QR libraries. I think for now let's close this issue ℹ️ eddiejaoude has some opened assigned issues: 🔧View assigned issues |
Description
We should update our QR code to use a stylized QR code library. There is a library here but it hasn't been maintained so I found a fork that fixes a couple of the issues.
Screenshots
It could all go here.
Additional information
No response
The text was updated successfully, but these errors were encountered: