npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

msc-ez-catalog

v1.0.0

Published

Book reading is a very common UI effect to provide different browsing experience for users. With <msc-ez-catalog />, developers could adopt this feature to web page easier. All developers need to do is just providing series image paths in config and every

Downloads

4

Readme

msc-ez-catalog

Published on webcomponents.org DeepScan grade

Book reading is a very common UI effect to provide different browsing experience for users. With <msc-ez-catalog />, developers could adopt this feature to web page easier. All developers need to do is just providing series image paths in config and everything will be all set.

msc-ez-catalog

Basic Usage

<msc-ez-catalog /> is a web component. All we need to do is put the required script into your HTML document. Then follow <msc-ez-catalog />'s html structure and everything will be all set.

  • Required Script
<script
  type="module"
  src="https://your-domain/wc-msc-ez-catalog.js">        
</script>
  • Structure

Put <msc-ez-catalog /> into HTML document. It will have different functions and looks with attribute mutation.

<msc-ez-catalog>
  <script type="application/json">
    {
      "pages": [
        "your_image_path_0.jpg",
        "your_image_path_1.jpg",
        "your_image_path_2.jpg",
        "your_image_path_3.jpg",
        ...
      ]
    }
  </script>
</msc-ez-catalog>

JavaScript Instantiation

<msc-ez-catalog /> could also use JavaScript to create DOM element. Here comes some examples.

<script type="module">
import { MscEzCatalog } from 'https://your-domain/wc-msc-ez-catalog.js';

const pages = [
  "your_image_path_0.jpg",
  "your_image_path_1.jpg",
  "your_image_path_2.jpg",
  "your_image_path_3.jpg"
];

// use DOM api
const nodeA = document.createElement('msc-ez-catalog');
document.body.appendChild(nodeA);
nodeA.pages = pages;

// new instance with Class
const nodeB = new MscEzCatalog();
document.body.appendChild(nodeB);
nodeB.pages = pages;

// new instance with Class & default config
const nodeC = new MscEzCatalog({ pages });
document.body.appendChild(nodeC);
</script>

Style Customization

Developers could apply styles to decorate <msc-ez-catalog />'s looking.

<style>
msc-ez-catalog {
  --msc-ez-cataloag-duration: 750ms;
  --msc-ez-cataloag-border-radius: 8px;
}
</style>

Attributes

<msc-ez-catalog /> supports some attributes to let it become more convenience & useful.

  • pages

Set pages' image path for <msc-ez-catalog />. Once setting, <msc-ez-catalog /> will re-render all pages.(pages should be array and has more than 4 children)

<msc-ez-catalog
  pages='["your_image_path_0.jpg","your_image_path_1.jpg","your_image_path_2.jpg","your_image_path_3.jpg"]'
>
  ...
</msc-ez-catalog>

Keyboard shortcuts

| Key | Description | | ----------- | ----------- | | ← | Go to previous flip. | | → | Go to next flip. | | f | Toggle fullscreen.(same as double click <msc-ez-catalog />) |

Methods

| Method Signature | Description | | ----------- | ----------- | | prev() | Go to previous flip. | | next() | Go to next flip. | | seekTo(index = 1) | Switch to flip index. index will be correct to flip count once more than flip count. |

Property

| Property Name | Type | Description | | ----------- | ----------- | ----------- | | pages | Array | Getter / Setter for pages' image path. | | currentflip | Number | Getter for current flip. | | flipcount | Number | Getter for flipcount. |

Event

| Event Signature | Description | | ----------- | ----------- | | msc-ez-catalog-flip | Fired when flip occured. Developers can gather pages' information through event.detail. |

Reference