A simple, lightweight library of CSS effects that are triggered when element enters the viewport as the user scrolls the page.
Intersy useses Intersection and Mutation Observers. It automatically adds "in-view" class to each element with "intersy" class currently present in viewport.
It works well with "reactive" frameworks where the content is loaded dynamically (Vue, React, LiveWire etc.).
See project on GitHub.
<script src="https://cdn.jsdelivr.net/gh/pronode/intersy@main/intersy.js"></script>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/gh/pronode/intersy@main/intersy.css" />
<div class="intersy fade-in"> yey! </div>
.my-custom-effect { /* when element is out of view */
opacity: 0;
}
.my-custom-effect.in-view { /* when element is in view */
opacity: 1;
}