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

@sj-js/partman

v1.1.0

Published

partman

Downloads

1

Readme

PartMan

🎞️

Build Status All Download Release License

  • 구역을 분리하여 강조합니다.
  • ✨ Source: https://github.com/sj-js/partman
  • ✨ Document: https://sj-js.github.io/sj-js/partman

Getting Started

  1. Load
    • Browser
      <script src="https://cdn.jsdelivr.net/npm/@sj-js/crossman/dist/js/crossman.min.js"></script>
      <script src="https://cdn.jsdelivr.net/npm/@sj-js/partman/dist/js/partman.min.js"></script>
      <script>
          var partman = new PartMan();
      </script>        
    • ES6+
      npm install @sj-js/partman
      require('@sj-js/partman/dist/css/partman.css');    
      const PartMan = require('@sj-js/partman');
      const partman = new PartMan();
Sample A
  1. Set data-part attribute to target element and set color

    <div data-part style="background:#EEFF88;">Hello Part Area 1</div>
    <div data-part style="background:#DDAAFF;">Hello Part Area 2</div>
  2. Run detect() then, When Page is Loaded, detect and apply elements with a data-part attribute

    partman.detect();
  3. Simple Example

    <!DOCTYPE html>
    <HTML>
        <head>
            <script src="https://cdn.jsdelivr.net/npm/@sj-js/crossman/dist/js/crossman.min.js"></script>
            <script src="https://cdn.jsdelivr.net/npm/@sj-js/partman/dist/js/partman.min.js"></script>
            <script>
                var partman = new PartMan();
            </script>
            <script>
                partman.setup({firstPartMarginHeight:100, partMarginHeight:50, lastPartMarginHeight:500}).detect();
            </script>
        </head>
       
        <body>
            <div data-part style="background:#EEFF88;">
                Hello Part Area 1
            </div>
            <div data-part style="background:#DDAAFF;">
                Hello Part Area 2
            </div>
            <div data-part style="background:gold;">
                Hello Part Area 3
            </div>
            <div data-part style="background:skyblue;">
                Hello Part Area 4
            </div>
        </body>
    </HTML>
Sample B
  1. Set data-part-fold-a attribute to button element to open folded content
    <button data-part-fold-a="fold-1">fold-1</button>
    <button data-part-fold-a="fold-2">fold-2</button>
  2. Set data-part-fold-tool attribute to tool element on top of content
    <div data-part-fold-tool>
        <button onclick="partman.closeContentAll();">X</button>
    </div>  
  3. Set data-part-fold attribute to folded content
    <div data-part-fold="fold-1">
        1
    </div>
    <div data-part-fold="fold-2">
        2     
    </div>
  4. Run detect() then, When Page is Loaded, detect and apply elements with a data-part attribute
    partman.detect();
  5. Simple Example
    <!DOCTYPE html>
    <HTML>
        <head>
            <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@sj-js/partman/dist/css/partman.min.css">
            <script src="https://cdn.jsdelivr.net/npm/@sj-js/crossman/dist/js/crossman.min.js"></script>
            <script src="https://cdn.jsdelivr.net/npm/@sj-js/partman/dist/js/partman.min.js"></script>
            <script>
                var partman = new PartMan();
            </script>
            <script>
                partman.setup({firstPartMarginHeight:100, partMarginHeight:50, lastPartMarginHeight:500}).detect();
            </script>
            <style>
                html { scroll-behavior: smooth; }
                button[data-part-fold-a] { width:150px; height:100px; cursor:pointer; }
                .part-fold-active { border:2px solid skyblue; background:skyblue; }
            </style>
        </head>
       
        <body>
            <!-- Icons -->
            <div>
                <button data-part-fold-a="fold-1">fold-1</button>
                <button data-part-fold-a="fold-2">fold-2</button>
                <button data-part-fold-a="fold-3">fold-3</button>
                <button data-part-fold-a="fold-4">fold-4</button>
                <button data-part-fold-a="fold-5">fold-5</button>
            </div>
            <!-- Tools -->
            <div data-part-fold-tool>
                <button onclick="partman.closeContentAll();">X</button>
            </div>
            <!-- Contents -->
            <div data-part-fold="fold-1">
                1
            </div>
            <div data-part-fold="fold-2">
                2
            </div>
            <div data-part-fold="fold-3">
                3
            </div>
            <div data-part-fold="fold-4">
                4
            </div>
            <div data-part-fold="fold-5">
                5
            </div>
        </body>
    </HTML>