Main navigation

Homepage Animation Block For Drupal 8

Wed, 02/21/2018 - 12:18

Many websites have an animation of some kind running on the homepage. My website is no exception however, I like to experiment with different animations and such and I am sure I will want to regularly swap them out. I could simply dump in a new file whenever I want to make a change but, I like to design things that are a little more elegant. Something that might be used by other people in the real world. So, I built this simple module.

The module allows me to simply drop in a new animation into a specific folder. Then after I clear Drupal's cache the new animation is available in the block settings for the module in a drop-down menu..."simple".

The only requirements for the Javascript are:

The main file that calls the animation needs to be placed into the folder /modules/homepage_animation/_/components/js/anims