Skip to content

Instantly share code, notes, and snippets.

@Pross
Created July 29, 2021 17:57
Show Gist options
  • Save Pross/3b41044dd8358b908a727d2b53f29bf9 to your computer and use it in GitHub Desktop.
Save Pross/3b41044dd8358b908a727d2b53f29bf9 to your computer and use it in GitHub Desktop.
Random row animations
<?php
add_filter( 'fl_builder_node_settings', function( $settings, $node ) {
if ( 'module' === $node->type ) {
$animations = array(
'fade-in',
'fade-left',
'fade-right',
'fade-up',
'fade-down',
'slide-in-left',
'slide-in-right',
'slide-in-up',
'slide-in-down',
'zoom-in',
'zoom-left',
'zoom-right',
'zoom-up',
'zoom-down',
'bounce',
'bounce-in',
'bounce-left',
'bounce-right',
'bounce-up',
'bounce-down',
'rotate-in',
'rotate-down-left',
'rotate-down-right',
'rotate-up-left',
'rotate-up-right',
'flip-vertical',
'flip-horizontal',
'fancy-flash',
'fancy-pulse',
'fancy-rubber-band',
'fancy-shake',
'fancy-swing',
'fancy-tada',
'fancy-wobble',
'fancy-jello',
'fancy-light-speed',
'fancy-jack-box',
'fancy-roll-in',
);
$settings->animation = array(
'style' => $animations[ array_rand( $animations, 1 ) ],
'delay' => '0',
'duration' => '1',
);
}
return $settings;
}, 10, 2 );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment