<helium-animated-pages>
Docs/Demo | Using it in pwa-starter-kit
This is a light spiritual successor to the now deprecated <neon-animated-pages>
.
It works with css animations and only depends on lit-element so you don't have to worry about including any heavy js libraries.
This component takes care of the logic behind triggering the animations so that you can focus on making your views and your animations (or just use the animations included in the sample-animations
folder if you don't want to bother with those either 😉.)
It can be easily used in pwa-starter-kit and here's how.
To begin using it just follow this simple steps:
-
Install it:
npm i --save helium-animated-pages
-
Import the script:
In html:
<!-- type="module" is essential -->In a js module:
; -
Create an instance of
<helium-animated-pages>
in your HTML page, or via any framework that supports rendering Custom Elements and start using it:Select a pagePage 1Page 2Page 3<!-- attrForSelected is used to say which attributeidentifies the pagesor you can just not use it and use numerical indexes --><!-- The pages can be almost anything -->Page 1Page 2<!-- It is recommended that custom elementsused as a page all extend an element like pwa-starter-kit'spage-view-elementhttps://github.com/Polymer/pwa-starter-kit/blob/master/src/components/page-view-element.js-->
Credits
- Almost all sample animations and the overall flow of the page selection are based on an article by Pedro Botelho@Codrops.
- The docs are powered by @web-padawan's api-viewer-element and @runem's [web-component-analyzer]https://www.npmjs.com/package/web-component-analyzer)