Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Emojis on input text

I'm trying to replace the bullet characters in a password field with emojis.

Desired Unicode output http://apps.timwhitlock.info/emoji/tables/unicode

Any ideas on where to start looking to achieve this would be helpfulenter image description here

like image 931
Rob Avatar asked Aug 24 '15 16:08

Rob


People also ask

How do you put emojis into input?

To insert a 🙂 emoji, either: Type a colon followed by a keyword, e.g., :smile , then press Enter or Return to add the highlighted emoji, or click the desired emoji from those displayed, or. Select the emoticons toolbar button to open the picker, and use the tabs or search bar to browse, then click the desired emoji.

Does UTF 8 contain emojis?

Emoji CharactersEmojis are also characters from the UTF-8 alphabet: 😄 is 128516.


2 Answers

I figured out how to change the bullet icon in Webkit browsers.

password-input-typing

Essentially, you use a custom font (demo).

  • Go to Fontello, or equivalent site.
  • Choose or upload an icon.
  • Select "Customize Codes" tab.
  • Change the glyph destination to U+"2022" to replace the bullet symbol.
  • Download webfont.
  • Include the font files on your site, and include the following css (Note, the 0000 will change depending on the glyph & glyph destination)

    /* Use the css below to change the password input symbol */
    @font-face {
      font-family: 'fontello';
      src: url('./font/fontello.eot?0000');
      src: url('./font/fontello.eot?0000#iefix') format('embedded-opentype'),
      url('./font/fontello.woff?0000') format('woff'),
      url('./font/fontello.ttf?0000') format('truetype'),
      url('./font/fontello.svg?0000#fontello') format('svg');
      font-weight: normal;
      font-style: normal;
    }
    
    input[type="password"] {
      font-family: "fontello";
      font-style: normal;
      font-weight: normal;
      speak: none;
    
      /* For safety - reset parent styles, that can break glyph codes*/
      font-variant: normal;
      text-transform: none;
    
      /* Font smoothing. That was taken from TWBS */
      -webkit-font-smoothing: antialiased;
      -moz-osx-font-smoothing: grayscale;
      /* Uncomment for 3D effect */
      /* text-shadow: 1px 1px 1px rgba(127, 127, 127, 0.3); */
    
      /* add spacing to better separate each image */
      letter-spacing: 2px;
    }
    

The full instructions with screenshots are here.

like image 184
Mottie Avatar answered Oct 18 '22 18:10

Mottie


From what I could find, this isn't a good idea. Since the browser renders these natively, if you build a JavaScript workaround you'll likely compromise the security, break autocompletion, etc.

Found from here: change password char in HTML.

Although this is different than what you're wanting to do, here's someone who is doing some basic CSS styling on the password input field. Sorry it's not as awesome as what you're trying to do: Styling Password Fields in CSS.

like image 29
bobbyz Avatar answered Oct 18 '22 19:10

bobbyz