Skip to content
This repository was archived by the owner on Apr 1, 2021. It is now read-only.

Commit 45e7e86

Browse files
committed
add animate.css
1 parent 19a3cad commit 45e7e86

File tree

5 files changed

+42
-5
lines changed

5 files changed

+42
-5
lines changed

.eslintrc

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,9 +44,12 @@
4444
"on": "colon"
4545
}
4646
}],
47-
"vue/require-default-prop": "warning",
48-
"vue/require-prop-types": "warning",
49-
"vue/prop-name-casing": ["error", "camelCase"]
47+
"vue/require-default-prop": "off",
48+
"vue/require-prop-types": "off",
49+
"vue/prop-name-casing": ["error", "camelCase"],
50+
"unicorn/catch-error-name": ["error", {
51+
"name": "err"
52+
}]
5053
},
5154
"overrides": [{
5255
"files": ["resources/assets/js/coreui/**/*.vue"],

package-lock.json

Lines changed: 5 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@
3636
"stylelint-scss": "^3.1.3"
3737
},
3838
"dependencies": {
39+
"animate.css": "^3.6.1",
3940
"axios": "^0.18",
4041
"bootstrap": "^4.1.1",
4142
"bootstrap-vue": "^2.0.0-rc.11",

resources/assets/js/bootstrap.js

Lines changed: 29 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,36 @@ window.Vue = require('vue')
1111
try {
1212
window.$ = window.jQuery = require('jquery')
1313

14+
// Animate CSS
15+
window.$.fn.extend({
16+
animateCss: function (animationName, callback) {
17+
const animationEnd = (function (el) {
18+
const animations = {
19+
animation : 'animationend',
20+
OAnimation : 'oAnimationEnd',
21+
MozAnimation : 'mozAnimationEnd',
22+
WebkitAnimation: 'webkitAnimationEnd',
23+
}
24+
25+
for (const t in animations) {
26+
if (el.style[t] !== undefined)
27+
return animations[t]
28+
}
29+
})(document.createElement('div'))
30+
31+
this.addClass(`animated ${animationName}`).one(animationEnd, function () {
32+
$(this).removeClass(`animated ${animationName}`)
33+
34+
if (typeof callback === 'function') callback()
35+
})
36+
37+
return this
38+
},
39+
})
40+
1441
require('bootstrap')
15-
} catch (error) {
16-
console.error(error)
42+
} catch (err) {
43+
console.error(err)
1744
}
1845

1946
/**

resources/assets/sass/coreui/style.scss

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ $simple-line-font-path: '~simple-line-icons/fonts/';
1919
@import '~font-awesome/css/font-awesome.min.css';
2020
@import '~simple-line-icons/css/simple-line-icons.css';
2121
@import '~flag-icon-css/css/flag-icon.min.css';
22+
@import '~animate.css/animate.min.css';
2223

2324
// Import Other CSS Module
2425

0 commit comments

Comments
 (0)