• Stars
    star
    1,429
  • Rank 31,724 (Top 0.7 %)
  • Language
    CSS
  • License
    MIT License
  • Created almost 8 years ago
  • Updated about 7 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

CSS3 scroll animation library

kissui.scrollanim

CSS3 scroll animation library

This library is a part of Kissui project.

Install

Bower

You can use bower to install the package:

bower install kissui.scrollanim

CDN

You can use cdnjs: https://cdnjs.com/libraries/kissui.scrollanim

Manually

You can also download and include files manually from the latest releases.

Getting Started

This projects doesn't have any dependecies. All you need to do is to include the scrollanim.js and scrollanim.css in your page.

Please note that you don't need jQuery, Angular.js, React, Whatever.

Write your first awesome scroll animation:

<p data-kui-anim="fadeIn">Show this with fade-in</p>

Simple, isn't it?

Need more help? have a look at /example folder in the project OR http://scrollanim.kissui.io

Adding animations

You can add animations using data-kui-... attributes or programmatiaclly using the kissuiScrollAnim.add method. Read following sections for more details.

data-kui attributes

Currently we have two attributes to define the options:

  • data-kui-anim: Mandatory. Animation name. see Animations section.
  • data-kui-event: Option to define the event to trigger. see Events section. Default is in.

Example:

<div data-kui-anim="fadeIn" data-kui-event="top">

Programmatically (JSON)

Also, you can use the kissuiScrollAnim.add method to add the animations.

Example:

kissuiScrollAnim.add(element, {
  'in': 'fadeIn'
});

Options

There are some options to define the default values in Scrollanim.

  • triggerOnInit: Trigger the events on module init (automatically after page load)?. Default is true.
  • attributePrefix: Prefix for all data-... attributes. Default is data-kui-.
  • animAttribute: Name of animation attribute. Default is anim
  • eventAttribute: Event attribute name. Default is event
  • defaultEvent: Default event to trigger when data-kui-event is not provided. Default is in
  • autoReset: Reset the animation event after element is out of the viewport?. Defualt is true

To alter event you can use setOption or setOptions methods:

kissuiScrollAnim.setOption('autoReset', false)

or

kissuiScrollAnim.setOptions({ 
  'autoReset': false,
  'triggerOnInit': false
})

Events

Scrollanim uses kissui.position to manage and track elements. Please note that kissui.position is a builtin dependency and you don't need to include anything in your page.

Kissui.position supports these events:

  • in - when element is in the viewport
  • out - when element is not in the viewport
  • middle - center aligned element (vertically)
  • center - center aligned element (horizontally)
  • top - element at the top of the page
  • bottom - element at the bottom of the page
  • left - element at the left side of the page
  • right - element at the right side of the page

Also, it is possible to use a compond of events together, e.g. center middle, in right or out left. Please check out kissui.position for more information.

It is possible to use both data-kui-anim attribute and kissuiScrollAnim.add(element, event) to bind an element and reveal it after scrolling but please note that data-kui-anim attribute uses in event of kissui.position by default.

An example of adding an element using the API:

kissuiScrollAnim.add(element, {
  'in': 'fadeIn'
});

Or

kissuiScrollAnim.add(element, {
  'center middle': 'fadeIn'
});

Or

kissuiScrollAnim.add(element, {
  'center middle': 'fadeIn',
  'out': 'fadeOut'
});

Super cool.

Animations

Scrollanim uses Animate.css as a builtin dependency to provide stunnishing animations.

Here is a list of supported animations:

  • bounce
    • flash
    • pulse
    • rubberBand
    • shake
    • headShake
    • swing
    • tada
    • wobble
    • jello
    • bounceIn
    • bounceInDown
    • bounceInLeft
    • bounceInRight
    • bounceInUp
    • bounceOut
    • bounceOutDown
    • bounceOutLeft
    • bounceOutRight
    • bounceOutUp
    • fadeIn
    • fadeInDown
    • fadeInDownBig
    • fadeInLeft
    • fadeInLeftBig
    • fadeInRight
    • fadeInRightBig
    • fadeInUp
    • fadeInUpBig
    • fadeOut
    • fadeOutDown
    • fadeOutDownBig
    • fadeOutLeft
    • fadeOutLeftBig
    • fadeOutRight
    • fadeOutRightBig
    • fadeOutUp
    • fadeOutUpBig
    • flipInX
    • flipInY
    • flipOutX
    • flipOutY
    • lightSpeedIn
    • lightSpeedOut
    • rotateIn
    • rotateInDownLeft
    • rotateInDownRight
    • rotateInUpLeft
    • rotateInUpRight
    • rotateOut
    • rotateOutDownLeft
    • rotateOutDownRight
    • rotateOutUpLeft
    • rotateOutUpRight
    • hinge
    • rollIn
    • rollOut
    • zoomIn
    • zoomInDown
    • zoomInLeft
    • zoomInRight
    • zoomInUp
    • zoomOut
    • zoomOutDown
    • zoomOutLeft
    • zoomOutRight
    • zoomOutUp
    • slideInDown
    • slideInLeft
    • slideInRight
    • slideInUp
    • slideOutDown
    • slideOutLeft
    • slideOutRight
    • slideOutUp

We always keep an up-to-date version on Animate.css.

Author

Afshin Mehrabani

Thanks to Daniel Eden for making animate.css

License

MIT

More Repositories

1

intro.js

Lightweight, user-friendly onboarding tour library
TypeScript
22,527
star
2

front-end-frameworks

A collection of best front-end frameworks for faster and easier web development.
2,777
star
3

progress.js

ProgressJs is a JavaScript and CSS3 library which help developers to create and manage progress bar for every objects on the page.
JavaScript
2,372
star
4

widearea

Create expandable textarea and write large amount of text easily.
JavaScript
1,135
star
5

label.css

Just a simply easy way to label each element you want!
Ruby
766
star
6

persian.js

A simple library for Persian language localization.
JavaScript
356
star
7

liaar

Create fake REST API in a minute
Python
201
star
8

motion.js

Motion.js is a easy to use, cross-browser CSS3 library for creating animations in web.
JavaScript
80
star
9

_s

_s: Pythonic array slicing in JavaScript
JavaScript
72
star
10

density

NodeJs module for calculating keyword density in a text/html
JavaScript
45
star
11

lup

Easy to use CSS3 transition manager
JavaScript
40
star
12

doc42

Jekyll-Kissui bundle to create awesome documentations
24
star
13

kissui.position

Track element(s) on the page like a boss.
JavaScript
23
star
14

kissui

πŸ’« Simple, easy to use, modern web development framework
CSS
17
star
15

dummychat

A NodeJS-Socket.IO dummy chat, every client has a dummy and can play with it!
JavaScript
14
star
16

otobox.js

Simple and fast JavaScript/HTML5 library to create autocomplete inputs
JavaScript
14
star
17

semver.ir

Semantic Versioning Specification (Persian)
JavaScript
13
star
18

sourcedoc

Document your code, continuously.
CSS
12
star
19

kissui.sticky

Simple and lightweight sticky position that works everywhere
CSS
11
star
20

introjs-website

Intro.js website and documentation
JavaScript
10
star
21

hello-backbonejs-fa

Tutorial of increasing complexity for Backbone.js, translated to Persian
JavaScript
8
star
22

parserjs

Javascript AST parser
JavaScript
7
star
23

algorithms

Implementation of common algorithms
Rust
4
star
24

localr

Map localhost ports to localr.io
JavaScript
4
star
25

datatube

Javascript library to import, process and export data
JavaScript
2
star
26

readr

News API client in React Native + ES6 version of AYLIEN News API SDK
JavaScript
2
star