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

staffroller

v0.5.0

Published

Simple JavaScript(+CSS) to add staff roles to a website

Downloads

5

Readme

Staffroller

Site

https://staffroller.qranoko.jp

About

Staffroller(スタッフローラー)は Web サイトにスタッフロールを追加する簡単な JavaScript (+CSS) ライブラリです。

  • トリガーをクリックするとスタッフロールが表示
  • 閉じる場合は右上の × ボタンもしくは esc キーを押す

How To Use

  1. JSON ファイルに表示したい項目を書き込み設置(URL と Image は任意)
[
  {
    "role": "役割A",
    "members": [
      {
        "name": "スタッフ1-名前(役割A)",
        "url": "https://example.com",
        "image": "https://example.com/image.png"
      },
      {
        "name": "スタッフ2-名前(役割A)",
        "url": "https://example.com"
      }
    ]
  },
  {
    "role": ["役割B", "役割C"],
    "members": [
      {
        "name": "スタッフ3-名前(役割B・役割C)"
      }
    ]
  }
]
  1. staffroller.min.css を読み込む
  2. 表示させるトリガー(ボタンなど)に data-staffroller-show="オプションで設定したid" を付与
  3. staffroller.min.js を読み込む
  4. オプション dataFile に JSON ファイルへのパスを書いて StaffRoller を呼び出し
<!DOCTYPE html>
<html lang="ja">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <meta http-equiv="X-UA-Compatible" content="ie=edge" />
    <title>Example</title>

    <!-- 2. Import CSS File -->
    <link rel="stylesheet" href="path/to/staffroller.min.css" />
  </head>
  <body>
    <!-- 3. Setting Trigger -->
    <button type="button" data-staffroller-show="staff-1">
      View Staff
    </button>

    <!-- 4. Import JavaScript File -->
    <script src="path/to/staffroller.min.js"></script>

    <!-- 5. Init JavaScript -->
    <script>
      const Staff1 = new StaffRoller({
        id: "staff-1",
        title: "STAFF",
        dataFile: "./staff.json"
      })
    </script>
  </body>
</html>

Install

CDN

<link
  rel="stylesheet"
  href="https://cdn.jsdelivr.net/npm/[email protected]/dist/staffroller.min.css"
/>
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/staffroller.min.js"></script>

npm

$ yarn add staffroller

Option

JavaScript

| Option | Default | Note | | ----------- | ------------- | ------------------------------------------ | | id | staff | モーダルを特定する ID | | title | STAFF | スタッフロールのタイトル | | data | null | 表示する役割と名前を渡す配列 | | dataFile | null | 表示する項目を書いた JSON ファイルへのパス | | nameSpace | staffroller | 属性名の設定 |

CSS

色やサイズなどは、SCSS 変数またはCSSで上書きできます。

License

  • MIT

Credit