├── .babelrc
├── .circleci
└── config.yml
├── .eslintrc
├── .github
├── CODE_OF_CONDUCT.md
├── CONTRIBUTING.md
├── ISSUE_TEMPLATE.md
├── PULL_REQUEST_TEMPLATE.md
├── funding.yml
└── settings.yml
├── .gitignore
├── .release-it.json
├── LICENSE
├── README.md
├── docs
├── .nojekyll
├── README.md
└── index.html
├── example
├── App.vue
└── index.js
├── package.json
├── src
└── index.js
├── test
├── index.spec.js
├── mocks
│ ├── tweenjs.js
│ └── tweezer.js
├── tweenjs.spec.js
├── tweezer.spec.js
└── utils
│ └── Helper.vue
└── yarn.lock
/.babelrc:
--------------------------------------------------------------------------------
1 | {
2 | "presets": [
3 | ["env", { "modules": false }]
4 | ],
5 | "env": {
6 | "test": {
7 | "presets": [
8 | ["env", { "targets": { "node": "current" }}]
9 | ]
10 | }
11 | }
12 | }
13 |
--------------------------------------------------------------------------------
/.circleci/config.yml:
--------------------------------------------------------------------------------
1 | # Javascript Node CircleCI 2.0 configuration file
2 | #
3 | # Check https://circleci.com/docs/2.0/language-javascript/ for more details
4 | #
5 | version: 2
6 |
7 |
8 | jobs:
9 | build:
10 | docker:
11 | - image: circleci/node:8
12 |
13 | working_directory: ~/repo
14 |
15 | steps:
16 | - checkout
17 |
18 | # Download and cache dependencies
19 | - restore_cache:
20 | keys:
21 | - v1-dependencies-{{ checksum "package.json" }}
22 | # fallback to using the latest cache if no exact match is found
23 | - v1-dependencies-
24 |
25 | - run: yarn install
26 |
27 | - save_cache:
28 | paths:
29 | - node_modules
30 | key: v1-dependencies-{{ checksum "package.json" }}
31 |
32 | # run tests!
33 | - run: npm test
34 |
35 | - run:
36 | name: Send code coverage
37 | command: './node_modules/.bin/codecov'
38 |
--------------------------------------------------------------------------------
/.eslintrc:
--------------------------------------------------------------------------------
1 | {
2 | "extends": [
3 | "posva"
4 | ],
5 | "env": {
6 | "jest": true
7 | }
8 | }
9 |
--------------------------------------------------------------------------------
/.github/CODE_OF_CONDUCT.md:
--------------------------------------------------------------------------------
1 | # Contributor Code of Conduct
2 |
3 | As contributors and maintainers of this project, we pledge to respect all people who contribute through reporting issues, posting feature requests, updating documentation, submitting pull requests or patches, and other activities.
4 |
5 | We are committed to making participation in this project a harassment-free experience for everyone, regardless of level of experience, gender, gender identity and expression, sexual orientation, disability, personal appearance, body size, race, age, or religion.
6 |
7 | Examples of unacceptable behavior by participants include the use of sexual language or imagery, derogatory comments or personal attacks, trolling, public or private harassment, insults, or other unprofessional conduct.
8 |
9 | Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct. Project maintainers who do not follow the Code of Conduct may be removed from the project team.
10 |
11 | Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by opening an issue or contacting one or more of the project maintainers.
12 |
13 | This Code of Conduct is adapted from the [Contributor Covenant](http://contributor-covenant.org), version 1.0.0, available at [http://contributor-covenant.org/version/1/0/0/](http://contributor-covenant.org/version/1/0/0/)
14 |
--------------------------------------------------------------------------------
/.github/CONTRIBUTING.md:
--------------------------------------------------------------------------------
1 | # Contributing
2 |
3 | Contributions are welcome and will be fully credited!
4 |
5 | We accept contributions via Pull Requests on [Github](https://github.com/{{ githubAccount }}/{{ name }}).
6 |
7 | ## Pull Requests
8 |
9 | Here are some guidelines to make the process smoother:
10 |
11 | - **Add a test** - New features and bugfixes need tests. If you find it difficult to test, please tell us in the pull request and we will try to help you!
12 | - **Document any change in behaviour** - Make sure the `README.md` and any other relevant documentation are kept up-to-date.
13 | - **Run `npm test` locally** - This will allow you to go faster
14 | - **One pull request per feature** - If you want to do more than one thing, send multiple pull requests.
15 | - **Send coherent history** - Make sure your commits message means something
16 | - **Consider our release cycle** - We try to follow [SemVer v2.0.0](http://semver.org/). Randomly breaking public APIs is not an option.
17 |
18 | ## Creating issues
19 |
20 | ### Bug reports
21 |
22 | Always try to provide as much information as possible. If you are reporting a bug, try to provide a repro on jsfiddle.net (or anything else) or a stacktrace at the very least. This will help us check the problem quicker.
23 |
24 | ### Feature requests
25 |
26 | Lay out the reasoning behind it and propose an API for it. Ideally, you should have a practical example to prove the utility of the feature you're requesting.
27 |
28 |
--------------------------------------------------------------------------------
/.github/ISSUE_TEMPLATE.md:
--------------------------------------------------------------------------------
1 |
9 |
--------------------------------------------------------------------------------
/.github/PULL_REQUEST_TEMPLATE.md:
--------------------------------------------------------------------------------
1 |
5 |
6 |
7 |
8 |
9 | **What kind of change does this PR introduce?** (check at least one)
10 |
11 | - [ ] Bugfix
12 | - [ ] Feature
13 | - [ ] Code style update
14 | - [ ] Refactor
15 | - [ ] Build-related changes
16 | - [ ] Other, please describe:
17 |
18 | **Does this PR introduce a breaking change?** (check one)
19 |
20 | - [ ] Yes
21 | - [ ] No
22 |
23 | If yes, please describe the impact and migration path for existing applications:
24 |
25 | **The PR fulfills these requirements:**
26 |
27 | - [ ] When resolving a specific issue, it's referenced in the PR's title (e.g. `fix #xxx[,#xxx]`, where "xxx" is the issue number)
28 | - [ ] All tests are passing
29 | - [ ] New/updated tests are included
30 |
31 | If adding a **new feature**, the PR's description includes:
32 | - [ ] A convincing reason for adding this feature (to avoid wasting your time, it's best to open a suggestion issue first and wait for approval before working on it)
33 |
34 | **Other information:**
35 |
--------------------------------------------------------------------------------
/.github/funding.yml:
--------------------------------------------------------------------------------
1 | github: posva
2 | patreon: posva
3 | custom: https://www.paypal.me/posva
4 |
--------------------------------------------------------------------------------
/.github/settings.yml:
--------------------------------------------------------------------------------
1 | labels:
2 | - name: bug
3 | color: ee0701
4 | - name: contribution welcome
5 | color: 0e8a16
6 | - name: discussion
7 | color: 4935ad
8 | - name: docs
9 | color: 8be281
10 | - name: enhancement
11 | color: a2eeef
12 | - name: good first issue
13 | color: 7057ff
14 | - name: help wanted
15 | color: 008672
16 | - name: question
17 | color: d876e3
18 | - name: wontfix
19 | color: ffffff
20 | - name: WIP
21 | color: ffffff
22 | - name: need repro
23 | color: c9581c
24 | - name: feature request
25 | color: fbca04
26 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | node_modules
2 | coverage
3 | npm-debug.log
4 | yarn-error.log
5 | .nyc_output
6 | coverage.lcov
7 | dist
8 | package-lock.json
9 | .DS_Store
10 |
--------------------------------------------------------------------------------
/.release-it.json:
--------------------------------------------------------------------------------
1 | {
2 | "src": {
3 | "tagName": "v%s",
4 | "commitMessage": "🔖 %s"
5 | },
6 | "github": {
7 | "release": true,
8 | "releaseName": "🚀 Release %s",
9 | "tokenRef": "GITHUB_TOKEN"
10 | },
11 | "npm": {
12 | "publish": true
13 | },
14 | "changelogCommand": "git log --pretty=format:'* %s (%h)' [REV_RANGE]"
15 | }
16 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | The MIT License (MIT)
2 |
3 | Copyright (c) 2018 Eduardo San Martin Morote
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 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # VueTweezing [](https://circleci.com/gh/posva/vue-tweezing) [](https://www.npmjs.com/package/vue-tweezing) [](https://codecov.io/github/posva/vue-tweezing) [](https://github.com/posva/thanks)
2 |
3 | > Easy, customizable and automatic tweening nicely served in scoped slots
4 |
5 | VueTweezing works with any tweening engine and provide easy integration with some engines like
6 | [tween.js](https://github.com/tweenjs/tween.js) and [Tweezer](https://github.com/jaxgeller/tweezer.js/)
7 |
8 | [Demo](https://state-animations-amsterdam.surge.sh/polygon), [source](https://github.com/posva/state-animation-demos/blob/master/pages/polygon.vue)
9 |
10 | ## Usage
11 |
12 | Install it as a plugin:
13 |
14 | ```js
15 | import { Tweezing, tweezerHelper } from 'vue-tweezing'
16 | // import Tweezer to use it as our Tweening engine
17 | import Tweezer from 'tweezer.js'
18 |
19 | // install the plugin with as many engines as you want
20 | // use the tweezerHelper to generate the function
21 | // needed by VueTweezing to handle tweezing
22 | Vue.use(Tweezing, {
23 | tweezer: tweezerHelper(Tweezer),
24 | })
25 | ```
26 |
27 | Use it as a component:
28 |
29 | ```vue
30 |
31 |
35 |
36 | ```
37 |
38 | Change `value` as you would usually do:
39 |
40 | ```js
41 | const vm = new Vue({
42 | el: '#app',
43 | data: {
44 | value: 0,
45 | },
46 | })
47 | // somewhere else
48 | vm.value = 200
49 | ```
50 |
51 | You can play with the tween object by accessing the property `$tween` in the `Tweening` component:
52 |
53 | ```js
54 | // given the example above
55 | vm.$refs.tweezing.$tween.stop()
56 | ```
57 |
58 | ## Passing tweening options
59 |
60 | Any prop passed to `Tweezing` different from `tween` and `to` will be considered an option and passed
61 |
62 | ## Supported Tweening engines
63 |
64 | WIP
65 |
66 | ### Tweezer
67 |
68 | ### Tween.js
69 |
70 | ### Adding your own
71 |
72 | WIP
73 |
74 | You can check the examples in `src/index.js` to see how to create your own helpers.
75 |
76 | ## License
77 |
78 | [MIT](http://opensource.org/licenses/MIT)
79 |
--------------------------------------------------------------------------------
/docs/.nojekyll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/posva/vue-tweezing/e794e8db105029029496175135968f009a578d05/docs/.nojekyll
--------------------------------------------------------------------------------
/docs/README.md:
--------------------------------------------------------------------------------
1 | # vue-tweezing
2 |
3 | ## Basic Usage
4 |
5 | It's better to install it as a plugin, to add a default tweening engine:
6 |
7 | ```js
8 | import { Tweezing, tweezerHelper } from 'vue-tweezing'
9 | // import Tweezer to use it as our Tweening engine
10 | import Tweezer from 'tweezer.js'
11 |
12 | // install the plugin with one single engines
13 | // use the tweezerHelper to generate the function
14 | // needed by VueTweezing to handle tweezing
15 | Vue.use(Tweezing, {
16 | tweezer: tweezerHelper(Tweezer)
17 | })
18 | ```
19 |
20 | Then you get access to the component `Tweezing`:
21 |
22 | ```html
23 |
24 |
28 |
29 | ```
30 |
31 | In your js you can change `value` as you would usually:
32 |
33 | ```js
34 | const vm = new Vue({
35 | el: '#app',
36 | data: {
37 | value: 0
38 | }
39 | })
40 | // somewhere else
41 | vm.value = 200
42 | ```
43 |
44 | That will trigger a new tween using Tweezer. See [Tweezer helper documentation](#Tweezer) for more information.
45 |
46 | You can play with the tween object by accessing the property `$tween` in the `Tweening` component:
47 |
48 | ```js
49 | // given the example above
50 | vm.$refs.tweezing.$tween.stop()
51 | ```
52 |
53 |
--------------------------------------------------------------------------------
/docs/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |