-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.js
97 lines (92 loc) · 2 KB
/
index.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
const plugin = require('tailwindcss/plugin');
// Vov.css animation classes
const vovAnimations = [
'fade-in-bottom-left',
'fade-in-bottom-right',
'fade-in-down',
'fade-in-left',
'fade-in-right',
'fade-in-top-left',
'fade-in-top-right',
'fade-in-up',
'fade-in',
'fade-out-bottom-left',
'fade-out-bottom-right',
'fade-out-down',
'fade-out-left',
'fade-out-right',
'fade-out-top-left',
'fade-out-top-right',
'fade-out-up',
'fade-out',
'roll-in-left',
'roll-in-right',
'roll-out-left',
'roll-out-right',
'shake-vertical',
'shake-horizontal',
'shake-diagonally',
'shake-i-diagonally',
'blur-in',
'blur-out',
'slide-in-down',
'slide-in-left',
'slide-in-right',
'slide-in-up',
'slide-out-down',
'slide-out-left',
'slide-out-right',
'slide-out-up',
'zoom-in-down',
'zoom-in-left',
'zoom-in-right',
'zoom-in-up',
'zoom-in',
'zoom-out-down',
'zoom-out-left',
'zoom-out-right',
'zoom-out-up',
'zoom-out',
'throb',
'i-throb',
'swivel-horizontal',
'swivel-horizontal-double',
'swivel-vertical',
'swivel-vertical-double',
'shrink-left',
'shrink-right',
'shrink-top',
'shrink-bottom',
'wheel-in-left',
'wheel-in-right',
'wheel-out-left',
'wheel-out-right',
'flash'
];
// Speed modifiers (match vov.css)
const vovSpeeds = {
fastest: '0.3s',
faster: '0.5s',
fast: '0.8s',
slow: '2s',
slower: '3s',
slowest: '4s',
};
module.exports = plugin(function ({ addUtilities }) {
// Animation utilities
const animationUtilities = Object.fromEntries(
vovAnimations.map((name) => [
`.vov-${name}`,
{ animation: `${name} 1s ease-in-out` }, // Default duration
])
);
// Speed utilities
const speedUtilities = Object.entries(vovSpeeds).map(([key, value]) => ({
[`.vov-${key}`]: {
animationDuration: value,
},
}));
// Add utilities to TailwindCSS
addUtilities(animationUtilities, { variants: ['responsive', 'hover'] });
addUtilities(speedUtilities, { variants: ['responsive', 'hover'] });
});