Idyll's Scroller component is a useful way to incorporate more narrative structure into an article. As its name suggests, it provides a scroll-based presentation layout that can manipulate graphics upon each “step” that is entered.
This tutorial will focus on introducing multiple Scroller components in one Idyll document to further aid your scrollytelling needs. If you are not familiar with Idyll’s Scrollers, take a peek at this tutorial first. Otherwise, let’s get started!What are Stacked Scrollers?
Instead of one Scroller component per document, stacking Scrollers simply translates to declaring multiple Scroller components one after another. This way, each Scroller can be thought of as its own section with steps that only it can control.
Why Stack?
Stacking allows us to easily transition between the different graphics of each component. Take for example, the smooth transitions between the graphics of the article below.
With stacking, the graphic of each Scroller slides up and replaces the previous one on the screen -- and quite easily too. Since each Scroller component only allows for one graphic, switching between them is a bit more difficult and clunky when using just one Scroller.
Perhaps one of the biggest perks is that stacking lets us include multiple animated graphics per document because each Scroller controls their own set of steps. This also gives us greater customizeability in terms of style and functionality since every Scroller has a corresponding id.Let’s Build Something
To get acquainted with stacked scrolling, below is a short example of customizing each
of the stacked Scroller components.
For this example, we’ve made changes to the styles.css and index.idyll files.
Also in the package.json file, we have switched to the layout: centered
format.