项目作者: hustcc

项目描述 :
:ribbon: Only 1kb javascript gist to generate a ribbon in your website with HTML5 canvas.
高级语言: JavaScript
项目地址: git://github.com/hustcc/ribbon.js.git
创建时间: 2016-11-22T05:19:47Z
项目社区:https://github.com/hustcc/ribbon.js

开源协议:MIT License

下载


ribbon.js

Only 1kb javascript gist to generate a ribbon in your website with HTML5 canvas. Code from evanyou.

travis-ci

1. usage

Very easy and simple.

insert the code below between <body> and </body>.

  1. <script src="dist/ribbon.min.js"></script>

Suggest before the tag </body>, like below:

  1. <html>
  2. <head>
  3. ...
  4. </head>
  5. <body>
  6. ...
  7. ...
  8. ...
  9. <script src="dist/ribbon.min.js"></script>
  10. </body>
  11. </html>

Please do not add the code in the <head> </head>. then ok!

2. config

  • size: the size of ribbon, default: 90.
  • alpha: the opacity of line (0 ~ 1), default: 0.6.
  • zIndex: the index of z space, default: -1.

Example:

  1. <script type="text/javascript" size="150" alpha='0.3' zIndex="-2" src="dist/ribbon.min.js"></script>

Set the config on the script node as a attribute. all the config has the default value, you can choose to set any of them, or none of them.

3. preview

screenshot

4. other

The project source comes from http://evanyou.me/.