Skip to content

menow2/aoe

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

41 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Overview

Animate On entrance (AOE) is a lightweight, dependency free, insanely fast scroll animation library built on top of Intersection Observer API.

Combined with many Included CSS3 animations AOE aims to provice the fastest possible solution for animating elements as they appear in users viewport.

Table of Contents

Install

Make sure to include aoe.css

<link rel="stylesheet" href="dist/aoe.css">
npm i aoejs
import Aoe from 'aoejs';

const aoe = new Aoe();
aoe.init();

Standalone

<script src="dist/aoe-standalone.js"></script>
const aoe = new Aoe();
aoe.init();

Options

You can set options during initialization:

aoe.init({
    speed: 1000,
    delay: 100,
	once: false,
	shift: '20px'
});
Property Type Description Default
speed Int Defines animation speed on all elements. eg. 1s null
delay Int Defines animation delay on all elements. eg. 200ms null
timing String Defines css timing function on all elements eg. ease-in null
shift String Shifs when element is going to be triggered. eg. 200px 0px
once Boolean Defines if element should be animated every time it enters viewport. true

Usage

Add data-aoe attribute to your desired HTML elements.

<div data-aoe="popIn"></div>

With AOE you can easily affect animation speed and delay on individual items. Simply set proper data attribute:

<div data-aoe-delay="300" data-aoe-speed="100"></div>

Animations

AOE ships with many fancy CSS3 animations

  • swoopInTop
  • swoopInBottom
  • swoopInLeft
  • swoopInRight
  • popIn
  • popInTop
  • popInBottom
  • popInLeft
  • popInRight
  • hitLeft
  • hitRight
  • fadeIn
  • fadeInTop
  • fadeInBottom
  • fadeInLeft
  • fadeInRight
  • jumpInLeft
  • jumpInRight
  • driveInTop
  • driveInBottom
  • driveInLeft
  • driveInRight
  • ball
  • pull
  • pullLeft
  • pullRight
  • unfold
  • spinIn
  • flipInX
  • flipInY
  • rollIn

With AOE you can easily add your own, custom animations.

<div data-aoe="CustomAnimation"></div>
.CustomAnimation {
    animation-name: animation;
}

@keyframes animation {
    0% { opacity: 0; }
    100% { opacity: 1; }
}

Note: You probably gonna need overflow-x: hidden on body / main

Note: Intersection Observer API does not work on older browsers! Make sure to:

Aoe should fallback to simple fadeIn animation if browser doesn't support it.

License

Created by Michał Gwóźdź. Released under the ISC License.

About

Animate On entrance (AOE) is a lightweight, dependency free, insanely fast scroll animation library built on top of Intersection Observer API

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages

  • SCSS 80.9%
  • JavaScript 16.9%
  • HTML 2.2%