Analysis updated 2026-07-03
Add fade-in, slide-up, or zoom-in animations to landing page sections as visitors scroll down to them.
Animate any HTML element on scroll without adding jQuery or any other library to your project.
Fire custom JavaScript events when a specific section scrolls into view to trigger additional page logic.
| mciastek/sal | tc39/proposal-temporal | twitter/scala_school | |
|---|---|---|---|
| Stars | 3,692 | 3,693 | 3,696 |
| Language | HTML | HTML | HTML |
| Setup difficulty | easy | easy | easy |
| Complexity | 1/5 | 2/5 | 1/5 |
| Audience | developer | developer | developer |
Figures from each repo's GitHub metadata at analysis time.
Sal (short for Scroll Animation Library) is a small JavaScript library that makes elements on a webpage animate as visitors scroll down to see them. The entire library weighs less than 2.8 kilobytes and has no outside dependencies, meaning you add one file and a stylesheet to your project and it is ready to use. The setup is minimal. You add a data attribute to any HTML element you want to animate, specify which animation type to use (such as fade, slide-up, or zoom-in), and call the library once in your script. It then watches the page and triggers the chosen animation whenever that element scrolls into view. Eleven animation types are available: fade, four slide directions, two zoom directions, and four flip directions. You can fine-tune each animation using additional data attributes: one controls duration (from 200 to 2000 milliseconds), another adds a delay before the animation starts, and a third controls the motion curve. CSS custom properties can be used as an alternative if you prefer to manage these values from a stylesheet rather than inline attributes. By default, each animation plays once. You can change this globally so animations repeat every time an element enters and exits view, or override the behavior on individual elements. The library also fires events when elements enter or leave the viewport, so you can attach your own code to react to those moments. Under the hood, Sal uses the browser's Intersection Observer API rather than scroll event listeners, which keeps CPU usage low even on pages with many animated elements. It is released under the MIT license.
A tiny 2.8KB JavaScript library that animates webpage elements as visitors scroll, with no dependencies, 11 animation types, and low CPU usage via the browser's Intersection Observer API.
Mainly HTML. The stack also includes JavaScript, CSS, HTML.
Use freely for any purpose, including commercial projects, as long as you keep the copyright notice.
Setup difficulty is rated easy, with roughly 5min to a first successful run.
Mainly developer.
This repo across BitVibe Labs
Verify against the repo before relying on details.