├── .eslintrc.js ├── .firebaserc ├── .github ├── ISSUE_TEMPLATE │ ├── bug_report.md │ └── feature_request.md └── workflows │ ├── firebase-hosting-merge.yml │ └── firebase-hosting-pull-request.yml ├── .gitignore ├── .nvmrc ├── .vscode ├── extensions.json └── settings.json ├── 404.html ├── CODE_OF_CONDUCT.md ├── CONTRIBUTING.md ├── LICENSE ├── README.md ├── dist ├── index.js └── v-animate-css.js ├── firebase.json ├── index.html ├── index.js ├── package.json ├── src ├── directives │ ├── animate.js │ ├── animations.json │ ├── events.js │ └── index.js └── index.js ├── webpack.config.js └── yarn.lock /.eslintrc.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | env: { 3 | es2021: true, 4 | node: true, 5 | }, 6 | extends: [ 7 | 'standard', 8 | 'semistandard', 9 | 'eslint:recommended', 10 | 'plugin:vue/vue3-essential', 11 | ], 12 | overrides: [], 13 | parserOptions: { 14 | ecmaVersion: 'latest', 15 | sourceType: 'module', 16 | }, 17 | plugins: [ 18 | 'vue', 19 | ], 20 | rules: { 21 | 'generator-star-spacing': 'off', 22 | 'arrow-parens': 'off', 23 | 'one-var': 'off', 24 | semi: [2, 'always'], 25 | 'space-before-function-paren': [2, 'always'], 26 | 'keyword-spacing': [2, { before: true, after: true }], 27 | 'space-before-blocks': [2, 'always'], 28 | 'comma-dangle': [2, 'always-multiline'], 29 | 'no-console': 'off', 30 | 'no-multi-str': 'off', 31 | }, 32 | }; 33 | -------------------------------------------------------------------------------- /.firebaserc: -------------------------------------------------------------------------------- 1 | { 2 | "projects": { 3 | "default": "ossph-org" 4 | }, 5 | "targets": { 6 | "ossph-org": { 7 | "hosting": { 8 | "production": [ 9 | "v-animate-css" 10 | ] 11 | } 12 | } 13 | } 14 | } -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/bug_report.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Bug report 3 | about: Create a report to help us improve 4 | title: '' 5 | labels: '' 6 | assignees: '' 7 | 8 | --- 9 | 10 | **Describe the bug** 11 | A clear and concise description of what the bug is. 12 | 13 | **To Reproduce** 14 | Steps to reproduce the behavior: 15 | 1. Go to '...' 16 | 2. Click on '....' 17 | 3. Scroll down to '....' 18 | 4. See error 19 | 20 | **Expected behavior** 21 | A clear and concise description of what you expected to happen. 22 | 23 | **Screenshots** 24 | If applicable, add screenshots to help explain your problem. 25 | 26 | **Desktop (please complete the following information):** 27 | - OS: [e.g. iOS] 28 | - Browser [e.g. chrome, safari] 29 | - Version [e.g. 22] 30 | 31 | **Smartphone (please complete the following information):** 32 | - Device: [e.g. iPhone6] 33 | - OS: [e.g. iOS8.1] 34 | - Browser [e.g. stock browser, safari] 35 | - Version [e.g. 22] 36 | 37 | **Additional context** 38 | Add any other context about the problem here. 39 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/feature_request.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Feature request 3 | about: Suggest an idea for this project 4 | title: '' 5 | labels: '' 6 | assignees: '' 7 | 8 | --- 9 | 10 | **Is your feature request related to a problem? Please describe.** 11 | A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] 12 | 13 | **Describe the solution you'd like** 14 | A clear and concise description of what you want to happen. 15 | 16 | **Describe alternatives you've considered** 17 | A clear and concise description of any alternative solutions or features you've considered. 18 | 19 | **Additional context** 20 | Add any other context or screenshots about the feature request here. 21 | -------------------------------------------------------------------------------- /.github/workflows/firebase-hosting-merge.yml: -------------------------------------------------------------------------------- 1 | # This file was auto-generated by the Firebase CLI 2 | # https://github.com/firebase/firebase-tools 3 | 4 | name: Deploy to Firebase Hosting on merge 5 | 'on': 6 | push: 7 | branches: 8 | - main 9 | jobs: 10 | build_and_deploy: 11 | runs-on: ubuntu-latest 12 | steps: 13 | - uses: actions/checkout@v2 14 | - uses: actions/setup-node@v2 15 | with: 16 | node-version: 16 17 | - name: Install Yarn 18 | run: npm install yarn@latest -g 19 | - name: Install Dependencies 20 | run: yarn 21 | - name: Run Build 22 | run: yarn build 23 | - uses: FirebaseExtended/action-hosting-deploy@v0 24 | with: 25 | repoToken: '${{ secrets.GITHUB_TOKEN }}' 26 | firebaseServiceAccount: '${{ secrets.FIREBASE_SERVICE_ACCOUNT_OSSPH_ORG }}' 27 | projectId: ossph-org 28 | siteId: v-animate-css 29 | target: production 30 | channelId: live 31 | -------------------------------------------------------------------------------- /.github/workflows/firebase-hosting-pull-request.yml: -------------------------------------------------------------------------------- 1 | # This file was auto-generated by the Firebase CLI 2 | # https://github.com/firebase/firebase-tools 3 | 4 | name: Deploy to Firebase Hosting on PR 5 | on: 6 | pull_request: 7 | branches: 8 | - main 9 | types: 10 | - opened 11 | - reopened 12 | - synchronize 13 | jobs: 14 | build_and_preview: 15 | # if: '${{ github.event.pull_request.head.repo.full_name == github.repository }}' 16 | runs-on: ubuntu-latest 17 | steps: 18 | - uses: actions/checkout@v3 19 | with: 20 | ref: ${{ github.event.pull_request.head.sha }} 21 | - uses: actions/setup-node@v2 22 | with: 23 | node-version: 16 24 | - name: Install Yarn 25 | run: npm install yarn@latest -g 26 | - name: Install Dependencies 27 | run: yarn 28 | - name: Run Build 29 | run: yarn build 30 | - uses: FirebaseExtended/action-hosting-deploy@v0 31 | with: 32 | repoToken: '${{ secrets.GITHUB_TOKEN }}' 33 | firebaseServiceAccount: '${{ secrets.FIREBASE_SERVICE_ACCOUNT_OSSPH_ORG }}' 34 | projectId: ossph-org 35 | siteId: v-animate-css 36 | target: production 37 | channelId: pull-requests 38 | expires: 7d 39 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | demo/ 3 | node_modules/ 4 | npm-debug.log 5 | yarn-error.log 6 | 7 | # Editor directories and files 8 | .idea 9 | *.suo 10 | *.ntvs* 11 | *.njsproj 12 | *.sln 13 | .npmignore -------------------------------------------------------------------------------- /.nvmrc: -------------------------------------------------------------------------------- 1 | 16 -------------------------------------------------------------------------------- /.vscode/extensions.json: -------------------------------------------------------------------------------- 1 | { 2 | "recommendations": [ 3 | "dbaeumer.vscode-eslint", 4 | "editorconfig.editorconfig", 5 | "vue.volar", 6 | "wayou.vscode-todo-highlight" 7 | ], 8 | "unwantedRecommendations": [ 9 | "octref.vetur", 10 | "hookyqr.beautify", 11 | "dbaeumer.jshint", 12 | "ms-vscode.vscode-typescript-tslint-plugin" 13 | ] 14 | } -------------------------------------------------------------------------------- /.vscode/settings.json: -------------------------------------------------------------------------------- 1 | { 2 | "editor.bracketPairColorization.enabled": true, 3 | "editor.guides.bracketPairs": true, 4 | "editor.formatOnSave": false, 5 | "editor.codeActionsOnSave": ["source.fixAll.eslint"], 6 | "eslint.validate": ["javascript", "javascriptreact", "typescript", "vue"], 7 | "[json]": { 8 | "editor.defaultFormatter": "vscode.json-language-features" 9 | }, 10 | "prettier.singleQuote": true 11 | } 12 | -------------------------------------------------------------------------------- /404.html: -------------------------------------------------------------------------------- 1 | 2 | 3 |
4 | 5 | 6 |The specified file was not found on this website. Please check the URL for mistakes and try again.
29 |This page was generated by the Firebase Command-Line Interface. To modify it, edit the 404.html
file in your project's configured public
directory.
(v-animate-css)
157 | 159 | The easiest to implement 160 | Vue directive for 161 | Animate.css 162 |
163 |164 | Star on 165 | GitHub 166 |
167 |npm install v-animate-css --save
171 | yarn add v-animate-css
174 | https://unpkg.com/v-animate-css/dist/v-animate-css.js
177 | 181 | import { createApp } from 'vue'; 182 | import VAnimateCss from 'v-animate-css'; 183 | 184 | const app = createApp({}) 185 | 186 | app.use(VAnimateCss); 187 | app.mount("#app") 188 |189 |
195 | <script src="https://unpkg.com/vue@3/dist/vue.global.js"><script> 196 | <script src="https://unpkg.com/v-animate-css/dist/v-animate-css.js"><script> 197 | 198 | <script> 199 | const { createApp } = Vue 200 | const app = createApp({...}); 201 | app.use(VAnimateCss.default); 202 | app.mount("#app"); 203 | </script> 204 |205 |
208 | Related to 209 | Issue#33 210 | it make sense to give the user the option to add their own local 211 | version of Animate.css instead of relying to the default CDN 212 | version of Animate.css within the plugin. 213 |
214 |
215 | You can do it using the new animateCSSPath
option.
216 |
218 | import { createApp } from 'vue'; 219 | import VAnimateCss from 'v-animate-css'; 220 | 221 | const app = createApp({...}) 222 | 223 | app.use(VAnimateCss, { animateCSSPath: './local-animate-css-file.css' }); 224 | 225 | // You can also use this option to inject a newer version of Animate.css 226 | 227 | app.use(VAnimateCss, { animateCSSPath: 'cdn-link-to-a-newer-animate-css-version' }); 228 | 229 | app.mount("#app") 230 |231 |
Start the animation on page load.
235 | Directivev-animate-css="'fadeIn'"
237 | Start the animation on click event.
246 | Directivev-animate-css.click="'tada'"
248 | Start the animation onmouseover
to the element.
v-animate-css.hover="'rotateIn'"
258 | 265 | Start the animation on click event, with 266 | 500ms delay and 100ms animation 267 | duration. 268 |
269 | Directivev-animate-css.click="animationObject"
273 | animationObject: { 274 | classes: 'tada', 275 | delay: 500, 276 | duration: 1000 277 | } 278 |279 | Output
286 | Start the animation on page load, with 287 | 5000ms animation duration and 288 | infinite iteration. 289 |
290 | Directivev-animate-css.click="animationInfinite"
294 | animationInfinite: { 295 | classes: 'fadeIn', 296 | duration: 5000, 297 | iteration: 'infinite' 298 | } 299 |300 | Output
309 | This directive has 3 main modifiers click
,
310 | hover
and once
.
311 |
Modifier | 316 |Description | 317 |
---|---|
322 | click
323 | |
324 | 325 | This tells the directive to start the animation upon 326 | clicking the component. E.g. Button. 327 | | 328 |
331 | hover
332 | |
333 |
334 | This tells the directive to start the animation upon
335 | onmouseover event.
336 | |
337 |
340 | once
341 | |
342 |
343 | When once modifier is used, the directive will
344 | do the animation only once.
345 | |
346 |
353 | Aside from plain usage v-animate-css="'animation'"
,
354 | this directive can also accept an object, with different options.
355 |
357 | { 358 | classes: 'bounce', 359 | delay: 1000, 360 | duration: 1000, 361 | iteration: 5, // the animation will repeat 5 times. 362 | } 363 |364 |
Option | 368 |Description | 369 |Required? | 370 |
---|---|---|
375 | classes
376 | |
377 | The type of animation to be used. | 378 |YES | 379 |
382 | delay
383 | |
384 | 385 | The amount of delay time before the animation starts, in 386 | millis. 387 | | 388 |OPTIONAL | 389 |
392 | duration
393 | |
394 | 395 | The amount of time should the animation last, in millis. 396 | | 397 |OPTIONAL | 398 |
401 | iteration
402 | |
403 |
404 | The number of times the animation will be repeated. Any
405 | whole number or infinite for infinite
406 | iteration.
407 | |
408 | OPTIONAL | 409 |