Requirements
- WordPress : Version 5.9 or higher
- PHP : Version 7.0 or higher
Installation
To install the plugin, please refer to the “Installing a plugin” documentation.
Example
Fading
Zoom
Bounce
Rotate
Attention seekers
Special
Personalization
Blocks
By default, animations are available on all blocks, but you can exclude blocks by entering the following PHP code in your theme's functions.php file:
add_filter( "habefast_gutenberg_animations_get_excludes_blocks",function($array){
$exludesBlocks = ["core/heading"]; //array with excluded blocks name
return array_merge($exludesBlocks,$array);
},11);
Default values
Default groups
xxxxxxxxxx
[
"fadein" => ["label" => __("Fading", "habefast-gutenberg-animations")],
"zoom" => ["label" => __("Zoom", "habefast-gutenberg-animations")],
"bounce" => ["label" => __("Bounce", "habefast-gutenberg-animations")],
"rotate" => ["label" => __("Rotate", "habefast-gutenberg-animations")],
"attention" => ["label" => __("Attention seekers", "habefast-gutenberg-animations")],
"special" => ["label" => __("Special", "habefast-gutenberg-animations")]
]
Default animations
xxxxxxxxxx
"animationsList" => [
"none" => ["label" => __('None', "habefast-gutenberg-animations")],
"fade_in" => ["label" => __('Fade in', "habefast-gutenberg-animations"), "group" => "fadein"],
"fade_left" => ["label" => __('Fade in left', "habefast-gutenberg-animations"), "group" => "fadein"],
"fade_right" => ["label" => __('Fade in right', "habefast-gutenberg-animations"), "group" => "fadein"],
"fade_top" => ["label" => __('Fade in top', "habefast-gutenberg-animations"), "group" => "fadein"],
"fade_bottom" => ["label" => __('Fade in bottom', "habefast-gutenberg-animations"), "group" => "fadein"],
"fade_left_big" => ["label" => __('Fade in left big', "habefast-gutenberg-animations"), "group" => "fadein"],
"fade_right_big" => ["label" => __('Fade in right big', "habefast-gutenberg-animations"), "group" => "fadein"],
"fade_top_big" => ["label" => __('Fade in top big', "habefast-gutenberg-animations"), "group" => "fadein"],
"fade_bottom_big" => ["label" => __('Fade in bottom big', "habefast-gutenberg-animations"), "group" => "fadein"],
"fade_top_left" => ["label" => __('Fade in top left', "habefast-gutenberg-animations"), "group" => "fadein"],
"fade_top_right" => ["label" => __('Fade in top right', "habefast-gutenberg-animations"), "group" => "fadein"],
"fade_bottom_left" => ["label" => __('Fade in bottom left', "habefast-gutenberg-animations"), "group" => "fadein"],
"fade_bottom_right" => ["label" => __('Fade in bottom right', "habefast-gutenberg-animations"), "group" => "fadein"],
"zoom_in" => ["label" => __('Zoom in', "habefast-gutenberg-animations"), "group" => "zoom"],
"zoom_in_down" => ["label" => __('Zoom in Down', "habefast-gutenberg-animations"), "group" => "zoom"],
"zoom_in_left" => ["label" => __('Zoom in Left', "habefast-gutenberg-animations"), "group" => "zoom"],
"zoom_in_right" => ["label" => __('Zoom in Right', "habefast-gutenberg-animations"), "group" => "zoom"],
"zoom_in_up" => ["label" => __('Zoom in Up', "habefast-gutenberg-animations"), "group" => "zoom"],
"bouncein" => ["label" => __('Bounce in', "habefast-gutenberg-animations"), "group" => "bounce"],
"bounceindown" => ["label" => __('Bounce in Down', "habefast-gutenberg-animations"), "group" => "bounce"],
"bounceinleft" => ["label" => __('Bounce in Left', "habefast-gutenberg-animations"), "group" => "bounce"],
"bounceinright" => ["label" => __('Bounce in Right', "habefast-gutenberg-animations"), "group" => "bounce"],
"bounceinup" => ["label" => __('Bounce in Up', "habefast-gutenberg-animations"), "group" => "bounce"],
"rotatein" => ["label" => __('Rotate in', "habefast-gutenberg-animations"), "group" => "rotate"],
"rotateindownleft" => ["label" => __('Rotate in down left', "habefast-gutenberg-animations"), "group" => "rotate"],
"rotateindownright" => ["label" => __('Rotate in down right', "habefast-gutenberg-animations"), "group" => "rotate"],
"rotateinupleft" => ["label" => __('Rotate in up left', "habefast-gutenberg-animations"), "group" => "rotate"],
"rotateinupright" => ["label" => __('Rotate in up right', "habefast-gutenberg-animations"), "group" => "rotate"],
"bounce" => ["label" => __('Bounce', "habefast-gutenberg-animations"), "group" => "attention"],
"flash" => ["label" => __('Flash', "habefast-gutenberg-animations"), "group" => "attention"],
"pulse" => ["label" => __('Pulse', "habefast-gutenberg-animations"), "group" => "attention"],
"rubberband" => ["label" => __('Rubber band', "habefast-gutenberg-animations"), "group" => "attention"],
"shakex" => ["label" => __('Shake X', "habefast-gutenberg-animations"), "group" => "attention"],
"shakey" => ["label" => __('Shake Y', "habefast-gutenberg-animations"), "group" => "attention"],
"headshake" => ["label" => __('Head shake', "habefast-gutenberg-animations"), "group" => "attention"],
"swing" => ["label" => __('Swing', "habefast-gutenberg-animations"), "group" => "attention"],
"tada" => ["label" => __('Tada', "habefast-gutenberg-animations"), "group" => "attention"],
"wobble" => ["label" => __('Wobble', "habefast-gutenberg-animations"), "group" => "attention"],
"jello" => ["label" => __('Jello', "habefast-gutenberg-animations"), "group" => "attention"],
"heartbeat" => ["label" => __('Heart beat', "habefast-gutenberg-animations"), "group" => "attention"],
"jackinthebox" => ["label" => __('Jack in the box', "habefast-gutenberg-animations"), "group" => "special"],
"rollin" => ["label" => __('Roll in', "habefast-gutenberg-animations"), "group" => "special"],
"lightspeedinright " => ["label" => __('Light speed in right', "habefast-gutenberg-animations"), "group" => "special"],
"lightspeedinleft" => ["label" => __('Light speed in left', "habefast-gutenberg-animations"), "group" => "special"],
],
Default delays
xxxxxxxxxx
"delayList" => [
"none" => ["label" => __('None', "habefast-gutenberg-animations")],
"d-100ms" => ["label" => __('100 Milliseconds', "habefast-gutenberg-animations")],
"d-200ms" => ["label" => __('200 Milliseconds', "habefast-gutenberg-animations")],
"d-500ms" => ["label" => __('500 Milliseconds', "habefast-gutenberg-animations")],
"d-1s" => ["label" => __('One Second', "habefast-gutenberg-animations")],
"d-2s" => ["label" => __('Two Seconds', "habefast-gutenberg-animations")],
"d-3s" => ["label" => __('Three Seconds', "habefast-gutenberg-animations")],
],
Default speed
xxxxxxxxxx
"speedList" => [
"none" => ["label" => __('None', "habefast-gutenberg-animations")],
"slow" => ["label" => __('Slow', "habefast-gutenberg-animations")],
"slower" => ["label" => __('Slower', "habefast-gutenberg-animations")],
"default" => ["label" => __('Default', "habefast-gutenberg-animations")],
"fast" => ["label" => __('Fast', "habefast-gutenberg-animations")],
"faster" => ["label" => __('Faster', "habefast-gutenberg-animations")],
]
Add an animation
To add a new animation, you need to add it to the block settings and add the associated CSS.
Add the animation to the Gutenberg editor
To add the animation to the Gutenberg editor, you can use the following PHP code by pasting it into your child theme's functions.php
file.
xxxxxxxxxx
add_filter("habefast_gutenberg_animations_get_animations_datas",function($array){
if(isset($array["animationsList"])){
$array["animationsList"]["custom_rotate"] = ["label"=>"Custom Rotate", "group"=>"rotate"];
}
return $array;
},11);
Add the style associated with the new animation
In the style.css
file of your child theme, you can add the associated CSS code. Here's an example:
xxxxxxxxxx
.hf_animated.custom_rotate{
transform: rotateX(720deg);
transform-origin: center bottom;
opacity: 0;
transition: all 1500ms cubic-bezier(0.23, 1, 0.32, 1);
transition: all 1500ms cubic-bezier(0.23, 1, 0.32, 1);
transition: all 1500ms cubic-bezier(0.23, 1, 0.32, 1);
transition: all 1500ms cubic-bezier(0.23,1,0.32,1);
transform-style: preserve-3d;
}
.hf_animated.custom_rotate.active{
transform: rotateX(0);
opacity: 1;
}
Delete an animation
To delete an animation, you can use the following example code in the functions.php
file of your child theme:
xxxxxxxxxx
add_filter("habefast_gutenberg_animations_get_animations_datas",function($array){
if(isset($array["animationsList"])){
if(isset($array["animationsList"]["zoom_in"])){
unset($array["animationsList"]["zoom_in"]);
}
}
return $array;
},11);
Add a delay
To add a new delay, you need to add this delay in the block settings and add the associated CSS.
Add the delay to the Gutenberg editor
To add the delay to the Gutenberg editor, you can use the following PHP code by pasting it into your child theme's functions.php
file.
xxxxxxxxxx
add_filter("habefast_gutenberg_animations_get_animations_datas",function($array){
if(isset($array["delayList"])){
$array["delayList"]["delay-custom"] = ["label"=>"Custom delay"];
}
return $array;
},11);
Add the style associated with the new delay
In the style.css
file of your child theme, you can add the associated CSS code. Here's an example:
xxxxxxxxxx
.hf_animated.delay-custom{
transition-delay: 1.800s !important;
}
Delete a delay
To remove a delay, you can use the following example code in the functions.php
file of your child theme:
xxxxxxxxxx
add_filter("habefast_gutenberg_animations_get_animations_datas",function($array){
if(isset($array["animationsList"])){
if(isset($array["animationsList"]["zoom_in"])){
unset($array["animationsList"]["zoom_in"]);
}
}
return $array;
},11);
Add a speed
To add a new speed, you need to add this delay in the block settings and add the associated CSS.
Add speed to the Gutenberg editor
To add speed to the Gutenberg editor, you can use the following PHP code by pasting it into your child theme's functions.php
file.
xxxxxxxxxx
add_filter("habefast_gutenberg_animations_get_animations_datas",function($array){
if(isset($array["speedList"])){
$array["speedList"]["custom-speed"] = ["label"=>"Custom speed"];
}
return $array;
},11);
Add the style associated with the new speed
In the style.css
file of your child theme, you can add the associated CSS code. Here's an example:
xxxxxxxxxx
.hf_animated.custom-speed{
transition-duration: 1.750s !important;
}
Delete a speed
To delete a speed, you can use the following example code in the functions.php
file of your child theme:
xxxxxxxxxx
add_filter("habefast_gutenberg_animations_get_animations_datas",function($array){
if(isset($array["speedList"])){
if(isset($array["speedList"]["slow"])){
unset($array["speedList"]["slow"]);
}
}
return $array;
},11);