web-pet

0.1.3 • Public • Published

web-pet

npm (scoped)

在页面上打瞌睡的一只小猫咪,负责陪伴和引导用户。记录用户行为和设备页面性能信息,并上报每次的统计信息。

简体中文 | English

启动

npm run dev

构建生产

npm run build

安装

使用 npm:

npm install web-pet

使用script标签:

<script src="/dist/webPet.min.js"></script>

例子

import WebPet from "web-pet";
 
const firstPet = new WebPet();
 
const opt = {
  ...
}
 
const otherPet = new WebPet(opt);

WebPet 配置

你可以个性化配置生成自定义属性的宠物。

{
  name: '二狗',
  footPrint: false,
  report: true,
  reportUrl: "http://localhost:3000/api/report",
  action: {
    firstGreet: false,
    randomMove: true,
    randomSay: true
  },
  server: {
    answer: {
      url: "http://localhost:3000/api/answer",
      dataPath: "data.msg",
      separator: "."
    }
  },
  on: {
    create: function(){ },
    mounted: function(){ }
  }
  ...
}

License

MIT

Readme

Keywords

Package Sidebar

Install

npm i web-pet

Weekly Downloads

1

Version

0.1.3

License

MIT

Unpacked Size

181 kB

Total Files

17

Last publish

Collaborators

  • onaug6th