JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 5
  • Score
    100M100P100Q41702F
  • License GPL

The javascript library for story scroll interactions with html5 canvas

Package Exports

  • storyscroll

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (storyscroll) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

StoryScroll

The javascript library for story scroll interactions with html5 canvas.

Installation

Option 1: npm
If you prefer the node package manager, feel free to use it.
Keep in mind that like with bower non-crucial files will be ignored (see above).

npm install storyscroll

Option 2: Bower
Please mind that since they are not core dependencies, you will have to add frameworks like GSAP, PIXI manually, should you choose to use them.

Include the core library in your HTML file:

<script src="src//StoryScroll.js"></script>

Usage

import StoryScroll from 'storyscroll'

// init controller
window.story = new StoryScroll ({
    crop: 'longside',	// false, none,longside,shortside
    cropOrigin: 'top',	// center, top,bottom, left,right
    orientation: 'landscape',
    scrollDirection: 'x',
    maxScroll: 20000,
    backgroundColor: 0x000000
});

// create a sprite
let sprite = story.sprite(require('./images/sprite.png'), {x:40, y:540}).act({x: 0,y:400}, 0.8);

Browser Support

StoryScroll aims to support all major browsers even in older versions:
Firefox 26+, Chrome 30+, Safari 5.1+, Opera 10+, IE 9+

About the Author

I am a creative coder based in Xiamen, China.

Learn more on my website or Follow me on Weibo

License

StoryScroll is dual licensed under the GPL.
For more information click here.

Thanks

This library was made possible by many people who have supported it with passion, donations or advice. Special thanks go out to: Esone MacGhilleseatheanaich.