abcnews/odyssey-scrollyteller

Name: odyssey-scrollyteller

Owner: ABC News

Description: A scrollytelling plugin for the Odyssey story format

Created: 2017-08-07 23:42:26.0

Updated: 2018-02-06 10:22:37.0

Pushed: 2017-11-13 04:49:46.0

Homepage: null

Size: 184

Language: HTML

GitHub Committers

UserMost Recent Commit# Commits

Other Committers

UserEmailMost Recent Commit# Commits

README

Odyssey Scrollyteller

This module integrates with Odyssey to implement 'scrollytelling' sections in Odyssey based stories.

To use this, include it in the story along with the implementation of the visual element.

 text before the scrollytelling portion of the story starts.
ollyteller
k to your interactive here]
rst paragraph of the scrollytelling experience.
kIDone
cond section. These sections can be broken into multiple paragraphs and are divided by the '#mark' anchors.
'#mark' anchors also act as waypoints for which Odyssey Scrollyteller will create events.
kIDtwo
 the start of each section scrolls past the bottom of the viewport, a new event is fired on the background element (which can then bubble up the DOM, so you can listen for it anywhere).
scrollyteller
can then carry on your story after the scrollytelling section.
Usage

To hook into the events, use some variation on this code:

nitialise
t stage = document.querySelector('[selector-for-your-interactive] .scrollyteller-stage');

stage) {
it({
target: stage,
detail: stage.__SCROLLYTELLER__
;
se {
 console.log('waiting for the stage');
cument.addEventListener('mark', init);


tion init(ev) {
console.log(ev.target); // the stage element
console.log(ev.detail); // the `activated` and `deactivated` marks (if any)

Configuration options

The opening #scrollyteller tag takes some options which are specified using an alternating case syntax. For example, the opening tag #scrollytellerHELLOworldMEANING42 will result in a config object which looks like:


hello: "world",
meaning: 42

The config options available are:

There is also an option available on individual #mark tags.

Authors

This work is supported by the National Institutes of Health's National Center for Advancing Translational Sciences, Grant Number U24TR002306. This work is solely the responsibility of the creators and does not necessarily represent the official views of the National Institutes of Health.