1.0.0 • Published 6 years ago

js_emojis v1.0.0

Weekly downloads
1
License
ISC
Repository
github
Last release
6 years ago

JsEmojis 😃

Install

npm install --save js_emojis

Configuration

PropertyTypeDefault
elStringinputtype="text"
insertToNodeafterend
mainClassStringemoji_main
emojiContentClassStringemojis_content
btnClassStringemoji_btn
btnTextString:)
btnStringspan

Static HTML

<link rel="stylesheet" href="/node_modules/js_emojis/assets/css/jsemojis.css" />
.....

<!-- EXAMPLE -->

<!-- Imortant to contain element in row class or you can contain it 
         in your class which must have property display:flex
    -->
    ....
    <div class="row">
       <input type="text">
    </div>
    ....
    <script src="/node_modules/js_emojis/Jsemoji.js"></script>
    <script>

        // Setup JsEmoji
        JsEmoji.set({
            btn:'button',
            btnText:'JS'
        });

        // Run JsEmoji
        JsEmoji.start();
        
        //** Example **//
        let input = document.querySelector('input[type="text"]'),
            ul    = document.createElement('ul');

        input.addEventListener('keyup' , (e) => {
            if(e.which == 13){
                let li = document.createElement('li');
                li.textContent = e.target.value;
                ul.appendChild(li);
                document.body.appendChild(ul);
            }
        });

    </script>
    
<!-- -->

In Node.js

import 'js_emojis'
1.0.0

6 years ago