benborgers / emojicdn Goto Github PK
View Code? Open in Web Editor NEW🥳 A fast, global content delivery network for emojis.
Home Page: https://emojicdn.elk.sh
🥳 A fast, global content delivery network for emojis.
Home Page: https://emojicdn.elk.sh
hey ben,
i've noticed like 2 months ago, you changed the tech stack in this repo from php to cloudflare workers, also added redirect for emojis to further increase the cost-effectiveness(i think). but there is a problem now: the domain cdn.jsdelivr.com got banned in China like 2 years ago. as a result, this CDN won't be working in raw Chinese network environments.
i forked your repo and made my own deployment (emoji.jw1.dev), changing redirect()
to fetch()
seems to be working. so i'd like to propose you make the same change for better versatility, the only problem now is, what kinda impact will it have on the workers' performance and cost?
changes i made:
https://github.com/jw-12138/emojicdn/blob/main/index.js#L33C1-L40C3
btw awesome project!
The API does not bother to set the content-type
on responses which causes issues for anything that checks those to see if the URL points to an image.
Hi there! The CDN is awesome, congrats! 🥳
I have this particular use case where I'm trying to retrieve the color palette from the emojis (any image actually but I just happen to be using your CDN) and to do that I have to add it to an HTML canvas
element.
Since the image comes from a different origin than the website and no CORS header is preset the canvas gets tainted and refuses to use methods like getImageData()
. The problem in detail
I'm no PHP expert (I don't know anything about PHP actually) but I think that adding the CORS definition should do the trick.
app/Http/Controllers/EmojiController.php
line 95
return response($emojiImage)
->header('content-type', 'image/png');
// ->header('Access-Control-Allow-Origin', '*'); or something like that
Please let me know if this is feasible and if you're willing to do that.
Have a great week!
I've tested a whole bunch of emojis with it and none of them seem to be working: I checked a url on emojipedia for a messenger-style emoji and it seems to have been also categorised under facebook in their file structure? https://emojipedia-us.s3.dualstack.us-west-1.amazonaws.com/thumbs/120/facebook/65/heavy-check-mark_2714.png
zwj emoji such as here get response 404
I'm updating the notion-enhancer at the moment and trying to reduce lag as much as I can, and the emoji-sets extension that depends on this is... not fast.
It works by replacing emojis one-by-one with the emoji from emojicdn in the chosen style - which is fine if it's just doing a few at a time, but isn't great when you open the emoji picker and it has to load all 3000+ emojis. It's not a massive download size, but it takes a long time when every request is done individually.
If at all possible I'd like to stick with emojicdn because it has wide support and is fairly reliable/easy to use. The only thing I can think of to speed this up would be to provide a full emoji set as a spritesheet that could be downloaded in one request or packaged with the enhancer... could emojicdn provide these? Or do you have any other ideas?
Edit: I've attempted doing all the many requests asynchronously, but then the whole page freezes up for a couple of minutes until it's done.
Hi Ben! Thanks for your cool CDN. I used it to build a website called https://whatsmuse.com
It was working but it looks like after a recent update it stopped working. You can see errors in the web console.
Just thought I'd let you know.
Also, I have a friend at Tufts who knows of you!
Maybe this API have parameter like ?style=
but for resizing emoji image?
Hello, I use emojicdn to embed emoji into google sheets since they are not supported when exporting to PDF. I typically use the microsoft style for emojis and recently all of the emojis in my workbook disappeared because it appears that the microsoft style is no longer available.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.