All Projects → alangdm → helium-animated-pages

alangdm / helium-animated-pages

Licence: BSD-3-Clause license
A light spiritual succesor to neon-animated-pages using only css animations

Programming Languages

javascript
184084 projects - #8 most used programming language
HTML
75241 projects

Projects that are alternatives of or similar to helium-animated-pages

Nutmeg
Build, test, and publish vanilla Web Components with a little spice
Stars: ✭ 111 (+552.94%)
Mutual labels:  web-components, shadow-dom
Eplayer
🔮 A web-component html5 video player facing future
Stars: ✭ 253 (+1388.24%)
Mutual labels:  web-components, shadow-dom
Omi
Front End Cross-Frameworks Framework - 前端跨框架跨平台框架
Stars: ✭ 12,153 (+71388.24%)
Mutual labels:  web-components, shadow-dom
Xy Ui
🎨面向未来的原生 web components UI组件库
Stars: ✭ 603 (+3447.06%)
Mutual labels:  web-components, shadow-dom
Epic Spinners
Easy to use css spinners collection with Vue.js integration
Stars: ✭ 3,548 (+20770.59%)
Mutual labels:  css-animations, animations
Push State
Turn static web sites into dynamic web apps.
Stars: ✭ 16 (-5.88%)
Mutual labels:  web-components, animations
Shadow Dom In Depth
Everything you need to know about Shadow DOM
Stars: ✭ 191 (+1023.53%)
Mutual labels:  web-components, shadow-dom
ionic-custom-components
🌈 Ionic Tutorial: Mastering Web Components in Ionic Framework. This repo is an Ionic project showcasing Angular custom components and Stencil custom web components.
Stars: ✭ 30 (+76.47%)
Mutual labels:  web-components, shadow-dom
learn-css-animation
Learn CSS animation with fun. It is simple, easy to use, and fun to learn.
Stars: ✭ 54 (+217.65%)
Mutual labels:  css-animations, animations
react-awesome-reveal
React components to add reveal animations using the Intersection Observer API and CSS Animations.
Stars: ✭ 564 (+3217.65%)
Mutual labels:  css-animations, animations
Remount
Mount React components to the DOM using custom elements
Stars: ✭ 522 (+2970.59%)
Mutual labels:  web-components, shadow-dom
Easytransform
Enhancing CSS transform with a little bit of JavaScript.
Stars: ✭ 10 (-41.18%)
Mutual labels:  css-animations, animations
Atomico
Atomico a micro-library for creating webcomponents using only functions, hooks and virtual-dom.
Stars: ✭ 481 (+2729.41%)
Mutual labels:  web-components, shadow-dom
Custom Elements Ts
Create native custom elements using Typescript
Stars: ✭ 52 (+205.88%)
Mutual labels:  web-components, shadow-dom
svelte-webcomponents
A ready-to-use project template to build custom elements (web components) with Svelte 3 with support and examples for web components, jest, sass, nested components with props, eslinting, stylelinting, Github actions, propagating custom events from shadow-DOM to real-DOM etc.
Stars: ✭ 22 (+29.41%)
Mutual labels:  web-components, shadow-dom
Animatable Component
Animate once, use Everywhere! 💫
Stars: ✭ 188 (+1005.88%)
Mutual labels:  web-components, animations
focus-trap
A lightweight web component that traps focus within a DOM node
Stars: ✭ 44 (+158.82%)
Mutual labels:  web-components, shadow-dom
web-components-tutorial
HTML Web Component using Vanilla JavaScript
Stars: ✭ 38 (+123.53%)
Mutual labels:  web-components, shadow-dom
ui-components
💄 Library of UI components
Stars: ✭ 84 (+394.12%)
Mutual labels:  css-animations, animations
React Awesome Reveal
React components to add reveal animations using the Intersection Observer API and CSS Animations.
Stars: ✭ 346 (+1935.29%)
Mutual labels:  css-animations, animations

<helium-animated-pages>

Published on webcomponents.orgnpm version

Docs/Demo

This is a light spiritual successor to the now deprecated <neon-animated-pages>.

It works with CSS animations and only depends on lit. 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. Alternatively, you can use the animations included in the sample-animations folder. 😉

To begin using it follow these simple steps:

  • Install it:

    npm i --save helium-animated-pages

  • Import the script:

    In html:

    <!-- type="module" is essential -->
    <script type="module" src="node_modules/helium-animated-pages"></script>

    In a js module:

    import 'helium-animated-pages';
  • Create an instance of <helium-animated-pages> in your HTML page. You can also use any framework that supports rendering Custom Elements.

    <style>
      /*
        Define your animation keyframes and classes
          in the same context that contains
          <helium-animated-pages>.
        You can also use the provided sample animations.
      */
      /*
        The sample code here only uses a simple
          fade animation to keep the code short.
      */
      .page-fadeIn {
        animation: fadeIn 0.7s ease both;
      }
      @keyframes fadeIn {
        from {
          opacity: 0.3;
        }
        to {
        }
      }
      .page-fadeOut {
        animation: fadeOut 0.7s ease both;
      }
      @keyframes fadeOut {
        from {
        }
        to {
          opacity: 0;
        }
      }
    </style>
    <section>
      <h2>Select a page</h2>
      <select id="selector">
        <option value="page1">Page 1</option>
        <option value="page2">Page 2</option>
        <option value="page3">Page 3</option>
      </select>
    </section>
    <!--
      Use attrForSelected to define which attribute will
        act as the identifier for the pages.
      You can also opt to not use it and use numerical indexes instead.
    -->
    <helium-animated-pages id="pages" attrForSelected="name">
      <!-- The pages can be almost anything -->
      <section name="page1">Page 1</section>
      <div name="page2">Page 2</div>
      <custom-element name="page3"></custom-element>
    </helium-animated-pages>
    <script>
      /*
        Here's a sample way of switching pages.
        You can use a router to do this switching.
      */
      document.querySelector('#selector').addEventListener('change', e => {
        // Switch pages; you can use the numerical index too.
        document.querySelector('#pages').selected = e.target.value;
      });
      /*
        Here we define the "rules" about which CSS classes
          should be applied on the different page transitions.
        For more info go to:
          https://alangdm.github.io/helium-animated-pages/demo/
        I'm using CSS classes that aren't actually defined in
          this context for illustrative purposes.
        You must define every class that you want to use.
      */
      document.querySelector('#pages').animationClasses = {
        /*
          The animation classes rules are like CSS rules:
            the most specific ones apply first.
        */
        // from page1 to page2
        page1_page2: {
          in: 'page_moveFromRight',
          out: 'page_moveToLeft',
        },
        // from anything other than page1 to page2
        '*_page2': {
          in: 'page_moveFromLeft',
          out: 'page_moveToRight',
        },
        // from page1 to anything other than page2
        'page1_*': {
          in: 'page_moveFromTop',
          out: 'page_moveToBottom',
        },
        // from nothing selected to page1
        _page1: {
          in: 'page_moveFromBottom',
          out: 'page_moveToTop',
        },
        // fallback in case none of the rules above apply
        default: {
          in: 'page-fadeIn',
          out: 'page-fadeOut',
        },
      };
    </script>

Credits

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].