├── .all-contributorsrc
├── .browserslistrc
├── .eslintrc.js
├── .gitignore
├── .travis.yml
├── CHANGELOG.md
├── CODE_OF_CONDUCT.md
├── LICENSE
├── Makefile
├── README.md
├── babel.config.js
├── coverage
├── clover.xml
├── coverage-final.json
├── lcov-report
│ ├── base.css
│ ├── index.html
│ ├── index.vue.html
│ ├── prettify.css
│ ├── prettify.js
│ ├── sort-arrow-sprite.png
│ └── sorter.js
└── lcov.info
├── docs
├── base.css
├── favicon.ico
├── index.html
└── js
│ ├── app.421856e5.js
│ ├── app.421856e5.js.map
│ ├── chunk-vendors.81b4fa07.js
│ └── chunk-vendors.81b4fa07.js.map
├── jest.config.js
├── package-lock.json
├── package.json
├── postcss.config.js
├── public
├── base.css
├── favicon.ico
└── index.html
├── src
├── App.vue
├── index.js
├── index.scss
├── index.vue
└── main.js
├── tests
└── unit
│ ├── .eslintrc.js
│ └── example.spec.js
└── vue.config.js
/.all-contributorsrc:
--------------------------------------------------------------------------------
1 | {
2 | "files": [
3 | "README.md"
4 | ],
5 | "imageSize": 100,
6 | "commit": false,
7 | "contributors": [
8 | {
9 | "login": "dreambo8563",
10 | "name": "Vincent Guo",
11 | "avatar_url": "https://avatars2.githubusercontent.com/u/6948318?v=4",
12 | "profile": "https://dreambo8563.github.io/",
13 | "contributions": [
14 | "code",
15 | "doc",
16 | "infra"
17 | ]
18 | }
19 | ],
20 | "contributorsPerLine": 7,
21 | "projectName": "vue-particle-effect-buttons",
22 | "projectOwner": "dreambo8563",
23 | "repoType": "github",
24 | "repoHost": "https://github.com"
25 | }
26 |
--------------------------------------------------------------------------------
/.browserslistrc:
--------------------------------------------------------------------------------
1 | > 1%
2 | last 2 versions
3 | not ie <= 8
4 |
--------------------------------------------------------------------------------
/.eslintrc.js:
--------------------------------------------------------------------------------
1 | module.exports = {
2 | root: true,
3 | env: {
4 | node: true
5 | },
6 | extends: ["plugin:vue/essential", "@vue/prettier"],
7 | rules: {
8 | "no-console": process.env.NODE_ENV === "production" ? "error" : "off",
9 | "no-debugger": process.env.NODE_ENV === "production" ? "error" : "off"
10 | },
11 | parserOptions: {
12 | parser: "babel-eslint"
13 | },
14 | overrides: [
15 | {
16 | files: ["**/__tests__/*.{j,t}s?(x)"],
17 | env: {
18 | jest: true
19 | }
20 | }
21 | ]
22 | };
23 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | .DS_Store
2 | node_modules
3 | /dist
4 |
5 | # local env files
6 | .env.local
7 | .env.*.local
8 |
9 | # Log files
10 | npm-debug.log*
11 | yarn-debug.log*
12 | yarn-error.log*
13 |
14 | # Editor directories and files
15 | .idea
16 | .vscode
17 | *.suo
18 | *.ntvs*
19 | *.njsproj
20 | *.sln
21 | *.sw?
22 |
--------------------------------------------------------------------------------
/.travis.yml:
--------------------------------------------------------------------------------
1 | language: node_js
2 | node_js:
3 | - "lts/*"
4 | install:
5 | - npm i
6 | - npm install -g codecov
7 | before_install:
8 | - npm i -g npm@latest
9 |
--------------------------------------------------------------------------------
/CHANGELOG.md:
--------------------------------------------------------------------------------
1 |
2 | ## [1.0.4](https://github.com/dreambo8563/vue-particle-effect-buttons/compare/v1.0.3...v1.0.4) (2019-08-22)
3 |
4 |
5 | ### Bug Fixes
6 |
7 | * **base.css:** fixd page too wide on windows ([b37bee5](https://github.com/dreambo8563/vue-particle-effect-buttons/commit/b37bee5))
8 |
9 |
10 |
11 |
12 | ## [1.0.3](https://github.com/dreambo8563/vue-particle-effect-buttons/compare/v1.0.2-beta.0...v1.0.3) (2019-04-28)
13 |
14 |
15 | ### Bug Fixes
16 |
17 | * **log:** rm log ([f93f050](https://github.com/dreambo8563/vue-particle-effect-buttons/commit/f93f050))
18 |
19 |
20 |
21 |
22 | ## [1.0.2-beta.0](https://github.com/dreambo8563/vue-particle-effect-buttons/compare/v1.0.1...v1.0.2-beta.0) (2019-04-28)
23 |
24 |
25 |
26 |
27 | ## [1.0.1](https://github.com/dreambo8563/vue-particle-effect-buttons/compare/v1.0.0...v1.0.1) (2019-04-26)
28 |
29 |
30 |
31 |
32 | # [1.0.0](https://github.com/dreambo8563/vue-particle-effect-buttons/compare/v0.1.3...v1.0.0) (2019-04-25)
33 |
34 |
35 | ### Features
36 |
37 | * **implement:** almost done ([cd505a4](https://github.com/dreambo8563/vue-particle-effect-buttons/commit/cd505a4))
38 |
39 |
40 |
41 |
42 | ## [0.1.3](https://github.com/dreambo8563/vue-particle-effect-buttons/compare/v0.1.2...v0.1.3) (2019-04-25)
43 |
44 |
45 | ### Bug Fixes
46 |
47 | * **dup complete event:** buttonVisible ([6ef89f3](https://github.com/dreambo8563/vue-particle-effect-buttons/commit/6ef89f3))
48 |
49 |
50 |
51 |
52 | ## [0.1.2](https://github.com/dreambo8563/vue-particle-effect-buttons/compare/v0.1.1...v0.1.2) (2019-04-24)
53 |
54 |
55 | ### Bug Fixes
56 |
57 | * **rename:** to vue-particle-effect-buttons to resolve conflict ([926e056](https://github.com/dreambo8563/vue-particle-effect-buttons/commit/926e056))
58 |
59 |
60 |
61 |
62 | ## [0.1.1](https://github.com/dreambo8563/vue-particle-effect-buttons/compare/b3f6a61...v0.1.1) (2019-04-24)
63 |
64 |
65 | ### Features
66 |
67 | * **implement:** basic implement and ci ([b3f6a61](https://github.com/dreambo8563/vue-particle-effect-buttons/commit/b3f6a61))
68 |
69 |
70 |
71 |
--------------------------------------------------------------------------------
/CODE_OF_CONDUCT.md:
--------------------------------------------------------------------------------
1 | # Contributor Covenant Code of Conduct
2 |
3 | ## Our Pledge
4 |
5 | In the interest of fostering an open and welcoming environment, we as
6 | contributors and maintainers pledge to making participation in our project and
7 | our community a harassment-free experience for everyone, regardless of age, body
8 | size, disability, ethnicity, sex characteristics, gender identity and expression,
9 | level of experience, education, socio-economic status, nationality, personal
10 | appearance, race, religion, or sexual identity and orientation.
11 |
12 | ## Our Standards
13 |
14 | Examples of behavior that contributes to creating a positive environment
15 | include:
16 |
17 | * Using welcoming and inclusive language
18 | * Being respectful of differing viewpoints and experiences
19 | * Gracefully accepting constructive criticism
20 | * Focusing on what is best for the community
21 | * Showing empathy towards other community members
22 |
23 | Examples of unacceptable behavior by participants include:
24 |
25 | * The use of sexualized language or imagery and unwelcome sexual attention or
26 | advances
27 | * Trolling, insulting/derogatory comments, and personal or political attacks
28 | * Public or private harassment
29 | * Publishing others' private information, such as a physical or electronic
30 | address, without explicit permission
31 | * Other conduct which could reasonably be considered inappropriate in a
32 | professional setting
33 |
34 | ## Our Responsibilities
35 |
36 | Project maintainers are responsible for clarifying the standards of acceptable
37 | behavior and are expected to take appropriate and fair corrective action in
38 | response to any instances of unacceptable behavior.
39 |
40 | Project maintainers have the right and responsibility to remove, edit, or
41 | reject comments, commits, code, wiki edits, issues, and other contributions
42 | that are not aligned to this Code of Conduct, or to ban temporarily or
43 | permanently any contributor for other behaviors that they deem inappropriate,
44 | threatening, offensive, or harmful.
45 |
46 | ## Scope
47 |
48 | This Code of Conduct applies both within project spaces and in public spaces
49 | when an individual is representing the project or its community. Examples of
50 | representing a project or community include using an official project e-mail
51 | address, posting via an official social media account, or acting as an appointed
52 | representative at an online or offline event. Representation of a project may be
53 | further defined and clarified by project maintainers.
54 |
55 | ## Enforcement
56 |
57 | Instances of abusive, harassing, or otherwise unacceptable behavior may be
58 | reported by contacting the project team at dreambo8563@outlook.com. All
59 | complaints will be reviewed and investigated and will result in a response that
60 | is deemed necessary and appropriate to the circumstances. The project team is
61 | obligated to maintain confidentiality with regard to the reporter of an incident.
62 | Further details of specific enforcement policies may be posted separately.
63 |
64 | Project maintainers who do not follow or enforce the Code of Conduct in good
65 | faith may face temporary or permanent repercussions as determined by other
66 | members of the project's leadership.
67 |
68 | ## Attribution
69 |
70 | This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
71 | available at https://www.contributor-covenant.org/version/1/4/code-of-conduct.html
72 |
73 | [homepage]: https://www.contributor-covenant.org
74 |
75 | For answers to common questions about this code of conduct, see
76 | https://www.contributor-covenant.org/faq
77 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | MIT License
2 |
3 | Copyright (c) 2019 Vincent Guo
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
22 |
--------------------------------------------------------------------------------
/Makefile:
--------------------------------------------------------------------------------
1 | lint:
2 | npm run lint
3 | local:
4 | npm run serve
5 | build:
6 | npm run build
7 | pages:
8 | npm run pages
9 | report:
10 | npm run report
11 | test:
12 | npm run test
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # vue-particle-effect-buttons ([demo](https://dreambo8563.github.io/vue-particle-effect-buttons/))
2 |
3 | [](#contributors)
4 | [](https://app.codacy.com/app/dreambo8563/vue-particle-effect-buttons?utm_source=github.com&utm_medium=referral&utm_content=dreambo8563/vue-particle-effect-buttons&utm_campaign=Badge_Grade_Dashboard)
5 | [](https://greenkeeper.io/)
6 | [](https://travis-ci.org/dreambo8563/vue-particle-effect-buttons)
7 | [](https://snyk.io/test/github/dreambo8563/vue-particle-effect-buttons?targetFile=package.json)
8 | [](https://opensource.org/licenses/MIT)
9 | 
10 |
11 | > Bursting particle effect buttons for Vue.
12 |
13 | This library is a Vue portal of an awesome [Codrops Article](https://tympanus.net/codrops/2018/04/25/particle-effects-for-buttons/) by [Luis Manuel](https://tympanus.net/codrops/author/luis/) (original [source](https://github.com/codrops/ParticleEffectsButtons/)).
14 |
15 | ## Install
16 |
17 | ```bash
18 | npm install --save animejs vue-particle-effect-buttons
19 | ```
20 |
21 | ## Usage
22 |
23 | Check out the [Demo](https://dreambo8563.github.io/vue-particle-effect-buttons/) to see it in action.
24 |
25 | ```js
26 |
27 |
33 | hello eveybody!
34 |
35 |
animating:{{btnOps.animating}}
36 |
visible:{{btnOps.visible}}
37 |
38 |
39 |
40 |
41 |
72 | ```
73 |
74 | Note that `children` can be anything, The `children` should represent the button's contents.
75 |
76 | You change the `visible` boolean prop to kick-off an animation, typically as a result of a click on the button's contents. If `visible` changes to `false`, the button will perform a disintegrating animation. If `visible` changes to `true`, it will reverse and reintegrate the original content.
77 |
78 | ## Props
79 |
80 | | Property | Type | Default | Description |
81 | | :--------------------------- | :------------------ | :--------------- | :--------------------------------------------------------------------------------------------------------- |
82 | | `visible` | boolean | true | Whether button should be hidden or visible. Changing this prop starts an animation. support .sync modifier |
83 | | `animating` | boolean | false | Get the current status of animating or end of the animation. support .sync modifier | |
84 | | `cls` | string/Object/Arrar | noop | The class to change the default button styles |
85 | | `duration` | number | 1000 | Animation duration in milliseconds. |
86 | | `easing` | string | 'easeInOutCubic' | Animation easing. |
87 | | `type` | string | circle | 'circle' or 'rectangle' or 'triangle' |
88 | | `style` | string | fill | 'fill' or 'stroke' |
89 | | `direction` | string | 'left' | 'left' or 'right' or 'top' or 'bottom' |
90 | | `canvasPadding` | number | 150 | Amount of extra padding to add to the canvas since the animation will overflow the content's bounds |
91 | | `size` | number | func | random(4) | Particle size. May be a static number or a function which returns numbers. |
92 | | `speed` | number | func | random(4) | Particle speed. May be a static number or a function which returns numbers. |
93 | | `particlesAmountCoefficient` | number | 3 | Increases or decreases the relative number of particles |
94 | | `oscillationCoefficient` | number | 20 | Increases or decreases the relative curvature of particles |
95 | | `onBegin` | func | noop | Callback to be notified once an animation starts. |
96 | | `onComplete` | func | noop | Callback to be notified once an animation completes. |
97 |
98 | I tried to keep the properties exactly the same as in the original codrops version.
99 |
100 | ## Slots
101 |
102 | | Property | Type | Default | Description |
103 | | :-------- | :--- | :---------------------- | :------------------------ |
104 | | `default` | slot | the string of 'content' | the content of the button |
105 |
106 | ## Related
107 |
108 | - [anime.js](http://animejs.com/) - Underlying animation engine.
109 | - [ParticleEffectsButtons](https://github.com/codrops/ParticleEffectsButtons/) - Original source this library is based on.
110 | - [Codrops Article](https://tympanus.net/codrops/2018/04/25/particle-effects-for-buttons/) - Original article this library is based on.
111 |
112 | ## Contributors
113 |
114 | Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/docs/en/emoji-key)):
115 |
116 |
117 |
118 |