Skip to Content
Menu

Animations

A set of animation helper classes.

CSS April 26, 2025

Usage

This is a variable or event handle.

Examples

Animate on DOM ready with a delay

HTML
<div class="animate-dom-ready nebula-fade-in-up" nebula-delay="500">Welcome</div>

Animate a slow fade in on window load

HTML
<div class="animate-window-load nebula-fade-in-up slow">Welcome</div>

Animate once the remote font finishes loading

HTML
<div class="animate-font-load nebula-fade-in-up slow" nebula-font-name="Condiment">Welcome</div>

Animate a push on click

HTML
<a class="animate-click nebula-push" href="#">Click Here</a>

Use the nebula-click attribute to trigger an animation on click.

HTML
<a nebula-click="nebula-push" href="#">Click Here</a>

Use the nebula-hover attribute to trigger an animation on hover.

HTML
<a nebula-hover="nebula-grow" href="#">Hover Me</a>

Use a combination of data attributes

HTML
<a nebula-hover="nebula-grow" nebula-click="nebula-push" href="#">Click Here</a>

Use a combination of classes and data attributes

HTML
<a class="animate-click nebula-push" nebula-hover="nebula-grow" href="#">Click Here</a>

Use JavaScript to play a random animation on click

JavaScript
jQuery('#nebula-hero-name').on('click', function(){
    jQuery(this).removeClass(); //Remove all of the previous animation classes
    let animations = ['nebula-push-loose', 'nebula-pull-loose', 'nebula-bounce', 'nebula-jump'];
    let randomAnimation = animations[Math.floor(Math.random()*animations.length)];
    nebula.animate('#nebula-hero-name', randomAnimation);
    return false;
});

Demo


Additional Notes

This uses a series of classes to modify the type and speed of animation. Elements must be display block or inline-block to be animated.

Event Trigger Classes

These have built in classes that listen for some events so that JavaScript does not need to be written to use them. They include:

  • animate-dom-ready (DOM ready)
  • animate-window-load (window load)
  • animate-font-load (specific font load)
    • This must be accompanied by an attribute of nebula-font-name="Condiment"
  • animate-click (element click)
  • animate (for manual trigger)

Note: For detected bot traffic (such as Googlebot), all “ready” and “load” based animations are skipped and those elements are shown immediately. Although these animations would likely be just fine for things like search indexing, this is done as a precaution regardless.

There is also a “safety net” built into Nebula where all “ready” and “load” based animations will be triggered within a few seconds of loading even if there is a JavaScript error in a linked asset. The safety net ignores animation delays attributes. A “used-safety-net” class will appear on the body if this triggered the animations.

Speed Modifiers

  • fastest (.25s)
  • faster (.5s)
  • fast (.75s)
  • slow (1s)
  • slower (2s)
  • slowest (3s)

Continuous Animations

These animations continue repeatedly

  • nebula-spin
  • nebula-fade
  • nebula-zoom
  • nebula-wave-x
  • nebula-wave-y
  • nebula-intensifies

One-Time Animations

These animations happen once and then stop.

  • nebula-fade-out
  • nebula-fade-out-up
  • nebula-fade-out-down
  • nebula-fade-out-left
  • nebula-fade-out-right
  • nebula-fade-in
  • nebula-fade-in-up
  • nebula-fade-in-down
  • nebula-fade-in-left
  • nebula-fade-in-right
  • nebula-zoom-out
  • nebula-zoom-in
  • nebula-reveal-in
  • nebula-reveal-out
  • nebula-stretch-in
  • nebula-stretch-out
  • nebula-flip-in-x
  • nebula-flip-in-y
  • nebula-flip-out-x
  • nebula-flip-out-y
  • nebula-tap
  • nebula-tap-loose
  • nebula-push
  • nebula-push-loose
  • nebula-shove
  • nebula-shove-loose
  • nebula-shove-out
  • nebula-tug
  • nebula-tug-loose
  • nebula-pull
  • nebula-pull-loose
  • nebula-thrust
  • nebula-thrust-loose
  • nebula-thrust-in
  • nebula-shake
  • nebula-nod

Hover Animations

  • nebula-grow

Advanced

For more advanced integration, see the nebulaAnimate() JavaScript function.

Was this page helpful? Yes No


    A feedback message is required to submit this form.


    Please check that you have entered a valid email address.

    Enter your email address if you would like a response.

    Thank you for your feedback!

    Source File

    Located in /assets/scss/partials/_animations.scss.