plibither8 / made-with-love-in

🛠️ ❤️ 🗺️ 🛡️ — Mircoservice for serving and listing "Made with love in <country-name>" badges
https://madewithlove.now.sh
MIT License
23 stars 17 forks source link

Adding Flags of different country? #8

Open Karthik-Nayak98 opened 4 years ago

Karthik-Nayak98 commented 4 years ago

Is it possible to add Flags of different countries along with their country name?

plibither8 commented 4 years ago

Hi! You can try adding flags by using the "Custom text" paramter. Does that solve the issue?

Karthik-Nayak98 commented 4 years ago

Is there any particular syntax for that? Can you give an example?

plibither8 commented 4 years ago

You can head over to https://madewithlove.now.sh and generate your badge. There you'll find the "Custom text" input where you can add the flag and country name yourself :).

Karthik-Nayak98 commented 4 years ago

It works for other emojis but not for flags. It will show letters instead 'IN' instead of the flag. I think these kinds of emojis are not supported.

plibither8 commented 4 years ago

That's surprising and disappointing. It definitely has to do with how the badge generator handles zero-width characters that allow to make a. combinational emoji, like flags. If this is the case, I don't think it's possible to add flags.

plibither8 commented 4 years ago

Onl a closer look at this issue, https://github.com/badges/shields/issues/3638#issuecomment-508844285 provides an interesting approach which might even work - though this wil call for changing the layout around a bit.

Karthik-Nayak98 commented 4 years ago

Only a closer look at this issue, badges/shields#3638 (comment) provides an interesting approach which might even work - through this will call for changing the layout around a bit.

Flag-with-shield

I added the India flag to the badge. It looks good now.

Karthik-Nayak98 commented 4 years ago

I had to get the SVG of the country flag and then convert it to base64 encoding and then add this to the shield. This is a lot of work. Instead, we can add this as a new feature for this project. Can we do this?

plibither8 commented 4 years ago

Definitely it's possible. As mentioned in the linked comment, we can take a look at this repo: https://www.npmjs.com/package/svg-country-flags to get the svg of the flag, with appropriate height settings. Do you want to take this up?

Karthik-Nayak98 commented 4 years ago

I am not that good at node.js. I can try adding this feature. Is there any other way to contact you? Your LinkedIn account maybe.

plibither8 commented 4 years ago

Perhaps, Telegram? https://t.me/plibither8

Karthik-Nayak98 commented 4 years ago

Okay thanks