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

find-h5-toolbar

v2.0.27

Published

```typescript interface IToolBarItem { pianoKey: number | 'ANY_KEY' // 按钮对应的琴键id display?: boolean // 当前按钮显示状态 positionX?: number // 自由模式x坐标 positionY?: number // 自由模式Y坐标 offsetY?: number // 按钮容器纵向偏移 offsetX?: number // 按钮容器横向偏移 class?: stri

Downloads

4

Readme

默认样式类名 default-toolbar

interface IToolBarItem {
  pianoKey: number | 'ANY_KEY' // 按钮对应的琴键id
  display?: boolean // 当前按钮显示状态
  positionX?: number // 自由模式x坐标
  positionY?: number // 自由模式Y坐标
  offsetY?: number // 按钮容器纵向偏移
  offsetX?: number // 按钮容器横向偏移
  class?: string // 自定义样式名
  background?: { // 背景 以琴键中心定位
    bgValue: string | object // 颜色 图片地址 dom
    width?: number
    height?: number
  },
  button: {
    bgValue: string | object // 颜色 图片地址
    class?: string // 额外的样式名称
    width?: number
    height?: number
    offsetY?: number
    offsetX?: number
  }
  extra?: HTMLElement // 额外的任意dom元素 追加在按钮容器中
  bottomDot?: boolean // 下方小圆点
  bottomText?: string // 按钮下方文本
  middleText?: string | { value: string, style?: string, class?: string } // 按钮中间的文字
  active?: boolean // 激活状态
  activeSign?: HTMLElement // 激活标识
  longClickProgressTime?: number // 长按多久触发长按事件 单位ms default: 1500
  event: {
    keyDown?: (e?: TouchEvent, pianoKey?: number) => void
    keyUp?: (e?: TouchEvent, pianoKey?: number) => void
    click?: (e?: TouchEvent, pianoKey?: number) => void
    longClick?: (e?: TouchEvent, pianoKey?: number) => void
  }
}
interface IToolBar {
  uniqueId?: string // 唯一id 自动生成 初始化不需要传递
  display: boolean // 按钮组显示状态
  class?: string // 父容器类名
  style?: string // 父容器样式
  toolBarItems: IToolBarItem[] // 按钮配置
}

创建一个数据驱动的toolbar. 需要变更toolbar状态可直接修改配置属性

参数2: 默认的按钮尺寸/是否自由布局模式

const t = new ToolBar(/*初始化配置对象*/,/*{width?: number, height?: number, freePosition?: boolean}*/, /*可选标识, 会追加在domID中*/)
// 销毁toolbar
t.destory()