Coder Social home page Coder Social logo

unicoder.js's Introduction

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!

Twitter works. Unicode on twitter

Tumblr too... Unicode on tumblr

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]

unicoder.js's People

Contributors

tholman avatar

Watchers

James Cloos avatar Mark Chipman and sidekick Mollie avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.