Demo: Different page transitions based on clicked anchor with smoothState.js
This demo shows how to switch transitions based on initiating link with smoothState.js. This solution has been inspired by @pudgereyem's comment on smoothState.js #143.
You can view the demo here.
The demo implements a crude idea of viewports that are horizontally aligned to determine the needed animation: every anchor has a numeric data-target
paramter that represents the needed viewport while every scene element provides a numeric data-viewport
parameter that reprents the current viewport. If the viewport requested for the clicked target is larger then the current viewport, the scene element is moved to the left, else to the right.
The logic to determine the wanted ani