Animating Poems Using CSS
Tags: javascript, animation, css
Published: 2019-08-12 00:29:20

---
title: Animating Poems Using CSS
published: true
tags: javascript,animation,css
canonical_url: https://www.blindemanwebsites.com/today-i-learned/2019/animated-poems/
cover_image: https://thepracticaldev.s3.amazonaws.com/i/z6jzg3mucoj59wocl2kh.jpg
---

### Some History

Back in the days when it seemed as if one in five websites was built entirely in Flash, I would use Flash to animate poems I wrote. [Inge Raadschelders](http://www.ingeraadschelders.nl/) and I did this together and we called ourselves [Blindschelders & Raadsman](http://blindschelders.nl/). When Flash died we gradually stopped making them because there wasn’t an immediately obvious successor to Flash.

In 2012 I tried to recreate one of the animated poems in HTML and CSS, was rather pleased with the effect but also immediately lost interest. Most browsers did not support CSS animations, so they weren’t fun to share, and I was comfortable with CSS but Inge wasn’t. We both made little poetry movies by ourselves but the collaboration was a fruitful one and if we couldn’t do it together, it just wasn’t as much fun. We started making other things instead.

### The Plan

Yesterday, I had the thought that it might be nice to make some animated poems that are triggered by scrolling. This would mean the speed is dictated by the person reading the poem, just like with a book, and not by me, when I make them into little movies. The idea made me very happy and I was thinking about it last night and suddenly remembered that one attempt I’d made. This one isn’t triggered by scrolling and I might make it into a CodePen someday soon but I was glad to see it today.

Here is the little animated poem from 2012: [blindschelders.nl/mobile/sneeuwkerk](http://blindschelders.nl/mobile/sneeuwkerk.html) It’s far from perfect, it’s very simple, it’s pretty cross-browser compatible these days and works on desktop, laptop and phone. So much has happened in the last 7 years that scroll-triggered animation seems an obvious choice and perhaps a format that I would enjoy.

### The Resources

Now I have to figure out the best way to go about it. I looked at some libraries. The first one I thought of was GreenSock. I used to use them with Flash but they do a lot more than that and I’m tempted. As I searched I came across a few more that caught my attention. Here is a little list, the notes included are for me. I haven’t tested any of them yet.

- [GreenSock](https://greensock.com)  
  Does TweenLite do enough of what I want? Am I willing to pay for the full version? Which I think you need if you want to use cssanimation.io… but do I?
- [ScrollMagic](https://scrollmagic.io/)
  Seems really big to me. Many possibilities but in all their examples the scrolling feels like schlepping something through mud.
- [Animate On Scroll (AOS)](https://michalsnik.github.io/aos/)
  Seems pretty good, lightweight and versatile. I don’t know. Maybe.
- [CSS3 Animate it](https://jackonthe.net/css3animateit/)
  Hm.
- [anime.js](https://github.com/juliangarnier/anime)
  This seems interesting. Especially if you look at the [text](https://tobiasahlin.com/moving-letters/) [effects](https://codepen.io/collection/XLebem/). Not sure about the learning curve but might be worth it.
- [Velocity](http://velocityjs.org/)
  Might make ScrollMagic work better. It speeds up jQuery animation and is in fact a replacement of it.
- [Transit](http://ricostacruz.com/jquery.transit/)
  Apparently Velocity is faster under stress, which might be relevant.
- [Animista](http://animista.net)
  Oh! I love this. Pre-made CSS animations, copy only the ones you want.
- [Intersection Observer](https://cssanimation.rocks/scroll-animations/)
  Nice tutorial on how to use JavaScript to check whether an element has been scrolled into view at which point you can use CSS animations. I like this a lot.
- [jQuery to detect scroll](https://www.sitepoint.com/scroll-based-animations-jquery-css3/)
  Tutorial on how to use jQuery to detect whether an element has been scrolled into view. I’d rather not load jQuery if there is no need.

### The Project

I would try to recreate this one, below. I’m sure redoing it will change the little animated poem, because redoing anything always changes things, because of the difference in technology and for the obvious: I want it to be triggered by scrolling.

{% vimeo 152154454 %}