Skip to content

Commit ac00450

Browse files
committed
add animation delay
1 parent 6e50501 commit ac00450

3 files changed

Lines changed: 45 additions & 2 deletions

File tree

README.md

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,8 @@ plugins: [
2727
heartBeatSpeed: 1000,
2828
hingeSpeed: 2000,
2929
bounceInSpeed: 750,
30-
bounceOutSpeed: 750
30+
bounceOutSpeed: 750,
31+
animationDeplaySpeed: 1000
3132
},
3233
variants: ['responsive'],
3334
}),
@@ -40,6 +41,7 @@ plugins: [
4041
* ```hingeSpeed``` used for the animationDuration of the .hingeSpeed class
4142
* ```bounceInSpeed``` used for the animationDuration of the .bounceInSpeed class
4243
* ```bounceOutSpeed``` used for the animationDuration of the .bounceOutSpeed class
44+
* ```animationDeplaySpeed``` used for the animationDeplay, just add .delay class to your element
4345

4446
All of these settings are optional, if not set basic animate.css fallback animationDuration speed is used.
4547

@@ -48,6 +50,16 @@ The plugin generates all the animate.css utility classes for you.
4850
### Available Animate CSS classes
4951
* .animated
5052
* .infinite
53+
* .delay
54+
* .delay-1
55+
* .delay-2
56+
* .delay-3
57+
* .delay-4
58+
* .delay-5
59+
* .fast
60+
* .faster
61+
* .slow
62+
* .slower
5163
* .bounce
5264
* .flash
5365
* .pulse

animate/animate.js

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ module.exports = function ({ settings = {}, variants = ['responsive'] }) {
2222
const hingeSpeed = settings.hingeSpeed ? settings.hingeSpeed : 2000;
2323
const bounceInSpeed = settings.bounceInSpeed ? settings.bounceInSpeed : 750;
2424
const bounceOutSpeed = settings.bounceOutSpeed ? settings.bounceOutSpeed : 750;
25+
const animationDeplaySpeed = settings.animationDeplaySpeed ? settings.animationDeplaySpeed : 500;
2526
const opacity = settings.opacity ? settings.opacity : 1;
2627

2728
addUtilities({
@@ -32,6 +33,36 @@ module.exports = function ({ settings = {}, variants = ['responsive'] }) {
3233
'.infinite': {
3334
animationIterationCount: 'infinite'
3435
},
36+
'.delay': {
37+
animationDelay: `${animationDeplaySpeed}ms`
38+
},
39+
'.delay-1s': {
40+
animationDelay: `1000ms`
41+
},
42+
'.delay-2s': {
43+
animationDelay: `2000ms`
44+
},
45+
'.delay-3s': {
46+
animationDelay: `3000ms`
47+
},
48+
'.delay-4s': {
49+
animationDelay: `4000ms`
50+
},
51+
'.delay-5s': {
52+
animationDelay: `5000ms`
53+
},
54+
'.fast': {
55+
animationDelay: `800ms`
56+
},
57+
'.faster': {
58+
animationDelay: `500ms`
59+
},
60+
'.slow': {
61+
animationDelay: `2000ms`
62+
},
63+
'.slower': {
64+
animationDelay: `3000ms`
65+
},
3566
'.bounce': {
3667
animationName: 'bounce',
3768
transformOrigin: 'center bottom'

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "tailwindcss-animatecss",
3-
"version": "0.2.1",
3+
"version": "0.2.2",
44
"description": "Add Animate CSS as Tailwind CSS plugin to your project.",
55
"main": "index.js",
66
"repository": {

0 commit comments

Comments
 (0)