Coder Social home page Coder Social logo

saifjerbi / scratch-card Goto Github PK

View Code? Open in Web Editor NEW
11.0 3.0 4.0 2.47 MB

Scratch card is based on HTML5, it generates canvas on the fly and is optimized for all modern browsers and has touch support for mobile devices. You can use it to make scratch cards, coupons, promotionnal game and even advertisement.

License: MIT License

HTML 19.38% JavaScript 80.62%
scratchcard scratch polymer2 polymer-element es6 webcomponents custom-elements-v1 web-components

scratch-card's Introduction

<scratch-card>

Published on webcomponents.org

Scratch card is based on HTML5, it generates canvas on the fly and is optimized for all modern browsers and has touch support for mobile devices. You can use it to make scratch cards, coupons, promotionnal game and even advertisement.

Demo

Please visit the demo and enjoy the scratch card

Installation

To install the scratch-card

bower install SaifJerbi/scratch-card

Usage

You can use it to make scratch cards, coupons, promotionnal game and even advertisement.

Once you have installed the scratch-card element, you can import it in your project using HTML import :

  <link rel="import" href="bower_components/scratch-card.html">

Once the element is imported , it's very easy to use :

<scratch-card 
            background="images/background01.png" 
            foreground="images/foreground01.png"
            percent=80
            thickness=15
            load>
</scratch-card>
Properties value Usage
background String The path of the background images
foreground String The path of the foreground images to be scratched
percent Integer The scratch area size in percent to fully scratch the card
thikness Integer The area scratched when touching the screen, it's in Pixel
load Boolean Tell the component that is ready to create scratch component. It must be set to true when you want load the scratch card

Contributing

Fork it! Create your feature branch: git checkout -b my-new-feature Commit your changes: git commit -am 'Add some feature' Push to the branch: git push origin my-new-feature Submit a pull request :D

Install the Polymer-CLI

First, make sure you have the Polymer CLI installed. Then run polymer serve to serve your element locally.

Viewing Your Element

$ polymer serve

Running Tests

$ polymer test

Your application is already set up to be tested via web-component-tester. Run polymer test to run your application's test suite locally.

History

The first stable release v1.0.0

scratch-card's People

Contributors

saifjerbi avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  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.