Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sylvaincordiere/15442ea3b01ef86e9cf84284dfbf66da to your computer and use it in GitHub Desktop.
Save sylvaincordiere/15442ea3b01ef86e9cf84284dfbf66da to your computer and use it in GitHub Desktop.
Aos innerblock
import AOS from 'aos';
import 'aos/dist/aos.css';
const { __ } = wp.i18n;
const { Component } = wp.element;
const { registerBlockType, InnerBlocks } = wp.blocks;
class App extends Component {
constructor(props){
super(props);
}
componentDidMount(){
AOS.init({
duration : 2000
})
}
render(){
return(
<div data-aos='fade-up'>
<InnerBlocks />
</div>
)
}
};
registerBlockType( 'my-plugin/my-block', {
title: __( 'Aos' ),
icon: 'universal-access-alt',
category: 'layout',
edit: App,
save() {
return (
<div>
<InnerBlocks.Content />
</div>
);
}
} );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment