Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: replace emoji with SVGs (#129) #584

Merged
merged 7 commits into from
Jan 2, 2023
Merged

feat: replace emoji with SVGs (#129) #584

merged 7 commits into from
Jan 2, 2023

Conversation

cyberalien
Copy link
Member

Replaces emojis with SVGs.

Emoji sets can be replaced by changing dependency in config/emoji.ts.

Currently available emoji sets:

  • @iconify-emoji/twemoji - Twitter Emoji, used by default
  • @iconify-emoji/openmoji - OpenMoji
  • @iconify-emoji/noto - Noto Emoji by Google
  • @iconify-emoji/fluent-emoji-flat - Fluent Emoji (only "Flat" version for now) by Microsoft

To switch set, install appropriate package as dependency, change it in config/emoji.ts and run prepare script that will copy all files.

Emojis are copied to public/emojis/${prefix}/, which is ignored in .gitignore.

There probably are bugs, creation of various emoji packages is not automated yet.

@stackblitz
Copy link

stackblitz bot commented Dec 27, 2022

Review PR in StackBlitz Codeflow Run & review this pull request in StackBlitz Codeflow.

@netlify
Copy link

netlify bot commented Dec 27, 2022

Deploy Preview for elk-zone ready!

Name Link
🔨 Latest commit d30ee73
🔍 Latest deploy log https://app.netlify.com/sites/elk-zone/deploys/63b2634544b20800097140eb
😎 Deploy Preview https://deploy-preview-584--elk-zone.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.

@cyberalien cyberalien self-assigned this Dec 27, 2022
@cyberalien
Copy link
Member Author

cyberalien commented Dec 27, 2022

Bugs:

  • Posting several emojis in sequence without spaces sometimes does not replace all emojis
  • Editing post with replaced emojis fails to convert emojis back to text

@cyberalien
Copy link
Member Author

Fixed first bug in a dependency.

@cyberalien
Copy link
Member Author

Fixed issue with editing drafts. So I think this is usable now. No bugs that I can see.

Switching emoji sets for now requires changing dependency, in future I want to create an easy to use workflow that would allow quickly changing emoji set without much effort, add/replace custom emoji (unicode emojis, not :whatever: "emojis", though code has some support for that syntax too).

@cyberalien
Copy link
Member Author

cyberalien commented Jan 1, 2023

Fixed #667

Old code failed at this sequence, which was mentioned in another issue:

👦🏾 👧🏾 👨🏾 👩🏾 👴🏾 👵🏾 👶🏾 👱🏾 👮🏾 👲🏾 👳🏾 👷🏾 👸🏾 💂🏾 🎅🏾 👼🏾 💆🏾 💇🏾 👰🏾 🙍🏾 🙎🏾 🙅🏾 🙆🏾 💁🏾 🙋🏾 🙇🏾 🙌🏾 🙏🏾 🚶🏾 🏃🏾 💃🏾 💪🏾 👈🏾 👉🏾 ☝️🏾 👆🏾👇🏾 ✌️🏾 🖖🏾 ✊🏾 ✋🏾 👊🏾 👌🏾 👍🏾 👎🏾 👋🏾 👏🏾 👐🏾 💅🏾 👂🏾 👃🏾 🚣🏾 🛀🏾 🏄🏾 🏇🏾 🏊🏾 🚴🏾 🚵🏾

GitHub seems to fail at parsing it too, click button to quote this reply to see correct emoji as raw text without GitHub replacement.

Copy link
Member

@antfu antfu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is awesome! Thanks a lot for your effort! 🔥

I will figure out how to replace the ones on EmojiMarket later.

@antfu antfu merged commit fa9c418 into main Jan 2, 2023
@antfu antfu deleted the cyberalien/emojis branch January 2, 2023 04:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants