GithubHelp home page GithubHelp logo

davidmr001 / vue-canvas-effect Goto Github PK

View Code? Open in Web Editor NEW

This project forked from chenxuan0000/vue-canvas-effect

0.0 1.0 0.0 420 KB

:tada: vue canvas动效库

License: MIT License

JavaScript 29.06% Vue 67.66% HTML 3.28%

vue-canvas-effect's Introduction

vue-canvas-effect

A simple, canvas effect collection for Vue.js

Build Status LICENSE MIT



logo of vue-canvas-effect repository

🌾 online demo | 📘 中文文档

Contents

Browser support

IE
IE
Firefox
Firefox
Chrome
Chrome
Safari
Safari
iOS Safari
iOS
Chrome for Android
Android
IE9+

Installation

NPM

npm install vue-canvas-effect --save

Usage

ES6

On demand

Recommend ways First, install babel-plugin-import

npm install babel-plugin-import --save-dev

Then edit .babelrc

// .babelrc
{
  "plugins": [["import", {
    "libraryName": "vue-canvas-effect",
    "libraryDirectory": "src/components"
  }]]
}

Next, if you need neon, edit main.js

import Vue from 'vue'
import {neon} from 'vue-canvas-effect';
Vue.component(neon.name, neon);
`or`
Vue.component('customName', neon);
new Vue({
  el: '#app',
  render: h => h(App)
})

Fully import

no recommend ways

import Vue from 'vue'
import vueCanvas from 'vue-canvas-effect';
Vue.use(vueCanvas)
new Vue({
  el: '#app',
  render: h => h(App)
})

normal use

script tag

<html>
<head>
  ...
</head>
<body>
   <div id="app">
        <neon-effect></neon-effect>
   </div>
   <script src="https://cdn.bootcss.com/vue/2.5.9/vue.js"></script>
   <script src="../dist/neon.min.js"></script>
   <script>
      new Vue({
           el: '#app'
        })
   </script>
</body>
</html>

Component List

neon

name: neonEffect

// default tagName use
<neon-effect :options="options"></neon-effect>
//default options
        {
          len: 20, //The unilateral length of the pentagon
          count: 50, //How many lines overlap
          rate: 20, //rate the smaller fast
          dieChance: 0.05, //The chance to redraw a single painting failure.
          sparkChance: 0.1, //[0,1] The larger the figure, the larger the pentagon.
          sparkDist: 10, //Flash point distance.
          sparkSize: 2,//Flash point size.
          contentLight: 60, // [0,100] Brightness of color block
          shadowToTimePropMult: 6, //The shadow size of the inner ring of the pentagon.
          bgColorArr: [0, 0, 0] //Background color array
        }

bubbles

name: bubblesEffect

// default tagName use
<bubbles-effect :options="options"></bubbles-effect>
//default options
        {
          color: 'rgba(225,225,225,0.5)', //Bubble color
          radius: 15, //Bubble radius
          densety: 0.3, // The larger the bubble density, the greater the density (suggest no more than 1).
          clearOffset: 0.2 // The larger the bubble disappears [0-1], the longer it disappears.
        }

Changelog

See the GitHub release history.

Contribution

Welcome to give some Suggestions and optimizations, and look forward to your Pull Request.

TkS

circleMagic

License

vue-seamless-scroll is open source and released under the MIT License.

vue-canvas-effect's People

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.