Unicoder.js
Unicoder.js is a small javascript library, which converts letters of a given text to some of the more artistic unicode alphabets โโโโ โฃโโโข, ๐ ฐ๐ ฝ๐ ณ ๐๐ ท๐ ธ๐. You can try it out live, here.
Instructions
Unicoder.js
is a stand alone, vanilla javascript library, so usage is pretty straight forward. Its a matter of creating a new instance of Unicoder
, and calling translate
.
JS
Unicoder.js
is built with a single purpose in mind, so there aren't really a whole lot of different things that can be need to be done with it. It translates the text, that is all.
The most basic example, would be below, translating some text, using a dictionary. (examples above) The dictionary defines the type of unicode characters to be returned.
// Unicoder.js file referenced somewhere above... var unicoder = new Unicoder(); console.log( unicoder.translate('Hello, how are you.', 'fraktur') ); // returns: ๐ณ๐๐๐๐, ๐๐๐ ๐๐๐ ๐๐๐.
In the first example, the dictionary is hard coded. Unicoder.js
also provides a function to get the list of current dictionaries available.
// Unicoder.js file referenced somewhere above... var unicoder = new Unicoder(); console.log( unicoder.getDictionaryKeys() ); // returns: ["circled", "negative-circled", "squared", "negative-squared", "script", "fraktur", "parenthesized", "monospace"]
Demo & Examples
You can play around with a small demo here... but just for fun, here are some live samples of the results.
Dictionary | Output |
---|---|
Circled | โโโโขโ โโกโ โโโโโโกโโโฃ โโงโโโโโโข โโ โคโโโโโโโก.โโข โโคโฃโโคโฃโข. |
Negative-Circled | ๐ ฃ๐ ๐ ๐ ข๐ ๐ ๐ ก๐ ๐ ๐ ๐ ๐ ๐ ๐ ก๐ ๐ ๐ ฃ ๐ ๐ ง๐ ๐ ๐ ๐ ๐ ๐ ข ๐ ๐ ๐ ค๐ ๐ ๐ ๐ ๐ ๐ ๐ ก.๐ ๐ ข ๐ ๐ ค๐ ฃ๐ ๐ ค๐ ฃ๐ ข. |
Squared | ๐ ๐ท๐ด๐ ๐ด ๐ฐ๐ ๐ด ๐ณ๐ธ๐ต๐ต๐ด๐ ๐ด๐ฝ๐ ๐ด๐ ๐ฐ๐ผ๐ฟ๐ป๐ด๐ ๐พ๐ต ๐ ๐ฝ๐ธ๐ฒ๐พ๐ณ๐ด๐ .๐น๐ |
Negative-Squared | ๐๐ ท๐ ด๐๐ ด ๐ ฐ๐๐ ด ๐ ณ๐ ธ๐ ต๐ ต๐ ด๐๐ ด๐ ฝ๐ ๐ ด๐๐ ฐ๐ ผ๐ ฟ๐ ป๐ ด๐ ๐ พ๐ ต ๐๐ ฝ๐ ธ๐ ฒ๐ พ๐ ณ๐ ด๐.๐ น๐ |
Script | ๐ฃ๐ฑ๐ฎ๐ผ๐ฎ ๐ช๐ป๐ฎ ๐ญ๐ฒ๐ฏ๐ฏ๐ฎ๐ป๐ฎ๐ท๐ฝ ๐ฎ๐๐ช๐ถ๐น๐ต๐ฎ๐ผ ๐ธ๐ฏ ๐พ๐ท๐ฒ๐ฌ๐ธ๐ญ๐ฎ๐ป.๐ณ๐ผ ๐ธ๐พ๐ฝ๐น๐พ๐ฝ๐ผ. |
Fraktur | ๐ฟ๐๐๐๐ ๐๐๐ ๐๐๐๐๐๐๐๐๐ ๐๐๐๐๐๐๐๐ ๐๐ ๐๐๐๐๐๐๐๐.๐๐ ๐๐๐๐๐๐๐. |
Parenthesized | โฏโฃโ โฎโ โโญโ โโคโกโกโ โญโ โฉโฏ โ โณโโจโซโงโ โฎ โชโก โฐโฉโคโโชโโ โญ.โฅโฎ โชโฐโฏโซโฐโฏโฎ. |
Monospace | ๐๐๐๐๐ ๐๐๐ ๐๐๐๐๐๐๐๐๐ ๐๐ก๐๐๐๐๐๐ ๐๐ ๐๐๐๐๐๐๐๐.๐๐ ๐๐๐๐๐๐๐. |
In the wild
The fun part about this, is that almost all platforms accept unicode text, so next time you can add a little more spice to your social with the demo, or work it into your site for some insane reason!
Most of everything does.
License & Acknowledgements
The main goal here was to make an open source, js version of this unicode toy, its awesome. Also this little tool and this dictionary where super useful in helping to understand the unicode system & structure.
The MIT License (MIT)
Copyright (C) 2015 ~ Tim Holman ~ [email protected]