Git Product home page Git Product logo

star-rating's Introduction

UPD: Angular2 star rating app added.

Need to show a Stars (or other graphic items) rating with floating numbers (like to show 2.5 stars or 3.75 circles)? Use this AngularJS directive! :-)

Screenshot

In a file stars.html you'll find a working example of using AngularJS and canvas awesomeness. With said directive you can:

  • Define the stars size -- attribute star-radius;
  • Stipulate how many stars you want to display -- attribute stars;
  • You can define the color of the 'empty star' with attribute empty-back-color, background color of the stars wrapper -- back-color and the background color of the selected stars -- sel-color;
  • Also you can use a two ways to define how many stars will be selected: by defining a 'fill percent' approach -- rating-percent attribute, or with 'stars number' -- rating-stars (you can use here float numbers, for example you can select 3.5 stars).
  • Do not like stars? Prefer circles? Provide your own function to draw the rating element you want via custom-figure-drawer attribute.

Wishing to change the rating live?

  • You can use the rating-define attribute to make the directive to change the rating, depending on mouse moves (percent value by percent and star value to change by full star). The click will "secure" the new rating.

N.B. If you want to use several ratings on one page, please wrap each of them into separate controller or isolate them other way in order not to interfere each other...

star-rating's People

Contributors

vitalpoltava avatar hyandell avatar younesm 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.