--- layout: default title: Animate In Demo description: When elements enter the viewport, they transition in from zero opacity and from the bottom. image: /demos/animated.jpg prism: true externalJS: [ "https://unpkg.com/intersection-observer" ] extraJS: [ "demos/animate-in.js" ] ---

Animated viewport entry

{% for item in site.data.items %} {% assign item = item %} {% include picture-item.html %} {% endfor %} {% for item in site.data.items %} {% assign item = item %} {% include picture-item.html %} {% endfor %} {% for item in site.data.items %} {% assign item = item %} {% include picture-item.html %} {% endfor %}

About this demo

This was inspired by codrops’ demo Loading effects for grid items with css animations.

IntersectionObserver is used to determine when the elements enter the viewport. A polyfill is included on the page for browsers which don't support it.

Source code for this demo

Link to demo source