All Projects → YanNerio → Emotion Ratings

YanNerio / Emotion Ratings

Licence: mit
😠 😞 😑 😊 😍 This plugin allows you to create ratings using emojis

Projects that are alternatives of or similar to Emotion Ratings

Electron Markdownify
📕 A minimal Markdown editor desktop app
Stars: ✭ 700 (+1791.89%)
Mutual labels:  emoji, jquery
Ttgemojirate
An emoji-liked rating view for iOS, implemented in Swift3.
Stars: ✭ 284 (+667.57%)
Mutual labels:  emoji, rating
Rateit.js
Rating plugin for jQuery. Fast, Progressive enhancement, touch support, icon-font support, highly customizable, unobtrusive JavaScript (using HTML5 data-* attributes), RTL support, supports as many stars as you'd like, and also any step size.
Stars: ✭ 146 (+294.59%)
Mutual labels:  rating, jquery
Bootstrap Star Rating
A simple yet powerful JQuery star rating plugin with fractional rating support.
Stars: ✭ 985 (+2562.16%)
Mutual labels:  rating, jquery
Jqtree
Tree widget for jQuery
Stars: ✭ 977 (+2540.54%)
Mutual labels:  jquery
Price Tracker
Live and historical prices for fiat currencies, crypto currencies and gold/silver over REST and WebSocket APIs, using Redis as storage. Node.js, jQuery, Bootstrap
Stars: ✭ 32 (-13.51%)
Mutual labels:  jquery
Why Frameworks Matter
Why vanilla JavaScript isn't used for large applications
Stars: ✭ 32 (-13.51%)
Mutual labels:  jquery
Learningprocess
💥 本仓库用于记录我的学习历程和学习笔记
Stars: ✭ 31 (-16.22%)
Mutual labels:  jquery
Viewer
⚠️ [Deprecated] No longer maintained, please use https://github.com/fengyuanchen/jquery-viewer
Stars: ✭ 985 (+2562.16%)
Mutual labels:  jquery
Bootstrap 4 Autocomplete
A simple autocomplete/typeahead for Bootstrap 4 and jQuery
Stars: ✭ 36 (-2.7%)
Mutual labels:  jquery
Layout Spliter
Split label(horizontal,vertical),you can make a layout whatever you want !
Stars: ✭ 34 (-8.11%)
Mutual labels:  jquery
Jquery.lazy
A lightweight, fast, feature-rich, powerful and highly configurable delayed content, image and background lazy loading plugin for jQuery & Zepto.
Stars: ✭ 965 (+2508.11%)
Mutual labels:  jquery
A11y tooltips
Accessible Tooltip Component
Stars: ✭ 35 (-5.41%)
Mutual labels:  jquery
Gridstrap.js
gridstrap.js is a jQuery plugin designed to take Bootstrap's CSS grid system and turn it into a managed draggable and resizeable grid while truely maintaining its responsive behaviour.
Stars: ✭ 32 (-13.51%)
Mutual labels:  jquery
Js Boilerplate
Boilerplate for any javascript frontend project
Stars: ✭ 36 (-2.7%)
Mutual labels:  jquery
Node Emoji
😏 simple emoji support for node.js projects
Stars: ✭ 958 (+2489.19%)
Mutual labels:  emoji
Polarity
Detect the polarity (sentiment) of text
Stars: ✭ 33 (-10.81%)
Mutual labels:  emoji
Ecommerce
We're going to take you step-by-step to build a modern, fully open-source, eCommerce web application using Python, Django, Bootstrap, Javascript, and more.
Stars: ✭ 980 (+2548.65%)
Mutual labels:  jquery
Emojikeyboard
自定义表情键盘(支持系统表情, 图片表情),仅供参考学习~
Stars: ✭ 33 (-10.81%)
Mutual labels:  emoji
Pymap webapp
A webapp version for Raster Map Download Helper
Stars: ✭ 34 (-8.11%)
Mutual labels:  jquery

npm version

emotion-ratings

This plugin allows you to create ratings using emojis!

Preview:

emotion ratings

emotion ratings

Demo

Emotion Ratings

Installation

You can install emotion-ratings component using the npm package manager:

npm install --save emotion-ratings

Usage

  1. Include jQuery >=1.9:

    <script src="http://ajax.googleapis.com/ajax/libs/jquery/2.1.4/jquery.min.js"></script>
    
  2. Include plugin's code:

    <script src="emotion-ratings.min.js"></script>
    
  3. Call the plugin:

      // the emotions can be an array 
      var emotionsArray = ['angry','disappointed','meh', 'happy', 'inLove'];
      // or a single one
      var emotionsArray = ['happy'];
      jQ("#element").emotionsRating({
        emotionSize: 30,
        bgEmotion: 'happy',
        emotions: emotionsArray,
        color: '#FF0066', //the color must be expressed with a css code
            initialRating: 4, //initialize the rating number
        disabled: true, //set if the rating can be changed or not, default is false
        onUpdate: function(value) {} //set value changed event handler
      });
    

Use image as emoji

  • useCustomEmotions: Boolean. This option verifies if you want to use images as emoji.
  • transformImages: Boolean. This option verifies if you want to process the images. For example; an svg type image when it is added in an img tag, you can not access certain functionalities such as changing the color and border, because it is not in the correct svg tag, and for that reason you have to convert the img tag into a svg type. This process can take processing time and unnecessary in some cases, for this reason it is asked if you want to transform the images and get more features.

Short explanation about config an image as emoji

Following the original logic, you need by default an emoji to display with less opacity, and one array with the emoji to show in each position, in the original idea you pass the name of the emoji to be displayed, but in the new functionality you have to specific the path of the image you want to show. For example in bgEmotion option; bgEmotion: 'icons/icon.svg' and in emotions array emotions: ['icons/icon1.svg', 'icons/icon2.svg']

In the case that useCustomEmotions: true and transformImages: true, the hover event is disabled, because it makes the images transform many times, which causes it to fall into a cycle.

Code example:

// the emotions can be an array with path of the images
var emotionsArray = ['icons/icon1.svg', 'icons/icon2.svg', 'icons/icon3.svg'];
// or a single one
var emotionsArray = ['icons/icon1.svg'];
jQ("#element").emotionsRating({
  bgEmotion: 'icons/icon-default.svg', // String with path of the image
  emotions: emotionsArray,
  useCustomEmotions: true, // Enable use of images as emoji
  transformImages: false,
  initialRating: 4, //initialize the rating number
});

If you want to change the size of the image, you can directly modify the css, using the element specified in your js file with this: custom-emotion-style- class and the selector of the element

.custom-emotion-style-element {
  width: 30px;
  height: auto;
}

Contribution

You can contribute by forking and doing a PR.

Active contributors: @moudev

License

MIT License © Yanci Nerio

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].