Amaze UI 2.4

CSS

Basic CSS settings, fundamental HTML elements styled and grid system, .etc

Animation


CSS3 Animation, require support from browser.

ClassDescription
.am-animation-fadeFade
.am-animation-scale-upScale Up
.am-animation-scale-downScale Down
.am-animation-slide-topSlide from Top
.am-animation-slide-bottomSlide from Bottom
.am-animation-slide-leftSlide from Left
.am-animation-slide-rightSlide from Right
.am-animation-shakeShake
.am-animation-spinInfinitly spin

Sample

Click on the buttons to see animations.

Default effects

<div class="am-animation-fade">...</div>

<span class="am-icon-cog am-animation-spin"></span>

Reverse Animations

Using .am-animation-reverse class, we can reverse the animation (by settinganimation-direction to reverse).

<div class="am-animation-fade am-animation-reverse">...</div>

<span class="am-icon-cog am-animation-spin am-animation-reverse"></span>

Delay Animation

Delay Animations using following classes.

  • .am-animation-delay-1
  • .am-animation-delay-2
  • .am-animation-delay-3
  • .am-animation-delay-4
  • .am-animation-delay-5
  • .am-animation-delay-6

Customized delay:

.my-animation-delay {
  -webkit-animation-delay: 15s;
  animation-delay: 15s;
}

<button id="animation-start" type="button" class="am-btn am-btn-danger">Click Here to play animations</button>

<hr/>

<div id="animation-group">
<p><button type="button" class="am-btn am-btn-primary">No delay</button></p>

<p><button type="button" class="am-btn am-btn-primary am-animation-delay-1">Delay 1s</button></p>
<p><button type="button" class="am-btn am-btn-secondary am-animation-delay-2">Delay 2s</button></p>
<p><button type="button" class="am-btn am-btn-success am-animation-delay-3">Delay 3s</button></p>
<p><button type="button" class="am-btn am-btn-warning am-animation-delay-4">Delay 4s</button></p>
<p><button type="button" class="am-btn am-btn-danger am-animation-delay-5">Delay 5s</button></p>
<p><button type="button" class="am-btn am-btn-primary am-animation-delay-6">Delay 6s</button></p>
</div>

<script>
  $(function() {
    var $btns = $('#animation-group').find('.am-btn');
    var dfds = [];
    var animating = false;
    var animation = 'am-animation-scale-up';

    $('#animation-start').on('click', function() {
      if (!animating) {
        animating = true;
        $btns.each(function() {
          var dfd = new $.Deferred();
          dfds.push(dfd);
          var $this = $(this);
          if ($.AMUI.support.animation) {
            $this.addClass(animation).one($.AMUI.support.animation.end, function() {
              $this.removeClass(animation);
              dfd.resolve();
            });
          }
        });

        $.when.apply(null, dfds).done(function() {
          animating = false;
          console.log('[AMUI] - All animations end');
          dfds = [];
        });
      }
    });
  });
</script>

Reference

侧栏导航
Amaze UI 微信
在微信上关注我们