Coder Social home page Coder Social logo

a1401358759 / canvas-ribbon Goto Github PK

View Code? Open in Web Editor NEW

This project forked from zproo/canvas-ribbon

0.0 1.0 0.0 3 KB

:ribbon: 简单一条命令为你的网页添加canvas-ribbon背景彩带。 效果展示:

Home Page: https://zproo.github.io/showcase/project/canvas-ribbon/

HTML 39.11% JavaScript 60.89%

canvas-ribbon's Introduction

canvas-ribbon.js

重写了Vue作者博客中的canvas背景彩带,简单一条命令为你的网站加上canvas-ribbon背景动画。

鼠标每次点击,随机生成彩带背景。

1. 使用

在页面中插入以下语句。

<script id="ribbon" src="js/canvas-ribbon.js"></script>

注意此处要为script标签设置 id="ribbon" 。插入位置任意,推荐插入到 </body> 标签上面。

2. 配置

可自定义背景彩带的宽度、透明度和z-index属性

  • size: 彩带宽度, 默认: 90.
  • alpha: 彩带透明度, 默认: 0.6.
  • zIndex: 彩带html标签的z-index属性, 默认: -1.

例:

<script id="ribbon" size="150" alpha='0.3' zIndex="-2" src="js/canvas-ribbon.js"></script>

不设置时为默认属性。

canvas-ribbon's People

Contributors

zproo avatar

Watchers

James Cloos 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.