Giter Site home page Giter Site logo

plaintext-to-unicodetext's Introduction

Main Page

Description

Convert your plain text to unicode! I built this for someone who wanted to style text on Google Keep, which lacks bold/italic options. (NOTE: Unicode characters CANNOT be searched through.) Directions: First select a style, then enter some text, then copy the unicoded result, and lastly paste it into your app of choice (try this with iMessage for some fun!)

Technologies

  • Javascript
  • HTML
  • CSS
  • Bootstrap
  • SASS
  • Local Storage

Resources

  • Bootstrap

Inspiration

How it Works

When the user selects a style, a specific plainText-to-unicode object is selected as a reference.

{
    italic sans: {a: '๐˜ข', b: '๐˜ฃ', c: '๐˜ค', d: '๐˜ฅ', e: '๐˜ฆ', โ€ฆ},
    italic serif: {a: '๐‘Ž', b: '๐‘', c: '๐‘', d: '๐‘‘', e: '๐‘’', โ€ฆ},
    //etc
}

So if a user selects the 'italic sans' style, then this object {a: '๐˜ข', b: '๐˜ฃ', ...} will be used to convert plain text to unicode.

Learned

  • Boostrap: How to make a flexbox responsive
    • Eg: Change flex-direction from column to row at the sm breakpoint:
      • d-flex: Makes the container a flex box. (Default direction: row)
      • flex-column: Changes default direction to column.
      • flex-sm-row: Changes direction to row at the sm break-point

Cleaner Code

I make an effort to make code easier to read. In the following example, I originally had a comment explaining a function. I renamed the function for more clarity. I also reworked the function so that it accepts an argument to copy.
The end result needs no explanation. Beautiful, isn't it?

//copy textarea2.value to clipboard
onClick_copyToClipboardBtn();
copyToClipboard(textarea2.value)

Evolution

Earlier Version

Earlier Version 1

Issue: The copy-to-clipboard button makes text underneath it hard to read. Note to self: Do not use absolute-positioning to position buttons over text inputs!

Current Version

Main Page

Two additional styles were added. The textarea buttons were relocated for more consistency. (Also, the copy-to-clipboard button in particular no longer covers text.)

plaintext-to-unicodetext's People

Contributors

richardkentng avatar

Watchers

 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.