Skip to content

nice-naming/aniro

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

35 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

💨 Aniro

Animate your page effortlessly.

What's this?

Animations are always something we shelve off. Aniro is here to help – you'll only need to scatter some attributes here and your page will be animated right away.

Installation

Insert this into your head:

<link rel="stylesheet" href="https://cdn.jsdelivr.net/gh/uyouthe/aniro/aniro.min.css">

...and this at the end of your <body>:

<script src="https://cdn.jsdelivr.net/gh/uyouthe/aniro/aniro.min.js"></script>
<script>aniro()</script>

Usage

  1. Add the data-aniro_root to the element you want the magic to happen inside.
  2. Add the data-aniro to all the elements you want to be animated.

Configuration

You can pass the configuration object to the aniro() initialization function:

aniro({
  // the position of the virtual line that triggers the animation, in pixels relative to the viewport top.
  // defaults to document.documentElement.clientHeight / 2
  line: 300,

  // a padding of the animated elements' "hitbox", in pixels
  // defaults to 30
  gap: 30,

  // disable the whole animation when the bottom is reached. Recommended for better performance
  // defaults to false
  disableWhenBottomReached: false
})

Delays

You may add data-aniro_delay attribute to delay the animation. The value is milliseconds:

<div data-aniro_delay="300"> ... </div>

Immediate animation

If you want an element to be animated right after page loads, add data-aniro_now attribute to it. You'll probably want to use it for something your users would see right away.

Naming

It's "animation" plus "yamero" – "stop it" in Japanese. The word is heavily associated with anime culture.

Author

Miloslav Voloskov
The idea by nice-naming team Gifs are from 30000fps

About

💨 Animate your page effortlessly

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages

  • HTML 51.6%
  • JavaScript 31.2%
  • CSS 17.2%