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

gm-game-colorblock

v1.0.4

Published

``` npm install gm-game-colorblock ```

Downloads

3

Readme

Gm-game-colorblock

色块匹配小游戏

安装
npm install gm-game-colorblock
使用
  • json
{
    "usingComponents": {
        "colorblock": "/pages/components/colorBlock/colorBlock"
    }
}
  • js
Page({
  data: {
    checkprobability: 3,
    imgs: [
      { src: "https://img.alicdn.com/imgextra/i2/1080040467/O1CN01wgmopf1FJvZCSWGJf_!!1080040467.jpg", id: 1, width: 300, height: 300, probability: 1 },//probability:随机出现概率
      { src: "https://img.alicdn.com/imgextra/i4/1080040467/O1CN01qhLpOE1FJvZPzAs58_!!1080040467.png", id: 2, width: 300, height: 300, probability: 1 },
      { src: "https://img.alicdn.com/imgextra/i2/1080040467/O1CN01KXz8vN1FJvZZmspbu_!!1080040467.jpg", id: 3, width: 300, height: 300, probability: 1 },
      { src: "https://img.alicdn.com/imgextra/i2/1080040467/O1CN01G4o4jD1FJvZUm5pMA_!!1080040467.png", id: 4, width: 300, height: 300, probability: 1 },
      { src: "https://img.alicdn.com/imgextra/i2/1080040467/O1CN01wdhn8n1FJvZOeWKXC_!!1080040467.png", id: 5, width: 300, height: 300, probability: 1 },
    ],
  },
  onLoad() {
  },
  startGame() {
    this.colorBlockGameComponent.start();
  },
  stopGame() {
    // 手动停止游戏
    this.colorBlockGameComponent.stop();
  },
  // 下面为组件回调方法
  onChange(item, checkstr) {
  },
  onStop(data) {
    console.log("游戏结束")
  },
  onRender() {
    console.log("游戏渲染完成")
  },
  onStart() {
    console.log("游戏开始了")
  },
});
  • xaml
<colorblock imgs="{{imgs}}" 
                speedminx="{{0}}" //横向最小速度
                speedmaxx="{{2}}" //横向最大速度
                speedminy="{{3}}" //纵向最小速度
                speedmaxy="{{4}}" //纵向最大速度
                fadetime="{{0}}" //成功匹配后,间隔时间消失
                scalemin="{{0.5}}" //缩放比例最小值
                scalemax="{{1}}" //缩放比例最大值
                checkstr="{{'id=1'}}"//匹配属性 键=值 格式传递
                checkprobability="{{checkprobability}}" //当前匹配属性出现的概率
    ></colorblock>