Skip to content

Commit 56c823b

Browse files
authored
Merge pull request #38 from MahoMuri/main
Added support for Vue3 (branch main)
2 parents 9787152 + fedee17 commit 56c823b

File tree

12 files changed

+979
-250
lines changed

12 files changed

+979
-250
lines changed

.eslintrc.js

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,27 @@
11
module.exports = {
2-
'env': {
3-
'browser': true,
4-
'es2021': true,
2+
env: {
3+
es2021: true,
4+
node: true,
55
},
6-
'extends': [
6+
extends: [
7+
'standard',
8+
'semistandard',
79
'eslint:recommended',
810
'plugin:vue/vue3-essential',
911
],
10-
'overrides': [
11-
],
12-
'parserOptions': {
13-
'ecmaVersion': 'latest',
14-
'sourceType': 'module',
12+
overrides: [],
13+
parserOptions: {
14+
ecmaVersion: 'latest',
15+
sourceType: 'module',
1516
},
16-
'plugins': [
17+
plugins: [
1718
'vue',
1819
],
19-
'rules': {
20+
rules: {
2021
'generator-star-spacing': 'off',
2122
'arrow-parens': 'off',
2223
'one-var': 'off',
23-
'semi': [2, 'always'],
24+
semi: [2, 'always'],
2425
'space-before-function-paren': [2, 'always'],
2526
'keyword-spacing': [2, { before: true, after: true }],
2627
'space-before-blocks': [2, 'always'],

.vscode/settings.json

Lines changed: 5 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,11 @@
11
{
22
"editor.bracketPairColorization.enabled": true,
33
"editor.guides.bracketPairs": true,
4-
"editor.formatOnSave": true,
5-
"editor.defaultFormatter": "dbaeumer.vscode-eslint",
6-
"editor.codeActionsOnSave": [
7-
"source.fixAll.eslint"
8-
],
9-
"eslint.validate": [
10-
"javascript",
11-
"javascriptreact",
12-
"typescript",
13-
"vue"
14-
],
4+
"editor.formatOnSave": false,
5+
"editor.codeActionsOnSave": ["source.fixAll.eslint"],
6+
"eslint.validate": ["javascript", "javascriptreact", "typescript", "vue"],
157
"[json]": {
168
"editor.defaultFormatter": "vscode.json-language-features"
17-
}
9+
},
10+
"prettier.singleQuote": true
1811
}

dist/index.js

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -81,14 +81,16 @@ var _directives2 = _interopRequireDefault(_directives);
8181

8282
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
8383

84+
var ANIMATE_CSS_CDN_LINK = 'https://cdnjs.cloudflare.com/ajax/libs/animate.css/4.1.1/animate.min.css';
85+
8486
var VAnimateCss = {
8587
install: function install(Vue) {
8688
var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
8789

8890
var animateCSSPath = options.animateCSSPath;
8991
var link = document.createElement('link');
9092
link.rel = 'stylesheet';
91-
link.href = animateCSSPath || 'https://cdnjs.cloudflare.com/ajax/libs/animate.css/3.5.2/animate.min.css';
93+
link.href = animateCSSPath || ANIMATE_CSS_CDN_LINK;
9294
document.getElementsByTagName('head')[0].appendChild(link);
9395

9496
(0, _directives2.default)(Vue);
@@ -116,8 +118,8 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de
116118

117119
exports.default = function (Vue) {
118120
Vue.directive('animate-css', {
119-
inserted: function inserted() {},
120-
bind: function bind(el, binding) {
121+
mounted: function mounted() {},
122+
beforeMount: function beforeMount(el, binding) {
121123
var value = binding.value,
122124
modifiers = binding.modifiers;
123125

@@ -228,14 +230,14 @@ var animationEnd = exports.animationEnd = function animationEnd(el, value, modif
228230
el.addEventListener('animationend', function () {
229231
var classes = el.classList;
230232
_animations2.default.forEach(function (item) {
231-
if (classes.contains(item)) {
232-
el.classList.remove(item);
233+
if (classes.contains('animate__' + item)) {
234+
el.classList.remove('animate__' + item);
233235
if (value.removeAfterAnimation) {
234236
el.parentNode.removeChild(el);
235237
}
236238
}
237239
});
238-
}, false);
240+
});
239241
};
240242

241243
var animateNow = exports.animateNow = function animateNow(el, value, modifiers) {
@@ -266,7 +268,7 @@ var animateNow = exports.animateNow = function animateNow(el, value, modifiers)
266268
el.style['animation-iteration-count'] = '' + iteration;
267269
}
268270

269-
el.className = el.classList.value + ' animated ' + classes;
271+
el.classList.add('animate__animated', 'animate__' + classes);
270272

271273
animationEnd(el, value, modifiers);
272274
};
@@ -275,7 +277,7 @@ var animateNow = exports.animateNow = function animateNow(el, value, modifiers)
275277
/* 4 */
276278
/***/ (function(module, exports) {
277279

278-
module.exports = ["animated","bounce","flash","pulse","rubberBand","shake","headShake","swing","tada","wobble","jello","bounceIn","bounceInDown","bounceInLeft","bounceInRight","bounceInUp","bounceOut","bounceOutDown","bounceOutLeft","bounceOutRight","bounceOutUp","fadeIn","fadeInDown","fadeInDownBig","fadeInLeft","fadeInLeftBig","fadeInRight","fadeInRightBig","fadeInUp","fadeInUpBig","fadeOut","fadeOutDown","fadeOutDownBig","fadeOutLeft","fadeOutLeftBig","fadeOutRight","fadeOutRightBig","fadeOutUp","fadeOutUpBig","flipInX","flipInY","flipOutX","flipOutY","lightSpeedIn","lightSpeedOut","rotateIn","rotateInDownLeft","rotateInDownRight","rotateInUpLeft","rotateInUpRight","rotateOut","rotateOutDownLeft","rotateOutDownRight","rotateOutUpLeft","rotateOutUpRight","hinge","jackInTheBox","rollIn","rollOut","zoomIn","zoomInDown","zoomInLeft","zoomInRight","zoomInUp","zoomOut","zoomOutDown","zoomOutLeft","zoomOutRight","zoomOutUp","slideInDown","slideInLeft","slideInRight","slideInUp","slideOutDown","slideOutLeft","slideOutRight","slideOutUp"]
280+
module.exports = ["animated","bounce","backInDown","backInLeft","backInRight","backInUp","backOutDown","backOutLeft","backOutRight","backOutUp","bounceIn","bounceInDown","bounceInLeft","bounceInRight","bounceInUp","bounceOut","bounceOutDown","bounceOutLeft","bounceOutRight","bounceOutUp","flash","fadeIn","fadeInDown","fadeInDownBig","fadeInLeft","fadeInLeftBig","fadeInRight","fadeInRightBig","fadeInUp","fadeInUpBig","fadeInTopLeft","fadeInTopRight","fadeInBottomLeft","fadeInBottomRight","fadeOut","fadeOutDown","fadeOutDownBig","fadeOutLeft","fadeOutLeftBig","fadeOutRight","fadeOutRightBig","fadeOutUp","fadeOutUpBig","fadeOutTopLeft","fadeOutTopRight","fadeOutBottomLeft","fadeOutBottomRight","flipInX","flipInY","flipOutX","flipOutY","headShake","heartBeat","hinge","jello","jackInTheBox","lightSpeedInRight","lightSpeedInLeft","lightSpeedOutRight","lightSpeedOutLeft","pulse","rubberBand","rotateIn","rotateInDownLeft","rotateInDownRight","rotateInUpLeft","rotateInUpRight","rotateOut","rotateOutDownLeft","rotateOutDownRight","rotateOutUpLeft","rotateOutUpRight","rollIn","rollOut","shakeX","shakeY","swing","slideInDown","slideInLeft","slideInRight","slideInUp","slideOutDown","slideOutLeft","slideOutRight","slideOutUp","tada","wobble","zoomIn","zoomInDown","zoomInLeft","zoomInRight","zoomInUp","zoomOut","zoomOutDown","zoomOutLeft","zoomOutRight","zoomOutUp"]
279281

280282
/***/ }),
281283
/* 5 */

dist/v-animate-css.js

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -81,14 +81,16 @@ var _directives2 = _interopRequireDefault(_directives);
8181

8282
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
8383

84+
var ANIMATE_CSS_CDN_LINK = 'https://cdnjs.cloudflare.com/ajax/libs/animate.css/4.1.1/animate.min.css';
85+
8486
var VAnimateCss = {
8587
install: function install(Vue) {
8688
var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
8789

8890
var animateCSSPath = options.animateCSSPath;
8991
var link = document.createElement('link');
9092
link.rel = 'stylesheet';
91-
link.href = animateCSSPath || 'https://cdnjs.cloudflare.com/ajax/libs/animate.css/3.5.2/animate.min.css';
93+
link.href = animateCSSPath || ANIMATE_CSS_CDN_LINK;
9294
document.getElementsByTagName('head')[0].appendChild(link);
9395

9496
(0, _directives2.default)(Vue);
@@ -116,8 +118,8 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de
116118

117119
exports.default = function (Vue) {
118120
Vue.directive('animate-css', {
119-
inserted: function inserted() {},
120-
bind: function bind(el, binding) {
121+
mounted: function mounted() {},
122+
beforeMount: function beforeMount(el, binding) {
121123
var value = binding.value,
122124
modifiers = binding.modifiers;
123125

@@ -228,14 +230,14 @@ var animationEnd = exports.animationEnd = function animationEnd(el, value, modif
228230
el.addEventListener('animationend', function () {
229231
var classes = el.classList;
230232
_animations2.default.forEach(function (item) {
231-
if (classes.contains(item)) {
232-
el.classList.remove(item);
233+
if (classes.contains('animate__' + item)) {
234+
el.classList.remove('animate__' + item);
233235
if (value.removeAfterAnimation) {
234236
el.parentNode.removeChild(el);
235237
}
236238
}
237239
});
238-
}, false);
240+
});
239241
};
240242

241243
var animateNow = exports.animateNow = function animateNow(el, value, modifiers) {
@@ -266,7 +268,7 @@ var animateNow = exports.animateNow = function animateNow(el, value, modifiers)
266268
el.style['animation-iteration-count'] = '' + iteration;
267269
}
268270

269-
el.className = el.classList.value + ' animated ' + classes;
271+
el.classList.add('animate__animated', 'animate__' + classes);
270272

271273
animationEnd(el, value, modifiers);
272274
};
@@ -275,7 +277,7 @@ var animateNow = exports.animateNow = function animateNow(el, value, modifiers)
275277
/* 4 */
276278
/***/ (function(module, exports) {
277279

278-
module.exports = ["animated","bounce","flash","pulse","rubberBand","shake","headShake","swing","tada","wobble","jello","bounceIn","bounceInDown","bounceInLeft","bounceInRight","bounceInUp","bounceOut","bounceOutDown","bounceOutLeft","bounceOutRight","bounceOutUp","fadeIn","fadeInDown","fadeInDownBig","fadeInLeft","fadeInLeftBig","fadeInRight","fadeInRightBig","fadeInUp","fadeInUpBig","fadeOut","fadeOutDown","fadeOutDownBig","fadeOutLeft","fadeOutLeftBig","fadeOutRight","fadeOutRightBig","fadeOutUp","fadeOutUpBig","flipInX","flipInY","flipOutX","flipOutY","lightSpeedIn","lightSpeedOut","rotateIn","rotateInDownLeft","rotateInDownRight","rotateInUpLeft","rotateInUpRight","rotateOut","rotateOutDownLeft","rotateOutDownRight","rotateOutUpLeft","rotateOutUpRight","hinge","jackInTheBox","rollIn","rollOut","zoomIn","zoomInDown","zoomInLeft","zoomInRight","zoomInUp","zoomOut","zoomOutDown","zoomOutLeft","zoomOutRight","zoomOutUp","slideInDown","slideInLeft","slideInRight","slideInUp","slideOutDown","slideOutLeft","slideOutRight","slideOutUp"]
280+
module.exports = ["animated","bounce","backInDown","backInLeft","backInRight","backInUp","backOutDown","backOutLeft","backOutRight","backOutUp","bounceIn","bounceInDown","bounceInLeft","bounceInRight","bounceInUp","bounceOut","bounceOutDown","bounceOutLeft","bounceOutRight","bounceOutUp","flash","fadeIn","fadeInDown","fadeInDownBig","fadeInLeft","fadeInLeftBig","fadeInRight","fadeInRightBig","fadeInUp","fadeInUpBig","fadeInTopLeft","fadeInTopRight","fadeInBottomLeft","fadeInBottomRight","fadeOut","fadeOutDown","fadeOutDownBig","fadeOutLeft","fadeOutLeftBig","fadeOutRight","fadeOutRightBig","fadeOutUp","fadeOutUpBig","fadeOutTopLeft","fadeOutTopRight","fadeOutBottomLeft","fadeOutBottomRight","flipInX","flipInY","flipOutX","flipOutY","headShake","heartBeat","hinge","jello","jackInTheBox","lightSpeedInRight","lightSpeedInLeft","lightSpeedOutRight","lightSpeedOutLeft","pulse","rubberBand","rotateIn","rotateInDownLeft","rotateInDownRight","rotateInUpLeft","rotateInUpRight","rotateOut","rotateOutDownLeft","rotateOutDownRight","rotateOutUpLeft","rotateOutUpRight","rollIn","rollOut","shakeX","shakeY","swing","slideInDown","slideInLeft","slideInRight","slideInUp","slideOutDown","slideOutLeft","slideOutRight","slideOutUp","tada","wobble","zoomIn","zoomInDown","zoomInLeft","zoomInRight","zoomInUp","zoomOut","zoomOutDown","zoomOutLeft","zoomOutRight","zoomOutUp"]
279281

280282
/***/ }),
281283
/* 5 */

0 commit comments

Comments
 (0)